Skip to content

Instantly share code, notes, and snippets.

@mwylde
Created September 7, 2013 20:09
Show Gist options
  • Save mwylde/6478847 to your computer and use it in GitHub Desktop.
Save mwylde/6478847 to your computer and use it in GitHub Desktop.
emscripten bug
; ModuleID = '/tmp/tmpHJQFbe/pbtest.bc'
target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
target triple = "le32-unknown-nacl"
%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.Tuple = type <{ i16, [0 x %struct.anon] }>
%struct.anon = type { i32 }
@.str = private unnamed_addr constant [9 x i8] c"(%d, %d)\00", align 1
@_gm_ = internal global %struct.malloc_state zeroinitializer, align 4
@mparams = internal global %struct.malloc_params zeroinitializer, align 4
define i32 @main() nounwind {
%1 = alloca i32, align 4
%t = alloca %struct.Tuple*, align 4
store i32 0, i32* %1
%2 = call i8* @malloc(i32 6)
%3 = bitcast i8* %2 to %struct.Tuple*
store %struct.Tuple* %3, %struct.Tuple** %t, align 4
%4 = load %struct.Tuple** %t, align 4
%5 = getelementptr inbounds %struct.Tuple* %4, i32 0, i32 0
store i16 4, i16* %5, align 1
%6 = load %struct.Tuple** %t, align 4
%7 = getelementptr inbounds %struct.Tuple* %6, i32 0, i32 1
%8 = getelementptr inbounds [0 x %struct.anon]* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.anon* %8, i32 0, i32 0
store i32 100, i32* %9, align 4
%10 = load %struct.Tuple** %t, align 4
%11 = getelementptr inbounds %struct.Tuple* %10, i32 0, i32 0
%12 = load i16* %11, align 1
%13 = zext i16 %12 to i32
%14 = load %struct.Tuple** %t, align 4
%15 = getelementptr inbounds %struct.Tuple* %14, i32 0, i32 1
%16 = getelementptr inbounds [0 x %struct.anon]* %15, i32 0, i32 0
%17 = getelementptr inbounds %struct.anon* %16, i32 0, i32 0
%18 = load i32* %17, align 4
%19 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8]* @.str, i32 0, i32 0), i32 %13, i32 %18)
ret i32 0
}
declare i32 @printf(i8*, ...)
define weak i8* @malloc(i32 %bytes) nounwind {
%1 = icmp ult i32 %bytes, 245
br i1 %1, label %2, label %345
; <label>:2 ; preds = %0
%3 = icmp ult i32 %bytes, 11
br i1 %3, label %7, label %4
; <label>:4 ; preds = %2
%5 = add i32 %bytes, 11
%6 = and i32 %5, -8
br label %7
; <label>:7 ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ 16, %2 ]
%9 = lshr exact i32 %8, 3
%10 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%11 = lshr i32 %10, %9
%12 = and i32 %11, 3
%13 = icmp eq i32 %12, 0
br i1 %13, label %49, label %14
; <label>:14 ; preds = %7
%15 = and i32 %11, 1
%16 = xor i32 %15, 1
%17 = add i32 %16, %9
%18 = shl nsw i32 %17, 1
%19 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %18
%20 = bitcast %struct.malloc_chunk** %19 to %struct.malloc_chunk*
%.sum111 = add i32 %18, 2
%21 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum111
%22 = load %struct.malloc_chunk** %21, align 4
%23 = getelementptr inbounds %struct.malloc_chunk* %22, i32 0, i32 2
%24 = load %struct.malloc_chunk** %23, align 4
%25 = icmp eq %struct.malloc_chunk* %20, %24
br i1 %25, label %26, label %30
; <label>:26 ; preds = %14
%27 = shl i32 1, %17
%28 = xor i32 %27, -1
%29 = and i32 %10, %28
store i32 %29, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
br label %39
; <label>:30 ; preds = %14
%31 = bitcast %struct.malloc_chunk* %24 to i8*
%32 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%33 = icmp ult i8* %31, %32
br i1 %33, label %.critedge, label %34
; <label>:34 ; preds = %30
%35 = getelementptr inbounds %struct.malloc_chunk* %24, i32 0, i32 3
%36 = load %struct.malloc_chunk** %35, align 4
%37 = icmp eq %struct.malloc_chunk* %36, %22
br i1 %37, label %38, label %.critedge, !prof !0
; <label>:38 ; preds = %34
store %struct.malloc_chunk* %20, %struct.malloc_chunk** %35, align 4
store %struct.malloc_chunk* %24, %struct.malloc_chunk** %21, align 4
br label %39
.critedge: ; preds = %34, %30
tail call void @abort() noreturn nounwind
unreachable
; <label>:39 ; preds = %38, %26
%40 = shl i32 %17, 3
%41 = or i32 %40, 3
%42 = getelementptr inbounds %struct.malloc_chunk* %22, i32 0, i32 1
store i32 %41, i32* %42, align 4
%43 = bitcast %struct.malloc_chunk* %22 to i8*
%.sum113114 = or i32 %40, 4
%44 = getelementptr inbounds i8* %43, i32 %.sum113114
%45 = bitcast i8* %44 to i32*
%46 = load i32* %45, align 4
%47 = or i32 %46, 1
store i32 %47, i32* %45, align 4
%48 = bitcast %struct.malloc_chunk** %23 to i8*
br label %sys_alloc.exit
; <label>:49 ; preds = %7
%50 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%51 = icmp ugt i32 %8, %50
br i1 %51, label %52, label %tmalloc_large.exit.thread
; <label>:52 ; preds = %49
%53 = icmp eq i32 %11, 0
br i1 %53, label %144, label %54
; <label>:54 ; preds = %52
%55 = shl i32 %11, %9
%56 = shl i32 2, %9
%57 = sub i32 0, %56
%58 = or i32 %56, %57
%59 = and i32 %55, %58
%60 = sub i32 0, %59
%61 = and i32 %59, %60
%62 = add i32 %61, -1
%63 = lshr i32 %62, 12
%64 = and i32 %63, 16
%65 = lshr i32 %62, %64
%66 = lshr i32 %65, 5
%67 = and i32 %66, 8
%68 = or i32 %67, %64
%69 = lshr i32 %65, %67
%70 = lshr i32 %69, 2
%71 = and i32 %70, 4
%72 = or i32 %68, %71
%73 = lshr i32 %69, %71
%74 = lshr i32 %73, 1
%75 = and i32 %74, 2
%76 = or i32 %72, %75
%77 = lshr i32 %73, %75
%78 = lshr i32 %77, 1
%79 = and i32 %78, 1
%80 = or i32 %76, %79
%81 = lshr i32 %77, %79
%82 = add i32 %80, %81
%83 = shl i32 %82, 1
%84 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %83
%85 = bitcast %struct.malloc_chunk** %84 to %struct.malloc_chunk*
%.sum104 = add i32 %83, 2
%86 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum104
%87 = load %struct.malloc_chunk** %86, align 4
%88 = getelementptr inbounds %struct.malloc_chunk* %87, i32 0, i32 2
%89 = load %struct.malloc_chunk** %88, align 4
%90 = icmp eq %struct.malloc_chunk* %85, %89
br i1 %90, label %91, label %95
; <label>:91 ; preds = %54
%92 = shl i32 1, %82
%93 = xor i32 %92, -1
%94 = and i32 %10, %93
store i32 %94, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
br label %104
; <label>:95 ; preds = %54
%96 = bitcast %struct.malloc_chunk* %89 to i8*
%97 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%98 = icmp ult i8* %96, %97
br i1 %98, label %.critedge115, label %99
; <label>:99 ; preds = %95
%100 = getelementptr inbounds %struct.malloc_chunk* %89, i32 0, i32 3
%101 = load %struct.malloc_chunk** %100, align 4
%102 = icmp eq %struct.malloc_chunk* %101, %87
br i1 %102, label %103, label %.critedge115, !prof !0
; <label>:103 ; preds = %99
store %struct.malloc_chunk* %85, %struct.malloc_chunk** %100, align 4
store %struct.malloc_chunk* %89, %struct.malloc_chunk** %86, align 4
br label %104
.critedge115: ; preds = %99, %95
tail call void @abort() noreturn nounwind
unreachable
; <label>:104 ; preds = %103, %91
%105 = shl i32 %82, 3
%106 = sub i32 %105, %8
%107 = or i32 %8, 3
%108 = getelementptr inbounds %struct.malloc_chunk* %87, i32 0, i32 1
store i32 %107, i32* %108, align 4
%109 = bitcast %struct.malloc_chunk* %87 to i8*
%110 = getelementptr inbounds i8* %109, i32 %8
%111 = bitcast i8* %110 to %struct.malloc_chunk*
%112 = or i32 %106, 1
%.sum106107 = or i32 %8, 4
%113 = getelementptr inbounds i8* %109, i32 %.sum106107
%114 = bitcast i8* %113 to i32*
store i32 %112, i32* %114, align 4
%115 = getelementptr inbounds i8* %109, i32 %105
%116 = bitcast i8* %115 to i32*
store i32 %106, i32* %116, align 4
%117 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%118 = icmp eq i32 %117, 0
br i1 %118, label %142, label %119
; <label>:119 ; preds = %104
%120 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%121 = lshr i32 %117, 3
%122 = shl nuw nsw i32 %121, 1
%123 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %122
%124 = bitcast %struct.malloc_chunk** %123 to %struct.malloc_chunk*
%125 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%126 = shl i32 1, %121
%127 = and i32 %125, %126
%128 = icmp eq i32 %127, 0
br i1 %128, label %129, label %131
; <label>:129 ; preds = %119
%130 = or i32 %125, %126
store i32 %130, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%.sum109.pre = add i32 %122, 2
%.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum109.pre
br label %138
; <label>:131 ; preds = %119
%.sum110 = add i32 %122, 2
%132 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum110
%133 = load %struct.malloc_chunk** %132, align 4
%134 = bitcast %struct.malloc_chunk* %133 to i8*
%135 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%136 = icmp ult i8* %134, %135
br i1 %136, label %137, label %138, !prof !1
; <label>:137 ; preds = %131
tail call void @abort() noreturn nounwind
unreachable
; <label>:138 ; preds = %131, %129
%.pre-phi = phi %struct.malloc_chunk** [ %132, %131 ], [ %.pre, %129 ]
%F4.0 = phi %struct.malloc_chunk* [ %133, %131 ], [ %124, %129 ]
store %struct.malloc_chunk* %120, %struct.malloc_chunk** %.pre-phi, align 4
%139 = getelementptr inbounds %struct.malloc_chunk* %F4.0, i32 0, i32 3
store %struct.malloc_chunk* %120, %struct.malloc_chunk** %139, align 4
%140 = getelementptr inbounds %struct.malloc_chunk* %120, i32 0, i32 2
store %struct.malloc_chunk* %F4.0, %struct.malloc_chunk** %140, align 4
%141 = getelementptr inbounds %struct.malloc_chunk* %120, i32 0, i32 3
store %struct.malloc_chunk* %124, %struct.malloc_chunk** %141, align 4
br label %142
; <label>:142 ; preds = %138, %104
store i32 %106, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
store %struct.malloc_chunk* %111, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%143 = bitcast %struct.malloc_chunk** %88 to i8*
br label %sys_alloc.exit
; <label>:144 ; preds = %52
%145 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%146 = icmp eq i32 %145, 0
br i1 %146, label %tmalloc_large.exit.thread, label %147
; <label>:147 ; preds = %144
%148 = sub i32 0, %145
%149 = and i32 %145, %148
%150 = add i32 %149, -1
%151 = lshr i32 %150, 12
%152 = and i32 %151, 16
%153 = lshr i32 %150, %152
%154 = lshr i32 %153, 5
%155 = and i32 %154, 8
%156 = or i32 %155, %152
%157 = lshr i32 %153, %155
%158 = lshr i32 %157, 2
%159 = and i32 %158, 4
%160 = or i32 %156, %159
%161 = lshr i32 %157, %159
%162 = lshr i32 %161, 1
%163 = and i32 %162, 2
%164 = or i32 %160, %163
%165 = lshr i32 %161, %163
%166 = lshr i32 %165, 1
%167 = and i32 %166, 1
%168 = or i32 %164, %167
%169 = lshr i32 %165, %167
%170 = add i32 %168, %169
%171 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %170
%172 = load %struct.malloc_tree_chunk** %171, align 4
%173 = getelementptr inbounds %struct.malloc_tree_chunk* %172, i32 0, i32 1
%174 = load i32* %173, align 4
%175 = and i32 %174, -8
%176 = sub i32 %175, %8
br label %177
; <label>:177 ; preds = %.thread.i, %147
%rsize.0.i = phi i32 [ %176, %147 ], [ %.rsize.0.i, %.thread.i ]
%v.0.i = phi %struct.malloc_tree_chunk* [ %172, %147 ], [ %.v.0.i, %.thread.i ]
%t.0.i = phi %struct.malloc_tree_chunk* [ %172, %147 ], [ %185, %.thread.i ]
%178 = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i, i32 0, i32 4, i32 0
%179 = load %struct.malloc_tree_chunk** %178, align 4
%180 = icmp eq %struct.malloc_tree_chunk* %179, null
br i1 %180, label %181, label %.thread.i
; <label>:181 ; preds = %177
%182 = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i, i32 0, i32 4, i32 1
%183 = load %struct.malloc_tree_chunk** %182, align 4
%184 = icmp eq %struct.malloc_tree_chunk* %183, null
br i1 %184, label %191, label %.thread.i
.thread.i: ; preds = %181, %177
%185 = phi %struct.malloc_tree_chunk* [ %183, %181 ], [ %179, %177 ]
%186 = getelementptr inbounds %struct.malloc_tree_chunk* %185, i32 0, i32 1
%187 = load i32* %186, align 4
%188 = and i32 %187, -8
%189 = sub i32 %188, %8
%190 = icmp ult i32 %189, %rsize.0.i
%.rsize.0.i = select i1 %190, i32 %189, i32 %rsize.0.i
%.v.0.i = select i1 %190, %struct.malloc_tree_chunk* %185, %struct.malloc_tree_chunk* %v.0.i
br label %177
; <label>:191 ; preds = %181
%192 = bitcast %struct.malloc_tree_chunk* %v.0.i to i8*
%193 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%194 = icmp ult i8* %192, %193
br i1 %194, label %341, label %195, !prof !1
; <label>:195 ; preds = %191
%196 = getelementptr inbounds i8* %192, i32 %8
%197 = bitcast i8* %196 to %struct.malloc_chunk*
%198 = icmp ult i8* %192, %196
br i1 %198, label %199, label %341, !prof !0
; <label>:199 ; preds = %195
%200 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 5
%201 = load %struct.malloc_tree_chunk** %200, align 4
%202 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 3
%203 = load %struct.malloc_tree_chunk** %202, align 4
%204 = icmp eq %struct.malloc_tree_chunk* %203, %v.0.i
br i1 %204, label %219, label %205
; <label>:205 ; preds = %199
%206 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 2
%207 = load %struct.malloc_tree_chunk** %206, align 4
%208 = bitcast %struct.malloc_tree_chunk* %207 to i8*
%209 = icmp ult i8* %208, %193
br i1 %209, label %.critedge6.i, label %210
; <label>:210 ; preds = %205
%211 = getelementptr inbounds %struct.malloc_tree_chunk* %207, i32 0, i32 3
%212 = load %struct.malloc_tree_chunk** %211, align 4
%213 = icmp eq %struct.malloc_tree_chunk* %212, %v.0.i
br i1 %213, label %214, label %.critedge6.i
; <label>:214 ; preds = %210
%215 = getelementptr inbounds %struct.malloc_tree_chunk* %203, i32 0, i32 2
%216 = load %struct.malloc_tree_chunk** %215, align 4
%217 = icmp eq %struct.malloc_tree_chunk* %216, %v.0.i
br i1 %217, label %218, label %.critedge6.i, !prof !0
; <label>:218 ; preds = %214
store %struct.malloc_tree_chunk* %203, %struct.malloc_tree_chunk** %211, align 4
store %struct.malloc_tree_chunk* %207, %struct.malloc_tree_chunk** %215, align 4
br label %239
.critedge6.i: ; preds = %214, %210, %205
tail call void @abort() noreturn nounwind
unreachable
; <label>:219 ; preds = %199
%220 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 1
%221 = load %struct.malloc_tree_chunk** %220, align 4
%222 = icmp eq %struct.malloc_tree_chunk* %221, null
br i1 %222, label %223, label %.preheader.i
; <label>:223 ; preds = %219
%224 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 0
%225 = load %struct.malloc_tree_chunk** %224, align 4
%226 = icmp eq %struct.malloc_tree_chunk* %225, null
br i1 %226, label %239, label %.preheader.i
.preheader.i: ; preds = %230, %.preheader.i, %223, %219
%RP.0.i = phi %struct.malloc_tree_chunk** [ %224, %223 ], [ %220, %219 ], [ %227, %.preheader.i ], [ %231, %230 ]
%R.0.i = phi %struct.malloc_tree_chunk* [ %225, %223 ], [ %221, %219 ], [ %228, %.preheader.i ], [ %232, %230 ]
%227 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i, i32 0, i32 4, i32 1
%228 = load %struct.malloc_tree_chunk** %227, align 4
%229 = icmp eq %struct.malloc_tree_chunk* %228, null
br i1 %229, label %230, label %.preheader.i
; <label>:230 ; preds = %.preheader.i
%231 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i, i32 0, i32 4, i32 0
%232 = load %struct.malloc_tree_chunk** %231, align 4
%233 = icmp eq %struct.malloc_tree_chunk* %232, null
br i1 %233, label %234, label %.preheader.i
; <label>:234 ; preds = %230
%235 = bitcast %struct.malloc_tree_chunk** %RP.0.i to i8*
%236 = icmp ult i8* %235, %193
br i1 %236, label %238, label %237, !prof !1
; <label>:237 ; preds = %234
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i, align 4
br label %239
; <label>:238 ; preds = %234
tail call void @abort() noreturn nounwind
unreachable
; <label>:239 ; preds = %237, %223, %218
%R.1.i = phi %struct.malloc_tree_chunk* [ %203, %218 ], [ %R.0.i, %237 ], [ null, %223 ]
%240 = icmp eq %struct.malloc_tree_chunk* %201, null
br i1 %240, label %297, label %241
; <label>:241 ; preds = %239
%242 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 6
%243 = load i32* %242, align 4
%244 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %243
%245 = load %struct.malloc_tree_chunk** %244, align 4
%246 = icmp eq %struct.malloc_tree_chunk* %v.0.i, %245
br i1 %246, label %247, label %253
; <label>:247 ; preds = %241
store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %244, align 4
%cond.i = icmp eq %struct.malloc_tree_chunk* %R.1.i, null
br i1 %cond.i, label %.thread9.i, label %267
.thread9.i: ; preds = %247
%248 = load i32* %242, align 4
%249 = shl i32 1, %248
%250 = xor i32 %249, -1
%251 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%252 = and i32 %251, %250
store i32 %252, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
br label %297
; <label>:253 ; preds = %241
%254 = bitcast %struct.malloc_tree_chunk* %201 to i8*
%255 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%256 = icmp ult i8* %254, %255
br i1 %256, label %264, label %257, !prof !1
; <label>:257 ; preds = %253
%258 = getelementptr inbounds %struct.malloc_tree_chunk* %201, i32 0, i32 4, i32 0
%259 = load %struct.malloc_tree_chunk** %258, align 4
%260 = icmp eq %struct.malloc_tree_chunk* %259, %v.0.i
br i1 %260, label %261, label %262
; <label>:261 ; preds = %257
store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %258, align 4
br label %265
; <label>:262 ; preds = %257
%263 = getelementptr inbounds %struct.malloc_tree_chunk* %201, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %263, align 4
br label %265
; <label>:264 ; preds = %253
tail call void @abort() noreturn nounwind
unreachable
; <label>:265 ; preds = %262, %261
%266 = icmp eq %struct.malloc_tree_chunk* %R.1.i, null
br i1 %266, label %297, label %267
; <label>:267 ; preds = %265, %247
%268 = bitcast %struct.malloc_tree_chunk* %R.1.i to i8*
%269 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%270 = icmp ult i8* %268, %269
br i1 %270, label %296, label %271, !prof !1
; <label>:271 ; preds = %267
%272 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 5
store %struct.malloc_tree_chunk* %201, %struct.malloc_tree_chunk** %272, align 4
%273 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 0
%274 = load %struct.malloc_tree_chunk** %273, align 4
%275 = icmp eq %struct.malloc_tree_chunk* %274, null
br i1 %275, label %284, label %276
; <label>:276 ; preds = %271
%277 = bitcast %struct.malloc_tree_chunk* %274 to i8*
%278 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%279 = icmp ult i8* %277, %278
br i1 %279, label %283, label %280, !prof !1
; <label>:280 ; preds = %276
%281 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 4, i32 0
store %struct.malloc_tree_chunk* %274, %struct.malloc_tree_chunk** %281, align 4
%282 = getelementptr inbounds %struct.malloc_tree_chunk* %274, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %282, align 4
br label %284
; <label>:283 ; preds = %276
tail call void @abort() noreturn nounwind
unreachable
; <label>:284 ; preds = %280, %271
%285 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 1
%286 = load %struct.malloc_tree_chunk** %285, align 4
%287 = icmp eq %struct.malloc_tree_chunk* %286, null
br i1 %287, label %297, label %288
; <label>:288 ; preds = %284
%289 = bitcast %struct.malloc_tree_chunk* %286 to i8*
%290 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%291 = icmp ult i8* %289, %290
br i1 %291, label %295, label %292, !prof !1
; <label>:292 ; preds = %288
%293 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %286, %struct.malloc_tree_chunk** %293, align 4
%294 = getelementptr inbounds %struct.malloc_tree_chunk* %286, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %294, align 4
br label %297
; <label>:295 ; preds = %288
tail call void @abort() noreturn nounwind
unreachable
; <label>:296 ; preds = %267
tail call void @abort() noreturn nounwind
unreachable
; <label>:297 ; preds = %292, %284, %265, %.thread9.i, %239
%298 = icmp ult i32 %rsize.0.i, 16
br i1 %298, label %299, label %307
; <label>:299 ; preds = %297
%300 = add i32 %rsize.0.i, %8
%301 = or i32 %300, 3
%302 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 1
store i32 %301, i32* %302, align 4
%.sum4.i = add i32 %300, 4
%303 = getelementptr inbounds i8* %192, i32 %.sum4.i
%304 = bitcast i8* %303 to i32*
%305 = load i32* %304, align 4
%306 = or i32 %305, 1
store i32 %306, i32* %304, align 4
br label %tmalloc_small.exit
; <label>:307 ; preds = %297
%308 = or i32 %8, 3
%309 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 1
store i32 %308, i32* %309, align 4
%310 = or i32 %rsize.0.i, 1
%.sum.i137 = or i32 %8, 4
%311 = getelementptr inbounds i8* %192, i32 %.sum.i137
%312 = bitcast i8* %311 to i32*
store i32 %310, i32* %312, align 4
%.sum1.i = add i32 %rsize.0.i, %8
%313 = getelementptr inbounds i8* %192, i32 %.sum1.i
%314 = bitcast i8* %313 to i32*
store i32 %rsize.0.i, i32* %314, align 4
%315 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%316 = icmp eq i32 %315, 0
br i1 %316, label %340, label %317
; <label>:317 ; preds = %307
%318 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%319 = lshr i32 %315, 3
%320 = shl nuw nsw i32 %319, 1
%321 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %320
%322 = bitcast %struct.malloc_chunk** %321 to %struct.malloc_chunk*
%323 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%324 = shl i32 1, %319
%325 = and i32 %323, %324
%326 = icmp eq i32 %325, 0
br i1 %326, label %327, label %329
; <label>:327 ; preds = %317
%328 = or i32 %323, %324
store i32 %328, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%.sum2.pre.i = add i32 %320, 2
%.pre.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum2.pre.i
br label %336
; <label>:329 ; preds = %317
%.sum3.i = add i32 %320, 2
%330 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum3.i
%331 = load %struct.malloc_chunk** %330, align 4
%332 = bitcast %struct.malloc_chunk* %331 to i8*
%333 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%334 = icmp ult i8* %332, %333
br i1 %334, label %335, label %336, !prof !1
; <label>:335 ; preds = %329
tail call void @abort() noreturn nounwind
unreachable
; <label>:336 ; preds = %329, %327
%.pre-phi.i = phi %struct.malloc_chunk** [ %330, %329 ], [ %.pre.i, %327 ]
%F1.0.i = phi %struct.malloc_chunk* [ %331, %329 ], [ %322, %327 ]
store %struct.malloc_chunk* %318, %struct.malloc_chunk** %.pre-phi.i, align 4
%337 = getelementptr inbounds %struct.malloc_chunk* %F1.0.i, i32 0, i32 3
store %struct.malloc_chunk* %318, %struct.malloc_chunk** %337, align 4
%338 = getelementptr inbounds %struct.malloc_chunk* %318, i32 0, i32 2
store %struct.malloc_chunk* %F1.0.i, %struct.malloc_chunk** %338, align 4
%339 = getelementptr inbounds %struct.malloc_chunk* %318, i32 0, i32 3
store %struct.malloc_chunk* %322, %struct.malloc_chunk** %339, align 4
br label %340
; <label>:340 ; preds = %336, %307
store i32 %rsize.0.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
store %struct.malloc_chunk* %197, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
br label %tmalloc_small.exit
; <label>:341 ; preds = %195, %191
tail call void @abort() noreturn nounwind
unreachable
tmalloc_small.exit: ; preds = %340, %299
%342 = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 2
%343 = bitcast %struct.malloc_tree_chunk** %342 to i8*
%344 = icmp eq %struct.malloc_tree_chunk** %342, null
br i1 %344, label %tmalloc_large.exit.thread, label %sys_alloc.exit
; <label>:345 ; preds = %0
%346 = icmp ugt i32 %bytes, -65
br i1 %346, label %tmalloc_large.exit.thread, label %347
; <label>:347 ; preds = %345
%348 = add i32 %bytes, 11
%349 = and i32 %348, -8
%350 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%351 = icmp eq i32 %350, 0
br i1 %351, label %tmalloc_large.exit.thread, label %352
; <label>:352 ; preds = %347
%353 = sub i32 0, %349
%354 = lshr i32 %348, 8
%355 = icmp eq i32 %354, 0
br i1 %355, label %381, label %356
; <label>:356 ; preds = %352
%357 = icmp ugt i32 %349, 16777215
br i1 %357, label %381, label %358
; <label>:358 ; preds = %356
%359 = add i32 %354, 1048320
%360 = lshr i32 %359, 16
%361 = and i32 %360, 8
%362 = shl i32 %354, %361
%363 = add i32 %362, 520192
%364 = lshr i32 %363, 16
%365 = and i32 %364, 4
%366 = or i32 %365, %361
%367 = shl i32 %362, %365
%368 = add i32 %367, 245760
%369 = lshr i32 %368, 16
%370 = and i32 %369, 2
%371 = or i32 %366, %370
%372 = sub i32 14, %371
%373 = shl i32 %367, %370
%374 = lshr i32 %373, 15
%375 = add i32 %372, %374
%376 = shl nsw i32 %375, 1
%377 = add i32 %375, 7
%378 = lshr i32 %349, %377
%379 = and i32 %378, 1
%380 = or i32 %379, %376
br label %381
; <label>:381 ; preds = %358, %356, %352
%idx.0.i = phi i32 [ %380, %358 ], [ 0, %352 ], [ 31, %356 ]
%382 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %idx.0.i
%383 = load %struct.malloc_tree_chunk** %382, align 4
%384 = icmp eq %struct.malloc_tree_chunk* %383, null
br i1 %384, label %.loopexit.i, label %385
; <label>:385 ; preds = %381
%386 = icmp eq i32 %idx.0.i, 31
br i1 %386, label %390, label %387
; <label>:387 ; preds = %385
%388 = lshr i32 %idx.0.i, 1
%389 = sub i32 25, %388
br label %390
; <label>:390 ; preds = %387, %385
%391 = phi i32 [ %389, %387 ], [ 0, %385 ]
%392 = shl i32 %349, %391
br label %393
; <label>:393 ; preds = %401, %390
%rst.0.i = phi %struct.malloc_tree_chunk* [ null, %390 ], [ %rst.1.i, %401 ]
%sizebits.0.i = phi i32 [ %392, %390 ], [ %410, %401 ]
%t.0.i116 = phi %struct.malloc_tree_chunk* [ %383, %390 ], [ %406, %401 ]
%rsize.0.i117 = phi i32 [ %353, %390 ], [ %rsize.1.i, %401 ]
%v.0.i118 = phi %struct.malloc_tree_chunk* [ null, %390 ], [ %v.1.i, %401 ]
%394 = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i116, i32 0, i32 1
%395 = load i32* %394, align 4
%396 = and i32 %395, -8
%397 = sub i32 %396, %349
%398 = icmp ult i32 %397, %rsize.0.i117
br i1 %398, label %399, label %401
; <label>:399 ; preds = %393
%400 = icmp eq i32 %396, %349
br i1 %400, label %.loopexit.i, label %401
; <label>:401 ; preds = %399, %393
%rsize.1.i = phi i32 [ %397, %399 ], [ %rsize.0.i117, %393 ]
%v.1.i = phi %struct.malloc_tree_chunk* [ %t.0.i116, %399 ], [ %v.0.i118, %393 ]
%402 = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i116, i32 0, i32 4, i32 1
%403 = load %struct.malloc_tree_chunk** %402, align 4
%404 = lshr i32 %sizebits.0.i, 31
%405 = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i116, i32 0, i32 4, i32 %404
%406 = load %struct.malloc_tree_chunk** %405, align 4
%407 = icmp eq %struct.malloc_tree_chunk* %403, null
%408 = icmp eq %struct.malloc_tree_chunk* %403, %406
%or.cond.i = or i1 %407, %408
%rst.1.i = select i1 %or.cond.i, %struct.malloc_tree_chunk* %rst.0.i, %struct.malloc_tree_chunk* %403
%409 = icmp eq %struct.malloc_tree_chunk* %406, null
%410 = shl i32 %sizebits.0.i, 1
br i1 %409, label %.loopexit.i, label %393
.loopexit.i: ; preds = %401, %399, %381
%t.1.i = phi %struct.malloc_tree_chunk* [ null, %381 ], [ %rst.1.i, %401 ], [ %t.0.i116, %399 ]
%rsize.2.i = phi i32 [ %353, %381 ], [ %rsize.1.i, %401 ], [ %397, %399 ]
%v.2.i = phi %struct.malloc_tree_chunk* [ null, %381 ], [ %v.1.i, %401 ], [ %t.0.i116, %399 ]
%411 = icmp eq %struct.malloc_tree_chunk* %t.1.i, null
%412 = icmp eq %struct.malloc_tree_chunk* %v.2.i, null
%or.cond21.i = and i1 %411, %412
br i1 %or.cond21.i, label %413, label %.preheader26.i
; <label>:413 ; preds = %.loopexit.i
%414 = shl i32 2, %idx.0.i
%415 = sub i32 0, %414
%416 = or i32 %414, %415
%417 = and i32 %350, %416
%418 = icmp eq i32 %417, 0
br i1 %418, label %tmalloc_large.exit.thread, label %419
; <label>:419 ; preds = %413
%420 = sub i32 0, %417
%421 = and i32 %417, %420
%422 = add i32 %421, -1
%423 = lshr i32 %422, 12
%424 = and i32 %423, 16
%425 = lshr i32 %422, %424
%426 = lshr i32 %425, 5
%427 = and i32 %426, 8
%428 = or i32 %427, %424
%429 = lshr i32 %425, %427
%430 = lshr i32 %429, 2
%431 = and i32 %430, 4
%432 = or i32 %428, %431
%433 = lshr i32 %429, %431
%434 = lshr i32 %433, 1
%435 = and i32 %434, 2
%436 = or i32 %432, %435
%437 = lshr i32 %433, %435
%438 = lshr i32 %437, 1
%439 = and i32 %438, 1
%440 = or i32 %436, %439
%441 = lshr i32 %437, %439
%442 = add i32 %440, %441
%443 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %442
%444 = load %struct.malloc_tree_chunk** %443, align 4
br label %.preheader26.i
.preheader26.i: ; preds = %419, %.loopexit.i
%t.2.ph.i = phi %struct.malloc_tree_chunk* [ %t.1.i, %.loopexit.i ], [ %444, %419 ]
%445 = icmp eq %struct.malloc_tree_chunk* %t.2.ph.i, null
br i1 %445, label %._crit_edge.i, label %.lr.ph.i
.lr.ph.i: ; preds = %.backedge.i, %.lr.ph.i, %.preheader26.i
%v.330.i = phi %struct.malloc_tree_chunk* [ %v.2.i, %.preheader26.i ], [ %t.2.v.3.i, %.lr.ph.i ], [ %t.2.v.3.i, %.backedge.i ]
%rsize.329.i = phi i32 [ %rsize.2.i, %.preheader26.i ], [ %.rsize.3.i, %.lr.ph.i ], [ %.rsize.3.i, %.backedge.i ]
%t.228.i = phi %struct.malloc_tree_chunk* [ %t.2.ph.i, %.preheader26.i ], [ %452, %.lr.ph.i ], [ %455, %.backedge.i ]
%446 = getelementptr inbounds %struct.malloc_tree_chunk* %t.228.i, i32 0, i32 1
%447 = load i32* %446, align 4
%448 = and i32 %447, -8
%449 = sub i32 %448, %349
%450 = icmp ult i32 %449, %rsize.329.i
%.rsize.3.i = select i1 %450, i32 %449, i32 %rsize.329.i
%t.2.v.3.i = select i1 %450, %struct.malloc_tree_chunk* %t.228.i, %struct.malloc_tree_chunk* %v.330.i
%451 = getelementptr inbounds %struct.malloc_tree_chunk* %t.228.i, i32 0, i32 4, i32 0
%452 = load %struct.malloc_tree_chunk** %451, align 4
%453 = icmp eq %struct.malloc_tree_chunk* %452, null
br i1 %453, label %.backedge.i, label %.lr.ph.i
.backedge.i: ; preds = %.lr.ph.i
%454 = getelementptr inbounds %struct.malloc_tree_chunk* %t.228.i, i32 0, i32 4, i32 1
%455 = load %struct.malloc_tree_chunk** %454, align 4
%456 = icmp eq %struct.malloc_tree_chunk* %455, null
br i1 %456, label %._crit_edge.i, label %.lr.ph.i
._crit_edge.i: ; preds = %.backedge.i, %.preheader26.i
%v.3.lcssa.i = phi %struct.malloc_tree_chunk* [ %v.2.i, %.preheader26.i ], [ %t.2.v.3.i, %.backedge.i ]
%rsize.3.lcssa.i = phi i32 [ %rsize.2.i, %.preheader26.i ], [ %.rsize.3.i, %.backedge.i ]
%457 = icmp eq %struct.malloc_tree_chunk* %v.3.lcssa.i, null
br i1 %457, label %tmalloc_large.exit.thread, label %458
; <label>:458 ; preds = %._crit_edge.i
%459 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%460 = sub i32 %459, %349
%461 = icmp ult i32 %rsize.3.lcssa.i, %460
br i1 %461, label %462, label %tmalloc_large.exit.thread
; <label>:462 ; preds = %458
%463 = bitcast %struct.malloc_tree_chunk* %v.3.lcssa.i to i8*
%464 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%465 = icmp ult i8* %463, %464
br i1 %465, label %710, label %466, !prof !1
; <label>:466 ; preds = %462
%467 = getelementptr inbounds i8* %463, i32 %349
%468 = bitcast i8* %467 to %struct.malloc_chunk*
%469 = icmp ult i8* %463, %467
br i1 %469, label %470, label %710, !prof !0
; <label>:470 ; preds = %466
%471 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 5
%472 = load %struct.malloc_tree_chunk** %471, align 4
%473 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 3
%474 = load %struct.malloc_tree_chunk** %473, align 4
%475 = icmp eq %struct.malloc_tree_chunk* %474, %v.3.lcssa.i
br i1 %475, label %490, label %476
; <label>:476 ; preds = %470
%477 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 2
%478 = load %struct.malloc_tree_chunk** %477, align 4
%479 = bitcast %struct.malloc_tree_chunk* %478 to i8*
%480 = icmp ult i8* %479, %464
br i1 %480, label %.critedge22.i, label %481
; <label>:481 ; preds = %476
%482 = getelementptr inbounds %struct.malloc_tree_chunk* %478, i32 0, i32 3
%483 = load %struct.malloc_tree_chunk** %482, align 4
%484 = icmp eq %struct.malloc_tree_chunk* %483, %v.3.lcssa.i
br i1 %484, label %485, label %.critedge22.i
; <label>:485 ; preds = %481
%486 = getelementptr inbounds %struct.malloc_tree_chunk* %474, i32 0, i32 2
%487 = load %struct.malloc_tree_chunk** %486, align 4
%488 = icmp eq %struct.malloc_tree_chunk* %487, %v.3.lcssa.i
br i1 %488, label %489, label %.critedge22.i, !prof !0
; <label>:489 ; preds = %485
store %struct.malloc_tree_chunk* %474, %struct.malloc_tree_chunk** %482, align 4
store %struct.malloc_tree_chunk* %478, %struct.malloc_tree_chunk** %486, align 4
br label %510
.critedge22.i: ; preds = %485, %481, %476
tail call void @abort() noreturn nounwind
unreachable
; <label>:490 ; preds = %470
%491 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 1
%492 = load %struct.malloc_tree_chunk** %491, align 4
%493 = icmp eq %struct.malloc_tree_chunk* %492, null
br i1 %493, label %494, label %.preheader.i121
; <label>:494 ; preds = %490
%495 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 0
%496 = load %struct.malloc_tree_chunk** %495, align 4
%497 = icmp eq %struct.malloc_tree_chunk* %496, null
br i1 %497, label %510, label %.preheader.i121
.preheader.i121: ; preds = %501, %.preheader.i121, %494, %490
%RP.0.i119 = phi %struct.malloc_tree_chunk** [ %495, %494 ], [ %491, %490 ], [ %498, %.preheader.i121 ], [ %502, %501 ]
%R.0.i120 = phi %struct.malloc_tree_chunk* [ %496, %494 ], [ %492, %490 ], [ %499, %.preheader.i121 ], [ %503, %501 ]
%498 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i120, i32 0, i32 4, i32 1
%499 = load %struct.malloc_tree_chunk** %498, align 4
%500 = icmp eq %struct.malloc_tree_chunk* %499, null
br i1 %500, label %501, label %.preheader.i121
; <label>:501 ; preds = %.preheader.i121
%502 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i120, i32 0, i32 4, i32 0
%503 = load %struct.malloc_tree_chunk** %502, align 4
%504 = icmp eq %struct.malloc_tree_chunk* %503, null
br i1 %504, label %505, label %.preheader.i121
; <label>:505 ; preds = %501
%506 = bitcast %struct.malloc_tree_chunk** %RP.0.i119 to i8*
%507 = icmp ult i8* %506, %464
br i1 %507, label %509, label %508, !prof !1
; <label>:508 ; preds = %505
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i119, align 4
br label %510
; <label>:509 ; preds = %505
tail call void @abort() noreturn nounwind
unreachable
; <label>:510 ; preds = %508, %494, %489
%R.1.i122 = phi %struct.malloc_tree_chunk* [ %474, %489 ], [ %R.0.i120, %508 ], [ null, %494 ]
%511 = icmp eq %struct.malloc_tree_chunk* %472, null
br i1 %511, label %568, label %512
; <label>:512 ; preds = %510
%513 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 6
%514 = load i32* %513, align 4
%515 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %514
%516 = load %struct.malloc_tree_chunk** %515, align 4
%517 = icmp eq %struct.malloc_tree_chunk* %v.3.lcssa.i, %516
br i1 %517, label %518, label %524
; <label>:518 ; preds = %512
store %struct.malloc_tree_chunk* %R.1.i122, %struct.malloc_tree_chunk** %515, align 4
%cond.i123 = icmp eq %struct.malloc_tree_chunk* %R.1.i122, null
br i1 %cond.i123, label %.thread.i124, label %538
.thread.i124: ; preds = %518
%519 = load i32* %513, align 4
%520 = shl i32 1, %519
%521 = xor i32 %520, -1
%522 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%523 = and i32 %522, %521
store i32 %523, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
br label %568
; <label>:524 ; preds = %512
%525 = bitcast %struct.malloc_tree_chunk* %472 to i8*
%526 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%527 = icmp ult i8* %525, %526
br i1 %527, label %535, label %528, !prof !1
; <label>:528 ; preds = %524
%529 = getelementptr inbounds %struct.malloc_tree_chunk* %472, i32 0, i32 4, i32 0
%530 = load %struct.malloc_tree_chunk** %529, align 4
%531 = icmp eq %struct.malloc_tree_chunk* %530, %v.3.lcssa.i
br i1 %531, label %532, label %533
; <label>:532 ; preds = %528
store %struct.malloc_tree_chunk* %R.1.i122, %struct.malloc_tree_chunk** %529, align 4
br label %536
; <label>:533 ; preds = %528
%534 = getelementptr inbounds %struct.malloc_tree_chunk* %472, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %R.1.i122, %struct.malloc_tree_chunk** %534, align 4
br label %536
; <label>:535 ; preds = %524
tail call void @abort() noreturn nounwind
unreachable
; <label>:536 ; preds = %533, %532
%537 = icmp eq %struct.malloc_tree_chunk* %R.1.i122, null
br i1 %537, label %568, label %538
; <label>:538 ; preds = %536, %518
%539 = bitcast %struct.malloc_tree_chunk* %R.1.i122 to i8*
%540 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%541 = icmp ult i8* %539, %540
br i1 %541, label %567, label %542, !prof !1
; <label>:542 ; preds = %538
%543 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i122, i32 0, i32 5
store %struct.malloc_tree_chunk* %472, %struct.malloc_tree_chunk** %543, align 4
%544 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 0
%545 = load %struct.malloc_tree_chunk** %544, align 4
%546 = icmp eq %struct.malloc_tree_chunk* %545, null
br i1 %546, label %555, label %547
; <label>:547 ; preds = %542
%548 = bitcast %struct.malloc_tree_chunk* %545 to i8*
%549 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%550 = icmp ult i8* %548, %549
br i1 %550, label %554, label %551, !prof !1
; <label>:551 ; preds = %547
%552 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i122, i32 0, i32 4, i32 0
store %struct.malloc_tree_chunk* %545, %struct.malloc_tree_chunk** %552, align 4
%553 = getelementptr inbounds %struct.malloc_tree_chunk* %545, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1.i122, %struct.malloc_tree_chunk** %553, align 4
br label %555
; <label>:554 ; preds = %547
tail call void @abort() noreturn nounwind
unreachable
; <label>:555 ; preds = %551, %542
%556 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 1
%557 = load %struct.malloc_tree_chunk** %556, align 4
%558 = icmp eq %struct.malloc_tree_chunk* %557, null
br i1 %558, label %568, label %559
; <label>:559 ; preds = %555
%560 = bitcast %struct.malloc_tree_chunk* %557 to i8*
%561 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%562 = icmp ult i8* %560, %561
br i1 %562, label %566, label %563, !prof !1
; <label>:563 ; preds = %559
%564 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i122, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %557, %struct.malloc_tree_chunk** %564, align 4
%565 = getelementptr inbounds %struct.malloc_tree_chunk* %557, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1.i122, %struct.malloc_tree_chunk** %565, align 4
br label %568
; <label>:566 ; preds = %559
tail call void @abort() noreturn nounwind
unreachable
; <label>:567 ; preds = %538
tail call void @abort() noreturn nounwind
unreachable
; <label>:568 ; preds = %563, %555, %536, %.thread.i124, %510
%569 = icmp ult i32 %rsize.3.lcssa.i, 16
br i1 %569, label %570, label %578
; <label>:570 ; preds = %568
%571 = add i32 %rsize.3.lcssa.i, %349
%572 = or i32 %571, 3
%573 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 1
store i32 %572, i32* %573, align 4
%.sum19.i = add i32 %571, 4
%574 = getelementptr inbounds i8* %463, i32 %.sum19.i
%575 = bitcast i8* %574 to i32*
%576 = load i32* %575, align 4
%577 = or i32 %576, 1
store i32 %577, i32* %575, align 4
br label %tmalloc_large.exit
; <label>:578 ; preds = %568
%579 = or i32 %349, 3
%580 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 1
store i32 %579, i32* %580, align 4
%581 = or i32 %rsize.3.lcssa.i, 1
%.sum.i125136 = or i32 %349, 4
%582 = getelementptr inbounds i8* %463, i32 %.sum.i125136
%583 = bitcast i8* %582 to i32*
store i32 %581, i32* %583, align 4
%.sum1.i126 = add i32 %rsize.3.lcssa.i, %349
%584 = getelementptr inbounds i8* %463, i32 %.sum1.i126
%585 = bitcast i8* %584 to i32*
store i32 %rsize.3.lcssa.i, i32* %585, align 4
%586 = lshr i32 %rsize.3.lcssa.i, 3
%587 = icmp ult i32 %rsize.3.lcssa.i, 256
br i1 %587, label %588, label %611
; <label>:588 ; preds = %578
%589 = shl nuw nsw i32 %586, 1
%590 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %589
%591 = bitcast %struct.malloc_chunk** %590 to %struct.malloc_chunk*
%592 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%593 = shl i32 1, %586
%594 = and i32 %592, %593
%595 = icmp eq i32 %594, 0
br i1 %595, label %596, label %598
; <label>:596 ; preds = %588
%597 = or i32 %592, %593
store i32 %597, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%.sum15.pre.i = add i32 %589, 2
%.pre.i127 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum15.pre.i
br label %605
; <label>:598 ; preds = %588
%.sum18.i = add i32 %589, 2
%599 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum18.i
%600 = load %struct.malloc_chunk** %599, align 4
%601 = bitcast %struct.malloc_chunk* %600 to i8*
%602 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%603 = icmp ult i8* %601, %602
br i1 %603, label %604, label %605, !prof !1
; <label>:604 ; preds = %598
tail call void @abort() noreturn nounwind
unreachable
; <label>:605 ; preds = %598, %596
%.pre-phi.i128 = phi %struct.malloc_chunk** [ %599, %598 ], [ %.pre.i127, %596 ]
%F5.0.i = phi %struct.malloc_chunk* [ %600, %598 ], [ %591, %596 ]
store %struct.malloc_chunk* %468, %struct.malloc_chunk** %.pre-phi.i128, align 4
%606 = getelementptr inbounds %struct.malloc_chunk* %F5.0.i, i32 0, i32 3
store %struct.malloc_chunk* %468, %struct.malloc_chunk** %606, align 4
%.sum16.i = add i32 %349, 8
%607 = getelementptr inbounds i8* %463, i32 %.sum16.i
%608 = bitcast i8* %607 to %struct.malloc_chunk**
store %struct.malloc_chunk* %F5.0.i, %struct.malloc_chunk** %608, align 4
%.sum17.i = add i32 %349, 12
%609 = getelementptr inbounds i8* %463, i32 %.sum17.i
%610 = bitcast i8* %609 to %struct.malloc_chunk**
store %struct.malloc_chunk* %591, %struct.malloc_chunk** %610, align 4
br label %tmalloc_large.exit
; <label>:611 ; preds = %578
%612 = bitcast i8* %467 to %struct.malloc_tree_chunk*
%613 = lshr i32 %rsize.3.lcssa.i, 8
%614 = icmp eq i32 %613, 0
br i1 %614, label %640, label %615
; <label>:615 ; preds = %611
%616 = icmp ugt i32 %rsize.3.lcssa.i, 16777215
br i1 %616, label %640, label %617
; <label>:617 ; preds = %615
%618 = add i32 %613, 1048320
%619 = lshr i32 %618, 16
%620 = and i32 %619, 8
%621 = shl i32 %613, %620
%622 = add i32 %621, 520192
%623 = lshr i32 %622, 16
%624 = and i32 %623, 4
%625 = or i32 %624, %620
%626 = shl i32 %621, %624
%627 = add i32 %626, 245760
%628 = lshr i32 %627, 16
%629 = and i32 %628, 2
%630 = or i32 %625, %629
%631 = sub i32 14, %630
%632 = shl i32 %626, %629
%633 = lshr i32 %632, 15
%634 = add i32 %631, %633
%635 = shl nsw i32 %634, 1
%636 = add i32 %634, 7
%637 = lshr i32 %rsize.3.lcssa.i, %636
%638 = and i32 %637, 1
%639 = or i32 %638, %635
br label %640
; <label>:640 ; preds = %617, %615, %611
%I7.0.i = phi i32 [ %639, %617 ], [ 0, %611 ], [ 31, %615 ]
%641 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I7.0.i
%.sum2.i = add i32 %349, 28
%642 = getelementptr inbounds i8* %463, i32 %.sum2.i
%643 = bitcast i8* %642 to i32*
store i32 %I7.0.i, i32* %643, align 4
%.sum3.i129 = add i32 %349, 16
%644 = getelementptr inbounds i8* %463, i32 %.sum3.i129
%.sum4.i130 = add i32 %349, 20
%645 = getelementptr inbounds i8* %463, i32 %.sum4.i130
%646 = bitcast i8* %645 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %646, align 4
%647 = bitcast i8* %644 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %647, align 4
%648 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%649 = shl i32 1, %I7.0.i
%650 = and i32 %648, %649
%651 = icmp eq i32 %650, 0
br i1 %651, label %652, label %661
; <label>:652 ; preds = %640
%653 = or i32 %648, %649
store i32 %653, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %641, align 4
%654 = bitcast %struct.malloc_tree_chunk** %641 to %struct.malloc_tree_chunk*
%.sum5.i = add i32 %349, 24
%655 = getelementptr inbounds i8* %463, i32 %.sum5.i
%656 = bitcast i8* %655 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %654, %struct.malloc_tree_chunk** %656, align 4
%.sum6.i = add i32 %349, 12
%657 = getelementptr inbounds i8* %463, i32 %.sum6.i
%658 = bitcast i8* %657 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %658, align 4
%.sum7.i = add i32 %349, 8
%659 = getelementptr inbounds i8* %463, i32 %.sum7.i
%660 = bitcast i8* %659 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %660, align 4
br label %tmalloc_large.exit
; <label>:661 ; preds = %640
%662 = load %struct.malloc_tree_chunk** %641, align 4
%663 = icmp eq i32 %I7.0.i, 31
br i1 %663, label %667, label %664
; <label>:664 ; preds = %661
%665 = lshr i32 %I7.0.i, 1
%666 = sub i32 25, %665
br label %667
; <label>:667 ; preds = %664, %661
%668 = phi i32 [ %666, %664 ], [ 0, %661 ]
%669 = shl i32 %rsize.3.lcssa.i, %668
br label %670
; <label>:670 ; preds = %675, %667
%T.0.i = phi %struct.malloc_tree_chunk* [ %662, %667 ], [ %678, %675 ]
%K12.0.i = phi i32 [ %669, %667 ], [ %680, %675 ]
%671 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i, i32 0, i32 1
%672 = load i32* %671, align 4
%673 = and i32 %672, -8
%674 = icmp eq i32 %673, %rsize.3.lcssa.i
br i1 %674, label %693, label %675
; <label>:675 ; preds = %670
%676 = lshr i32 %K12.0.i, 31
%677 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i, i32 0, i32 4, i32 %676
%678 = load %struct.malloc_tree_chunk** %677, align 4
%679 = icmp eq %struct.malloc_tree_chunk* %678, null
%680 = shl i32 %K12.0.i, 1
br i1 %679, label %681, label %670
; <label>:681 ; preds = %675
%682 = bitcast %struct.malloc_tree_chunk** %677 to i8*
%683 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%684 = icmp ult i8* %682, %683
br i1 %684, label %692, label %685, !prof !1
; <label>:685 ; preds = %681
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %677, align 4
%.sum12.i = add i32 %349, 24
%686 = getelementptr inbounds i8* %463, i32 %.sum12.i
%687 = bitcast i8* %686 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %T.0.i, %struct.malloc_tree_chunk** %687, align 4
%.sum13.i = add i32 %349, 12
%688 = getelementptr inbounds i8* %463, i32 %.sum13.i
%689 = bitcast i8* %688 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %689, align 4
%.sum14.i = add i32 %349, 8
%690 = getelementptr inbounds i8* %463, i32 %.sum14.i
%691 = bitcast i8* %690 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %691, align 4
br label %tmalloc_large.exit
; <label>:692 ; preds = %681
tail call void @abort() noreturn nounwind
unreachable
; <label>:693 ; preds = %670
%694 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i, i32 0, i32 2
%695 = load %struct.malloc_tree_chunk** %694, align 4
%696 = bitcast %struct.malloc_tree_chunk* %T.0.i to i8*
%697 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%698 = icmp ult i8* %696, %697
br i1 %698, label %.critedge24.i, label %699
; <label>:699 ; preds = %693
%700 = bitcast %struct.malloc_tree_chunk* %695 to i8*
%701 = icmp ult i8* %700, %697
br i1 %701, label %.critedge24.i, label %702, !prof !1
; <label>:702 ; preds = %699
%703 = getelementptr inbounds %struct.malloc_tree_chunk* %695, i32 0, i32 3
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %703, align 4
store %struct.malloc_tree_chunk* %612, %struct.malloc_tree_chunk** %694, align 4
%.sum9.i = add i32 %349, 8
%704 = getelementptr inbounds i8* %463, i32 %.sum9.i
%705 = bitcast i8* %704 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %695, %struct.malloc_tree_chunk** %705, align 4
%.sum10.i = add i32 %349, 12
%706 = getelementptr inbounds i8* %463, i32 %.sum10.i
%707 = bitcast i8* %706 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %T.0.i, %struct.malloc_tree_chunk** %707, align 4
%.sum11.i = add i32 %349, 24
%708 = getelementptr inbounds i8* %463, i32 %.sum11.i
%709 = bitcast i8* %708 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %709, align 4
br label %tmalloc_large.exit
.critedge24.i: ; preds = %699, %693
tail call void @abort() noreturn nounwind
unreachable
; <label>:710 ; preds = %466, %462
tail call void @abort() noreturn nounwind
unreachable
tmalloc_large.exit: ; preds = %702, %685, %652, %605, %570
%711 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 2
%712 = bitcast %struct.malloc_tree_chunk** %711 to i8*
%713 = icmp eq %struct.malloc_tree_chunk** %711, null
br i1 %713, label %tmalloc_large.exit.thread, label %sys_alloc.exit
tmalloc_large.exit.thread: ; preds = %tmalloc_large.exit, %458, %._crit_edge.i, %413, %347, %345, %tmalloc_small.exit, %144, %49
%nb.0 = phi i32 [ %8, %144 ], [ %8, %49 ], [ %8, %tmalloc_small.exit ], [ -1, %345 ], [ %349, %347 ], [ %349, %._crit_edge.i ], [ %349, %458 ], [ %349, %tmalloc_large.exit ], [ %349, %413 ]
%714 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%715 = icmp ugt i32 %nb.0, %714
br i1 %715, label %742, label %716
; <label>:716 ; preds = %tmalloc_large.exit.thread
%717 = sub i32 %714, %nb.0
%718 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%719 = icmp ugt i32 %717, 15
br i1 %719, label %720, label %731
; <label>:720 ; preds = %716
%721 = bitcast %struct.malloc_chunk* %718 to i8*
%722 = getelementptr inbounds i8* %721, i32 %nb.0
%723 = bitcast i8* %722 to %struct.malloc_chunk*
store %struct.malloc_chunk* %723, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
store i32 %717, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%724 = or i32 %717, 1
%.sum102 = add i32 %nb.0, 4
%725 = getelementptr inbounds i8* %721, i32 %.sum102
%726 = bitcast i8* %725 to i32*
store i32 %724, i32* %726, align 4
%727 = getelementptr inbounds i8* %721, i32 %714
%728 = bitcast i8* %727 to i32*
store i32 %717, i32* %728, align 4
%729 = or i32 %nb.0, 3
%730 = getelementptr inbounds %struct.malloc_chunk* %718, i32 0, i32 1
store i32 %729, i32* %730, align 4
br label %739
; <label>:731 ; preds = %716
store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%732 = or i32 %714, 3
%733 = getelementptr inbounds %struct.malloc_chunk* %718, i32 0, i32 1
store i32 %732, i32* %733, align 4
%734 = bitcast %struct.malloc_chunk* %718 to i8*
%.sum101 = add i32 %714, 4
%735 = getelementptr inbounds i8* %734, i32 %.sum101
%736 = bitcast i8* %735 to i32*
%737 = load i32* %736, align 4
%738 = or i32 %737, 1
store i32 %738, i32* %736, align 4
br label %739
; <label>:739 ; preds = %731, %720
%740 = getelementptr inbounds %struct.malloc_chunk* %718, i32 0, i32 2
%741 = bitcast %struct.malloc_chunk** %740 to i8*
br label %sys_alloc.exit
; <label>:742 ; preds = %tmalloc_large.exit.thread
%743 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%744 = icmp ult i32 %nb.0, %743
br i1 %744, label %745, label %758
; <label>:745 ; preds = %742
%746 = sub i32 %743, %nb.0
store i32 %746, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%747 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%748 = bitcast %struct.malloc_chunk* %747 to i8*
%749 = getelementptr inbounds i8* %748, i32 %nb.0
%750 = bitcast i8* %749 to %struct.malloc_chunk*
store %struct.malloc_chunk* %750, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%751 = or i32 %746, 1
%.sum = add i32 %nb.0, 4
%752 = getelementptr inbounds i8* %748, i32 %.sum
%753 = bitcast i8* %752 to i32*
store i32 %751, i32* %753, align 4
%754 = or i32 %nb.0, 3
%755 = getelementptr inbounds %struct.malloc_chunk* %747, i32 0, i32 1
store i32 %754, i32* %755, align 4
%756 = getelementptr inbounds %struct.malloc_chunk* %747, i32 0, i32 2
%757 = bitcast %struct.malloc_chunk** %756 to i8*
br label %sys_alloc.exit
; <label>:758 ; preds = %742
%759 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4
%760 = icmp eq i32 %759, 0
br i1 %760, label %761, label %770
; <label>:761 ; preds = %758
%762 = tail call i32 @sysconf(i32 8) nounwind
%763 = add i32 %762, -1
%764 = and i32 %763, %762
%765 = icmp eq i32 %764, 0
br i1 %765, label %init_mparams.exit.i, label %766
; <label>:766 ; preds = %761
tail call void @abort() noreturn nounwind
unreachable
init_mparams.exit.i: ; preds = %761
store i32 %762, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4
store i32 %762, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4
store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4
store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4
store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4
store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4
%767 = tail call i32 @time(i32* null) nounwind
%768 = and i32 %767, -16
%769 = xor i32 %768, 1431655768
store volatile i32 %769, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4
br label %770
; <label>:770 ; preds = %init_mparams.exit.i, %758
%771 = add i32 %nb.0, 48
%772 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4
%773 = add i32 %nb.0, 47
%774 = add i32 %772, %773
%775 = sub i32 0, %772
%776 = and i32 %774, %775
%777 = icmp ugt i32 %776, %nb.0
br i1 %777, label %778, label %sys_alloc.exit
; <label>:778 ; preds = %770
%779 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4
%780 = icmp eq i32 %779, 0
br i1 %780, label %786, label %781
; <label>:781 ; preds = %778
%782 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4
%783 = add i32 %782, %776
%784 = icmp ule i32 %783, %782
%785 = icmp ugt i32 %783, %779
%or.cond1.i = or i1 %784, %785
br i1 %or.cond1.i, label %sys_alloc.exit, label %786
; <label>:786 ; preds = %781, %778
%787 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4
%788 = and i32 %787, 4
%789 = icmp eq i32 %788, 0
br i1 %789, label %790, label %873
; <label>:790 ; preds = %786
%791 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%792 = icmp eq %struct.malloc_chunk* %791, null
br i1 %792, label %segment_holding.exit.thread.i, label %793
; <label>:793 ; preds = %790
%794 = bitcast %struct.malloc_chunk* %791 to i8*
br label %795
; <label>:795 ; preds = %804, %793
%sp.0.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %793 ], [ %806, %804 ]
%796 = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 0
%797 = load i8** %796, align 4
%798 = icmp ugt i8* %797, %794
br i1 %798, label %804, label %799
; <label>:799 ; preds = %795
%800 = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 1
%801 = load i32* %800, align 4
%802 = getelementptr inbounds i8* %797, i32 %801
%803 = icmp ugt i8* %802, %794
br i1 %803, label %segment_holding.exit.i, label %804
; <label>:804 ; preds = %799, %795
%805 = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 2
%806 = load %struct.malloc_segment** %805, align 4
%807 = icmp eq %struct.malloc_segment* %806, null
br i1 %807, label %segment_holding.exit.thread.i, label %795
segment_holding.exit.i: ; preds = %799
%808 = icmp eq %struct.malloc_segment* %sp.0.i.i, null
br i1 %808, label %segment_holding.exit.thread.i, label %837
segment_holding.exit.thread.i: ; preds = %segment_holding.exit.i, %804, %790
%809 = tail call i8* @sbrk(i32 0) nounwind
%810 = icmp eq i8* %809, inttoptr (i32 -1 to i8*)
br i1 %810, label %.thread38.i, label %811
; <label>:811 ; preds = %segment_holding.exit.thread.i
%812 = ptrtoint i8* %809 to i32
%813 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4
%814 = add i32 %813, -1
%815 = and i32 %814, %812
%816 = icmp eq i32 %815, 0
br i1 %816, label %823, label %817
; <label>:817 ; preds = %811
%818 = add i32 %814, %812
%819 = sub i32 0, %813
%820 = and i32 %818, %819
%821 = sub i32 %776, %812
%822 = add i32 %821, %820
br label %823
; <label>:823 ; preds = %817, %811
%ssize.0.i = phi i32 [ %776, %811 ], [ %822, %817 ]
%824 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4
%825 = add i32 %824, %ssize.0.i
%826 = icmp ugt i32 %ssize.0.i, %nb.0
%827 = icmp ult i32 %ssize.0.i, 2147483647
%or.cond.i131 = and i1 %826, %827
br i1 %or.cond.i131, label %828, label %.thread38.i
; <label>:828 ; preds = %823
%829 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4
%830 = icmp eq i32 %829, 0
br i1 %830, label %834, label %831
; <label>:831 ; preds = %828
%832 = icmp ule i32 %825, %824
%833 = icmp ugt i32 %825, %829
%or.cond2.i = or i1 %832, %833
br i1 %or.cond2.i, label %.thread38.i, label %834
; <label>:834 ; preds = %831, %828
%835 = tail call i8* @sbrk(i32 %ssize.0.i) nounwind
%836 = icmp eq i8* %835, %809
%ssize.0..i = select i1 %836, i32 %ssize.0.i, i32 0
%..i = select i1 %836, i8* %809, i8* inttoptr (i32 -1 to i8*)
br label %848
; <label>:837 ; preds = %segment_holding.exit.i
%838 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%839 = sub i32 %774, %838
%840 = and i32 %839, %775
%841 = icmp ult i32 %840, 2147483647
br i1 %841, label %842, label %.thread38.i
; <label>:842 ; preds = %837
%843 = tail call i8* @sbrk(i32 %840) nounwind
%844 = load i8** %796, align 4
%845 = load i32* %800, align 4
%846 = getelementptr inbounds i8* %844, i32 %845
%847 = icmp eq i8* %843, %846
%.3.i = select i1 %847, i32 %840, i32 0
%.4.i = select i1 %847, i8* %843, i8* inttoptr (i32 -1 to i8*)
br label %848
; <label>:848 ; preds = %842, %834
%ssize.1.i = phi i32 [ %ssize.0.i, %834 ], [ %840, %842 ]
%br.0.i = phi i8* [ %835, %834 ], [ %843, %842 ]
%tsize.0.i = phi i32 [ %ssize.0..i, %834 ], [ %.3.i, %842 ]
%tbase.0.i = phi i8* [ %..i, %834 ], [ %.4.i, %842 ]
%849 = sub i32 0, %ssize.1.i
%850 = icmp eq i8* %tbase.0.i, inttoptr (i32 -1 to i8*)
br i1 %850, label %851, label %.thread42.thread.i
; <label>:851 ; preds = %848
%852 = icmp ne i8* %br.0.i, inttoptr (i32 -1 to i8*)
%853 = icmp ult i32 %ssize.1.i, 2147483647
%or.cond5.i = and i1 %852, %853
%854 = icmp ult i32 %ssize.1.i, %771
%or.cond6.i = and i1 %or.cond5.i, %854
br i1 %or.cond6.i, label %855, label %869
; <label>:855 ; preds = %851
%856 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4
%857 = sub i32 %773, %ssize.1.i
%858 = add i32 %857, %856
%859 = sub i32 0, %856
%860 = and i32 %858, %859
%861 = icmp ult i32 %860, 2147483647
br i1 %861, label %862, label %869
; <label>:862 ; preds = %855
%863 = tail call i8* @sbrk(i32 %860) nounwind
%864 = icmp eq i8* %863, inttoptr (i32 -1 to i8*)
br i1 %864, label %867, label %865
; <label>:865 ; preds = %862
%866 = add i32 %860, %ssize.1.i
br label %869
; <label>:867 ; preds = %862
%868 = tail call i8* @sbrk(i32 %849) nounwind
br label %.thread38.i
; <label>:869 ; preds = %865, %855, %851
%ssize.2.i = phi i32 [ %866, %865 ], [ %ssize.1.i, %855 ], [ %ssize.1.i, %851 ]
%870 = icmp eq i8* %br.0.i, inttoptr (i32 -1 to i8*)
br i1 %870, label %.thread38.i, label %.thread42.thread.i
.thread38.i: ; preds = %869, %867, %837, %831, %823, %segment_holding.exit.thread.i
%tsize.0303639.i = phi i32 [ %tsize.0.i, %867 ], [ 0, %837 ], [ 0, %segment_holding.exit.thread.i ], [ 0, %823 ], [ 0, %831 ], [ %tsize.0.i, %869 ]
%871 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4
%872 = or i32 %871, 4
store i32 %872, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4
br label %873
; <label>:873 ; preds = %.thread38.i, %786
%tsize.1.i = phi i32 [ 0, %786 ], [ %tsize.0303639.i, %.thread38.i ]
%874 = icmp ult i32 %776, 2147483647
br i1 %874, label %875, label %.thread42.thread107.i
; <label>:875 ; preds = %873
%876 = tail call i8* @sbrk(i32 %776) nounwind
%877 = tail call i8* @sbrk(i32 0) nounwind
%notlhs.i = icmp ne i8* %876, inttoptr (i32 -1 to i8*)
%notrhs.i = icmp ne i8* %877, inttoptr (i32 -1 to i8*)
%or.cond8.not.i = and i1 %notrhs.i, %notlhs.i
%878 = icmp ult i8* %876, %877
%or.cond9.i = and i1 %or.cond8.not.i, %878
br i1 %or.cond9.i, label %.thread42.i, label %.thread42.thread107.i
.thread42.i: ; preds = %875
%879 = ptrtoint i8* %877 to i32
%880 = ptrtoint i8* %876 to i32
%881 = sub i32 %879, %880
%882 = add i32 %nb.0, 40
%883 = icmp ugt i32 %881, %882
%.tsize.1.i = select i1 %883, i32 %881, i32 %tsize.1.i
%.tbase.1.i = select i1 %883, i8* %876, i8* inttoptr (i32 -1 to i8*)
%884 = icmp eq i8* %.tbase.1.i, inttoptr (i32 -1 to i8*)
br i1 %884, label %.thread42.thread107.i, label %.thread42.thread.i
.thread42.thread.i: ; preds = %.thread42.i, %869, %848
%tbase.245.i = phi i8* [ %tbase.0.i, %848 ], [ %br.0.i, %869 ], [ %.tbase.1.i, %.thread42.i ]
%tsize.244.i = phi i32 [ %tsize.0.i, %848 ], [ %ssize.2.i, %869 ], [ %.tsize.1.i, %.thread42.i ]
%885 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4
%886 = add i32 %885, %tsize.244.i
store i32 %886, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4
%887 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4
%888 = icmp ugt i32 %886, %887
br i1 %888, label %889, label %.thread42.thread._crit_edge.i
; <label>:889 ; preds = %.thread42.thread.i
store i32 %886, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4
br label %.thread42.thread._crit_edge.i
.thread42.thread._crit_edge.i: ; preds = %889, %.thread42.thread.i
%890 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%891 = icmp eq %struct.malloc_chunk* %890, null
br i1 %891, label %892, label %.preheader61.i
; <label>:892 ; preds = %.thread42.thread._crit_edge.i
%893 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%894 = icmp eq i8* %893, null
%895 = icmp ult i8* %tbase.245.i, %893
%or.cond10.i = or i1 %894, %895
br i1 %or.cond10.i, label %896, label %._crit_edge.i132
; <label>:896 ; preds = %892
store i8* %tbase.245.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
br label %._crit_edge.i132
._crit_edge.i132: ; preds = %896, %892
store i8* %tbase.245.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 0), align 4
store i32 %tsize.244.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 1), align 4
store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 3), align 4
%897 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4
store i32 %897, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 9), align 4
store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4
br label %898
; <label>:898 ; preds = %898, %._crit_edge.i132
%i.02.i.i = phi i32 [ 0, %._crit_edge.i132 ], [ %904, %898 ]
%899 = shl i32 %i.02.i.i, 1
%900 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %899
%901 = bitcast %struct.malloc_chunk** %900 to %struct.malloc_chunk*
%.sum.i.i = add i32 %899, 3
%902 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum.i.i
store %struct.malloc_chunk* %901, %struct.malloc_chunk** %902, align 4
%.sum1.i.i = add i32 %899, 2
%903 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum1.i.i
store %struct.malloc_chunk* %901, %struct.malloc_chunk** %903, align 4
%904 = add i32 %i.02.i.i, 1
%905 = icmp ult i32 %904, 32
br i1 %905, label %898, label %init_bins.exit.i
init_bins.exit.i: ; preds = %898
%906 = add i32 %tsize.244.i, -40
%907 = getelementptr inbounds i8* %tbase.245.i, i32 8
%908 = ptrtoint i8* %907 to i32
%909 = and i32 %908, 7
%910 = icmp eq i32 %909, 0
br i1 %910, label %init_top.exit.i, label %911
; <label>:911 ; preds = %init_bins.exit.i
%912 = sub i32 0, %908
%913 = and i32 %912, 7
br label %init_top.exit.i
init_top.exit.i: ; preds = %911, %init_bins.exit.i
%914 = phi i32 [ %913, %911 ], [ 0, %init_bins.exit.i ]
%915 = getelementptr inbounds i8* %tbase.245.i, i32 %914
%916 = bitcast i8* %915 to %struct.malloc_chunk*
%917 = sub i32 %906, %914
store %struct.malloc_chunk* %916, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
store i32 %917, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%918 = or i32 %917, 1
%.sum.i14.i = add i32 %914, 4
%919 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum.i14.i
%920 = bitcast i8* %919 to i32*
store i32 %918, i32* %920, align 4
%.sum2.i.i = add i32 %tsize.244.i, -36
%921 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum2.i.i
%922 = bitcast i8* %921 to i32*
store i32 40, i32* %922, align 4
%923 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4
store i32 %923, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4
br label %add_segment.exit.i
.preheader61.i: ; preds = %930, %.thread42.thread._crit_edge.i
%sp.067.i = phi %struct.malloc_segment* [ %932, %930 ], [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %.thread42.thread._crit_edge.i ]
%924 = getelementptr inbounds %struct.malloc_segment* %sp.067.i, i32 0, i32 0
%925 = load i8** %924, align 4
%926 = getelementptr inbounds %struct.malloc_segment* %sp.067.i, i32 0, i32 1
%927 = load i32* %926, align 4
%928 = getelementptr inbounds i8* %925, i32 %927
%929 = icmp eq i8* %tbase.245.i, %928
br i1 %929, label %.critedge.i, label %930
; <label>:930 ; preds = %.preheader61.i
%931 = getelementptr inbounds %struct.malloc_segment* %sp.067.i, i32 0, i32 2
%932 = load %struct.malloc_segment** %931, align 4
%933 = icmp eq %struct.malloc_segment* %932, null
br i1 %933, label %.critedge11.i, label %.preheader61.i
.critedge.i: ; preds = %.preheader61.i
%934 = getelementptr inbounds %struct.malloc_segment* %sp.067.i, i32 0, i32 3
%935 = load i32* %934, align 4
%936 = and i32 %935, 8
%937 = icmp eq i32 %936, 0
br i1 %937, label %938, label %.critedge11.i
; <label>:938 ; preds = %.critedge.i
%939 = bitcast %struct.malloc_chunk* %890 to i8*
%940 = icmp uge i8* %939, %925
%941 = icmp ult i8* %939, %tbase.245.i
%or.cond47.i = and i1 %940, %941
br i1 %or.cond47.i, label %942, label %.critedge11.i
; <label>:942 ; preds = %938
%943 = add i32 %927, %tsize.244.i
store i32 %943, i32* %926, align 4
%944 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%945 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%946 = add i32 %945, %tsize.244.i
%947 = bitcast %struct.malloc_chunk* %944 to i8*
%948 = getelementptr inbounds %struct.malloc_chunk* %944, i32 0, i32 2
%949 = ptrtoint %struct.malloc_chunk** %948 to i32
%950 = and i32 %949, 7
%951 = icmp eq i32 %950, 0
br i1 %951, label %init_top.exit20.i, label %952
; <label>:952 ; preds = %942
%953 = sub i32 0, %949
%954 = and i32 %953, 7
br label %init_top.exit20.i
init_top.exit20.i: ; preds = %952, %942
%955 = phi i32 [ %954, %952 ], [ 0, %942 ]
%956 = getelementptr inbounds i8* %947, i32 %955
%957 = bitcast i8* %956 to %struct.malloc_chunk*
%958 = sub i32 %946, %955
store %struct.malloc_chunk* %957, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
store i32 %958, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%959 = or i32 %958, 1
%.sum.i18.i = add i32 %955, 4
%960 = getelementptr inbounds i8* %947, i32 %.sum.i18.i
%961 = bitcast i8* %960 to i32*
store i32 %959, i32* %961, align 4
%.sum2.i19.i = add i32 %946, 4
%962 = getelementptr inbounds i8* %947, i32 %.sum2.i19.i
%963 = bitcast i8* %962 to i32*
store i32 40, i32* %963, align 4
%964 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4
store i32 %964, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4
br label %add_segment.exit.i
.critedge11.i: ; preds = %938, %.critedge.i, %930
%965 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%966 = icmp ult i8* %tbase.245.i, %965
br i1 %966, label %967, label %.preheader.i133
; <label>:967 ; preds = %.critedge11.i
store i8* %tbase.245.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
br label %.preheader.i133
.preheader.i133: ; preds = %967, %.critedge11.i
%968 = getelementptr inbounds i8* %tbase.245.i, i32 %tsize.244.i
br label %969
; <label>:969 ; preds = %973, %.preheader.i133
%sp.160.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %.preheader.i133 ], [ %975, %973 ]
%970 = getelementptr inbounds %struct.malloc_segment* %sp.160.i, i32 0, i32 0
%971 = load i8** %970, align 4
%972 = icmp eq i8* %971, %968
br i1 %972, label %.critedge12.i, label %973
; <label>:973 ; preds = %969
%974 = getelementptr inbounds %struct.malloc_segment* %sp.160.i, i32 0, i32 2
%975 = load %struct.malloc_segment** %974, align 4
%976 = icmp eq %struct.malloc_segment* %975, null
br i1 %976, label %.critedge13.i, label %969
.critedge12.i: ; preds = %969
%977 = getelementptr inbounds %struct.malloc_segment* %sp.160.i, i32 0, i32 3
%978 = load i32* %977, align 4
%979 = and i32 %978, 8
%980 = icmp eq i32 %979, 0
br i1 %980, label %981, label %.critedge13.i
; <label>:981 ; preds = %.critedge12.i
store i8* %tbase.245.i, i8** %970, align 4
%982 = getelementptr inbounds %struct.malloc_segment* %sp.160.i, i32 0, i32 1
%983 = load i32* %982, align 4
%984 = add i32 %983, %tsize.244.i
store i32 %984, i32* %982, align 4
%985 = getelementptr inbounds i8* %tbase.245.i, i32 8
%986 = ptrtoint i8* %985 to i32
%987 = and i32 %986, 7
%988 = icmp eq i32 %987, 0
br i1 %988, label %992, label %989
; <label>:989 ; preds = %981
%990 = sub i32 0, %986
%991 = and i32 %990, 7
br label %992
; <label>:992 ; preds = %989, %981
%993 = phi i32 [ %991, %989 ], [ 0, %981 ]
%994 = getelementptr inbounds i8* %tbase.245.i, i32 %993
%.sum93.i = add i32 %tsize.244.i, 8
%995 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum93.i
%996 = ptrtoint i8* %995 to i32
%997 = and i32 %996, 7
%998 = icmp eq i32 %997, 0
br i1 %998, label %1002, label %999
; <label>:999 ; preds = %992
%1000 = sub i32 0, %996
%1001 = and i32 %1000, 7
br label %1002
; <label>:1002 ; preds = %999, %992
%1003 = phi i32 [ %1001, %999 ], [ 0, %992 ]
%.sum94.i = add i32 %1003, %tsize.244.i
%1004 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum94.i
%1005 = bitcast i8* %1004 to %struct.malloc_chunk*
%1006 = ptrtoint i8* %1004 to i32
%1007 = ptrtoint i8* %994 to i32
%1008 = sub i32 %1006, %1007
%.sum.i21.i = add i32 %993, %nb.0
%1009 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum.i21.i
%1010 = bitcast i8* %1009 to %struct.malloc_chunk*
%1011 = sub i32 %1008, %nb.0
%1012 = or i32 %nb.0, 3
%.sum1.i22.i = add i32 %993, 4
%1013 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum1.i22.i
%1014 = bitcast i8* %1013 to i32*
store i32 %1012, i32* %1014, align 4
%1015 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%1016 = icmp eq %struct.malloc_chunk* %1005, %1015
br i1 %1016, label %1017, label %1023
; <label>:1017 ; preds = %1002
%1018 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%1019 = add i32 %1018, %1011
store i32 %1019, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
store %struct.malloc_chunk* %1010, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%1020 = or i32 %1019, 1
%.sum46.i.i = add i32 %.sum.i21.i, 4
%1021 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum46.i.i
%1022 = bitcast i8* %1021 to i32*
store i32 %1020, i32* %1022, align 4
br label %prepend_alloc.exit.i
; <label>:1023 ; preds = %1002
%1024 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%1025 = icmp eq %struct.malloc_chunk* %1005, %1024
br i1 %1025, label %1026, label %1034
; <label>:1026 ; preds = %1023
%1027 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%1028 = add i32 %1027, %1011
store i32 %1028, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
store %struct.malloc_chunk* %1010, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%1029 = or i32 %1028, 1
%.sum44.i.i = add i32 %.sum.i21.i, 4
%1030 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum44.i.i
%1031 = bitcast i8* %1030 to i32*
store i32 %1029, i32* %1031, align 4
%.sum45.i.i = add i32 %1028, %.sum.i21.i
%1032 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum45.i.i
%1033 = bitcast i8* %1032 to i32*
store i32 %1028, i32* %1033, align 4
br label %prepend_alloc.exit.i
; <label>:1034 ; preds = %1023
%.sum2.i23.i = add i32 %tsize.244.i, 4
%.sum95.i = add i32 %.sum2.i23.i, %1003
%1035 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum95.i
%1036 = bitcast i8* %1035 to i32*
%1037 = load i32* %1036, align 4
%1038 = and i32 %1037, 3
%1039 = icmp eq i32 %1038, 1
br i1 %1039, label %1040, label %1193
; <label>:1040 ; preds = %1034
%1041 = and i32 %1037, -8
%1042 = lshr i32 %1037, 3
%1043 = icmp ult i32 %1037, 256
br i1 %1043, label %1044, label %1080
; <label>:1044 ; preds = %1040
%.sum3940.i.i = or i32 %1003, 8
%.sum105.i = add i32 %.sum3940.i.i, %tsize.244.i
%1045 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum105.i
%1046 = bitcast i8* %1045 to %struct.malloc_chunk**
%1047 = load %struct.malloc_chunk** %1046, align 4
%.sum41.i.i = add i32 %tsize.244.i, 12
%.sum106.i = add i32 %.sum41.i.i, %1003
%1048 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum106.i
%1049 = bitcast i8* %1048 to %struct.malloc_chunk**
%1050 = load %struct.malloc_chunk** %1049, align 4
%1051 = shl nuw nsw i32 %1042, 1
%1052 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %1051
%1053 = bitcast %struct.malloc_chunk** %1052 to %struct.malloc_chunk*
%1054 = icmp eq %struct.malloc_chunk* %1047, %1053
br i1 %1054, label %.critedge47.i.i, label %1055
; <label>:1055 ; preds = %1044
%1056 = bitcast %struct.malloc_chunk* %1047 to i8*
%1057 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1058 = icmp ult i8* %1056, %1057
br i1 %1058, label %.critedge48.i.i, label %1059
; <label>:1059 ; preds = %1055
%1060 = getelementptr inbounds %struct.malloc_chunk* %1047, i32 0, i32 3
%1061 = load %struct.malloc_chunk** %1060, align 4
%1062 = icmp eq %struct.malloc_chunk* %1061, %1005
br i1 %1062, label %.critedge47.i.i, label %.critedge48.i.i, !prof !0
.critedge47.i.i: ; preds = %1059, %1044
%1063 = icmp eq %struct.malloc_chunk* %1050, %1047
br i1 %1063, label %1064, label %1069
; <label>:1064 ; preds = %.critedge47.i.i
%1065 = shl i32 1, %1042
%1066 = xor i32 %1065, -1
%1067 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%1068 = and i32 %1067, %1066
store i32 %1068, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
br label %1189
; <label>:1069 ; preds = %.critedge47.i.i
%1070 = icmp eq %struct.malloc_chunk* %1050, %1053
br i1 %1070, label %..critedge49_crit_edge.i.i, label %1071
..critedge49_crit_edge.i.i: ; preds = %1069
%.pre56.i.i = getelementptr inbounds %struct.malloc_chunk* %1050, i32 0, i32 2
br label %.critedge49.i.i
; <label>:1071 ; preds = %1069
%1072 = bitcast %struct.malloc_chunk* %1050 to i8*
%1073 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1074 = icmp ult i8* %1072, %1073
br i1 %1074, label %.critedge50.i.i, label %1075
; <label>:1075 ; preds = %1071
%1076 = getelementptr inbounds %struct.malloc_chunk* %1050, i32 0, i32 2
%1077 = load %struct.malloc_chunk** %1076, align 4
%1078 = icmp eq %struct.malloc_chunk* %1077, %1005
br i1 %1078, label %.critedge49.i.i, label %.critedge50.i.i, !prof !0
.critedge49.i.i: ; preds = %1075, %..critedge49_crit_edge.i.i
%.pre-phi57.i.i = phi %struct.malloc_chunk** [ %.pre56.i.i, %..critedge49_crit_edge.i.i ], [ %1076, %1075 ]
%1079 = getelementptr inbounds %struct.malloc_chunk* %1047, i32 0, i32 3
store %struct.malloc_chunk* %1050, %struct.malloc_chunk** %1079, align 4
store %struct.malloc_chunk* %1047, %struct.malloc_chunk** %.pre-phi57.i.i, align 4
br label %1189
.critedge50.i.i: ; preds = %1075, %1071
tail call void @abort() noreturn nounwind
unreachable
.critedge48.i.i: ; preds = %1059, %1055
tail call void @abort() noreturn nounwind
unreachable
; <label>:1080 ; preds = %1040
%1081 = bitcast i8* %1004 to %struct.malloc_tree_chunk*
%.sum34.i.i = or i32 %1003, 24
%.sum96.i = add i32 %.sum34.i.i, %tsize.244.i
%1082 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum96.i
%1083 = bitcast i8* %1082 to %struct.malloc_tree_chunk**
%1084 = load %struct.malloc_tree_chunk** %1083, align 4
%.sum5.i.i = add i32 %tsize.244.i, 12
%.sum97.i = add i32 %.sum5.i.i, %1003
%1085 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum97.i
%1086 = bitcast i8* %1085 to %struct.malloc_tree_chunk**
%1087 = load %struct.malloc_tree_chunk** %1086, align 4
%1088 = icmp eq %struct.malloc_tree_chunk* %1087, %1081
br i1 %1088, label %1105, label %1089
; <label>:1089 ; preds = %1080
%.sum3637.i.i = or i32 %1003, 8
%.sum98.i = add i32 %.sum3637.i.i, %tsize.244.i
%1090 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum98.i
%1091 = bitcast i8* %1090 to %struct.malloc_tree_chunk**
%1092 = load %struct.malloc_tree_chunk** %1091, align 4
%1093 = bitcast %struct.malloc_tree_chunk* %1092 to i8*
%1094 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1095 = icmp ult i8* %1093, %1094
br i1 %1095, label %.critedge51.i.i, label %1096
; <label>:1096 ; preds = %1089
%1097 = getelementptr inbounds %struct.malloc_tree_chunk* %1092, i32 0, i32 3
%1098 = load %struct.malloc_tree_chunk** %1097, align 4
%1099 = icmp eq %struct.malloc_tree_chunk* %1098, %1081
br i1 %1099, label %1100, label %.critedge51.i.i
; <label>:1100 ; preds = %1096
%1101 = getelementptr inbounds %struct.malloc_tree_chunk* %1087, i32 0, i32 2
%1102 = load %struct.malloc_tree_chunk** %1101, align 4
%1103 = icmp eq %struct.malloc_tree_chunk* %1102, %1081
br i1 %1103, label %1104, label %.critedge51.i.i, !prof !0
; <label>:1104 ; preds = %1100
store %struct.malloc_tree_chunk* %1087, %struct.malloc_tree_chunk** %1097, align 4
store %struct.malloc_tree_chunk* %1092, %struct.malloc_tree_chunk** %1101, align 4
br label %1128
.critedge51.i.i: ; preds = %1100, %1096, %1089
tail call void @abort() noreturn nounwind
unreachable
; <label>:1105 ; preds = %1080
%.sum67.i.i = or i32 %1003, 16
%.sum103.i = add i32 %.sum2.i23.i, %.sum67.i.i
%1106 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum103.i
%1107 = bitcast i8* %1106 to %struct.malloc_tree_chunk**
%1108 = load %struct.malloc_tree_chunk** %1107, align 4
%1109 = icmp eq %struct.malloc_tree_chunk* %1108, null
br i1 %1109, label %1110, label %.preheader.i.i
; <label>:1110 ; preds = %1105
%.sum104.i = add i32 %.sum67.i.i, %tsize.244.i
%1111 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum104.i
%1112 = bitcast i8* %1111 to %struct.malloc_tree_chunk**
%1113 = load %struct.malloc_tree_chunk** %1112, align 4
%1114 = icmp eq %struct.malloc_tree_chunk* %1113, null
br i1 %1114, label %1128, label %.preheader.i.i
.preheader.i.i: ; preds = %1118, %.preheader.i.i, %1110, %1105
%RP.0.i.i = phi %struct.malloc_tree_chunk** [ %1112, %1110 ], [ %1107, %1105 ], [ %1115, %.preheader.i.i ], [ %1119, %1118 ]
%R.0.i.i = phi %struct.malloc_tree_chunk* [ %1113, %1110 ], [ %1108, %1105 ], [ %1116, %.preheader.i.i ], [ %1120, %1118 ]
%1115 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i.i, i32 0, i32 4, i32 1
%1116 = load %struct.malloc_tree_chunk** %1115, align 4
%1117 = icmp eq %struct.malloc_tree_chunk* %1116, null
br i1 %1117, label %1118, label %.preheader.i.i
; <label>:1118 ; preds = %.preheader.i.i
%1119 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i.i, i32 0, i32 4, i32 0
%1120 = load %struct.malloc_tree_chunk** %1119, align 4
%1121 = icmp eq %struct.malloc_tree_chunk* %1120, null
br i1 %1121, label %1122, label %.preheader.i.i
; <label>:1122 ; preds = %1118
%1123 = bitcast %struct.malloc_tree_chunk** %RP.0.i.i to i8*
%1124 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1125 = icmp ult i8* %1123, %1124
br i1 %1125, label %1127, label %1126, !prof !1
; <label>:1126 ; preds = %1122
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i.i, align 4
br label %1128
; <label>:1127 ; preds = %1122
tail call void @abort() noreturn nounwind
unreachable
; <label>:1128 ; preds = %1126, %1110, %1104
%R.1.i.i = phi %struct.malloc_tree_chunk* [ %1087, %1104 ], [ %R.0.i.i, %1126 ], [ null, %1110 ]
%1129 = icmp eq %struct.malloc_tree_chunk* %1084, null
br i1 %1129, label %1189, label %1130
; <label>:1130 ; preds = %1128
%.sum31.i.i = add i32 %tsize.244.i, 28
%.sum99.i = add i32 %.sum31.i.i, %1003
%1131 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum99.i
%1132 = bitcast i8* %1131 to i32*
%1133 = load i32* %1132, align 4
%1134 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %1133
%1135 = load %struct.malloc_tree_chunk** %1134, align 4
%1136 = icmp eq %struct.malloc_tree_chunk* %1081, %1135
br i1 %1136, label %1137, label %1143
; <label>:1137 ; preds = %1130
store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %1134, align 4
%cond.i.i = icmp eq %struct.malloc_tree_chunk* %R.1.i.i, null
br i1 %cond.i.i, label %.thread.i.i, label %1157
.thread.i.i: ; preds = %1137
%1138 = load i32* %1132, align 4
%1139 = shl i32 1, %1138
%1140 = xor i32 %1139, -1
%1141 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%1142 = and i32 %1141, %1140
store i32 %1142, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
br label %1189
; <label>:1143 ; preds = %1130
%1144 = bitcast %struct.malloc_tree_chunk* %1084 to i8*
%1145 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1146 = icmp ult i8* %1144, %1145
br i1 %1146, label %1154, label %1147, !prof !1
; <label>:1147 ; preds = %1143
%1148 = getelementptr inbounds %struct.malloc_tree_chunk* %1084, i32 0, i32 4, i32 0
%1149 = load %struct.malloc_tree_chunk** %1148, align 4
%1150 = icmp eq %struct.malloc_tree_chunk* %1149, %1081
br i1 %1150, label %1151, label %1152
; <label>:1151 ; preds = %1147
store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %1148, align 4
br label %1155
; <label>:1152 ; preds = %1147
%1153 = getelementptr inbounds %struct.malloc_tree_chunk* %1084, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %1153, align 4
br label %1155
; <label>:1154 ; preds = %1143
tail call void @abort() noreturn nounwind
unreachable
; <label>:1155 ; preds = %1152, %1151
%1156 = icmp eq %struct.malloc_tree_chunk* %R.1.i.i, null
br i1 %1156, label %1189, label %1157
; <label>:1157 ; preds = %1155, %1137
%1158 = bitcast %struct.malloc_tree_chunk* %R.1.i.i to i8*
%1159 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1160 = icmp ult i8* %1158, %1159
br i1 %1160, label %1188, label %1161, !prof !1
; <label>:1161 ; preds = %1157
%1162 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 5
store %struct.malloc_tree_chunk* %1084, %struct.malloc_tree_chunk** %1162, align 4
%.sum3233.i.i = or i32 %1003, 16
%.sum100.i = add i32 %.sum3233.i.i, %tsize.244.i
%1163 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum100.i
%1164 = bitcast i8* %1163 to %struct.malloc_tree_chunk**
%1165 = load %struct.malloc_tree_chunk** %1164, align 4
%1166 = icmp eq %struct.malloc_tree_chunk* %1165, null
br i1 %1166, label %1175, label %1167
; <label>:1167 ; preds = %1161
%1168 = bitcast %struct.malloc_tree_chunk* %1165 to i8*
%1169 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1170 = icmp ult i8* %1168, %1169
br i1 %1170, label %1174, label %1171, !prof !1
; <label>:1171 ; preds = %1167
%1172 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 4, i32 0
store %struct.malloc_tree_chunk* %1165, %struct.malloc_tree_chunk** %1172, align 4
%1173 = getelementptr inbounds %struct.malloc_tree_chunk* %1165, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %1173, align 4
br label %1175
; <label>:1174 ; preds = %1167
tail call void @abort() noreturn nounwind
unreachable
; <label>:1175 ; preds = %1171, %1161
%.sum101.i = add i32 %.sum2.i23.i, %.sum3233.i.i
%1176 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum101.i
%1177 = bitcast i8* %1176 to %struct.malloc_tree_chunk**
%1178 = load %struct.malloc_tree_chunk** %1177, align 4
%1179 = icmp eq %struct.malloc_tree_chunk* %1178, null
br i1 %1179, label %1189, label %1180
; <label>:1180 ; preds = %1175
%1181 = bitcast %struct.malloc_tree_chunk* %1178 to i8*
%1182 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1183 = icmp ult i8* %1181, %1182
br i1 %1183, label %1187, label %1184, !prof !1
; <label>:1184 ; preds = %1180
%1185 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %1178, %struct.malloc_tree_chunk** %1185, align 4
%1186 = getelementptr inbounds %struct.malloc_tree_chunk* %1178, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %1186, align 4
br label %1189
; <label>:1187 ; preds = %1180
tail call void @abort() noreturn nounwind
unreachable
; <label>:1188 ; preds = %1157
tail call void @abort() noreturn nounwind
unreachable
; <label>:1189 ; preds = %1184, %1175, %1155, %.thread.i.i, %1128, %.critedge49.i.i, %1064
%.sum9.i.i = or i32 %1041, %1003
%.sum102.i = add i32 %.sum9.i.i, %tsize.244.i
%1190 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum102.i
%1191 = bitcast i8* %1190 to %struct.malloc_chunk*
%1192 = add i32 %1041, %1011
br label %1193
; <label>:1193 ; preds = %1189, %1034
%qsize.0.i.i = phi i32 [ %1011, %1034 ], [ %1192, %1189 ]
%oldfirst.0.i.i = phi %struct.malloc_chunk* [ %1005, %1034 ], [ %1191, %1189 ]
%1194 = getelementptr inbounds %struct.malloc_chunk* %oldfirst.0.i.i, i32 0, i32 1
%1195 = load i32* %1194, align 4
%1196 = and i32 %1195, -2
store i32 %1196, i32* %1194, align 4
%1197 = or i32 %qsize.0.i.i, 1
%.sum10.i.i = add i32 %.sum.i21.i, 4
%1198 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum10.i.i
%1199 = bitcast i8* %1198 to i32*
store i32 %1197, i32* %1199, align 4
%.sum11.i.i = add i32 %qsize.0.i.i, %.sum.i21.i
%1200 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum11.i.i
%1201 = bitcast i8* %1200 to i32*
store i32 %qsize.0.i.i, i32* %1201, align 4
%1202 = lshr i32 %qsize.0.i.i, 3
%1203 = icmp ult i32 %qsize.0.i.i, 256
br i1 %1203, label %1204, label %1227
; <label>:1204 ; preds = %1193
%1205 = shl nuw nsw i32 %1202, 1
%1206 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %1205
%1207 = bitcast %struct.malloc_chunk** %1206 to %struct.malloc_chunk*
%1208 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%1209 = shl i32 1, %1202
%1210 = and i32 %1208, %1209
%1211 = icmp eq i32 %1210, 0
br i1 %1211, label %1212, label %1214
; <label>:1212 ; preds = %1204
%1213 = or i32 %1208, %1209
store i32 %1213, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%.sum27.pre.i.i = add i32 %1205, 2
%.pre.i24.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum27.pre.i.i
br label %1221
; <label>:1214 ; preds = %1204
%.sum30.i.i = add i32 %1205, 2
%1215 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum30.i.i
%1216 = load %struct.malloc_chunk** %1215, align 4
%1217 = bitcast %struct.malloc_chunk* %1216 to i8*
%1218 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1219 = icmp ult i8* %1217, %1218
br i1 %1219, label %1220, label %1221, !prof !1
; <label>:1220 ; preds = %1214
tail call void @abort() noreturn nounwind
unreachable
; <label>:1221 ; preds = %1214, %1212
%.pre-phi.i25.i = phi %struct.malloc_chunk** [ %1215, %1214 ], [ %.pre.i24.i, %1212 ]
%F4.0.i.i = phi %struct.malloc_chunk* [ %1216, %1214 ], [ %1207, %1212 ]
store %struct.malloc_chunk* %1010, %struct.malloc_chunk** %.pre-phi.i25.i, align 4
%1222 = getelementptr inbounds %struct.malloc_chunk* %F4.0.i.i, i32 0, i32 3
store %struct.malloc_chunk* %1010, %struct.malloc_chunk** %1222, align 4
%.sum28.i.i = add i32 %.sum.i21.i, 8
%1223 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum28.i.i
%1224 = bitcast i8* %1223 to %struct.malloc_chunk**
store %struct.malloc_chunk* %F4.0.i.i, %struct.malloc_chunk** %1224, align 4
%.sum29.i.i = add i32 %.sum.i21.i, 12
%1225 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum29.i.i
%1226 = bitcast i8* %1225 to %struct.malloc_chunk**
store %struct.malloc_chunk* %1207, %struct.malloc_chunk** %1226, align 4
br label %prepend_alloc.exit.i
; <label>:1227 ; preds = %1193
%1228 = bitcast i8* %1009 to %struct.malloc_tree_chunk*
%1229 = lshr i32 %qsize.0.i.i, 8
%1230 = icmp eq i32 %1229, 0
br i1 %1230, label %1256, label %1231
; <label>:1231 ; preds = %1227
%1232 = icmp ugt i32 %qsize.0.i.i, 16777215
br i1 %1232, label %1256, label %1233
; <label>:1233 ; preds = %1231
%1234 = add i32 %1229, 1048320
%1235 = lshr i32 %1234, 16
%1236 = and i32 %1235, 8
%1237 = shl i32 %1229, %1236
%1238 = add i32 %1237, 520192
%1239 = lshr i32 %1238, 16
%1240 = and i32 %1239, 4
%1241 = or i32 %1240, %1236
%1242 = shl i32 %1237, %1240
%1243 = add i32 %1242, 245760
%1244 = lshr i32 %1243, 16
%1245 = and i32 %1244, 2
%1246 = or i32 %1241, %1245
%1247 = sub i32 14, %1246
%1248 = shl i32 %1242, %1245
%1249 = lshr i32 %1248, 15
%1250 = add i32 %1247, %1249
%1251 = shl nsw i32 %1250, 1
%1252 = add i32 %1250, 7
%1253 = lshr i32 %qsize.0.i.i, %1252
%1254 = and i32 %1253, 1
%1255 = or i32 %1254, %1251
br label %1256
; <label>:1256 ; preds = %1233, %1231, %1227
%I7.0.i.i = phi i32 [ %1255, %1233 ], [ 0, %1227 ], [ 31, %1231 ]
%1257 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I7.0.i.i
%.sum12.i26.i = add i32 %.sum.i21.i, 28
%1258 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum12.i26.i
%1259 = bitcast i8* %1258 to i32*
store i32 %I7.0.i.i, i32* %1259, align 4
%.sum13.i.i = add i32 %.sum.i21.i, 16
%1260 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum13.i.i
%.sum14.i.i = add i32 %.sum.i21.i, 20
%1261 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum14.i.i
%1262 = bitcast i8* %1261 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %1262, align 4
%1263 = bitcast i8* %1260 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %1263, align 4
%1264 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%1265 = shl i32 1, %I7.0.i.i
%1266 = and i32 %1264, %1265
%1267 = icmp eq i32 %1266, 0
br i1 %1267, label %1268, label %1277
; <label>:1268 ; preds = %1256
%1269 = or i32 %1264, %1265
store i32 %1269, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1257, align 4
%1270 = bitcast %struct.malloc_tree_chunk** %1257 to %struct.malloc_tree_chunk*
%.sum15.i.i = add i32 %.sum.i21.i, 24
%1271 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum15.i.i
%1272 = bitcast i8* %1271 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %1270, %struct.malloc_tree_chunk** %1272, align 4
%.sum16.i.i = add i32 %.sum.i21.i, 12
%1273 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum16.i.i
%1274 = bitcast i8* %1273 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1274, align 4
%.sum17.i.i = add i32 %.sum.i21.i, 8
%1275 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum17.i.i
%1276 = bitcast i8* %1275 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1276, align 4
br label %prepend_alloc.exit.i
; <label>:1277 ; preds = %1256
%1278 = load %struct.malloc_tree_chunk** %1257, align 4
%1279 = icmp eq i32 %I7.0.i.i, 31
br i1 %1279, label %1283, label %1280
; <label>:1280 ; preds = %1277
%1281 = lshr i32 %I7.0.i.i, 1
%1282 = sub i32 25, %1281
br label %1283
; <label>:1283 ; preds = %1280, %1277
%1284 = phi i32 [ %1282, %1280 ], [ 0, %1277 ]
%1285 = shl i32 %qsize.0.i.i, %1284
br label %1286
; <label>:1286 ; preds = %1291, %1283
%T.0.i27.i = phi %struct.malloc_tree_chunk* [ %1278, %1283 ], [ %1294, %1291 ]
%K8.0.i.i = phi i32 [ %1285, %1283 ], [ %1296, %1291 ]
%1287 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i27.i, i32 0, i32 1
%1288 = load i32* %1287, align 4
%1289 = and i32 %1288, -8
%1290 = icmp eq i32 %1289, %qsize.0.i.i
br i1 %1290, label %1309, label %1291
; <label>:1291 ; preds = %1286
%1292 = lshr i32 %K8.0.i.i, 31
%1293 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i27.i, i32 0, i32 4, i32 %1292
%1294 = load %struct.malloc_tree_chunk** %1293, align 4
%1295 = icmp eq %struct.malloc_tree_chunk* %1294, null
%1296 = shl i32 %K8.0.i.i, 1
br i1 %1295, label %1297, label %1286
; <label>:1297 ; preds = %1291
%1298 = bitcast %struct.malloc_tree_chunk** %1293 to i8*
%1299 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1300 = icmp ult i8* %1298, %1299
br i1 %1300, label %1308, label %1301, !prof !1
; <label>:1301 ; preds = %1297
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1293, align 4
%.sum24.i.i = add i32 %.sum.i21.i, 24
%1302 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum24.i.i
%1303 = bitcast i8* %1302 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %T.0.i27.i, %struct.malloc_tree_chunk** %1303, align 4
%.sum25.i.i = add i32 %.sum.i21.i, 12
%1304 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum25.i.i
%1305 = bitcast i8* %1304 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1305, align 4
%.sum26.i.i = add i32 %.sum.i21.i, 8
%1306 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum26.i.i
%1307 = bitcast i8* %1306 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1307, align 4
br label %prepend_alloc.exit.i
; <label>:1308 ; preds = %1297
tail call void @abort() noreturn nounwind
unreachable
; <label>:1309 ; preds = %1286
%1310 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i27.i, i32 0, i32 2
%1311 = load %struct.malloc_tree_chunk** %1310, align 4
%1312 = bitcast %struct.malloc_tree_chunk* %T.0.i27.i to i8*
%1313 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1314 = icmp ult i8* %1312, %1313
br i1 %1314, label %.critedge53.i.i, label %1315
; <label>:1315 ; preds = %1309
%1316 = bitcast %struct.malloc_tree_chunk* %1311 to i8*
%1317 = icmp ult i8* %1316, %1313
br i1 %1317, label %.critedge53.i.i, label %1318, !prof !1
; <label>:1318 ; preds = %1315
%1319 = getelementptr inbounds %struct.malloc_tree_chunk* %1311, i32 0, i32 3
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1319, align 4
store %struct.malloc_tree_chunk* %1228, %struct.malloc_tree_chunk** %1310, align 4
%.sum21.i.i = add i32 %.sum.i21.i, 8
%1320 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum21.i.i
%1321 = bitcast i8* %1320 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %1311, %struct.malloc_tree_chunk** %1321, align 4
%.sum22.i.i = add i32 %.sum.i21.i, 12
%1322 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum22.i.i
%1323 = bitcast i8* %1322 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* %T.0.i27.i, %struct.malloc_tree_chunk** %1323, align 4
%.sum23.i.i = add i32 %.sum.i21.i, 24
%1324 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum23.i.i
%1325 = bitcast i8* %1324 to %struct.malloc_tree_chunk**
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %1325, align 4
br label %prepend_alloc.exit.i
.critedge53.i.i: ; preds = %1315, %1309
tail call void @abort() noreturn nounwind
unreachable
prepend_alloc.exit.i: ; preds = %1318, %1301, %1268, %1221, %1026, %1017
%.sum1819.i.i = or i32 %993, 8
%1326 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum1819.i.i
br label %sys_alloc.exit
.critedge13.i: ; preds = %.critedge12.i, %973
%1327 = bitcast %struct.malloc_chunk* %890 to i8*
br label %1328
; <label>:1328 ; preds = %1337, %.critedge13.i
%sp.0.i.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %.critedge13.i ], [ %1339, %1337 ]
%1329 = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 0
%1330 = load i8** %1329, align 4
%1331 = icmp ugt i8* %1330, %1327
br i1 %1331, label %1337, label %1332
; <label>:1332 ; preds = %1328
%1333 = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 1
%1334 = load i32* %1333, align 4
%1335 = getelementptr inbounds i8* %1330, i32 %1334
%1336 = icmp ugt i8* %1335, %1327
br i1 %1336, label %segment_holding.exit.i.i, label %1337
; <label>:1337 ; preds = %1332, %1328
%1338 = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 2
%1339 = load %struct.malloc_segment** %1338, align 4
br label %1328
segment_holding.exit.i.i: ; preds = %1332
%.sum.i15.i = add i32 %1334, -47
%.sum1.i16.i = add i32 %1334, -39
%1340 = getelementptr inbounds i8* %1330, i32 %.sum1.i16.i
%1341 = ptrtoint i8* %1340 to i32
%1342 = and i32 %1341, 7
%1343 = icmp eq i32 %1342, 0
br i1 %1343, label %1347, label %1344
; <label>:1344 ; preds = %segment_holding.exit.i.i
%1345 = sub i32 0, %1341
%1346 = and i32 %1345, 7
br label %1347
; <label>:1347 ; preds = %1344, %segment_holding.exit.i.i
%1348 = phi i32 [ %1346, %1344 ], [ 0, %segment_holding.exit.i.i ]
%.sum2.i17.i = add i32 %.sum.i15.i, %1348
%1349 = getelementptr inbounds i8* %1330, i32 %.sum2.i17.i
%1350 = getelementptr inbounds %struct.malloc_chunk* %890, i32 1
%1351 = bitcast %struct.malloc_chunk* %1350 to i8*
%1352 = icmp ult i8* %1349, %1351
%1353 = select i1 %1352, i8* %1327, i8* %1349
%1354 = getelementptr inbounds i8* %1353, i32 8
%1355 = bitcast i8* %1354 to %struct.malloc_segment*
%1356 = add i32 %tsize.244.i, -40
%1357 = getelementptr inbounds i8* %tbase.245.i, i32 8
%1358 = ptrtoint i8* %1357 to i32
%1359 = and i32 %1358, 7
%1360 = icmp eq i32 %1359, 0
br i1 %1360, label %init_top.exit.i.i, label %1361
; <label>:1361 ; preds = %1347
%1362 = sub i32 0, %1358
%1363 = and i32 %1362, 7
br label %init_top.exit.i.i
init_top.exit.i.i: ; preds = %1361, %1347
%1364 = phi i32 [ %1363, %1361 ], [ 0, %1347 ]
%1365 = getelementptr inbounds i8* %tbase.245.i, i32 %1364
%1366 = bitcast i8* %1365 to %struct.malloc_chunk*
%1367 = sub i32 %1356, %1364
store %struct.malloc_chunk* %1366, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
store i32 %1367, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%1368 = or i32 %1367, 1
%.sum.i.i.i = add i32 %1364, 4
%1369 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum.i.i.i
%1370 = bitcast i8* %1369 to i32*
store i32 %1368, i32* %1370, align 4
%.sum2.i.i.i = add i32 %tsize.244.i, -36
%1371 = getelementptr inbounds i8* %tbase.245.i, i32 %.sum2.i.i.i
%1372 = bitcast i8* %1371 to i32*
store i32 40, i32* %1372, align 4
%1373 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4
store i32 %1373, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4
%1374 = getelementptr inbounds i8* %1353, i32 4
%1375 = bitcast i8* %1374 to i32*
store i32 27, i32* %1375, align 4
tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %1354, i8* bitcast (%struct.malloc_segment* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16) to i8*), i32 16, i32 4, i1 false) nounwind
store i8* %tbase.245.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 0), align 4
store i32 %tsize.244.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 1), align 4
store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 3), align 4
store %struct.malloc_segment* %1355, %struct.malloc_segment** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 2), align 4
%1376 = getelementptr inbounds i8* %1353, i32 28
%1377 = bitcast i8* %1376 to i32*
store i32 7, i32* %1377, align 4
%1378 = getelementptr inbounds i8* %1353, i32 32
%1379 = icmp ult i8* %1378, %1335
br i1 %1379, label %.lr.ph.i.i, label %._crit_edge.i.i
.lr.ph.i.i: ; preds = %.lr.ph.i.i, %init_top.exit.i.i
%1380 = phi i32* [ %1381, %.lr.ph.i.i ], [ %1377, %init_top.exit.i.i ]
%1381 = getelementptr inbounds i32* %1380, i32 1
store i32 7, i32* %1381, align 4
%1382 = getelementptr inbounds i32* %1380, i32 2
%1383 = bitcast i32* %1382 to i8*
%1384 = icmp ult i8* %1383, %1335
br i1 %1384, label %.lr.ph.i.i, label %._crit_edge.i.i
._crit_edge.i.i: ; preds = %.lr.ph.i.i, %init_top.exit.i.i
%1385 = icmp eq i8* %1353, %1327
br i1 %1385, label %add_segment.exit.i, label %1386
; <label>:1386 ; preds = %._crit_edge.i.i
%1387 = ptrtoint i8* %1353 to i32
%1388 = ptrtoint %struct.malloc_chunk* %890 to i32
%1389 = sub i32 %1387, %1388
%1390 = getelementptr inbounds i8* %1327, i32 %1389
%.sum3.i.i = add i32 %1389, 4
%1391 = getelementptr inbounds i8* %1327, i32 %.sum3.i.i
%1392 = bitcast i8* %1391 to i32*
%1393 = load i32* %1392, align 4
%1394 = and i32 %1393, -2
store i32 %1394, i32* %1392, align 4
%1395 = or i32 %1389, 1
%1396 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 1
store i32 %1395, i32* %1396, align 4
%1397 = bitcast i8* %1390 to i32*
store i32 %1389, i32* %1397, align 4
%1398 = lshr i32 %1389, 3
%1399 = icmp ult i32 %1389, 256
br i1 %1399, label %1400, label %1421
; <label>:1400 ; preds = %1386
%1401 = shl nuw nsw i32 %1398, 1
%1402 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %1401
%1403 = bitcast %struct.malloc_chunk** %1402 to %struct.malloc_chunk*
%1404 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%1405 = shl i32 1, %1398
%1406 = and i32 %1404, %1405
%1407 = icmp eq i32 %1406, 0
br i1 %1407, label %1408, label %1410
; <label>:1408 ; preds = %1400
%1409 = or i32 %1404, %1405
store i32 %1409, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%.sum11.pre.i.i = add i32 %1401, 2
%.pre.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum11.pre.i.i
br label %1417
; <label>:1410 ; preds = %1400
%.sum12.i.i = add i32 %1401, 2
%1411 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum12.i.i
%1412 = load %struct.malloc_chunk** %1411, align 4
%1413 = bitcast %struct.malloc_chunk* %1412 to i8*
%1414 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1415 = icmp ult i8* %1413, %1414
br i1 %1415, label %1416, label %1417, !prof !1
; <label>:1416 ; preds = %1410
tail call void @abort() noreturn nounwind
unreachable
; <label>:1417 ; preds = %1410, %1408
%.pre-phi.i.i = phi %struct.malloc_chunk** [ %1411, %1410 ], [ %.pre.i.i, %1408 ]
%F.0.i.i = phi %struct.malloc_chunk* [ %1412, %1410 ], [ %1403, %1408 ]
store %struct.malloc_chunk* %890, %struct.malloc_chunk** %.pre-phi.i.i, align 4
%1418 = getelementptr inbounds %struct.malloc_chunk* %F.0.i.i, i32 0, i32 3
store %struct.malloc_chunk* %890, %struct.malloc_chunk** %1418, align 4
%1419 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 2
store %struct.malloc_chunk* %F.0.i.i, %struct.malloc_chunk** %1419, align 4
%1420 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 3
store %struct.malloc_chunk* %1403, %struct.malloc_chunk** %1420, align 4
br label %add_segment.exit.i
; <label>:1421 ; preds = %1386
%1422 = bitcast %struct.malloc_chunk* %890 to %struct.malloc_tree_chunk*
%1423 = lshr i32 %1389, 8
%1424 = icmp eq i32 %1423, 0
br i1 %1424, label %1450, label %1425
; <label>:1425 ; preds = %1421
%1426 = icmp ugt i32 %1389, 16777215
br i1 %1426, label %1450, label %1427
; <label>:1427 ; preds = %1425
%1428 = add i32 %1423, 1048320
%1429 = lshr i32 %1428, 16
%1430 = and i32 %1429, 8
%1431 = shl i32 %1423, %1430
%1432 = add i32 %1431, 520192
%1433 = lshr i32 %1432, 16
%1434 = and i32 %1433, 4
%1435 = or i32 %1434, %1430
%1436 = shl i32 %1431, %1434
%1437 = add i32 %1436, 245760
%1438 = lshr i32 %1437, 16
%1439 = and i32 %1438, 2
%1440 = or i32 %1435, %1439
%1441 = sub i32 14, %1440
%1442 = shl i32 %1436, %1439
%1443 = lshr i32 %1442, 15
%1444 = add i32 %1441, %1443
%1445 = shl nsw i32 %1444, 1
%1446 = add i32 %1444, 7
%1447 = lshr i32 %1389, %1446
%1448 = and i32 %1447, 1
%1449 = or i32 %1448, %1445
br label %1450
; <label>:1450 ; preds = %1427, %1425, %1421
%I1.0.i.i = phi i32 [ %1449, %1427 ], [ 0, %1421 ], [ 31, %1425 ]
%1451 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I1.0.i.i
%1452 = getelementptr inbounds %struct.malloc_chunk* %890, i32 1, i32 3
%I1.0.c.i.i = inttoptr i32 %I1.0.i.i to %struct.malloc_chunk*
store %struct.malloc_chunk* %I1.0.c.i.i, %struct.malloc_chunk** %1452, align 4
%1453 = getelementptr inbounds %struct.malloc_chunk* %890, i32 1, i32 1
store i32 0, i32* %1453, align 4
%1454 = getelementptr inbounds %struct.malloc_chunk* %890, i32 1, i32 0
store i32 0, i32* %1454, align 4
%1455 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%1456 = shl i32 1, %I1.0.i.i
%1457 = and i32 %1455, %1456
%1458 = icmp eq i32 %1457, 0
br i1 %1458, label %1459, label %1464
; <label>:1459 ; preds = %1450
%1460 = or i32 %1455, %1456
store i32 %1460, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
store %struct.malloc_tree_chunk* %1422, %struct.malloc_tree_chunk** %1451, align 4
%1461 = getelementptr inbounds %struct.malloc_chunk* %890, i32 1, i32 2
%.c.i.i = bitcast %struct.malloc_tree_chunk** %1451 to %struct.malloc_chunk*
store %struct.malloc_chunk* %.c.i.i, %struct.malloc_chunk** %1461, align 4
%1462 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 3
store %struct.malloc_chunk* %890, %struct.malloc_chunk** %1462, align 4
%1463 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 2
store %struct.malloc_chunk* %890, %struct.malloc_chunk** %1463, align 4
br label %add_segment.exit.i
; <label>:1464 ; preds = %1450
%1465 = load %struct.malloc_tree_chunk** %1451, align 4
%1466 = icmp eq i32 %I1.0.i.i, 31
br i1 %1466, label %1470, label %1467
; <label>:1467 ; preds = %1464
%1468 = lshr i32 %I1.0.i.i, 1
%1469 = sub i32 25, %1468
br label %1470
; <label>:1470 ; preds = %1467, %1464
%1471 = phi i32 [ %1469, %1467 ], [ 0, %1464 ]
%1472 = shl i32 %1389, %1471
br label %1473
; <label>:1473 ; preds = %1478, %1470
%T.0.i.i = phi %struct.malloc_tree_chunk* [ %1465, %1470 ], [ %1481, %1478 ]
%K2.0.i.i = phi i32 [ %1472, %1470 ], [ %1483, %1478 ]
%1474 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i.i, i32 0, i32 1
%1475 = load i32* %1474, align 4
%1476 = and i32 %1475, -8
%1477 = icmp eq i32 %1476, %1389
br i1 %1477, label %1493, label %1478
; <label>:1478 ; preds = %1473
%1479 = lshr i32 %K2.0.i.i, 31
%1480 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i.i, i32 0, i32 4, i32 %1479
%1481 = load %struct.malloc_tree_chunk** %1480, align 4
%1482 = icmp eq %struct.malloc_tree_chunk* %1481, null
%1483 = shl i32 %K2.0.i.i, 1
br i1 %1482, label %1484, label %1473
; <label>:1484 ; preds = %1478
%1485 = bitcast %struct.malloc_tree_chunk** %1480 to i8*
%1486 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1487 = icmp ult i8* %1485, %1486
br i1 %1487, label %1492, label %1488, !prof !1
; <label>:1488 ; preds = %1484
store %struct.malloc_tree_chunk* %1422, %struct.malloc_tree_chunk** %1480, align 4
%1489 = getelementptr inbounds %struct.malloc_chunk* %890, i32 1, i32 2
%T.0.c8.i.i = bitcast %struct.malloc_tree_chunk* %T.0.i.i to %struct.malloc_chunk*
store %struct.malloc_chunk* %T.0.c8.i.i, %struct.malloc_chunk** %1489, align 4
%1490 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 3
store %struct.malloc_chunk* %890, %struct.malloc_chunk** %1490, align 4
%1491 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 2
store %struct.malloc_chunk* %890, %struct.malloc_chunk** %1491, align 4
br label %add_segment.exit.i
; <label>:1492 ; preds = %1484
tail call void @abort() noreturn nounwind
unreachable
; <label>:1493 ; preds = %1473
%1494 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.i.i, i32 0, i32 2
%1495 = load %struct.malloc_tree_chunk** %1494, align 4
%1496 = bitcast %struct.malloc_tree_chunk* %T.0.i.i to i8*
%1497 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%1498 = icmp ult i8* %1496, %1497
br i1 %1498, label %.critedge.i.i, label %1499
; <label>:1499 ; preds = %1493
%1500 = bitcast %struct.malloc_tree_chunk* %1495 to i8*
%1501 = icmp ult i8* %1500, %1497
br i1 %1501, label %.critedge.i.i, label %1502, !prof !1
; <label>:1502 ; preds = %1499
%1503 = getelementptr inbounds %struct.malloc_tree_chunk* %1495, i32 0, i32 3
store %struct.malloc_tree_chunk* %1422, %struct.malloc_tree_chunk** %1503, align 4
store %struct.malloc_tree_chunk* %1422, %struct.malloc_tree_chunk** %1494, align 4
%1504 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 2
%.c7.i.i = bitcast %struct.malloc_tree_chunk* %1495 to %struct.malloc_chunk*
store %struct.malloc_chunk* %.c7.i.i, %struct.malloc_chunk** %1504, align 4
%1505 = getelementptr inbounds %struct.malloc_chunk* %890, i32 0, i32 3
%T.0.c.i.i = bitcast %struct.malloc_tree_chunk* %T.0.i.i to %struct.malloc_chunk*
store %struct.malloc_chunk* %T.0.c.i.i, %struct.malloc_chunk** %1505, align 4
%1506 = getelementptr inbounds %struct.malloc_chunk* %890, i32 1, i32 2
store %struct.malloc_chunk* null, %struct.malloc_chunk** %1506, align 4
br label %add_segment.exit.i
.critedge.i.i: ; preds = %1499, %1493
tail call void @abort() noreturn nounwind
unreachable
add_segment.exit.i: ; preds = %1502, %1488, %1459, %1417, %._crit_edge.i.i, %init_top.exit20.i, %init_top.exit.i
%1507 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%1508 = icmp ugt i32 %1507, %nb.0
br i1 %1508, label %1509, label %.thread42.thread107.i
; <label>:1509 ; preds = %add_segment.exit.i
%1510 = sub i32 %1507, %nb.0
store i32 %1510, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%1511 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%1512 = bitcast %struct.malloc_chunk* %1511 to i8*
%1513 = getelementptr inbounds i8* %1512, i32 %nb.0
%1514 = bitcast i8* %1513 to %struct.malloc_chunk*
store %struct.malloc_chunk* %1514, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%1515 = or i32 %1510, 1
%.sum.i134 = add i32 %nb.0, 4
%1516 = getelementptr inbounds i8* %1512, i32 %.sum.i134
%1517 = bitcast i8* %1516 to i32*
store i32 %1515, i32* %1517, align 4
%1518 = or i32 %nb.0, 3
%1519 = getelementptr inbounds %struct.malloc_chunk* %1511, i32 0, i32 1
store i32 %1518, i32* %1519, align 4
%1520 = getelementptr inbounds %struct.malloc_chunk* %1511, i32 0, i32 2
%1521 = bitcast %struct.malloc_chunk** %1520 to i8*
br label %sys_alloc.exit
.thread42.thread107.i: ; preds = %add_segment.exit.i, %.thread42.i, %875, %873
%1522 = tail call i32* @__errno() nounwind
store i32 12, i32* %1522, align 4
br label %sys_alloc.exit
sys_alloc.exit: ; preds = %.thread42.thread107.i, %1509, %prepend_alloc.exit.i, %781, %770, %745, %739, %tmalloc_large.exit, %tmalloc_small.exit, %142, %39
%mem.0 = phi i8* [ %48, %39 ], [ %143, %142 ], [ %343, %tmalloc_small.exit ], [ %741, %739 ], [ %757, %745 ], [ %712, %tmalloc_large.exit ], [ %1521, %1509 ], [ null, %.thread42.thread107.i ], [ %1326, %prepend_alloc.exit.i ], [ null, %770 ], [ null, %781 ]
ret i8* %mem.0
}
declare void @abort() noreturn
define weak void @free(i8* %mem) nounwind {
%1 = icmp eq i8* %mem, null
br i1 %1, label %500, label %2
; <label>:2 ; preds = %0
%3 = getelementptr inbounds i8* %mem, i32 -8
%4 = bitcast i8* %3 to %struct.malloc_chunk*
%5 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%6 = icmp ult i8* %3, %5
br i1 %6, label %.critedge282, label %7
; <label>:7 ; preds = %2
%8 = getelementptr inbounds i8* %mem, i32 -4
%9 = bitcast i8* %8 to i32*
%10 = load i32* %9, align 4
%11 = and i32 %10, 3
%12 = icmp eq i32 %11, 1
br i1 %12, label %.critedge282, label %13, !prof !1
; <label>:13 ; preds = %7
%14 = and i32 %10, -8
%.sum = add i32 %14, -8
%15 = getelementptr inbounds i8* %mem, i32 %.sum
%16 = bitcast i8* %15 to %struct.malloc_chunk*
%17 = and i32 %10, 1
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %188
; <label>:19 ; preds = %13
%20 = bitcast i8* %3 to i32*
%21 = load i32* %20, align 4
%22 = icmp eq i32 %11, 0
br i1 %22, label %500, label %23
; <label>:23 ; preds = %19
%.sum232 = sub i32 -8, %21
%24 = getelementptr inbounds i8* %mem, i32 %.sum232
%25 = bitcast i8* %24 to %struct.malloc_chunk*
%26 = add i32 %21, %14
%27 = icmp ult i8* %24, %5
br i1 %27, label %.critedge282, label %28, !prof !1
; <label>:28 ; preds = %23
%29 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%30 = icmp eq %struct.malloc_chunk* %25, %29
br i1 %30, label %175, label %31
; <label>:31 ; preds = %28
%32 = lshr i32 %21, 3
%33 = icmp ult i32 %21, 256
br i1 %33, label %34, label %68
; <label>:34 ; preds = %31
%.sum276 = add i32 %.sum232, 8
%35 = getelementptr inbounds i8* %mem, i32 %.sum276
%36 = bitcast i8* %35 to %struct.malloc_chunk**
%37 = load %struct.malloc_chunk** %36, align 4
%.sum277 = add i32 %.sum232, 12
%38 = getelementptr inbounds i8* %mem, i32 %.sum277
%39 = bitcast i8* %38 to %struct.malloc_chunk**
%40 = load %struct.malloc_chunk** %39, align 4
%41 = shl nuw nsw i32 %32, 1
%42 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %41
%43 = bitcast %struct.malloc_chunk** %42 to %struct.malloc_chunk*
%44 = icmp eq %struct.malloc_chunk* %37, %43
br i1 %44, label %.critedge283, label %45
; <label>:45 ; preds = %34
%46 = bitcast %struct.malloc_chunk* %37 to i8*
%47 = icmp ult i8* %46, %5
br i1 %47, label %.critedge284, label %48
; <label>:48 ; preds = %45
%49 = getelementptr inbounds %struct.malloc_chunk* %37, i32 0, i32 3
%50 = load %struct.malloc_chunk** %49, align 4
%51 = icmp eq %struct.malloc_chunk* %50, %25
br i1 %51, label %.critedge283, label %.critedge284, !prof !0
.critedge283: ; preds = %48, %34
%52 = icmp eq %struct.malloc_chunk* %40, %37
br i1 %52, label %53, label %58
; <label>:53 ; preds = %.critedge283
%54 = shl i32 1, %32
%55 = xor i32 %54, -1
%56 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%57 = and i32 %56, %55
store i32 %57, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
br label %188
; <label>:58 ; preds = %.critedge283
%59 = icmp eq %struct.malloc_chunk* %40, %43
br i1 %59, label %..critedge285_crit_edge, label %60
..critedge285_crit_edge: ; preds = %58
%.pre305 = getelementptr inbounds %struct.malloc_chunk* %40, i32 0, i32 2
br label %.critedge285
; <label>:60 ; preds = %58
%61 = bitcast %struct.malloc_chunk* %40 to i8*
%62 = icmp ult i8* %61, %5
br i1 %62, label %.critedge286, label %63
; <label>:63 ; preds = %60
%64 = getelementptr inbounds %struct.malloc_chunk* %40, i32 0, i32 2
%65 = load %struct.malloc_chunk** %64, align 4
%66 = icmp eq %struct.malloc_chunk* %65, %25
br i1 %66, label %.critedge285, label %.critedge286, !prof !0
.critedge285: ; preds = %63, %..critedge285_crit_edge
%.pre-phi306 = phi %struct.malloc_chunk** [ %.pre305, %..critedge285_crit_edge ], [ %64, %63 ]
%67 = getelementptr inbounds %struct.malloc_chunk* %37, i32 0, i32 3
store %struct.malloc_chunk* %40, %struct.malloc_chunk** %67, align 4
store %struct.malloc_chunk* %37, %struct.malloc_chunk** %.pre-phi306, align 4
br label %188
.critedge286: ; preds = %63, %60
tail call void @abort() noreturn nounwind
unreachable
.critedge284: ; preds = %48, %45
tail call void @abort() noreturn nounwind
unreachable
; <label>:68 ; preds = %31
%69 = bitcast i8* %24 to %struct.malloc_tree_chunk*
%.sum266 = add i32 %.sum232, 24
%70 = getelementptr inbounds i8* %mem, i32 %.sum266
%71 = bitcast i8* %70 to %struct.malloc_tree_chunk**
%72 = load %struct.malloc_tree_chunk** %71, align 4
%.sum267 = add i32 %.sum232, 12
%73 = getelementptr inbounds i8* %mem, i32 %.sum267
%74 = bitcast i8* %73 to %struct.malloc_tree_chunk**
%75 = load %struct.malloc_tree_chunk** %74, align 4
%76 = icmp eq %struct.malloc_tree_chunk* %75, %69
br i1 %76, label %92, label %77
; <label>:77 ; preds = %68
%.sum273 = add i32 %.sum232, 8
%78 = getelementptr inbounds i8* %mem, i32 %.sum273
%79 = bitcast i8* %78 to %struct.malloc_tree_chunk**
%80 = load %struct.malloc_tree_chunk** %79, align 4
%81 = bitcast %struct.malloc_tree_chunk* %80 to i8*
%82 = icmp ult i8* %81, %5
br i1 %82, label %.critedge287, label %83
; <label>:83 ; preds = %77
%84 = getelementptr inbounds %struct.malloc_tree_chunk* %80, i32 0, i32 3
%85 = load %struct.malloc_tree_chunk** %84, align 4
%86 = icmp eq %struct.malloc_tree_chunk* %85, %69
br i1 %86, label %87, label %.critedge287
; <label>:87 ; preds = %83
%88 = getelementptr inbounds %struct.malloc_tree_chunk* %75, i32 0, i32 2
%89 = load %struct.malloc_tree_chunk** %88, align 4
%90 = icmp eq %struct.malloc_tree_chunk* %89, %69
br i1 %90, label %91, label %.critedge287, !prof !0
; <label>:91 ; preds = %87
store %struct.malloc_tree_chunk* %75, %struct.malloc_tree_chunk** %84, align 4
store %struct.malloc_tree_chunk* %80, %struct.malloc_tree_chunk** %88, align 4
br label %114
.critedge287: ; preds = %87, %83, %77
tail call void @abort() noreturn nounwind
unreachable
; <label>:92 ; preds = %68
%.sum269 = add i32 %.sum232, 20
%93 = getelementptr inbounds i8* %mem, i32 %.sum269
%94 = bitcast i8* %93 to %struct.malloc_tree_chunk**
%95 = load %struct.malloc_tree_chunk** %94, align 4
%96 = icmp eq %struct.malloc_tree_chunk* %95, null
br i1 %96, label %97, label %.preheader301
; <label>:97 ; preds = %92
%.sum268 = add i32 %.sum232, 16
%98 = getelementptr inbounds i8* %mem, i32 %.sum268
%99 = bitcast i8* %98 to %struct.malloc_tree_chunk**
%100 = load %struct.malloc_tree_chunk** %99, align 4
%101 = icmp eq %struct.malloc_tree_chunk* %100, null
br i1 %101, label %114, label %.preheader301
.preheader301: ; preds = %105, %.preheader301, %97, %92
%RP.0 = phi %struct.malloc_tree_chunk** [ %99, %97 ], [ %94, %92 ], [ %102, %.preheader301 ], [ %106, %105 ]
%R.0 = phi %struct.malloc_tree_chunk* [ %100, %97 ], [ %95, %92 ], [ %103, %.preheader301 ], [ %107, %105 ]
%102 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 1
%103 = load %struct.malloc_tree_chunk** %102, align 4
%104 = icmp eq %struct.malloc_tree_chunk* %103, null
br i1 %104, label %105, label %.preheader301
; <label>:105 ; preds = %.preheader301
%106 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 0
%107 = load %struct.malloc_tree_chunk** %106, align 4
%108 = icmp eq %struct.malloc_tree_chunk* %107, null
br i1 %108, label %109, label %.preheader301
; <label>:109 ; preds = %105
%110 = bitcast %struct.malloc_tree_chunk** %RP.0 to i8*
%111 = icmp ult i8* %110, %5
br i1 %111, label %113, label %112, !prof !1
; <label>:112 ; preds = %109
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0, align 4
br label %114
; <label>:113 ; preds = %109
tail call void @abort() noreturn nounwind
unreachable
; <label>:114 ; preds = %112, %97, %91
%R.1 = phi %struct.malloc_tree_chunk* [ %75, %91 ], [ %R.0, %112 ], [ null, %97 ]
%115 = icmp eq %struct.malloc_tree_chunk* %72, null
br i1 %115, label %188, label %116
; <label>:116 ; preds = %114
%.sum270 = add i32 %.sum232, 28
%117 = getelementptr inbounds i8* %mem, i32 %.sum270
%118 = bitcast i8* %117 to i32*
%119 = load i32* %118, align 4
%120 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %119
%121 = load %struct.malloc_tree_chunk** %120, align 4
%122 = icmp eq %struct.malloc_tree_chunk* %69, %121
br i1 %122, label %123, label %129
; <label>:123 ; preds = %116
store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %120, align 4
%cond = icmp eq %struct.malloc_tree_chunk* %R.1, null
br i1 %cond, label %.thread, label %143
.thread: ; preds = %123
%124 = load i32* %118, align 4
%125 = shl i32 1, %124
%126 = xor i32 %125, -1
%127 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%128 = and i32 %127, %126
store i32 %128, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
br label %188
; <label>:129 ; preds = %116
%130 = bitcast %struct.malloc_tree_chunk* %72 to i8*
%131 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%132 = icmp ult i8* %130, %131
br i1 %132, label %140, label %133, !prof !1
; <label>:133 ; preds = %129
%134 = getelementptr inbounds %struct.malloc_tree_chunk* %72, i32 0, i32 4, i32 0
%135 = load %struct.malloc_tree_chunk** %134, align 4
%136 = icmp eq %struct.malloc_tree_chunk* %135, %69
br i1 %136, label %137, label %138
; <label>:137 ; preds = %133
store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %134, align 4
br label %141
; <label>:138 ; preds = %133
%139 = getelementptr inbounds %struct.malloc_tree_chunk* %72, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %139, align 4
br label %141
; <label>:140 ; preds = %129
tail call void @abort() noreturn nounwind
unreachable
; <label>:141 ; preds = %138, %137
%142 = icmp eq %struct.malloc_tree_chunk* %R.1, null
br i1 %142, label %188, label %143
; <label>:143 ; preds = %141, %123
%144 = bitcast %struct.malloc_tree_chunk* %R.1 to i8*
%145 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%146 = icmp ult i8* %144, %145
br i1 %146, label %174, label %147, !prof !1
; <label>:147 ; preds = %143
%148 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 5
store %struct.malloc_tree_chunk* %72, %struct.malloc_tree_chunk** %148, align 4
%.sum271 = add i32 %.sum232, 16
%149 = getelementptr inbounds i8* %mem, i32 %.sum271
%150 = bitcast i8* %149 to %struct.malloc_tree_chunk**
%151 = load %struct.malloc_tree_chunk** %150, align 4
%152 = icmp eq %struct.malloc_tree_chunk* %151, null
br i1 %152, label %161, label %153
; <label>:153 ; preds = %147
%154 = bitcast %struct.malloc_tree_chunk* %151 to i8*
%155 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%156 = icmp ult i8* %154, %155
br i1 %156, label %160, label %157, !prof !1
; <label>:157 ; preds = %153
%158 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 0
store %struct.malloc_tree_chunk* %151, %struct.malloc_tree_chunk** %158, align 4
%159 = getelementptr inbounds %struct.malloc_tree_chunk* %151, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %159, align 4
br label %161
; <label>:160 ; preds = %153
tail call void @abort() noreturn nounwind
unreachable
; <label>:161 ; preds = %157, %147
%.sum272 = add i32 %.sum232, 20
%162 = getelementptr inbounds i8* %mem, i32 %.sum272
%163 = bitcast i8* %162 to %struct.malloc_tree_chunk**
%164 = load %struct.malloc_tree_chunk** %163, align 4
%165 = icmp eq %struct.malloc_tree_chunk* %164, null
br i1 %165, label %188, label %166
; <label>:166 ; preds = %161
%167 = bitcast %struct.malloc_tree_chunk* %164 to i8*
%168 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%169 = icmp ult i8* %167, %168
br i1 %169, label %173, label %170, !prof !1
; <label>:170 ; preds = %166
%171 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %164, %struct.malloc_tree_chunk** %171, align 4
%172 = getelementptr inbounds %struct.malloc_tree_chunk* %164, i32 0, i32 5
store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %172, align 4
br label %188
; <label>:173 ; preds = %166
tail call void @abort() noreturn nounwind
unreachable
; <label>:174 ; preds = %143
tail call void @abort() noreturn nounwind
unreachable
; <label>:175 ; preds = %28
%.sum233 = add i32 %14, -4
%176 = getelementptr inbounds i8* %mem, i32 %.sum233
%177 = bitcast i8* %176 to i32*
%178 = load i32* %177, align 4
%179 = and i32 %178, 3
%180 = icmp eq i32 %179, 3
br i1 %180, label %181, label %188
; <label>:181 ; preds = %175
store i32 %26, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%182 = load i32* %177, align 4
%183 = and i32 %182, -2
store i32 %183, i32* %177, align 4
%184 = or i32 %26, 1
%.sum264 = add i32 %.sum232, 4
%185 = getelementptr inbounds i8* %mem, i32 %.sum264
%186 = bitcast i8* %185 to i32*
store i32 %184, i32* %186, align 4
%187 = bitcast i8* %15 to i32*
store i32 %26, i32* %187, align 4
br label %500
; <label>:188 ; preds = %175, %170, %161, %141, %.thread, %114, %.critedge285, %53, %13
%psize.0 = phi i32 [ %14, %13 ], [ %26, %53 ], [ %26, %.critedge285 ], [ %26, %170 ], [ %26, %161 ], [ %26, %141 ], [ %26, %114 ], [ %26, %175 ], [ %26, %.thread ]
%p.0 = phi %struct.malloc_chunk* [ %4, %13 ], [ %25, %53 ], [ %25, %.critedge285 ], [ %25, %170 ], [ %25, %161 ], [ %25, %141 ], [ %25, %114 ], [ %25, %175 ], [ %25, %.thread ]
%189 = bitcast %struct.malloc_chunk* %p.0 to i8*
%190 = icmp ult i8* %189, %15
br i1 %190, label %191, label %.critedge282
; <label>:191 ; preds = %188
%.sum263 = add i32 %14, -4
%192 = getelementptr inbounds i8* %mem, i32 %.sum263
%193 = bitcast i8* %192 to i32*
%194 = load i32* %193, align 4
%195 = and i32 %194, 1
%phitmp = icmp eq i32 %195, 0
br i1 %phitmp, label %.critedge282, label %196, !prof !1
; <label>:196 ; preds = %191
%197 = and i32 %194, 2
%198 = icmp eq i32 %197, 0
br i1 %198, label %199, label %378
; <label>:199 ; preds = %196
%200 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%201 = icmp eq %struct.malloc_chunk* %16, %200
br i1 %201, label %202, label %210
; <label>:202 ; preds = %199
%203 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
%204 = add i32 %203, %psize.0
store i32 %204, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4
%205 = or i32 %204, 1
%206 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
store i32 %205, i32* %206, align 4
%207 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%208 = icmp eq %struct.malloc_chunk* %p.0, %207
br i1 %208, label %209, label %500
; <label>:209 ; preds = %202
store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
br label %500
; <label>:210 ; preds = %199
%211 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%212 = icmp eq %struct.malloc_chunk* %16, %211
br i1 %212, label %213, label %220
; <label>:213 ; preds = %210
%214 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
%215 = add i32 %214, %psize.0
store i32 %215, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%216 = or i32 %215, 1
%217 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
store i32 %216, i32* %217, align 4
%218 = getelementptr inbounds i8* %189, i32 %215
%219 = bitcast i8* %218 to i32*
store i32 %215, i32* %219, align 4
br label %500
; <label>:220 ; preds = %210
%221 = and i32 %194, -8
%222 = add i32 %221, %psize.0
%223 = lshr i32 %194, 3
%224 = icmp ult i32 %194, 256
br i1 %224, label %225, label %261
; <label>:225 ; preds = %220
%226 = getelementptr inbounds i8* %mem, i32 %14
%227 = bitcast i8* %226 to %struct.malloc_chunk**
%228 = load %struct.malloc_chunk** %227, align 4
%.sum257258 = or i32 %14, 4
%229 = getelementptr inbounds i8* %mem, i32 %.sum257258
%230 = bitcast i8* %229 to %struct.malloc_chunk**
%231 = load %struct.malloc_chunk** %230, align 4
%232 = shl nuw nsw i32 %223, 1
%233 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %232
%234 = bitcast %struct.malloc_chunk** %233 to %struct.malloc_chunk*
%235 = icmp eq %struct.malloc_chunk* %228, %234
br i1 %235, label %.critedge290, label %236
; <label>:236 ; preds = %225
%237 = bitcast %struct.malloc_chunk* %228 to i8*
%238 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%239 = icmp ult i8* %237, %238
br i1 %239, label %.critedge291, label %240
; <label>:240 ; preds = %236
%241 = getelementptr inbounds %struct.malloc_chunk* %228, i32 0, i32 3
%242 = load %struct.malloc_chunk** %241, align 4
%243 = icmp eq %struct.malloc_chunk* %242, %16
br i1 %243, label %.critedge290, label %.critedge291, !prof !0
.critedge290: ; preds = %240, %225
%244 = icmp eq %struct.malloc_chunk* %231, %228
br i1 %244, label %245, label %250
; <label>:245 ; preds = %.critedge290
%246 = shl i32 1, %223
%247 = xor i32 %246, -1
%248 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%249 = and i32 %248, %247
store i32 %249, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
br label %370
; <label>:250 ; preds = %.critedge290
%251 = icmp eq %struct.malloc_chunk* %231, %234
br i1 %251, label %..critedge292_crit_edge, label %252
..critedge292_crit_edge: ; preds = %250
%.pre303 = getelementptr inbounds %struct.malloc_chunk* %231, i32 0, i32 2
br label %.critedge292
; <label>:252 ; preds = %250
%253 = bitcast %struct.malloc_chunk* %231 to i8*
%254 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%255 = icmp ult i8* %253, %254
br i1 %255, label %.critedge293, label %256
; <label>:256 ; preds = %252
%257 = getelementptr inbounds %struct.malloc_chunk* %231, i32 0, i32 2
%258 = load %struct.malloc_chunk** %257, align 4
%259 = icmp eq %struct.malloc_chunk* %258, %16
br i1 %259, label %.critedge292, label %.critedge293, !prof !0
.critedge292: ; preds = %256, %..critedge292_crit_edge
%.pre-phi304 = phi %struct.malloc_chunk** [ %.pre303, %..critedge292_crit_edge ], [ %257, %256 ]
%260 = getelementptr inbounds %struct.malloc_chunk* %228, i32 0, i32 3
store %struct.malloc_chunk* %231, %struct.malloc_chunk** %260, align 4
store %struct.malloc_chunk* %228, %struct.malloc_chunk** %.pre-phi304, align 4
br label %370
.critedge293: ; preds = %256, %252
tail call void @abort() noreturn nounwind
unreachable
.critedge291: ; preds = %240, %236
tail call void @abort() noreturn nounwind
unreachable
; <label>:261 ; preds = %220
%262 = bitcast i8* %15 to %struct.malloc_tree_chunk*
%.sum235 = add i32 %14, 16
%263 = getelementptr inbounds i8* %mem, i32 %.sum235
%264 = bitcast i8* %263 to %struct.malloc_tree_chunk**
%265 = load %struct.malloc_tree_chunk** %264, align 4
%.sum236237 = or i32 %14, 4
%266 = getelementptr inbounds i8* %mem, i32 %.sum236237
%267 = bitcast i8* %266 to %struct.malloc_tree_chunk**
%268 = load %struct.malloc_tree_chunk** %267, align 4
%269 = icmp eq %struct.malloc_tree_chunk* %268, %262
br i1 %269, label %286, label %270
; <label>:270 ; preds = %261
%271 = getelementptr inbounds i8* %mem, i32 %14
%272 = bitcast i8* %271 to %struct.malloc_tree_chunk**
%273 = load %struct.malloc_tree_chunk** %272, align 4
%274 = bitcast %struct.malloc_tree_chunk* %273 to i8*
%275 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%276 = icmp ult i8* %274, %275
br i1 %276, label %.critedge294, label %277
; <label>:277 ; preds = %270
%278 = getelementptr inbounds %struct.malloc_tree_chunk* %273, i32 0, i32 3
%279 = load %struct.malloc_tree_chunk** %278, align 4
%280 = icmp eq %struct.malloc_tree_chunk* %279, %262
br i1 %280, label %281, label %.critedge294
; <label>:281 ; preds = %277
%282 = getelementptr inbounds %struct.malloc_tree_chunk* %268, i32 0, i32 2
%283 = load %struct.malloc_tree_chunk** %282, align 4
%284 = icmp eq %struct.malloc_tree_chunk* %283, %262
br i1 %284, label %285, label %.critedge294, !prof !0
; <label>:285 ; preds = %281
store %struct.malloc_tree_chunk* %268, %struct.malloc_tree_chunk** %278, align 4
store %struct.malloc_tree_chunk* %273, %struct.malloc_tree_chunk** %282, align 4
br label %309
.critedge294: ; preds = %281, %277, %270
tail call void @abort() noreturn nounwind
unreachable
; <label>:286 ; preds = %261
%.sum239 = add i32 %14, 12
%287 = getelementptr inbounds i8* %mem, i32 %.sum239
%288 = bitcast i8* %287 to %struct.malloc_tree_chunk**
%289 = load %struct.malloc_tree_chunk** %288, align 4
%290 = icmp eq %struct.malloc_tree_chunk* %289, null
br i1 %290, label %291, label %.preheader300
; <label>:291 ; preds = %286
%.sum238 = add i32 %14, 8
%292 = getelementptr inbounds i8* %mem, i32 %.sum238
%293 = bitcast i8* %292 to %struct.malloc_tree_chunk**
%294 = load %struct.malloc_tree_chunk** %293, align 4
%295 = icmp eq %struct.malloc_tree_chunk* %294, null
br i1 %295, label %309, label %.preheader300
.preheader300: ; preds = %299, %.preheader300, %291, %286
%RP9.0 = phi %struct.malloc_tree_chunk** [ %293, %291 ], [ %288, %286 ], [ %296, %.preheader300 ], [ %300, %299 ]
%R7.0 = phi %struct.malloc_tree_chunk* [ %294, %291 ], [ %289, %286 ], [ %297, %.preheader300 ], [ %301, %299 ]
%296 = getelementptr inbounds %struct.malloc_tree_chunk* %R7.0, i32 0, i32 4, i32 1
%297 = load %struct.malloc_tree_chunk** %296, align 4
%298 = icmp eq %struct.malloc_tree_chunk* %297, null
br i1 %298, label %299, label %.preheader300
; <label>:299 ; preds = %.preheader300
%300 = getelementptr inbounds %struct.malloc_tree_chunk* %R7.0, i32 0, i32 4, i32 0
%301 = load %struct.malloc_tree_chunk** %300, align 4
%302 = icmp eq %struct.malloc_tree_chunk* %301, null
br i1 %302, label %303, label %.preheader300
; <label>:303 ; preds = %299
%304 = bitcast %struct.malloc_tree_chunk** %RP9.0 to i8*
%305 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%306 = icmp ult i8* %304, %305
br i1 %306, label %308, label %307, !prof !1
; <label>:307 ; preds = %303
store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP9.0, align 4
br label %309
; <label>:308 ; preds = %303
tail call void @abort() noreturn nounwind
unreachable
; <label>:309 ; preds = %307, %291, %285
%R7.1 = phi %struct.malloc_tree_chunk* [ %268, %285 ], [ %R7.0, %307 ], [ null, %291 ]
%310 = icmp eq %struct.malloc_tree_chunk* %265, null
br i1 %310, label %370, label %311
; <label>:311 ; preds = %309
%.sum250 = add i32 %14, 20
%312 = getelementptr inbounds i8* %mem, i32 %.sum250
%313 = bitcast i8* %312 to i32*
%314 = load i32* %313, align 4
%315 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %314
%316 = load %struct.malloc_tree_chunk** %315, align 4
%317 = icmp eq %struct.malloc_tree_chunk* %262, %316
br i1 %317, label %318, label %324
; <label>:318 ; preds = %311
store %struct.malloc_tree_chunk* %R7.1, %struct.malloc_tree_chunk** %315, align 4
%cond298 = icmp eq %struct.malloc_tree_chunk* %R7.1, null
br i1 %cond298, label %.thread307, label %338
.thread307: ; preds = %318
%319 = load i32* %313, align 4
%320 = shl i32 1, %319
%321 = xor i32 %320, -1
%322 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%323 = and i32 %322, %321
store i32 %323, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
br label %370
; <label>:324 ; preds = %311
%325 = bitcast %struct.malloc_tree_chunk* %265 to i8*
%326 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%327 = icmp ult i8* %325, %326
br i1 %327, label %335, label %328, !prof !1
; <label>:328 ; preds = %324
%329 = getelementptr inbounds %struct.malloc_tree_chunk* %265, i32 0, i32 4, i32 0
%330 = load %struct.malloc_tree_chunk** %329, align 4
%331 = icmp eq %struct.malloc_tree_chunk* %330, %262
br i1 %331, label %332, label %333
; <label>:332 ; preds = %328
store %struct.malloc_tree_chunk* %R7.1, %struct.malloc_tree_chunk** %329, align 4
br label %336
; <label>:333 ; preds = %328
%334 = getelementptr inbounds %struct.malloc_tree_chunk* %265, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %R7.1, %struct.malloc_tree_chunk** %334, align 4
br label %336
; <label>:335 ; preds = %324
tail call void @abort() noreturn nounwind
unreachable
; <label>:336 ; preds = %333, %332
%337 = icmp eq %struct.malloc_tree_chunk* %R7.1, null
br i1 %337, label %370, label %338
; <label>:338 ; preds = %336, %318
%339 = bitcast %struct.malloc_tree_chunk* %R7.1 to i8*
%340 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%341 = icmp ult i8* %339, %340
br i1 %341, label %369, label %342, !prof !1
; <label>:342 ; preds = %338
%343 = getelementptr inbounds %struct.malloc_tree_chunk* %R7.1, i32 0, i32 5
store %struct.malloc_tree_chunk* %265, %struct.malloc_tree_chunk** %343, align 4
%.sum251 = add i32 %14, 8
%344 = getelementptr inbounds i8* %mem, i32 %.sum251
%345 = bitcast i8* %344 to %struct.malloc_tree_chunk**
%346 = load %struct.malloc_tree_chunk** %345, align 4
%347 = icmp eq %struct.malloc_tree_chunk* %346, null
br i1 %347, label %356, label %348
; <label>:348 ; preds = %342
%349 = bitcast %struct.malloc_tree_chunk* %346 to i8*
%350 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%351 = icmp ult i8* %349, %350
br i1 %351, label %355, label %352, !prof !1
; <label>:352 ; preds = %348
%353 = getelementptr inbounds %struct.malloc_tree_chunk* %R7.1, i32 0, i32 4, i32 0
store %struct.malloc_tree_chunk* %346, %struct.malloc_tree_chunk** %353, align 4
%354 = getelementptr inbounds %struct.malloc_tree_chunk* %346, i32 0, i32 5
store %struct.malloc_tree_chunk* %R7.1, %struct.malloc_tree_chunk** %354, align 4
br label %356
; <label>:355 ; preds = %348
tail call void @abort() noreturn nounwind
unreachable
; <label>:356 ; preds = %352, %342
%.sum252 = add i32 %14, 12
%357 = getelementptr inbounds i8* %mem, i32 %.sum252
%358 = bitcast i8* %357 to %struct.malloc_tree_chunk**
%359 = load %struct.malloc_tree_chunk** %358, align 4
%360 = icmp eq %struct.malloc_tree_chunk* %359, null
br i1 %360, label %370, label %361
; <label>:361 ; preds = %356
%362 = bitcast %struct.malloc_tree_chunk* %359 to i8*
%363 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%364 = icmp ult i8* %362, %363
br i1 %364, label %368, label %365, !prof !1
; <label>:365 ; preds = %361
%366 = getelementptr inbounds %struct.malloc_tree_chunk* %R7.1, i32 0, i32 4, i32 1
store %struct.malloc_tree_chunk* %359, %struct.malloc_tree_chunk** %366, align 4
%367 = getelementptr inbounds %struct.malloc_tree_chunk* %359, i32 0, i32 5
store %struct.malloc_tree_chunk* %R7.1, %struct.malloc_tree_chunk** %367, align 4
br label %370
; <label>:368 ; preds = %361
tail call void @abort() noreturn nounwind
unreachable
; <label>:369 ; preds = %338
tail call void @abort() noreturn nounwind
unreachable
; <label>:370 ; preds = %365, %356, %336, %.thread307, %309, %.critedge292, %245
%371 = or i32 %222, 1
%372 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
store i32 %371, i32* %372, align 4
%373 = getelementptr inbounds i8* %189, i32 %222
%374 = bitcast i8* %373 to i32*
store i32 %222, i32* %374, align 4
%375 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4
%376 = icmp eq %struct.malloc_chunk* %p.0, %375
br i1 %376, label %377, label %384
; <label>:377 ; preds = %370
store i32 %222, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4
br label %500
; <label>:378 ; preds = %196
%379 = and i32 %194, -2
store i32 %379, i32* %193, align 4
%380 = or i32 %psize.0, 1
%381 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1
store i32 %380, i32* %381, align 4
%382 = getelementptr inbounds i8* %189, i32 %psize.0
%383 = bitcast i8* %382 to i32*
store i32 %psize.0, i32* %383, align 4
br label %384
; <label>:384 ; preds = %378, %370
%psize.1 = phi i32 [ %psize.0, %378 ], [ %222, %370 ]
%385 = lshr i32 %psize.1, 3
%386 = icmp ult i32 %psize.1, 256
br i1 %386, label %387, label %408
; <label>:387 ; preds = %384
%388 = shl nuw nsw i32 %385, 1
%389 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %388
%390 = bitcast %struct.malloc_chunk** %389 to %struct.malloc_chunk*
%391 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%392 = shl i32 1, %385
%393 = and i32 %391, %392
%394 = icmp eq i32 %393, 0
br i1 %394, label %395, label %397
; <label>:395 ; preds = %387
%396 = or i32 %391, %392
store i32 %396, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4
%.sum248.pre = add i32 %388, 2
%.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum248.pre
br label %404
; <label>:397 ; preds = %387
%.sum249 = add i32 %388, 2
%398 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %.sum249
%399 = load %struct.malloc_chunk** %398, align 4
%400 = bitcast %struct.malloc_chunk* %399 to i8*
%401 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%402 = icmp ult i8* %400, %401
br i1 %402, label %403, label %404, !prof !1
; <label>:403 ; preds = %397
tail call void @abort() noreturn nounwind
unreachable
; <label>:404 ; preds = %397, %395
%.pre-phi = phi %struct.malloc_chunk** [ %398, %397 ], [ %.pre, %395 ]
%F16.0 = phi %struct.malloc_chunk* [ %399, %397 ], [ %390, %395 ]
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %.pre-phi, align 4
%405 = getelementptr inbounds %struct.malloc_chunk* %F16.0, i32 0, i32 3
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %405, align 4
%406 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
store %struct.malloc_chunk* %F16.0, %struct.malloc_chunk** %406, align 4
%407 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
store %struct.malloc_chunk* %390, %struct.malloc_chunk** %407, align 4
br label %500
; <label>:408 ; preds = %384
%409 = bitcast %struct.malloc_chunk* %p.0 to %struct.malloc_tree_chunk*
%410 = lshr i32 %psize.1, 8
%411 = icmp eq i32 %410, 0
br i1 %411, label %437, label %412
; <label>:412 ; preds = %408
%413 = icmp ugt i32 %psize.1, 16777215
br i1 %413, label %437, label %414
; <label>:414 ; preds = %412
%415 = add i32 %410, 1048320
%416 = lshr i32 %415, 16
%417 = and i32 %416, 8
%418 = shl i32 %410, %417
%419 = add i32 %418, 520192
%420 = lshr i32 %419, 16
%421 = and i32 %420, 4
%422 = or i32 %421, %417
%423 = shl i32 %418, %421
%424 = add i32 %423, 245760
%425 = lshr i32 %424, 16
%426 = and i32 %425, 2
%427 = or i32 %422, %426
%428 = sub i32 14, %427
%429 = shl i32 %423, %426
%430 = lshr i32 %429, 15
%431 = add i32 %428, %430
%432 = shl nsw i32 %431, 1
%433 = add i32 %431, 7
%434 = lshr i32 %psize.1, %433
%435 = and i32 %434, 1
%436 = or i32 %435, %432
br label %437
; <label>:437 ; preds = %414, %412, %408
%I18.0 = phi i32 [ %436, %414 ], [ 0, %408 ], [ 31, %412 ]
%438 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I18.0
%439 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 3
%I18.0.c = inttoptr i32 %I18.0 to %struct.malloc_chunk*
store %struct.malloc_chunk* %I18.0.c, %struct.malloc_chunk** %439, align 4
%440 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 1
store i32 0, i32* %440, align 4
%441 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 0
store i32 0, i32* %441, align 4
%442 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
%443 = shl i32 1, %I18.0
%444 = and i32 %442, %443
%445 = icmp eq i32 %444, 0
br i1 %445, label %446, label %451
; <label>:446 ; preds = %437
%447 = or i32 %442, %443
store i32 %447, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4
store %struct.malloc_tree_chunk* %409, %struct.malloc_tree_chunk** %438, align 4
%448 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2
%.c = bitcast %struct.malloc_tree_chunk** %438 to %struct.malloc_chunk*
store %struct.malloc_chunk* %.c, %struct.malloc_chunk** %448, align 4
%449 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %449, align 4
%450 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %450, align 4
br label %494
; <label>:451 ; preds = %437
%452 = load %struct.malloc_tree_chunk** %438, align 4
%453 = icmp eq i32 %I18.0, 31
br i1 %453, label %457, label %454
; <label>:454 ; preds = %451
%455 = lshr i32 %I18.0, 1
%456 = sub i32 25, %455
br label %457
; <label>:457 ; preds = %454, %451
%458 = phi i32 [ %456, %454 ], [ 0, %451 ]
%459 = shl i32 %psize.1, %458
br label %460
; <label>:460 ; preds = %465, %457
%T.0 = phi %struct.malloc_tree_chunk* [ %452, %457 ], [ %468, %465 ]
%K19.0 = phi i32 [ %459, %457 ], [ %470, %465 ]
%461 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0, i32 0, i32 1
%462 = load i32* %461, align 4
%463 = and i32 %462, -8
%464 = icmp eq i32 %463, %psize.1
br i1 %464, label %480, label %465
; <label>:465 ; preds = %460
%466 = lshr i32 %K19.0, 31
%467 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0, i32 0, i32 4, i32 %466
%468 = load %struct.malloc_tree_chunk** %467, align 4
%469 = icmp eq %struct.malloc_tree_chunk* %468, null
%470 = shl i32 %K19.0, 1
br i1 %469, label %471, label %460
; <label>:471 ; preds = %465
%472 = bitcast %struct.malloc_tree_chunk** %467 to i8*
%473 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%474 = icmp ult i8* %472, %473
br i1 %474, label %479, label %475, !prof !1
; <label>:475 ; preds = %471
store %struct.malloc_tree_chunk* %409, %struct.malloc_tree_chunk** %467, align 4
%476 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2
%T.0.c245 = bitcast %struct.malloc_tree_chunk* %T.0 to %struct.malloc_chunk*
store %struct.malloc_chunk* %T.0.c245, %struct.malloc_chunk** %476, align 4
%477 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %477, align 4
%478 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %478, align 4
br label %494
; <label>:479 ; preds = %471
tail call void @abort() noreturn nounwind
unreachable
; <label>:480 ; preds = %460
%481 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0, i32 0, i32 2
%482 = load %struct.malloc_tree_chunk** %481, align 4
%483 = bitcast %struct.malloc_tree_chunk* %T.0 to i8*
%484 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4
%485 = icmp ult i8* %483, %484
br i1 %485, label %.critedge297, label %486
; <label>:486 ; preds = %480
%487 = bitcast %struct.malloc_tree_chunk* %482 to i8*
%488 = icmp ult i8* %487, %484
br i1 %488, label %.critedge297, label %489, !prof !1
; <label>:489 ; preds = %486
%490 = getelementptr inbounds %struct.malloc_tree_chunk* %482, i32 0, i32 3
store %struct.malloc_tree_chunk* %409, %struct.malloc_tree_chunk** %490, align 4
store %struct.malloc_tree_chunk* %409, %struct.malloc_tree_chunk** %481, align 4
%491 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2
%.c244 = bitcast %struct.malloc_tree_chunk* %482 to %struct.malloc_chunk*
store %struct.malloc_chunk* %.c244, %struct.malloc_chunk** %491, align 4
%492 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3
%T.0.c = bitcast %struct.malloc_tree_chunk* %T.0 to %struct.malloc_chunk*
store %struct.malloc_chunk* %T.0.c, %struct.malloc_chunk** %492, align 4
%493 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2
store %struct.malloc_chunk* null, %struct.malloc_chunk** %493, align 4
br label %494
.critedge297: ; preds = %486, %480
tail call void @abort() noreturn nounwind
unreachable
; <label>:494 ; preds = %489, %475, %446
%495 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4
%496 = add i32 %495, -1
store i32 %496, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4
%497 = icmp eq i32 %496, 0
br i1 %497, label %.preheader, label %500
.preheader: ; preds = %.preheader, %494
%sp.0.in.i = phi %struct.malloc_segment** [ %499, %.preheader ], [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 2), %494 ]
%sp.0.i = load %struct.malloc_segment** %sp.0.in.i, align 4
%498 = icmp eq %struct.malloc_segment* %sp.0.i, null
%499 = getelementptr inbounds %struct.malloc_segment* %sp.0.i, i32 0, i32 2
br i1 %498, label %release_unused_segments.exit, label %.preheader
release_unused_segments.exit: ; preds = %.preheader
store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4
br label %500
.critedge282: ; preds = %191, %188, %23, %7, %2
tail call void @abort() noreturn nounwind
unreachable
; <label>:500 ; preds = %release_unused_segments.exit, %494, %404, %377, %213, %209, %202, %181, %19, %0
ret void
}
declare i32* @__errno()
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
declare i8* @sbrk(i32)
declare i32 @sysconf(i32)
declare i32 @time(i32*)
!0 = metadata !{metadata !"branch_weights", i32 64, i32 4}
!1 = metadata !{metadata !"branch_weights", i32 4, i32 64}
// Note: Some Emscripten settings will significantly limit the speed of the generated code.
// Note: Some Emscripten settings may limit the speed of the generated code.
// The Module object: Our interface to the outside world. We import
// and export values on it, and do the work to get that through
// closure compiler if necessary. There are various ways Module can be used:
// 1. Not defined. We create it here
// 2. A function parameter, function(Module) { ..generated code.. }
// 3. pre-run appended it, var Module = {}; ..generated code..
// 4. External script tag defines var Module.
// We need to do an eval in order to handle the closure compiler
// case, where this code here is minified but Module was defined
// elsewhere (e.g. case 4 above). We also need to check if Module
// already exists (e.g. case 3 above).
// Note that if you want to run closure, and also to use Module
// after the generated code, you will need to define var Module = {};
// before the code. Then that object will be used in the code, and you
// can continue to use Module afterwards as well.
var Module;
if (!Module) Module = eval('(function() { try { return Module || {} } catch(e) { return {} } })()');
// Sometimes an existing Module object exists with properties
// meant to overwrite the default module functionality. Here
// we collect those properties and reapply _after_ we configure
// the current environment's defaults to avoid having to be so
// defensive during initialization.
var moduleOverrides = {};
for (var key in Module) {
if (Module.hasOwnProperty(key)) {
moduleOverrides[key] = Module[key];
}
}
// The environment setup code below is customized to use Module.
// *** Environment setup code ***
var ENVIRONMENT_IS_NODE = typeof process === 'object' && typeof require === 'function';
var ENVIRONMENT_IS_WEB = typeof window === 'object';
var ENVIRONMENT_IS_WORKER = typeof importScripts === 'function';
var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
if (ENVIRONMENT_IS_NODE) {
// Expose functionality in the same simple way that the shells work
// Note that we pollute the global namespace here, otherwise we break in node
Module['print'] = function(x) {
process['stdout'].write(x + '\n');
};
Module['printErr'] = function(x) {
process['stderr'].write(x + '\n');
};
var nodeFS = require('fs');
var nodePath = require('path');
Module['read'] = function(filename, binary) {
filename = nodePath['normalize'](filename);
var ret = nodeFS['readFileSync'](filename);
// The path is absolute if the normalized version is the same as the resolved.
if (!ret && filename != nodePath['resolve'](filename)) {
filename = path.join(__dirname, '..', 'src', filename);
ret = nodeFS['readFileSync'](filename);
}
if (ret && !binary) ret = ret.toString();
return ret;
};
Module['readBinary'] = function(filename) { return Module['read'](filename, true) };
Module['load'] = function(f) {
globalEval(read(f));
};
Module['arguments'] = process['argv'].slice(2);
module.exports = Module;
}
else if (ENVIRONMENT_IS_SHELL) {
Module['print'] = print;
if (typeof printErr != 'undefined') Module['printErr'] = printErr; // not present in v8 or older sm
if (typeof read != 'undefined') {
Module['read'] = read;
} else {
Module['read'] = function() { throw 'no read() available (jsc?)' };
}
Module['readBinary'] = function(f) {
return read(f, 'binary');
};
if (typeof scriptArgs != 'undefined') {
Module['arguments'] = scriptArgs;
} else if (typeof arguments != 'undefined') {
Module['arguments'] = arguments;
}
this['Module'] = Module;
}
else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
Module['read'] = function(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
xhr.send(null);
return xhr.responseText;
};
if (typeof arguments != 'undefined') {
Module['arguments'] = arguments;
}
if (ENVIRONMENT_IS_WEB) {
Module['print'] = function(x) {
console.log(x);
};
Module['printErr'] = function(x) {
console.log(x);
};
this['Module'] = Module;
} else if (ENVIRONMENT_IS_WORKER) {
// We can do very little here...
var TRY_USE_DUMP = false;
Module['print'] = (TRY_USE_DUMP && (typeof(dump) !== "undefined") ? (function(x) {
dump(x);
}) : (function(x) {
// self.postMessage(x); // enable this if you want stdout to be sent as messages
}));
Module['load'] = importScripts;
}
}
else {
// Unreachable because SHELL is dependant on the others
throw 'Unknown runtime environment. Where are we?';
}
function globalEval(x) {
eval.call(null, x);
}
if (!Module['load'] == 'undefined' && Module['read']) {
Module['load'] = function(f) {
globalEval(Module['read'](f));
};
}
if (!Module['print']) {
Module['print'] = function(){};
}
if (!Module['printErr']) {
Module['printErr'] = Module['print'];
}
if (!Module['arguments']) {
Module['arguments'] = [];
}
// *** Environment setup code ***
// Closure helpers
Module.print = Module['print'];
Module.printErr = Module['printErr'];
// Callbacks
Module['preRun'] = [];
Module['postRun'] = [];
// Merge back in the overrides
for (var key in moduleOverrides) {
if (moduleOverrides.hasOwnProperty(key)) {
Module[key] = moduleOverrides[key];
}
}
// === Auto-generated preamble library stuff ===
//========================================
// Runtime code shared with compiler
//========================================
var Runtime = {
stackSave: function () {
return STACKTOP;
},
stackRestore: function (stackTop) {
STACKTOP = stackTop;
},
forceAlign: function (target, quantum) {
quantum = quantum || 4;
if (quantum == 1) return target;
if (isNumber(target) && isNumber(quantum)) {
return Math.ceil(target/quantum)*quantum;
} else if (isNumber(quantum) && isPowerOfTwo(quantum)) {
var logg = log2(quantum);
return '((((' +target + ')+' + (quantum-1) + ')>>' + logg + ')<<' + logg + ')';
}
return 'Math.ceil((' + target + ')/' + quantum + ')*' + quantum;
},
isNumberType: function (type) {
return type in Runtime.INT_TYPES || type in Runtime.FLOAT_TYPES;
},
isPointerType: function isPointerType(type) {
return type[type.length-1] == '*';
},
isStructType: function isStructType(type) {
if (isPointerType(type)) return false;
if (isArrayType(type)) return true;
if (/<?{ ?[^}]* ?}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types
// See comment in isStructPointerType()
return type[0] == '%';
},
INT_TYPES: {"i1":0,"i8":0,"i16":0,"i32":0,"i64":0},
FLOAT_TYPES: {"float":0,"double":0},
or64: function (x, y) {
var l = (x | 0) | (y | 0);
var h = (Math.round(x / 4294967296) | Math.round(y / 4294967296)) * 4294967296;
return l + h;
},
and64: function (x, y) {
var l = (x | 0) & (y | 0);
var h = (Math.round(x / 4294967296) & Math.round(y / 4294967296)) * 4294967296;
return l + h;
},
xor64: function (x, y) {
var l = (x | 0) ^ (y | 0);
var h = (Math.round(x / 4294967296) ^ Math.round(y / 4294967296)) * 4294967296;
return l + h;
},
getNativeTypeSize: function (type, quantumSize) {
if (Runtime.QUANTUM_SIZE == 1) return 1;
var size = {
'%i1': 1,
'%i8': 1,
'%i16': 2,
'%i32': 4,
'%i64': 8,
"%float": 4,
"%double": 8
}['%'+type]; // add '%' since float and double confuse Closure compiler as keys, and also spidermonkey as a compiler will remove 's from '_i8' etc
if (!size) {
if (type.charAt(type.length-1) == '*') {
size = Runtime.QUANTUM_SIZE; // A pointer
} else if (type[0] == 'i') {
var bits = parseInt(type.substr(1));
assert(bits % 8 == 0);
size = bits/8;
}
}
return size;
},
getNativeFieldSize: function (type) {
return Math.max(Runtime.getNativeTypeSize(type), Runtime.QUANTUM_SIZE);
},
dedup: function dedup(items, ident) {
var seen = {};
if (ident) {
return items.filter(function(item) {
if (seen[item[ident]]) return false;
seen[item[ident]] = true;
return true;
});
} else {
return items.filter(function(item) {
if (seen[item]) return false;
seen[item] = true;
return true;
});
}
},
set: function set() {
var args = typeof arguments[0] === 'object' ? arguments[0] : arguments;
var ret = {};
for (var i = 0; i < args.length; i++) {
ret[args[i]] = 0;
}
return ret;
},
STACK_ALIGN: 8,
getAlignSize: function (type, size, vararg) {
// we align i64s and doubles on 64-bit boundaries, unlike x86
if (type == 'i64' || type == 'double' || vararg) return 8;
if (!type) return Math.min(size, 8); // align structures internally to 64 bits
return Math.min(size || (type ? Runtime.getNativeFieldSize(type) : 0), Runtime.QUANTUM_SIZE);
},
calculateStructAlignment: function calculateStructAlignment(type) {
type.flatSize = 0;
type.alignSize = 0;
var diffs = [];
var prev = -1;
var index = 0;
type.flatIndexes = type.fields.map(function(field) {
index++;
var size, alignSize;
if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {
size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.
alignSize = Runtime.getAlignSize(field, size);
} else if (Runtime.isStructType(field)) {
if (field[1] === '0') {
// this is [0 x something]. When inside another structure like here, it must be at the end,
// and it adds no size
// XXX this happens in java-nbody for example... assert(index === type.fields.length, 'zero-length in the middle!');
size = 0;
alignSize = type.alignSize || QUANTUM_SIZE;
} else {
size = Types.types[field].flatSize;
alignSize = Runtime.getAlignSize(null, Types.types[field].alignSize);
}
} else if (field[0] == 'b') {
// bN, large number field, like a [N x i8]
size = field.substr(1)|0;
alignSize = 1;
} else {
throw 'Unclear type in struct: ' + field + ', in ' + type.name_ + ' :: ' + dump(Types.types[type.name_]);
}
if (type.packed) alignSize = 1;
type.alignSize = Math.max(type.alignSize, alignSize);
var curr = Runtime.alignMemory(type.flatSize, alignSize); // if necessary, place this on aligned memory
type.flatSize = curr + size;
if (prev >= 0) {
diffs.push(curr-prev);
}
prev = curr;
return curr;
});
type.flatSize = Runtime.alignMemory(type.flatSize, type.alignSize);
if (diffs.length == 0) {
type.flatFactor = type.flatSize;
} else if (Runtime.dedup(diffs).length == 1) {
type.flatFactor = diffs[0];
}
type.needsFlattening = (type.flatFactor != 1);
return type.flatIndexes;
},
generateStructInfo: function (struct, typeName, offset) {
var type, alignment;
if (typeName) {
offset = offset || 0;
type = (typeof Types === 'undefined' ? Runtime.typeInfo : Types.types)[typeName];
if (!type) return null;
if (type.fields.length != struct.length) {
printErr('Number of named fields must match the type for ' + typeName + ': possibly duplicate struct names. Cannot return structInfo');
return null;
}
alignment = type.flatIndexes;
} else {
var type = { fields: struct.map(function(item) { return item[0] }) };
alignment = Runtime.calculateStructAlignment(type);
}
var ret = {
__size__: type.flatSize
};
if (typeName) {
struct.forEach(function(item, i) {
if (typeof item === 'string') {
ret[item] = alignment[i] + offset;
} else {
// embedded struct
var key;
for (var k in item) key = k;
ret[key] = Runtime.generateStructInfo(item[key], type.fields[i], alignment[i]);
}
});
} else {
struct.forEach(function(item, i) {
ret[item[1]] = alignment[i];
});
}
return ret;
},
dynCall: function (sig, ptr, args) {
if (args && args.length) {
assert(args.length == sig.length-1);
return FUNCTION_TABLE[ptr].apply(null, args);
} else {
assert(sig.length == 1);
return FUNCTION_TABLE[ptr]();
}
},
addFunction: function (func) {
var table = FUNCTION_TABLE;
var ret = table.length;
table.push(func);
table.push(0);
return ret;
},
removeFunction: function (index) {
var table = FUNCTION_TABLE;
table[index] = null;
},
warnOnce: function (text) {
if (!Runtime.warnOnce.shown) Runtime.warnOnce.shown = {};
if (!Runtime.warnOnce.shown[text]) {
Runtime.warnOnce.shown[text] = 1;
Module.printErr(text);
}
},
funcWrappers: {},
getFuncWrapper: function (func, sig) {
assert(sig);
if (!Runtime.funcWrappers[func]) {
Runtime.funcWrappers[func] = function() {
return Runtime.dynCall(sig, func, arguments);
};
}
return Runtime.funcWrappers[func];
},
UTF8Processor: function () {
var buffer = [];
var needed = 0;
this.processCChar = function (code) {
code = code & 0xFF;
if (buffer.length == 0) {
if ((code & 0x80) == 0x00) { // 0xxxxxxx
return String.fromCharCode(code);
}
buffer.push(code);
if ((code & 0xE0) == 0xC0) { // 110xxxxx
needed = 1;
} else if ((code & 0xF0) == 0xE0) { // 1110xxxx
needed = 2;
} else { // 11110xxx
needed = 3;
}
return '';
}
if (needed) {
buffer.push(code);
needed--;
if (needed > 0) return '';
}
var c1 = buffer[0];
var c2 = buffer[1];
var c3 = buffer[2];
var c4 = buffer[3];
var ret;
if (buffer.length == 2) {
ret = String.fromCharCode(((c1 & 0x1F) << 6) | (c2 & 0x3F));
} else if (buffer.length == 3) {
ret = String.fromCharCode(((c1 & 0x0F) << 12) | ((c2 & 0x3F) << 6) | (c3 & 0x3F));
} else {
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
var codePoint = ((c1 & 0x07) << 18) | ((c2 & 0x3F) << 12) |
((c3 & 0x3F) << 6) | (c4 & 0x3F);
ret = String.fromCharCode(
Math.floor((codePoint - 0x10000) / 0x400) + 0xD800,
(codePoint - 0x10000) % 0x400 + 0xDC00);
}
buffer.length = 0;
return ret;
}
this.processJSString = function(string) {
string = unescape(encodeURIComponent(string));
var ret = [];
for (var i = 0; i < string.length; i++) {
ret.push(string.charCodeAt(i));
}
return ret;
}
},
stackAlloc: function (size) { var ret = STACKTOP;STACKTOP = (STACKTOP + size)|0;STACKTOP = ((((STACKTOP)+7)>>3)<<3);(assert((STACKTOP|0) < (STACK_MAX|0))|0); return ret; },
staticAlloc: function (size) { var ret = STATICTOP;STATICTOP = (STATICTOP + (assert(!staticSealed),size))|0;STATICTOP = ((((STATICTOP)+7)>>3)<<3); return ret; },
dynamicAlloc: function (size) { var ret = DYNAMICTOP;DYNAMICTOP = (DYNAMICTOP + (assert(DYNAMICTOP > 0),size))|0;DYNAMICTOP = ((((DYNAMICTOP)+7)>>3)<<3); if (DYNAMICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },
alignMemory: function (size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 8))*(quantum ? quantum : 8); return ret; },
makeBigInt: function (low,high,unsigned) { var ret = (unsigned ? (((low)>>>(0))+(((high)>>>(0))*4294967296)) : (((low)>>>(0))+(((high)|(0))*4294967296))); return ret; },
GLOBAL_BASE: 8,
QUANTUM_SIZE: 4,
__dummy__: 0
}
//========================================
// Runtime essentials
//========================================
var __THREW__ = 0; // Used in checking for thrown exceptions.
var setjmpId = 1; // Used in setjmp/longjmp
var setjmpLabels = {};
var ABORT = false; // whether we are quitting the application. no code should run after this. set in exit() and abort()
var EXITSTATUS = 0;
var undef = 0;
// tempInt is used for 32-bit signed values or smaller. tempBigInt is used
// for 32-bit unsigned values or more than 32 bits. TODO: audit all uses of tempInt
var tempValue, tempInt, tempBigInt, tempInt2, tempBigInt2, tempPair, tempBigIntI, tempBigIntR, tempBigIntS, tempBigIntP, tempBigIntD;
var tempI64, tempI64b;
var tempRet0, tempRet1, tempRet2, tempRet3, tempRet4, tempRet5, tempRet6, tempRet7, tempRet8, tempRet9;
function assert(condition, text) {
if (!condition) {
abort('Assertion failed: ' + text);
}
}
var globalScope = this;
// C calling interface. A convenient way to call C functions (in C files, or
// defined with extern "C").
//
// Note: LLVM optimizations can inline and remove functions, after which you will not be
// able to call them. Closure can also do so. To avoid that, add your function to
// the exports using something like
//
// -s EXPORTED_FUNCTIONS='["_main", "_myfunc"]'
//
// @param ident The name of the C function (note that C++ functions will be name-mangled - use extern "C")
// @param returnType The return type of the function, one of the JS types 'number', 'string' or 'array' (use 'number' for any C pointer, and
// 'array' for JavaScript arrays and typed arrays; note that arrays are 8-bit).
// @param argTypes An array of the types of arguments for the function (if there are no arguments, this can be ommitted). Types are as in returnType,
// except that 'array' is not possible (there is no way for us to know the length of the array)
// @param args An array of the arguments to the function, as native JS values (as in returnType)
// Note that string arguments will be stored on the stack (the JS string will become a C string on the stack).
// @return The return value, as a native JS value (as in returnType)
function ccall(ident, returnType, argTypes, args) {
return ccallFunc(getCFunc(ident), returnType, argTypes, args);
}
Module["ccall"] = ccall;
// Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
function getCFunc(ident) {
try {
var func = Module['_' + ident]; // closure exported function
if (!func) func = eval('_' + ident); // explicit lookup
} catch(e) {
}
assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');
return func;
}
// Internal function that does a C call using a function, not an identifier
function ccallFunc(func, returnType, argTypes, args) {
var stack = 0;
function toC(value, type) {
if (type == 'string') {
if (value === null || value === undefined || value === 0) return 0; // null string
if (!stack) stack = Runtime.stackSave();
var ret = Runtime.stackAlloc(value.length+1);
writeStringToMemory(value, ret);
return ret;
} else if (type == 'array') {
if (!stack) stack = Runtime.stackSave();
var ret = Runtime.stackAlloc(value.length);
writeArrayToMemory(value, ret);
return ret;
}
return value;
}
function fromC(value, type) {
if (type == 'string') {
return Pointer_stringify(value);
}
assert(type != 'array');
return value;
}
var i = 0;
var cArgs = args ? args.map(function(arg) {
return toC(arg, argTypes[i++]);
}) : [];
var ret = fromC(func.apply(null, cArgs), returnType);
if (stack) Runtime.stackRestore(stack);
return ret;
}
// Returns a native JS wrapper for a C function. This is similar to ccall, but
// returns a function you can call repeatedly in a normal way. For example:
//
// var my_function = cwrap('my_c_function', 'number', ['number', 'number']);
// alert(my_function(5, 22));
// alert(my_function(99, 12));
//
function cwrap(ident, returnType, argTypes) {
var func = getCFunc(ident);
return function() {
return ccallFunc(func, returnType, argTypes, Array.prototype.slice.call(arguments));
}
}
Module["cwrap"] = cwrap;
// Sets a value in memory in a dynamic way at run-time. Uses the
// type data. This is the same as makeSetValue, except that
// makeSetValue is done at compile-time and generates the needed
// code then, whereas this function picks the right code at
// run-time.
// Note that setValue and getValue only do *aligned* writes and reads!
// Note that ccall uses JS types as for defining types, while setValue and
// getValue need LLVM types ('i8', 'i32') - this is a lower-level operation
function setValue(ptr, value, type, noSafe) {
type = type || 'i8';
if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
switch(type) {
case 'i1': HEAP8[(ptr)]=value; break;
case 'i8': HEAP8[(ptr)]=value; break;
case 'i16': HEAP16[((ptr)>>1)]=value; break;
case 'i32': HEAP32[((ptr)>>2)]=value; break;
case 'i64': (tempI64 = [value>>>0,(tempDouble=value,Math.abs(tempDouble) >= 1 ? (tempDouble > 0 ? Math.min(Math.floor((tempDouble)/4294967296), 4294967295)>>>0 : (~~(Math.ceil((tempDouble - +(((~~(tempDouble)))>>>0))/4294967296)))>>>0) : 0)],HEAP32[((ptr)>>2)]=tempI64[0],HEAP32[(((ptr)+(4))>>2)]=tempI64[1]); break;
case 'float': HEAPF32[((ptr)>>2)]=value; break;
case 'double': HEAPF64[((ptr)>>3)]=value; break;
default: abort('invalid type for setValue: ' + type);
}
}
Module['setValue'] = setValue;
// Parallel to setValue.
function getValue(ptr, type, noSafe) {
type = type || 'i8';
if (type.charAt(type.length-1) === '*') type = 'i32'; // pointers are 32-bit
switch(type) {
case 'i1': return HEAP8[(ptr)];
case 'i8': return HEAP8[(ptr)];
case 'i16': return HEAP16[((ptr)>>1)];
case 'i32': return HEAP32[((ptr)>>2)];
case 'i64': return HEAP32[((ptr)>>2)];
case 'float': return HEAPF32[((ptr)>>2)];
case 'double': return HEAPF64[((ptr)>>3)];
default: abort('invalid type for setValue: ' + type);
}
return null;
}
Module['getValue'] = getValue;
var ALLOC_NORMAL = 0; // Tries to use _malloc()
var ALLOC_STACK = 1; // Lives for the duration of the current function call
var ALLOC_STATIC = 2; // Cannot be freed
var ALLOC_DYNAMIC = 3; // Cannot be freed except through sbrk
var ALLOC_NONE = 4; // Do not allocate
Module['ALLOC_NORMAL'] = ALLOC_NORMAL;
Module['ALLOC_STACK'] = ALLOC_STACK;
Module['ALLOC_STATIC'] = ALLOC_STATIC;
Module['ALLOC_DYNAMIC'] = ALLOC_DYNAMIC;
Module['ALLOC_NONE'] = ALLOC_NONE;
// allocate(): This is for internal use. You can use it yourself as well, but the interface
// is a little tricky (see docs right below). The reason is that it is optimized
// for multiple syntaxes to save space in generated code. So you should
// normally not use allocate(), and instead allocate memory using _malloc(),
// initialize it with setValue(), and so forth.
// @slab: An array of data, or a number. If a number, then the size of the block to allocate,
// in *bytes* (note that this is sometimes confusing: the next parameter does not
// affect this!)
// @types: Either an array of types, one for each byte (or 0 if no type at that position),
// or a single type which is used for the entire block. This only matters if there
// is initial data - if @slab is a number, then this does not matter at all and is
// ignored.
// @allocator: How to allocate memory, see ALLOC_*
function allocate(slab, types, allocator, ptr) {
var zeroinit, size;
if (typeof slab === 'number') {
zeroinit = true;
size = slab;
} else {
zeroinit = false;
size = slab.length;
}
var singleType = typeof types === 'string' ? types : null;
var ret;
if (allocator == ALLOC_NONE) {
ret = ptr;
} else {
ret = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc, Runtime.dynamicAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));
}
if (zeroinit) {
var ptr = ret, stop;
assert((ret & 3) == 0);
stop = ret + (size & ~3);
for (; ptr < stop; ptr += 4) {
HEAP32[((ptr)>>2)]=0;
}
stop = ret + size;
while (ptr < stop) {
HEAP8[((ptr++)|0)]=0;
}
return ret;
}
if (singleType === 'i8') {
if (slab.subarray || slab.slice) {
HEAPU8.set(slab, ret);
} else {
HEAPU8.set(new Uint8Array(slab), ret);
}
return ret;
}
var i = 0, type, typeSize, previousType;
while (i < size) {
var curr = slab[i];
if (typeof curr === 'function') {
curr = Runtime.getFunctionIndex(curr);
}
type = singleType || types[i];
if (type === 0) {
i++;
continue;
}
assert(type, 'Must know what type to store in allocate!');
if (type == 'i64') type = 'i32'; // special case: we have one i32 here, and one i32 later
setValue(ret+i, curr, type);
// no need to look up size unless type changes, so cache it
if (previousType !== type) {
typeSize = Runtime.getNativeTypeSize(type);
previousType = type;
}
i += typeSize;
}
return ret;
}
Module['allocate'] = allocate;
function Pointer_stringify(ptr, /* optional */ length) {
// TODO: use TextDecoder
// Find the length, and check for UTF while doing so
var hasUtf = false;
var t;
var i = 0;
while (1) {
assert(ptr + i < TOTAL_MEMORY);
t = HEAPU8[(((ptr)+(i))|0)];
if (t >= 128) hasUtf = true;
else if (t == 0 && !length) break;
i++;
if (length && i == length) break;
}
if (!length) length = i;
var ret = '';
if (!hasUtf) {
var MAX_CHUNK = 1024; // split up into chunks, because .apply on a huge string can overflow the stack
var curr;
while (length > 0) {
curr = String.fromCharCode.apply(String, HEAPU8.subarray(ptr, ptr + Math.min(length, MAX_CHUNK)));
ret = ret ? ret + curr : curr;
ptr += MAX_CHUNK;
length -= MAX_CHUNK;
}
return ret;
}
var utf8 = new Runtime.UTF8Processor();
for (i = 0; i < length; i++) {
assert(ptr + i < TOTAL_MEMORY);
t = HEAPU8[(((ptr)+(i))|0)];
ret += utf8.processCChar(t);
}
return ret;
}
Module['Pointer_stringify'] = Pointer_stringify;
// Memory management
var PAGE_SIZE = 4096;
function alignMemoryPage(x) {
return ((x+4095)>>12)<<12;
}
var HEAP;
var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
var STATIC_BASE = 0, STATICTOP = 0, staticSealed = false; // static area
var STACK_BASE = 0, STACKTOP = 0, STACK_MAX = 0; // stack area
var DYNAMIC_BASE = 0, DYNAMICTOP = 0; // dynamic area handled by sbrk
function enlargeMemory() {
abort('Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.');
}
var TOTAL_STACK = Module['TOTAL_STACK'] || 5242880;
var TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 16777216;
var FAST_MEMORY = Module['FAST_MEMORY'] || 2097152;
// Initialize the runtime's memory
// check for full engine support (use string 'subarray' to avoid closure compiler confusion)
assert(!!Int32Array && !!Float64Array && !!(new Int32Array(1)['subarray']) && !!(new Int32Array(1)['set']),
'Cannot fallback to non-typed array case: Code is too specialized');
var buffer = new ArrayBuffer(TOTAL_MEMORY);
HEAP8 = new Int8Array(buffer);
HEAP16 = new Int16Array(buffer);
HEAP32 = new Int32Array(buffer);
HEAPU8 = new Uint8Array(buffer);
HEAPU16 = new Uint16Array(buffer);
HEAPU32 = new Uint32Array(buffer);
HEAPF32 = new Float32Array(buffer);
HEAPF64 = new Float64Array(buffer);
// Endianness check (note: assumes compiler arch was little-endian)
HEAP32[0] = 255;
assert(HEAPU8[0] === 255 && HEAPU8[3] === 0, 'Typed arrays 2 must be run on a little-endian system');
Module['HEAP'] = HEAP;
Module['HEAP8'] = HEAP8;
Module['HEAP16'] = HEAP16;
Module['HEAP32'] = HEAP32;
Module['HEAPU8'] = HEAPU8;
Module['HEAPU16'] = HEAPU16;
Module['HEAPU32'] = HEAPU32;
Module['HEAPF32'] = HEAPF32;
Module['HEAPF64'] = HEAPF64;
function callRuntimeCallbacks(callbacks) {
while(callbacks.length > 0) {
var callback = callbacks.shift();
if (typeof callback == 'function') {
callback();
continue;
}
var func = callback.func;
if (typeof func === 'number') {
if (callback.arg === undefined) {
Runtime.dynCall('v', func);
} else {
Runtime.dynCall('vi', func, [callback.arg]);
}
} else {
func(callback.arg === undefined ? null : callback.arg);
}
}
}
var __ATPRERUN__ = []; // functions called before the runtime is initialized
var __ATINIT__ = []; // functions called during startup
var __ATMAIN__ = []; // functions called when main() is to be run
var __ATEXIT__ = []; // functions called during shutdown
var __ATPOSTRUN__ = []; // functions called after the runtime has exited
var runtimeInitialized = false;
function preRun() {
// compatibility - merge in anything from Module['preRun'] at this time
if (Module['preRun']) {
if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];
while (Module['preRun'].length) {
addOnPreRun(Module['preRun'].shift());
}
}
callRuntimeCallbacks(__ATPRERUN__);
}
function ensureInitRuntime() {
if (runtimeInitialized) return;
runtimeInitialized = true;
callRuntimeCallbacks(__ATINIT__);
}
function preMain() {
callRuntimeCallbacks(__ATMAIN__);
}
function exitRuntime() {
callRuntimeCallbacks(__ATEXIT__);
}
function postRun() {
// compatibility - merge in anything from Module['postRun'] at this time
if (Module['postRun']) {
if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];
while (Module['postRun'].length) {
addOnPostRun(Module['postRun'].shift());
}
}
callRuntimeCallbacks(__ATPOSTRUN__);
}
function addOnPreRun(cb) {
__ATPRERUN__.unshift(cb);
}
Module['addOnPreRun'] = Module.addOnPreRun = addOnPreRun;
function addOnInit(cb) {
__ATINIT__.unshift(cb);
}
Module['addOnInit'] = Module.addOnInit = addOnInit;
function addOnPreMain(cb) {
__ATMAIN__.unshift(cb);
}
Module['addOnPreMain'] = Module.addOnPreMain = addOnPreMain;
function addOnExit(cb) {
__ATEXIT__.unshift(cb);
}
Module['addOnExit'] = Module.addOnExit = addOnExit;
function addOnPostRun(cb) {
__ATPOSTRUN__.unshift(cb);
}
Module['addOnPostRun'] = Module.addOnPostRun = addOnPostRun;
// Tools
// This processes a JS string into a C-line array of numbers, 0-terminated.
// For LLVM-originating strings, see parser.js:parseLLVMString function
function intArrayFromString(stringy, dontAddNull, length /* optional */) {
var ret = (new Runtime.UTF8Processor()).processJSString(stringy);
if (length) {
ret.length = length;
}
if (!dontAddNull) {
ret.push(0);
}
return ret;
}
Module['intArrayFromString'] = intArrayFromString;
function intArrayToString(array) {
var ret = [];
for (var i = 0; i < array.length; i++) {
var chr = array[i];
if (chr > 0xFF) {
assert(false, 'Character code ' + chr + ' (' + String.fromCharCode(chr) + ') at offset ' + i + ' not in 0x00-0xFF.');
chr &= 0xFF;
}
ret.push(String.fromCharCode(chr));
}
return ret.join('');
}
Module['intArrayToString'] = intArrayToString;
// Write a Javascript array to somewhere in the heap
function writeStringToMemory(string, buffer, dontAddNull) {
var array = intArrayFromString(string, dontAddNull);
var i = 0;
while (i < array.length) {
var chr = array[i];
HEAP8[(((buffer)+(i))|0)]=chr
i = i + 1;
}
}
Module['writeStringToMemory'] = writeStringToMemory;
function writeArrayToMemory(array, buffer) {
for (var i = 0; i < array.length; i++) {
HEAP8[(((buffer)+(i))|0)]=array[i];
}
}
Module['writeArrayToMemory'] = writeArrayToMemory;
function unSign(value, bits, ignore, sig) {
if (value >= 0) {
return value;
}
return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts
: Math.pow(2, bits) + value;
}
function reSign(value, bits, ignore, sig) {
if (value <= 0) {
return value;
}
var half = bits <= 32 ? Math.abs(1 << (bits-1)) // abs is needed if bits == 32
: Math.pow(2, bits-1);
if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that
// but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors
// TODO: In i64 mode 1, resign the two parts separately and safely
value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts
}
return value;
}
if (!Math['imul']) Math['imul'] = function(a, b) {
var ah = a >>> 16;
var al = a & 0xffff;
var bh = b >>> 16;
var bl = b & 0xffff;
return (al*bl + ((ah*bl + al*bh) << 16))|0;
};
Math.imul = Math['imul'];
// A counter of dependencies for calling run(). If we need to
// do asynchronous work before running, increment this and
// decrement it. Incrementing must happen in a place like
// PRE_RUN_ADDITIONS (used by emcc to add file preloading).
// Note that you can add dependencies in preRun, even though
// it happens right before run - run will be postponed until
// the dependencies are met.
var runDependencies = 0;
var runDependencyTracking = {};
var calledInit = false, calledRun = false;
var runDependencyWatcher = null;
function addRunDependency(id) {
runDependencies++;
if (Module['monitorRunDependencies']) {
Module['monitorRunDependencies'](runDependencies);
}
if (id) {
assert(!runDependencyTracking[id]);
runDependencyTracking[id] = 1;
if (runDependencyWatcher === null && typeof setInterval !== 'undefined') {
// Check for missing dependencies every few seconds
runDependencyWatcher = setInterval(function() {
var shown = false;
for (var dep in runDependencyTracking) {
if (!shown) {
shown = true;
Module.printErr('still waiting on run dependencies:');
}
Module.printErr('dependency: ' + dep);
}
if (shown) {
Module.printErr('(end of list)');
}
}, 10000);
}
} else {
Module.printErr('warning: run dependency added without ID');
}
}
Module['addRunDependency'] = addRunDependency;
function removeRunDependency(id) {
runDependencies--;
if (Module['monitorRunDependencies']) {
Module['monitorRunDependencies'](runDependencies);
}
if (id) {
assert(runDependencyTracking[id]);
delete runDependencyTracking[id];
} else {
Module.printErr('warning: run dependency removed without ID');
}
if (runDependencies == 0) {
if (runDependencyWatcher !== null) {
clearInterval(runDependencyWatcher);
runDependencyWatcher = null;
}
// If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false)
if (!calledRun && shouldRunNow) run();
}
}
Module['removeRunDependency'] = removeRunDependency;
Module["preloadedImages"] = {}; // maps url to image data
Module["preloadedAudios"] = {}; // maps url to audio data
function loadMemoryInitializer(filename) {
function applyData(data) {
HEAPU8.set(data, STATIC_BASE);
}
// always do this asynchronously, to keep shell and web as similar as possible
addOnPreRun(function() {
if (ENVIRONMENT_IS_NODE || ENVIRONMENT_IS_SHELL) {
applyData(Module['readBinary'](filename));
} else {
Browser.asyncLoad(filename, function(data) {
applyData(data);
}, function(data) {
throw 'could not load memory initializer ' + filename;
});
}
});
}
// === Body ===
STATIC_BASE = 8;
STATICTOP = STATIC_BASE + 512;
/* global initializers */ __ATINIT__.push({ func: function() { runPostSets() } });
/* memory initializer */ allocate([40,37,100,44,32,37,100,41,0,0,0,0,0,0,0,0], "i8", ALLOC_NONE, Runtime.GLOBAL_BASE)
function runPostSets() {
}
var tempDoublePtr = Runtime.alignMemory(allocate(12, "i8", ALLOC_STATIC), 8);
assert(tempDoublePtr % 8 == 0);
function copyTempFloat(ptr) { // functions, because inlining this code increases code size too much
HEAP8[tempDoublePtr] = HEAP8[ptr];
HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
}
function copyTempDouble(ptr) {
HEAP8[tempDoublePtr] = HEAP8[ptr];
HEAP8[tempDoublePtr+1] = HEAP8[ptr+1];
HEAP8[tempDoublePtr+2] = HEAP8[ptr+2];
HEAP8[tempDoublePtr+3] = HEAP8[ptr+3];
HEAP8[tempDoublePtr+4] = HEAP8[ptr+4];
HEAP8[tempDoublePtr+5] = HEAP8[ptr+5];
HEAP8[tempDoublePtr+6] = HEAP8[ptr+6];
HEAP8[tempDoublePtr+7] = HEAP8[ptr+7];
}
var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:35,EIDRM:36,ECHRNG:37,EL2NSYNC:38,EL3HLT:39,EL3RST:40,ELNRNG:41,EUNATCH:42,ENOCSI:43,EL2HLT:44,EDEADLK:45,ENOLCK:46,EBADE:50,EBADR:51,EXFULL:52,ENOANO:53,EBADRQC:54,EBADSLT:55,EDEADLOCK:56,EBFONT:57,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:74,EDOTDOT:76,EBADMSG:77,ENOTUNIQ:80,EBADFD:81,EREMCHG:82,ELIBACC:83,ELIBBAD:84,ELIBSCN:85,ELIBMAX:86,ELIBEXEC:87,ENOSYS:88,ENOTEMPTY:90,ENAMETOOLONG:91,ELOOP:92,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:106,EPROTOTYPE:107,ENOTSOCK:108,ENOPROTOOPT:109,ESHUTDOWN:110,ECONNREFUSED:111,EADDRINUSE:112,ECONNABORTED:113,ENETUNREACH:114,ENETDOWN:115,ETIMEDOUT:116,EHOSTDOWN:117,EHOSTUNREACH:118,EINPROGRESS:119,EALREADY:120,EDESTADDRREQ:121,EMSGSIZE:122,EPROTONOSUPPORT:123,ESOCKTNOSUPPORT:124,EADDRNOTAVAIL:125,ENETRESET:126,EISCONN:127,ENOTCONN:128,ETOOMANYREFS:129,EUSERS:131,EDQUOT:132,ESTALE:133,ENOTSUP:134,ENOMEDIUM:135,EILSEQ:138,EOVERFLOW:139,ECANCELED:140,ENOTRECOVERABLE:141,EOWNERDEAD:142,ESTRPIPE:143};
var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"No message of desired type",36:"Identifier removed",37:"Channel number out of range",38:"Level 2 not synchronized",39:"Level 3 halted",40:"Level 3 reset",41:"Link number out of range",42:"Protocol driver not attached",43:"No CSI structure available",44:"Level 2 halted",45:"Deadlock condition",46:"No record locks available",50:"Invalid exchange",51:"Invalid request descriptor",52:"Exchange full",53:"No anode",54:"Invalid request code",55:"Invalid slot",56:"File locking deadlock error",57:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",74:"Multihop attempted",76:"Cross mount point (not really error)",77:"Trying to read unreadable message",80:"Given log. name not unique",81:"f.d. invalid for this operation",82:"Remote address changed",83:"Can access a needed shared lib",84:"Accessing a corrupted shared lib",85:".lib section in a.out corrupted",86:"Attempting to link in too many libs",87:"Attempting to exec a shared library",88:"Function not implemented",90:"Directory not empty",91:"File or path name too long",92:"Too many symbolic links",95:"Operation not supported on transport endpoint",96:"Protocol family not supported",104:"Connection reset by peer",105:"No buffer space available",106:"Address family not supported by protocol family",107:"Protocol wrong type for socket",108:"Socket operation on non-socket",109:"Protocol not available",110:"Can't send after socket shutdown",111:"Connection refused",112:"Address already in use",113:"Connection aborted",114:"Network is unreachable",115:"Network interface is not configured",116:"Connection timed out",117:"Host is down",118:"Host is unreachable",119:"Connection already in progress",120:"Socket already connected",121:"Destination address required",122:"Message too long",123:"Unknown protocol",124:"Socket type not supported",125:"Address not available",126:"Connection reset by network",127:"Socket is already connected",128:"Socket is not connected",129:"Too many references",131:"Too many users",132:"Quota exceeded",133:"Stale file handle",134:"Not supported",135:"No medium (in tape drive)",138:"Illegal byte sequence",139:"Value too large for defined data type",140:"Operation canceled",141:"State not recoverable",142:"Previous owner died",143:"Streams pipe error"};
var ___errno_state=0;function ___setErrNo(value) {
// For convenient setting and returning of errno.
HEAP32[((___errno_state)>>2)]=value
return value;
}
var VFS=undefined;
var PATH={splitPath:function (filename) {
var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
return splitPathRe.exec(filename).slice(1);
},normalizeArray:function (parts, allowAboveRoot) {
// if the path tries to go above the root, `up` ends up > 0
var up = 0;
for (var i = parts.length - 1; i >= 0; i--) {
var last = parts[i];
if (last === '.') {
parts.splice(i, 1);
} else if (last === '..') {
parts.splice(i, 1);
up++;
} else if (up) {
parts.splice(i, 1);
up--;
}
}
// if the path is allowed to go above the root, restore leading ..s
if (allowAboveRoot) {
for (; up--; up) {
parts.unshift('..');
}
}
return parts;
},normalize:function (path) {
var isAbsolute = path.charAt(0) === '/',
trailingSlash = path.substr(-1) === '/';
// Normalize the path
path = PATH.normalizeArray(path.split('/').filter(function(p) {
return !!p;
}), !isAbsolute).join('/');
if (!path && !isAbsolute) {
path = '.';
}
if (path && trailingSlash) {
path += '/';
}
return (isAbsolute ? '/' : '') + path;
},dirname:function (path) {
var result = PATH.splitPath(path),
root = result[0],
dir = result[1];
if (!root && !dir) {
// No dirname whatsoever
return '.';
}
if (dir) {
// It has a dirname, strip trailing slash
dir = dir.substr(0, dir.length - 1);
}
return root + dir;
},basename:function (path, ext) {
// EMSCRIPTEN return '/'' for '/', not an empty string
if (path === '/') return '/';
var f = PATH.splitPath(path)[2];
if (ext && f.substr(-1 * ext.length) === ext) {
f = f.substr(0, f.length - ext.length);
}
return f;
},extname:function (path) {
return PATH.splitPath(path)[3];
},join:function () {
var paths = Array.prototype.slice.call(arguments, 0);
return PATH.normalize(paths.filter(function(p, index) {
if (typeof p !== 'string') {
throw new TypeError('Arguments to path.join must be strings');
}
return p;
}).join('/'));
},resolve:function () {
var resolvedPath = '',
resolvedAbsolute = false;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path = (i >= 0) ? arguments[i] : FS.cwd();
// Skip empty and invalid entries
if (typeof path !== 'string') {
throw new TypeError('Arguments to path.resolve must be strings');
} else if (!path) {
continue;
}
resolvedPath = path + '/' + resolvedPath;
resolvedAbsolute = path.charAt(0) === '/';
}
// At this point the path should be resolved to a full absolute path, but
// handle relative paths to be safe (might happen when process.cwd() fails)
resolvedPath = PATH.normalizeArray(resolvedPath.split('/').filter(function(p) {
return !!p;
}), !resolvedAbsolute).join('/');
return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
},relative:function (from, to) {
from = PATH.resolve(from).substr(1);
to = PATH.resolve(to).substr(1);
function trim(arr) {
var start = 0;
for (; start < arr.length; start++) {
if (arr[start] !== '') break;
}
var end = arr.length - 1;
for (; end >= 0; end--) {
if (arr[end] !== '') break;
}
if (start > end) return [];
return arr.slice(start, end - start + 1);
}
var fromParts = trim(from.split('/'));
var toParts = trim(to.split('/'));
var length = Math.min(fromParts.length, toParts.length);
var samePartsLength = length;
for (var i = 0; i < length; i++) {
if (fromParts[i] !== toParts[i]) {
samePartsLength = i;
break;
}
}
var outputParts = [];
for (var i = samePartsLength; i < fromParts.length; i++) {
outputParts.push('..');
}
outputParts = outputParts.concat(toParts.slice(samePartsLength));
return outputParts.join('/');
}};
var TTY={ttys:[],init:function () {
if (ENVIRONMENT_IS_NODE) {
// currently, FS.init does not distinguish if process.stdin is a file or TTY
// device, it always assumes it's a TTY device. because of this, we're forcing
// process.stdin to UTF8 encoding to at least make stdin reading compatible
// with text files until FS.init can be refactored.
process['stdin']['setEncoding']('utf8');
}
},shutdown:function () {
if (ENVIRONMENT_IS_NODE) {
// inolen: any idea as to why node -e 'process.stdin.read()' wouldn't exit immediately (with process.stdin being a tty)?
// isaacs: because now it's reading from the stream, you've expressed interest in it, so that read() kicks off a _read() which creates a ReadReq operation
// inolen: I thought read() in that case was a synchronous operation that just grabbed some amount of buffered data if it exists?
// isaacs: it is. but it also triggers a _read() call, which calls readStart() on the handle
// isaacs: do process.stdin.pause() and i'd think it'd probably close the pending call
process['stdin']['pause']();
}
},register:function (dev, ops) {
TTY.ttys[dev] = { input: [], output: [], ops: ops };
FS.registerDevice(dev, TTY.stream_ops);
},stream_ops:{open:function (stream) {
var tty = TTY.ttys[stream.node.rdev];
if (!tty) {
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
}
stream.tty = tty;
stream.seekable = false;
},close:function (stream) {
// flush any pending line data
if (stream.tty.output.length) {
stream.tty.ops.put_char(stream.tty, 10);
}
},read:function (stream, buffer, offset, length, pos /* ignored */) {
if (!stream.tty || !stream.tty.ops.get_char) {
throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
}
var bytesRead = 0;
for (var i = 0; i < length; i++) {
var result;
try {
result = stream.tty.ops.get_char(stream.tty);
} catch (e) {
throw new FS.ErrnoError(ERRNO_CODES.EIO);
}
if (result === undefined && bytesRead === 0) {
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
}
if (result === null || result === undefined) break;
bytesRead++;
buffer[offset+i] = result;
}
if (bytesRead) {
stream.node.timestamp = Date.now();
}
return bytesRead;
},write:function (stream, buffer, offset, length, pos) {
if (!stream.tty || !stream.tty.ops.put_char) {
throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
}
for (var i = 0; i < length; i++) {
try {
stream.tty.ops.put_char(stream.tty, buffer[offset+i]);
} catch (e) {
throw new FS.ErrnoError(ERRNO_CODES.EIO);
}
}
if (length) {
stream.node.timestamp = Date.now();
}
return i;
}},default_tty_ops:{get_char:function (tty) {
if (!tty.input.length) {
var result = null;
if (ENVIRONMENT_IS_NODE) {
result = process['stdin']['read']();
if (!result) {
if (process['stdin']['_readableState'] && process['stdin']['_readableState']['ended']) {
return null; // EOF
}
return undefined; // no data available
}
} else if (typeof window != 'undefined' &&
typeof window.prompt == 'function') {
// Browser.
result = window.prompt('Input: '); // returns null on cancel
if (result !== null) {
result += '\n';
}
} else if (typeof readline == 'function') {
// Command line.
result = readline();
if (result !== null) {
result += '\n';
}
}
if (!result) {
return null;
}
tty.input = intArrayFromString(result, true);
}
return tty.input.shift();
},put_char:function (tty, val) {
if (val === null || val === 10) {
Module['print'](tty.output.join(''));
tty.output = [];
} else {
tty.output.push(TTY.utf8.processCChar(val));
}
}},default_tty1_ops:{put_char:function (tty, val) {
if (val === null || val === 10) {
Module['printErr'](tty.output.join(''));
tty.output = [];
} else {
tty.output.push(TTY.utf8.processCChar(val));
}
}}};
var MEMFS={CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,ensureFlexible:function (node) {
if (node.contentMode !== MEMFS.CONTENT_FLEXIBLE) {
var contents = node.contents;
node.contents = Array.prototype.slice.call(contents);
node.contentMode = MEMFS.CONTENT_FLEXIBLE;
}
},mount:function (mount) {
return MEMFS.create_node(null, '/', 0040000 | 0777, 0);
},create_node:function (parent, name, mode, dev) {
if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
// no supported
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
var node = FS.createNode(parent, name, mode, dev);
if (FS.isDir(node.mode)) {
node.node_ops = {
getattr: MEMFS.node_ops.getattr,
setattr: MEMFS.node_ops.setattr,
lookup: MEMFS.node_ops.lookup,
mknod: MEMFS.node_ops.mknod,
mknod: MEMFS.node_ops.mknod,
rename: MEMFS.node_ops.rename,
unlink: MEMFS.node_ops.unlink,
rmdir: MEMFS.node_ops.rmdir,
readdir: MEMFS.node_ops.readdir,
symlink: MEMFS.node_ops.symlink
};
node.stream_ops = {
llseek: MEMFS.stream_ops.llseek
};
node.contents = {};
} else if (FS.isFile(node.mode)) {
node.node_ops = {
getattr: MEMFS.node_ops.getattr,
setattr: MEMFS.node_ops.setattr
};
node.stream_ops = {
llseek: MEMFS.stream_ops.llseek,
read: MEMFS.stream_ops.read,
write: MEMFS.stream_ops.write,
allocate: MEMFS.stream_ops.allocate,
mmap: MEMFS.stream_ops.mmap
};
node.contents = [];
node.contentMode = MEMFS.CONTENT_FLEXIBLE;
} else if (FS.isLink(node.mode)) {
node.node_ops = {
getattr: MEMFS.node_ops.getattr,
setattr: MEMFS.node_ops.setattr,
readlink: MEMFS.node_ops.readlink
};
node.stream_ops = {};
} else if (FS.isChrdev(node.mode)) {
node.node_ops = {
getattr: MEMFS.node_ops.getattr,
setattr: MEMFS.node_ops.setattr
};
node.stream_ops = FS.chrdev_stream_ops;
}
node.timestamp = Date.now();
// add the new node to the parent
if (parent) {
parent.contents[name] = node;
}
return node;
},node_ops:{getattr:function (node) {
var attr = {};
// device numbers reuse inode numbers.
attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
attr.ino = node.id;
attr.mode = node.mode;
attr.nlink = 1;
attr.uid = 0;
attr.gid = 0;
attr.rdev = node.rdev;
if (FS.isDir(node.mode)) {
attr.size = 4096;
} else if (FS.isFile(node.mode)) {
attr.size = node.contents.length;
} else if (FS.isLink(node.mode)) {
attr.size = node.link.length;
} else {
attr.size = 0;
}
attr.atime = new Date(node.timestamp);
attr.mtime = new Date(node.timestamp);
attr.ctime = new Date(node.timestamp);
// NOTE: In our implementation, st_blocks = Math.ceil(st_size/st_blksize),
// but this is not required by the standard.
attr.blksize = 4096;
attr.blocks = Math.ceil(attr.size / attr.blksize);
return attr;
},setattr:function (node, attr) {
if (attr.mode !== undefined) {
node.mode = attr.mode;
}
if (attr.timestamp !== undefined) {
node.timestamp = attr.timestamp;
}
if (attr.size !== undefined) {
MEMFS.ensureFlexible(node);
var contents = node.contents;
if (attr.size < contents.length) contents.length = attr.size;
else while (attr.size > contents.length) contents.push(0);
}
},lookup:function (parent, name) {
throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
},mknod:function (parent, name, mode, dev) {
return MEMFS.create_node(parent, name, mode, dev);
},rename:function (old_node, new_dir, new_name) {
// if we're overwriting a directory at new_name, make sure it's empty.
if (FS.isDir(old_node.mode)) {
var new_node;
try {
new_node = FS.lookupNode(new_dir, new_name);
} catch (e) {
}
if (new_node) {
for (var i in new_node.contents) {
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
}
}
}
// do the internal rewiring
delete old_node.parent.contents[old_node.name];
old_node.name = new_name;
new_dir.contents[new_name] = old_node;
},unlink:function (parent, name) {
delete parent.contents[name];
},rmdir:function (parent, name) {
var node = FS.lookupNode(parent, name);
for (var i in node.contents) {
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
}
delete parent.contents[name];
},readdir:function (node) {
var entries = ['.', '..']
for (var key in node.contents) {
if (!node.contents.hasOwnProperty(key)) {
continue;
}
entries.push(key);
}
return entries;
},symlink:function (parent, newname, oldpath) {
var node = MEMFS.create_node(parent, newname, 0777 | 0120000, 0);
node.link = oldpath;
return node;
},readlink:function (node) {
if (!FS.isLink(node.mode)) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
return node.link;
}},stream_ops:{read:function (stream, buffer, offset, length, position) {
var contents = stream.node.contents;
var size = Math.min(contents.length - position, length);
if (size > 8 && contents.subarray) { // non-trivial, and typed array
buffer.set(contents.subarray(position, position + size), offset);
} else
{
for (var i = 0; i < size; i++) {
buffer[offset + i] = contents[position + i];
}
}
return size;
},write:function (stream, buffer, offset, length, position, canOwn) {
var node = stream.node;
node.timestamp = Date.now();
var contents = node.contents;
if (length && contents.length === 0 && position === 0 && buffer.subarray) {
// just replace it with the new data
assert(buffer.length);
if (canOwn && buffer.buffer === HEAP8.buffer && offset === 0) {
node.contents = buffer; // this is a subarray of the heap, and we can own it
node.contentMode = MEMFS.CONTENT_OWNING;
} else {
node.contents = new Uint8Array(buffer.subarray(offset, offset+length));
node.contentMode = MEMFS.CONTENT_FIXED;
}
return length;
}
MEMFS.ensureFlexible(node);
var contents = node.contents;
while (contents.length < position) contents.push(0);
for (var i = 0; i < length; i++) {
contents[position + i] = buffer[offset + i];
}
return length;
},llseek:function (stream, offset, whence) {
var position = offset;
if (whence === 1) { // SEEK_CUR.
position += stream.position;
} else if (whence === 2) { // SEEK_END.
if (FS.isFile(stream.node.mode)) {
position += stream.node.contents.length;
}
}
if (position < 0) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
stream.ungotten = [];
stream.position = position;
return position;
},allocate:function (stream, offset, length) {
MEMFS.ensureFlexible(stream.node);
var contents = stream.node.contents;
var limit = offset + length;
while (limit > contents.length) contents.push(0);
},mmap:function (stream, buffer, offset, length, position, prot, flags) {
if (!FS.isFile(stream.node.mode)) {
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
}
var ptr;
var allocated;
var contents = stream.node.contents;
// Only make a new copy when MAP_PRIVATE is specified.
if ( !(flags & 0x02) &&
(contents.buffer === buffer || contents.buffer === buffer.buffer) ) {
// We can't emulate MAP_SHARED when the file is not backed by the buffer
// we're mapping to (e.g. the HEAP buffer).
allocated = false;
ptr = contents.byteOffset;
} else {
// Try to avoid unnecessary slices.
if (position > 0 || position + length < contents.length) {
if (contents.subarray) {
contents = contents.subarray(position, position + length);
} else {
contents = Array.prototype.slice.call(contents, position, position + length);
}
}
allocated = true;
ptr = _malloc(length);
if (!ptr) {
throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
}
buffer.set(contents, ptr);
}
return { ptr: ptr, allocated: allocated };
}}};
var _stdin=allocate(1, "i32*", ALLOC_STATIC);
var _stdout=allocate(1, "i32*", ALLOC_STATIC);
var _stderr=allocate(1, "i32*", ALLOC_STATIC);
function _fflush(stream) {
// int fflush(FILE *stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fflush.html
// we don't currently perform any user-space buffering of data
}var FS={root:null,nodes:[null],devices:[null],streams:[null],nextInode:1,name_table:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:function ErrnoError(errno) {
this.errno = errno;
for (var key in ERRNO_CODES) {
if (ERRNO_CODES[key] === errno) {
this.code = key;
break;
}
}
this.message = ERRNO_MESSAGES[errno];
},handleFSError:function (e) {
if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + new Error().stack;
return ___setErrNo(e.errno);
},hashName:function (parentid, name) {
var hash = 0;
for (var i = 0; i < name.length; i++) {
hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0;
}
return ((parentid + hash) >>> 0) % FS.name_table.length;
},hashAddNode:function (node) {
var hash = FS.hashName(node.parent.id, node.name);
node.name_next = FS.name_table[hash];
FS.name_table[hash] = node;
},hashRemoveNode:function (node) {
var hash = FS.hashName(node.parent.id, node.name);
if (FS.name_table[hash] === node) {
FS.name_table[hash] = node.name_next;
} else {
var current = FS.name_table[hash];
while (current) {
if (current.name_next === node) {
current.name_next = node.name_next;
break;
}
current = current.name_next;
}
}
},lookupNode:function (parent, name) {
var err = FS.mayLookup(parent);
if (err) {
throw new FS.ErrnoError(err);
}
var hash = FS.hashName(parent.id, name);
for (var node = FS.name_table[hash]; node; node = node.name_next) {
if (node.parent.id === parent.id && node.name === name) {
return node;
}
}
// if we failed to find it in the cache, call into the VFS
return FS.lookup(parent, name);
},createNode:function (parent, name, mode, rdev) {
var node = {
id: FS.nextInode++,
name: name,
mode: mode,
node_ops: {},
stream_ops: {},
rdev: rdev,
parent: null,
mount: null
};
if (!parent) {
parent = node; // root node sets parent to itself
}
node.parent = parent;
node.mount = parent.mount;
// compatibility
var readMode = 292 | 73;
var writeMode = 146;
// NOTE we must use Object.defineProperties instead of individual calls to
// Object.defineProperty in order to make closure compiler happy
Object.defineProperties(node, {
read: {
get: function() { return (node.mode & readMode) === readMode; },
set: function(val) { val ? node.mode |= readMode : node.mode &= ~readMode; }
},
write: {
get: function() { return (node.mode & writeMode) === writeMode; },
set: function(val) { val ? node.mode |= writeMode : node.mode &= ~writeMode; }
},
isFolder: {
get: function() { return FS.isDir(node.mode); },
},
isDevice: {
get: function() { return FS.isChrdev(node.mode); },
},
});
FS.hashAddNode(node);
return node;
},destroyNode:function (node) {
FS.hashRemoveNode(node);
},isRoot:function (node) {
return node === node.parent;
},isMountpoint:function (node) {
return node.mounted;
},isFile:function (mode) {
return (mode & 0170000) === 0100000;
},isDir:function (mode) {
return (mode & 0170000) === 0040000;
},isLink:function (mode) {
return (mode & 0170000) === 0120000;
},isChrdev:function (mode) {
return (mode & 0170000) === 0020000;
},isBlkdev:function (mode) {
return (mode & 0170000) === 0060000;
},isFIFO:function (mode) {
return (mode & 0170000) === 0010000;
},cwd:function () {
return FS.currentPath;
},lookupPath:function (path, opts) {
path = PATH.resolve(FS.currentPath, path);
opts = opts || { recurse_count: 0 };
if (opts.recurse_count > 8) { // max recursive lookup of 8
throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
}
// split the path
var parts = PATH.normalizeArray(path.split('/').filter(function(p) {
return !!p;
}), false);
// start at the root
var current = FS.root;
var current_path = '/';
for (var i = 0; i < parts.length; i++) {
var islast = (i === parts.length-1);
if (islast && opts.parent) {
// stop resolving
break;
}
current = FS.lookupNode(current, parts[i]);
current_path = PATH.join(current_path, parts[i]);
// jump to the mount's root node if this is a mountpoint
if (FS.isMountpoint(current)) {
current = current.mount.root;
}
// follow symlinks
// by default, lookupPath will not follow a symlink if it is the final path component.
// setting opts.follow = true will override this behavior.
if (!islast || opts.follow) {
var count = 0;
while (FS.isLink(current.mode)) {
var link = FS.readlink(current_path);
current_path = PATH.resolve(PATH.dirname(current_path), link);
var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
current = lookup.node;
if (count++ > 40) { // limit max consecutive symlinks to 40 (SYMLOOP_MAX).
throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
}
}
}
}
return { path: current_path, node: current };
},getPath:function (node) {
var path;
while (true) {
if (FS.isRoot(node)) {
return path ? PATH.join(node.mount.mountpoint, path) : node.mount.mountpoint;
}
path = path ? PATH.join(node.name, path) : node.name;
node = node.parent;
}
},flagModes:{"r":0,"rs":8192,"r+":2,"w":1537,"wx":3585,"xw":3585,"w+":1538,"wx+":3586,"xw+":3586,"a":521,"ax":2569,"xa":2569,"a+":522,"ax+":2570,"xa+":2570},modeStringToFlags:function (str) {
var flags = FS.flagModes[str];
if (typeof flags === 'undefined') {
throw new Error('Unknown file open mode: ' + str);
}
return flags;
},flagsToPermissionString:function (flag) {
var accmode = flag & 3;
var perms = ['r', 'w', 'rw'][accmode];
if ((flag & 1024)) {
perms += 'w';
}
return perms;
},nodePermissions:function (node, perms) {
if (FS.ignorePermissions) {
return 0;
}
// return 0 if any user, group or owner bits are set.
if (perms.indexOf('r') !== -1 && !(node.mode & 292)) {
return ERRNO_CODES.EACCES;
} else if (perms.indexOf('w') !== -1 && !(node.mode & 146)) {
return ERRNO_CODES.EACCES;
} else if (perms.indexOf('x') !== -1 && !(node.mode & 73)) {
return ERRNO_CODES.EACCES;
}
return 0;
},mayLookup:function (dir) {
return FS.nodePermissions(dir, 'x');
},mayMknod:function (mode) {
switch (mode & 0170000) {
case 0100000:
case 0020000:
case 0060000:
case 0010000:
case 0140000:
return 0;
default:
return ERRNO_CODES.EINVAL;
}
},mayCreate:function (dir, name) {
try {
var node = FS.lookupNode(dir, name);
return ERRNO_CODES.EEXIST;
} catch (e) {
}
return FS.nodePermissions(dir, 'wx');
},mayDelete:function (dir, name, isdir) {
var node;
try {
node = FS.lookupNode(dir, name);
} catch (e) {
return e.errno;
}
var err = FS.nodePermissions(dir, 'wx');
if (err) {
return err;
}
if (isdir) {
if (!FS.isDir(node.mode)) {
return ERRNO_CODES.ENOTDIR;
}
if (FS.isRoot(node) || FS.getPath(node) === FS.currentPath) {
return ERRNO_CODES.EBUSY;
}
} else {
if (FS.isDir(node.mode)) {
return ERRNO_CODES.EISDIR;
}
}
return 0;
},mayOpen:function (node, flags) {
if (!node) {
return ERRNO_CODES.ENOENT;
}
if (FS.isLink(node.mode)) {
return ERRNO_CODES.ELOOP;
} else if (FS.isDir(node.mode)) {
if ((flags & 3) !== 0 || // opening for write
(flags & 1024)) {
return ERRNO_CODES.EISDIR;
}
}
return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
},chrdev_stream_ops:{open:function (stream) {
var device = FS.getDevice(stream.node.rdev);
// override node's stream ops with the device's
stream.stream_ops = device.stream_ops;
// forward the open call
if (stream.stream_ops.open) {
stream.stream_ops.open(stream);
}
},llseek:function () {
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
}},major:function (dev) {
return ((dev) >> 8);
},minor:function (dev) {
return ((dev) & 0xff);
},makedev:function (ma, mi) {
return ((ma) << 8 | (mi));
},registerDevice:function (dev, ops) {
FS.devices[dev] = { stream_ops: ops };
},getDevice:function (dev) {
return FS.devices[dev];
},MAX_OPEN_FDS:4096,nextfd:function (fd_start, fd_end) {
fd_start = fd_start || 1;
fd_end = fd_end || FS.MAX_OPEN_FDS;
for (var fd = fd_start; fd <= fd_end; fd++) {
if (!FS.streams[fd]) {
return fd;
}
}
throw new FS.ErrnoError(ERRNO_CODES.EMFILE);
},getStream:function (fd) {
return FS.streams[fd];
},createStream:function (stream, fd_start, fd_end) {
var fd = FS.nextfd(fd_start, fd_end);
stream.fd = fd;
// compatibility
Object.defineProperties(stream, {
object: {
get: function() { return stream.node; },
set: function(val) { stream.node = val; }
},
isRead: {
get: function() { return (stream.flags & 3) !== 1; }
},
isWrite: {
get: function() { return (stream.flags & 3) !== 0; }
},
isAppend: {
get: function() { return (stream.flags & 8); }
}
});
FS.streams[fd] = stream;
return stream;
},closeStream:function (fd) {
FS.streams[fd] = null;
},getMode:function (canRead, canWrite) {
var mode = 0;
if (canRead) mode |= 292 | 73;
if (canWrite) mode |= 146;
return mode;
},joinPath:function (parts, forceRelative) {
var path = PATH.join.apply(null, parts);
if (forceRelative && path[0] == '/') path = path.substr(1);
return path;
},absolutePath:function (relative, base) {
return PATH.resolve(base, relative);
},standardizePath:function (path) {
return PATH.normalize(path);
},findObject:function (path, dontResolveLastLink) {
var ret = FS.analyzePath(path, dontResolveLastLink);
if (ret.exists) {
return ret.object;
} else {
___setErrNo(ret.error);
return null;
}
},analyzePath:function (path, dontResolveLastLink) {
// operate from within the context of the symlink's target
try {
var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
path = lookup.path;
} catch (e) {
}
var ret = {
isRoot: false, exists: false, error: 0, name: null, path: null, object: null,
parentExists: false, parentPath: null, parentObject: null
};
try {
var lookup = FS.lookupPath(path, { parent: true });
ret.parentExists = true;
ret.parentPath = lookup.path;
ret.parentObject = lookup.node;
ret.name = PATH.basename(path);
lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
ret.exists = true;
ret.path = lookup.path;
ret.object = lookup.node;
ret.name = lookup.node.name;
ret.isRoot = lookup.path === '/';
} catch (e) {
ret.error = e.errno;
};
return ret;
},createFolder:function (parent, name, canRead, canWrite) {
var path = PATH.join(typeof parent === 'string' ? parent : FS.getPath(parent), name);
var mode = FS.getMode(canRead, canWrite);
return FS.mkdir(path, mode);
},createPath:function (parent, path, canRead, canWrite) {
parent = typeof parent === 'string' ? parent : FS.getPath(parent);
var parts = path.split('/').reverse();
while (parts.length) {
var part = parts.pop();
if (!part) continue;
var current = PATH.join(parent, part);
try {
FS.mkdir(current, 0777);
} catch (e) {
// ignore EEXIST
}
parent = current;
}
return current;
},createFile:function (parent, name, properties, canRead, canWrite) {
var path = PATH.join(typeof parent === 'string' ? parent : FS.getPath(parent), name);
var mode = FS.getMode(canRead, canWrite);
return FS.create(path, mode);
},createDataFile:function (parent, name, data, canRead, canWrite, canOwn) {
var path = name ? PATH.join(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;
var mode = FS.getMode(canRead, canWrite);
var node = FS.create(path, mode);
if (data) {
if (typeof data === 'string') {
var arr = new Array(data.length);
for (var i = 0, len = data.length; i < len; ++i) arr[i] = data.charCodeAt(i);
data = arr;
}
// make sure we can write to the file
FS.chmod(path, mode | 146);
var stream = FS.open(path, 'w');
FS.write(stream, data, 0, data.length, 0, canOwn);
FS.close(stream);
FS.chmod(path, mode);
}
return node;
},createDevice:function (parent, name, input, output) {
var path = PATH.join(typeof parent === 'string' ? parent : FS.getPath(parent), name);
var mode = FS.getMode(!!input, !!output);
if (!FS.createDevice.major) FS.createDevice.major = 64;
var dev = FS.makedev(FS.createDevice.major++, 0);
// Create a fake device that a set of stream ops to emulate
// the old behavior.
FS.registerDevice(dev, {
open: function(stream) {
stream.seekable = false;
},
close: function(stream) {
// flush any pending line data
if (output && output.buffer && output.buffer.length) {
output(10);
}
},
read: function(stream, buffer, offset, length, pos /* ignored */) {
var bytesRead = 0;
for (var i = 0; i < length; i++) {
var result;
try {
result = input();
} catch (e) {
throw new FS.ErrnoError(ERRNO_CODES.EIO);
}
if (result === undefined && bytesRead === 0) {
throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
}
if (result === null || result === undefined) break;
bytesRead++;
buffer[offset+i] = result;
}
if (bytesRead) {
stream.node.timestamp = Date.now();
}
return bytesRead;
},
write: function(stream, buffer, offset, length, pos) {
for (var i = 0; i < length; i++) {
try {
output(buffer[offset+i]);
} catch (e) {
throw new FS.ErrnoError(ERRNO_CODES.EIO);
}
}
if (length) {
stream.node.timestamp = Date.now();
}
return i;
}
});
return FS.mkdev(path, mode, dev);
},createLink:function (parent, name, target, canRead, canWrite) {
var path = PATH.join(typeof parent === 'string' ? parent : FS.getPath(parent), name);
return FS.symlink(target, path);
},forceLoadFile:function (obj) {
if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
var success = true;
if (typeof XMLHttpRequest !== 'undefined') {
throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
} else if (Module['read']) {
// Command-line.
try {
// WARNING: Can't read binary files in V8's d8 or tracemonkey's js, as
// read() will try to parse UTF8.
obj.contents = intArrayFromString(Module['read'](obj.url), true);
} catch (e) {
success = false;
}
} else {
throw new Error('Cannot load without read() or XMLHttpRequest.');
}
if (!success) ___setErrNo(ERRNO_CODES.EIO);
return success;
},createLazyFile:function (parent, name, url, canRead, canWrite) {
if (typeof XMLHttpRequest !== 'undefined') {
if (!ENVIRONMENT_IS_WORKER) throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc';
// Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.
var LazyUint8Array = function() {
this.lengthKnown = false;
this.chunks = []; // Loaded chunks. Index is the chunk number
}
LazyUint8Array.prototype.get = function(idx) {
if (idx > this.length-1 || idx < 0) {
return undefined;
}
var chunkOffset = idx % this.chunkSize;
var chunkNum = Math.floor(idx / this.chunkSize);
return this.getter(chunkNum)[chunkOffset];
}
LazyUint8Array.prototype.setDataGetter = function(getter) {
this.getter = getter;
}
LazyUint8Array.prototype.cacheLength = function() {
// Find length
var xhr = new XMLHttpRequest();
xhr.open('HEAD', url, false);
xhr.send(null);
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
var datalength = Number(xhr.getResponseHeader("Content-length"));
var header;
var hasByteServing = (header = xhr.getResponseHeader("Accept-Ranges")) && header === "bytes";
var chunkSize = 1024*1024; // Chunk size in bytes
if (!hasByteServing) chunkSize = datalength;
// Function to get a range from the remote URL.
var doXHR = (function(from, to) {
if (from > to) throw new Error("invalid range (" + from + ", " + to + ") or no bytes requested!");
if (to > datalength-1) throw new Error("only " + datalength + " bytes available! programmer error!");
// TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
if (datalength !== chunkSize) xhr.setRequestHeader("Range", "bytes=" + from + "-" + to);
// Some hints to the browser that we want binary data.
if (typeof Uint8Array != 'undefined') xhr.responseType = 'arraybuffer';
if (xhr.overrideMimeType) {
xhr.overrideMimeType('text/plain; charset=x-user-defined');
}
xhr.send(null);
if (!(xhr.status >= 200 && xhr.status < 300 || xhr.status === 304)) throw new Error("Couldn't load " + url + ". Status: " + xhr.status);
if (xhr.response !== undefined) {
return new Uint8Array(xhr.response || []);
} else {
return intArrayFromString(xhr.responseText || '', true);
}
});
var lazyArray = this;
lazyArray.setDataGetter(function(chunkNum) {
var start = chunkNum * chunkSize;
var end = (chunkNum+1) * chunkSize - 1; // including this byte
end = Math.min(end, datalength-1); // if datalength-1 is selected, this is the last block
if (typeof(lazyArray.chunks[chunkNum]) === "undefined") {
lazyArray.chunks[chunkNum] = doXHR(start, end);
}
if (typeof(lazyArray.chunks[chunkNum]) === "undefined") throw new Error("doXHR failed!");
return lazyArray.chunks[chunkNum];
});
this._length = datalength;
this._chunkSize = chunkSize;
this.lengthKnown = true;
}
var lazyArray = new LazyUint8Array();
Object.defineProperty(lazyArray, "length", {
get: function() {
if(!this.lengthKnown) {
this.cacheLength();
}
return this._length;
}
});
Object.defineProperty(lazyArray, "chunkSize", {
get: function() {
if(!this.lengthKnown) {
this.cacheLength();
}
return this._chunkSize;
}
});
var properties = { isDevice: false, contents: lazyArray };
} else {
var properties = { isDevice: false, url: url };
}
var node = FS.createFile(parent, name, properties, canRead, canWrite);
// This is a total hack, but I want to get this lazy file code out of the
// core of MEMFS. If we want to keep this lazy file concept I feel it should
// be its own thin LAZYFS proxying calls to MEMFS.
if (properties.contents) {
node.contents = properties.contents;
} else if (properties.url) {
node.contents = null;
node.url = properties.url;
}
// override each stream op with one that tries to force load the lazy file first
var stream_ops = {};
var keys = Object.keys(node.stream_ops);
keys.forEach(function(key) {
var fn = node.stream_ops[key];
stream_ops[key] = function() {
if (!FS.forceLoadFile(node)) {
throw new FS.ErrnoError(ERRNO_CODES.EIO);
}
return fn.apply(null, arguments);
};
});
// use a custom read function
stream_ops.read = function(stream, buffer, offset, length, position) {
if (!FS.forceLoadFile(node)) {
throw new FS.ErrnoError(ERRNO_CODES.EIO);
}
var contents = stream.node.contents;
var size = Math.min(contents.length - position, length);
if (contents.slice) { // normal array
for (var i = 0; i < size; i++) {
buffer[offset + i] = contents[position + i];
}
} else {
for (var i = 0; i < size; i++) { // LazyUint8Array from sync binary XHR
buffer[offset + i] = contents.get(position + i);
}
}
return size;
};
node.stream_ops = stream_ops;
return node;
},createPreloadedFile:function (parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn) {
Browser.init();
// TODO we should allow people to just pass in a complete filename instead
// of parent and name being that we just join them anyways
var fullname = name ? PATH.resolve(PATH.join(parent, name)) : parent;
function processData(byteArray) {
function finish(byteArray) {
if (!dontCreateFile) {
FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
}
if (onload) onload();
removeRunDependency('cp ' + fullname);
}
var handled = false;
Module['preloadPlugins'].forEach(function(plugin) {
if (handled) return;
if (plugin['canHandle'](fullname)) {
plugin['handle'](byteArray, fullname, finish, function() {
if (onerror) onerror();
removeRunDependency('cp ' + fullname);
});
handled = true;
}
});
if (!handled) finish(byteArray);
}
addRunDependency('cp ' + fullname);
if (typeof url == 'string') {
Browser.asyncLoad(url, function(byteArray) {
processData(byteArray);
}, onerror);
} else {
processData(url);
}
},indexedDB:function () {
return window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
},DB_NAME:function () {
return 'EM_FS_' + window.location.pathname;
},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function (paths, onload, onerror) {
onload = onload || function(){};
onerror = onerror || function(){};
var indexedDB = FS.indexedDB();
try {
var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
} catch (e) {
return onerror(e);
}
openRequest.onupgradeneeded = function() {
console.log('creating db');
var db = openRequest.result;
db.createObjectStore(FS.DB_STORE_NAME);
};
openRequest.onsuccess = function() {
var db = openRequest.result;
var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');
var files = transaction.objectStore(FS.DB_STORE_NAME);
var ok = 0, fail = 0, total = paths.length;
function finish() {
if (fail == 0) onload(); else onerror();
}
paths.forEach(function(path) {
var putRequest = files.put(FS.analyzePath(path).object.contents, path);
putRequest.onsuccess = function() { ok++; if (ok + fail == total) finish() };
putRequest.onerror = function() { fail++; if (ok + fail == total) finish() };
});
transaction.onerror = onerror;
};
openRequest.onerror = onerror;
},loadFilesFromDB:function (paths, onload, onerror) {
onload = onload || function(){};
onerror = onerror || function(){};
var indexedDB = FS.indexedDB();
try {
var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
} catch (e) {
return onerror(e);
}
openRequest.onupgradeneeded = onerror; // no database to load from
openRequest.onsuccess = function() {
var db = openRequest.result;
try {
var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');
} catch(e) {
onerror(e);
return;
}
var files = transaction.objectStore(FS.DB_STORE_NAME);
var ok = 0, fail = 0, total = paths.length;
function finish() {
if (fail == 0) onload(); else onerror();
}
paths.forEach(function(path) {
var getRequest = files.get(path);
getRequest.onsuccess = function() {
if (FS.analyzePath(path).exists) {
FS.unlink(path);
}
FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
ok++;
if (ok + fail == total) finish();
};
getRequest.onerror = function() { fail++; if (ok + fail == total) finish() };
});
transaction.onerror = onerror;
};
openRequest.onerror = onerror;
},createDefaultDirectories:function () {
FS.mkdir('/tmp', 0777);
},createDefaultDevices:function () {
// create /dev
FS.mkdir('/dev', 0777);
// setup /dev/null
FS.registerDevice(FS.makedev(1, 3), {
read: function() { return 0; },
write: function() { return 0; }
});
FS.mkdev('/dev/null', 0666, FS.makedev(1, 3));
// setup /dev/tty and /dev/tty1
// stderr needs to print output using Module['printErr']
// so we register a second tty just for it.
TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
FS.mkdev('/dev/tty', 0666, FS.makedev(5, 0));
FS.mkdev('/dev/tty1', 0666, FS.makedev(6, 0));
// we're not going to emulate the actual shm device,
// just create the tmp dirs that reside in it commonly
FS.mkdir('/dev/shm', 0777);
FS.mkdir('/dev/shm/tmp', 0777);
},createStandardStreams:function () {
// TODO deprecate the old functionality of a single
// input / output callback and that utilizes FS.createDevice
// and instead require a unique set of stream ops
// by default, we symlink the standard streams to the
// default tty devices. however, if the standard streams
// have been overwritten we create a unique device for
// them instead.
if (Module['stdin']) {
FS.createDevice('/dev', 'stdin', Module['stdin']);
} else {
FS.symlink('/dev/tty', '/dev/stdin');
}
if (Module['stdout']) {
FS.createDevice('/dev', 'stdout', null, Module['stdout']);
} else {
FS.symlink('/dev/tty', '/dev/stdout');
}
if (Module['stderr']) {
FS.createDevice('/dev', 'stderr', null, Module['stderr']);
} else {
FS.symlink('/dev/tty1', '/dev/stderr');
}
// open default streams for the stdin, stdout and stderr devices
var stdin = FS.open('/dev/stdin', 'r');
HEAP32[((_stdin)>>2)]=stdin.fd;
assert(stdin.fd === 1, 'invalid handle for stdin (' + stdin.fd + ')');
var stdout = FS.open('/dev/stdout', 'w');
HEAP32[((_stdout)>>2)]=stdout.fd;
assert(stdout.fd === 2, 'invalid handle for stdout (' + stdout.fd + ')');
var stderr = FS.open('/dev/stderr', 'w');
HEAP32[((_stderr)>>2)]=stderr.fd;
assert(stderr.fd === 3, 'invalid handle for stderr (' + stderr.fd + ')');
},staticInit:function () {
FS.name_table = new Array(4096);
FS.root = FS.createNode(null, '/', 0040000 | 0777, 0);
FS.mount(MEMFS, {}, '/');
FS.createDefaultDirectories();
FS.createDefaultDevices();
},init:function (input, output, error) {
assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');
FS.init.initialized = true;
// Allow Module.stdin etc. to provide defaults, if none explicitly passed to us here
Module['stdin'] = input || Module['stdin'];
Module['stdout'] = output || Module['stdout'];
Module['stderr'] = error || Module['stderr'];
FS.createStandardStreams();
},quit:function () {
FS.init.initialized = false;
for (var i = 0; i < FS.streams.length; i++) {
var stream = FS.streams[i];
if (!stream) {
continue;
}
FS.close(stream);
}
},mount:function (type, opts, mountpoint) {
var mount = {
type: type,
opts: opts,
mountpoint: mountpoint,
root: null
};
var lookup;
if (mountpoint) {
lookup = FS.lookupPath(mountpoint, { follow: false });
}
// create a root node for the fs
var root = type.mount(mount);
root.mount = mount;
mount.root = root;
// assign the mount info to the mountpoint's node
if (lookup) {
lookup.node.mount = mount;
lookup.node.mounted = true;
// compatibility update FS.root if we mount to /
if (mountpoint === '/') {
FS.root = mount.root;
}
}
return root;
},lookup:function (parent, name) {
return parent.node_ops.lookup(parent, name);
},mknod:function (path, mode, dev) {
var lookup = FS.lookupPath(path, { parent: true });
var parent = lookup.node;
var name = PATH.basename(path);
var err = FS.mayCreate(parent, name);
if (err) {
throw new FS.ErrnoError(err);
}
if (!parent.node_ops.mknod) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
return parent.node_ops.mknod(parent, name, mode, dev);
},create:function (path, mode) {
mode &= 4095;
mode |= 0100000;
return FS.mknod(path, mode, 0);
},mkdir:function (path, mode) {
mode &= 511 | 0001000;
mode |= 0040000;
return FS.mknod(path, mode, 0);
},mkdev:function (path, mode, dev) {
mode |= 0020000;
return FS.mknod(path, mode, dev);
},symlink:function (oldpath, newpath) {
var lookup = FS.lookupPath(newpath, { parent: true });
var parent = lookup.node;
var newname = PATH.basename(newpath);
var err = FS.mayCreate(parent, newname);
if (err) {
throw new FS.ErrnoError(err);
}
if (!parent.node_ops.symlink) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
return parent.node_ops.symlink(parent, newname, oldpath);
},rename:function (old_path, new_path) {
var old_dirname = PATH.dirname(old_path);
var new_dirname = PATH.dirname(new_path);
var old_name = PATH.basename(old_path);
var new_name = PATH.basename(new_path);
// parents must exist
var lookup, old_dir, new_dir;
try {
lookup = FS.lookupPath(old_path, { parent: true });
old_dir = lookup.node;
lookup = FS.lookupPath(new_path, { parent: true });
new_dir = lookup.node;
} catch (e) {
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
}
// need to be part of the same mount
if (old_dir.mount !== new_dir.mount) {
throw new FS.ErrnoError(ERRNO_CODES.EXDEV);
}
// source must exist
var old_node = FS.lookupNode(old_dir, old_name);
// old path should not be an ancestor of the new path
var relative = PATH.relative(old_path, new_dirname);
if (relative.charAt(0) !== '.') {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
// new path should not be an ancestor of the old path
relative = PATH.relative(new_path, old_dirname);
if (relative.charAt(0) !== '.') {
throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
}
// see if the new path already exists
var new_node;
try {
new_node = FS.lookupNode(new_dir, new_name);
} catch (e) {
// not fatal
}
// early out if nothing needs to change
if (old_node === new_node) {
return;
}
// we'll need to delete the old entry
var isdir = FS.isDir(old_node.mode);
var err = FS.mayDelete(old_dir, old_name, isdir);
if (err) {
throw new FS.ErrnoError(err);
}
// need delete permissions if we'll be overwriting.
// need create permissions if new doesn't already exist.
err = new_node ?
FS.mayDelete(new_dir, new_name, isdir) :
FS.mayCreate(new_dir, new_name);
if (err) {
throw new FS.ErrnoError(err);
}
if (!old_dir.node_ops.rename) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
}
// if we are going to change the parent, check write permissions
if (new_dir !== old_dir) {
err = FS.nodePermissions(old_dir, 'w');
if (err) {
throw new FS.ErrnoError(err);
}
}
// remove the node from the lookup hash
FS.hashRemoveNode(old_node);
// do the underlying fs rename
try {
old_dir.node_ops.rename(old_node, new_dir, new_name);
} catch (e) {
throw e;
} finally {
// add the node back to the hash (in case node_ops.rename
// changed its name)
FS.hashAddNode(old_node);
}
},rmdir:function (path) {
var lookup = FS.lookupPath(path, { parent: true });
var parent = lookup.node;
var name = PATH.basename(path);
var node = FS.lookupNode(parent, name);
var err = FS.mayDelete(parent, name, true);
if (err) {
throw new FS.ErrnoError(err);
}
if (!parent.node_ops.rmdir) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
if (FS.isMountpoint(node)) {
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
}
parent.node_ops.rmdir(parent, name);
FS.destroyNode(node);
},readdir:function (path) {
var lookup = FS.lookupPath(path, { follow: true });
var node = lookup.node;
if (!node.node_ops.readdir) {
throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
}
return node.node_ops.readdir(node);
},unlink:function (path) {
var lookup = FS.lookupPath(path, { parent: true });
var parent = lookup.node;
var name = PATH.basename(path);
var node = FS.lookupNode(parent, name);
var err = FS.mayDelete(parent, name, false);
if (err) {
// POSIX says unlink should set EPERM, not EISDIR
if (err === ERRNO_CODES.EISDIR) err = ERRNO_CODES.EPERM;
throw new FS.ErrnoError(err);
}
if (!parent.node_ops.unlink) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
if (FS.isMountpoint(node)) {
throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
}
parent.node_ops.unlink(parent, name);
FS.destroyNode(node);
},readlink:function (path) {
var lookup = FS.lookupPath(path, { follow: false });
var link = lookup.node;
if (!link.node_ops.readlink) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
return link.node_ops.readlink(link);
},stat:function (path, dontFollow) {
var lookup = FS.lookupPath(path, { follow: !dontFollow });
var node = lookup.node;
if (!node.node_ops.getattr) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
return node.node_ops.getattr(node);
},lstat:function (path) {
return FS.stat(path, true);
},chmod:function (path, mode, dontFollow) {
var node;
if (typeof path === 'string') {
var lookup = FS.lookupPath(path, { follow: !dontFollow });
node = lookup.node;
} else {
node = path;
}
if (!node.node_ops.setattr) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
node.node_ops.setattr(node, {
mode: (mode & 4095) | (node.mode & ~4095),
timestamp: Date.now()
});
},lchmod:function (path, mode) {
FS.chmod(path, mode, true);
},fchmod:function (fd, mode) {
var stream = FS.getStream(fd);
if (!stream) {
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
}
FS.chmod(stream.node, mode);
},chown:function (path, uid, gid, dontFollow) {
var node;
if (typeof path === 'string') {
var lookup = FS.lookupPath(path, { follow: !dontFollow });
node = lookup.node;
} else {
node = path;
}
if (!node.node_ops.setattr) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
node.node_ops.setattr(node, {
timestamp: Date.now()
// we ignore the uid / gid for now
});
},lchown:function (path, uid, gid) {
FS.chown(path, uid, gid, true);
},fchown:function (fd, uid, gid) {
var stream = FS.getStream(fd);
if (!stream) {
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
}
FS.chown(stream.node, uid, gid);
},truncate:function (path, len) {
if (len < 0) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
var node;
if (typeof path === 'string') {
var lookup = FS.lookupPath(path, { follow: true });
node = lookup.node;
} else {
node = path;
}
if (!node.node_ops.setattr) {
throw new FS.ErrnoError(ERRNO_CODES.EPERM);
}
if (FS.isDir(node.mode)) {
throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
}
if (!FS.isFile(node.mode)) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
var err = FS.nodePermissions(node, 'w');
if (err) {
throw new FS.ErrnoError(err);
}
node.node_ops.setattr(node, {
size: len,
timestamp: Date.now()
});
},ftruncate:function (fd, len) {
var stream = FS.getStream(fd);
if (!stream) {
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
}
if ((stream.flags & 3) === 0) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
FS.truncate(stream.node, len);
},utime:function (path, atime, mtime) {
var lookup = FS.lookupPath(path, { follow: true });
var node = lookup.node;
node.node_ops.setattr(node, {
timestamp: Math.max(atime, mtime)
});
},open:function (path, flags, mode, fd_start, fd_end) {
path = PATH.normalize(path);
flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
mode = typeof mode === 'undefined' ? 0666 : mode;
if ((flags & 512)) {
mode = (mode & 4095) | 0100000;
} else {
mode = 0;
}
var node;
try {
var lookup = FS.lookupPath(path, {
follow: !(flags & 0200000)
});
node = lookup.node;
path = lookup.path;
} catch (e) {
// ignore
}
// perhaps we need to create the node
if ((flags & 512)) {
if (node) {
// if O_CREAT and O_EXCL are set, error out if the node already exists
if ((flags & 2048)) {
throw new FS.ErrnoError(ERRNO_CODES.EEXIST);
}
} else {
// node doesn't exist, try to create it
node = FS.mknod(path, mode, 0);
}
}
if (!node) {
throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
}
// can't truncate a device
if (FS.isChrdev(node.mode)) {
flags &= ~1024;
}
// check permissions
var err = FS.mayOpen(node, flags);
if (err) {
throw new FS.ErrnoError(err);
}
// do truncation if necessary
if ((flags & 1024)) {
FS.truncate(node, 0);
}
// register the stream with the filesystem
var stream = FS.createStream({
path: path,
node: node,
flags: flags,
seekable: true,
position: 0,
stream_ops: node.stream_ops,
// used by the file family libc calls (fopen, fwrite, ferror, etc.)
ungotten: [],
error: false
}, fd_start, fd_end);
// call the new stream's open function
if (stream.stream_ops.open) {
stream.stream_ops.open(stream);
}
return stream;
},close:function (stream) {
try {
if (stream.stream_ops.close) {
stream.stream_ops.close(stream);
}
} catch (e) {
throw e;
} finally {
FS.closeStream(stream.fd);
}
},llseek:function (stream, offset, whence) {
if (!stream.seekable || !stream.stream_ops.llseek) {
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
}
return stream.stream_ops.llseek(stream, offset, whence);
},read:function (stream, buffer, offset, length, position) {
if (length < 0 || position < 0) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
if ((stream.flags & 3) === 1) {
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
}
if (FS.isDir(stream.node.mode)) {
throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
}
if (!stream.stream_ops.read) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
var seeking = true;
if (typeof position === 'undefined') {
position = stream.position;
seeking = false;
} else if (!stream.seekable) {
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
}
var bytesRead = stream.stream_ops.read(stream, buffer, offset, length, position);
if (!seeking) stream.position += bytesRead;
return bytesRead;
},write:function (stream, buffer, offset, length, position, canOwn) {
if (length < 0 || position < 0) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
if ((stream.flags & 3) === 0) {
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
}
if (FS.isDir(stream.node.mode)) {
throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
}
if (!stream.stream_ops.write) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
var seeking = true;
if (typeof position === 'undefined') {
position = stream.position;
seeking = false;
} else if (!stream.seekable) {
throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
}
if (stream.flags & 8) {
// seek to the end before writing in append mode
FS.llseek(stream, 0, 2);
}
var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
if (!seeking) stream.position += bytesWritten;
return bytesWritten;
},allocate:function (stream, offset, length) {
if (offset < 0 || length <= 0) {
throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
}
if ((stream.flags & 3) === 0) {
throw new FS.ErrnoError(ERRNO_CODES.EBADF);
}
if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {
throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
}
if (!stream.stream_ops.allocate) {
throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
}
stream.stream_ops.allocate(stream, offset, length);
},mmap:function (stream, buffer, offset, length, position, prot, flags) {
// TODO if PROT is PROT_WRITE, make sure we have write access
if ((stream.flags & 3) === 1) {
throw new FS.ErrnoError(ERRNO_CODES.EACCES);
}
if (!stream.stream_ops.mmap) {
throw new FS.errnoError(ERRNO_CODES.ENODEV);
}
return stream.stream_ops.mmap(stream, buffer, offset, length, position, prot, flags);
}};
function _send(fd, buf, len, flags) {
var info = FS.getStream(fd);
if (!info) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
}
if (info.socket.readyState === WebSocket.CLOSING || info.socket.readyState === WebSocket.CLOSED) {
___setErrNo(ERRNO_CODES.ENOTCONN);
return -1;
} else if (info.socket.readyState === WebSocket.CONNECTING) {
___setErrNo(ERRNO_CODES.EAGAIN);
return -1;
}
info.sender(HEAPU8.subarray(buf, buf+len));
return len;
}
function _pwrite(fildes, buf, nbyte, offset) {
// ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html
var stream = FS.getStream(fildes);
if (!stream) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
}
try {
var slab = HEAP8;
return FS.write(stream, slab, buf, nbyte, offset);
} catch (e) {
FS.handleFSError(e);
return -1;
}
}function _write(fildes, buf, nbyte) {
// ssize_t write(int fildes, const void *buf, size_t nbyte);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/write.html
var stream = FS.getStream(fildes);
if (!stream) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
}
if (stream && ('socket' in stream)) {
return _send(fildes, buf, nbyte, 0);
}
try {
var slab = HEAP8;
return FS.write(stream, slab, buf, nbyte);
} catch (e) {
FS.handleFSError(e);
return -1;
}
}function _fwrite(ptr, size, nitems, stream) {
// size_t fwrite(const void *restrict ptr, size_t size, size_t nitems, FILE *restrict stream);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/fwrite.html
var bytesToWrite = nitems * size;
if (bytesToWrite == 0) return 0;
var bytesWritten = _write(stream, ptr, bytesToWrite);
if (bytesWritten == -1) {
var streamObj = FS.getStream(stream);
if (streamObj) streamObj.error = true;
return 0;
} else {
return Math.floor(bytesWritten / size);
}
}
function _strlen(ptr) {
ptr = ptr|0;
var curr = 0;
curr = ptr;
while (HEAP8[(curr)]) {
curr = (curr + 1)|0;
}
return (curr - ptr)|0;
}
function __reallyNegative(x) {
return x < 0 || (x === 0 && (1/x) === -Infinity);
}function __formatString(format, varargs) {
var textIndex = format;
var argIndex = 0;
function getNextArg(type) {
// NOTE: Explicitly ignoring type safety. Otherwise this fails:
// int x = 4; printf("%c\n", (char)x);
var ret;
if (type === 'double') {
ret = HEAPF64[(((varargs)+(argIndex))>>3)];
} else if (type == 'i64') {
ret = [HEAP32[(((varargs)+(argIndex))>>2)],
HEAP32[(((varargs)+(argIndex+8))>>2)]];
argIndex += 8; // each 32-bit chunk is in a 64-bit block
} else {
type = 'i32'; // varargs are always i32, i64, or double
ret = HEAP32[(((varargs)+(argIndex))>>2)];
}
argIndex += Math.max(Runtime.getNativeFieldSize(type), Runtime.getAlignSize(type, null, true));
return ret;
}
var ret = [];
var curr, next, currArg;
while(1) {
var startTextIndex = textIndex;
curr = HEAP8[(textIndex)];
if (curr === 0) break;
next = HEAP8[((textIndex+1)|0)];
if (curr == 37) {
// Handle flags.
var flagAlwaysSigned = false;
var flagLeftAlign = false;
var flagAlternative = false;
var flagZeroPad = false;
flagsLoop: while (1) {
switch (next) {
case 43:
flagAlwaysSigned = true;
break;
case 45:
flagLeftAlign = true;
break;
case 35:
flagAlternative = true;
break;
case 48:
if (flagZeroPad) {
break flagsLoop;
} else {
flagZeroPad = true;
break;
}
default:
break flagsLoop;
}
textIndex++;
next = HEAP8[((textIndex+1)|0)];
}
// Handle width.
var width = 0;
if (next == 42) {
width = getNextArg('i32');
textIndex++;
next = HEAP8[((textIndex+1)|0)];
} else {
while (next >= 48 && next <= 57) {
width = width * 10 + (next - 48);
textIndex++;
next = HEAP8[((textIndex+1)|0)];
}
}
// Handle precision.
var precisionSet = false;
if (next == 46) {
var precision = 0;
precisionSet = true;
textIndex++;
next = HEAP8[((textIndex+1)|0)];
if (next == 42) {
precision = getNextArg('i32');
textIndex++;
} else {
while(1) {
var precisionChr = HEAP8[((textIndex+1)|0)];
if (precisionChr < 48 ||
precisionChr > 57) break;
precision = precision * 10 + (precisionChr - 48);
textIndex++;
}
}
next = HEAP8[((textIndex+1)|0)];
} else {
var precision = 6; // Standard default.
}
// Handle integer sizes. WARNING: These assume a 32-bit architecture!
var argSize;
switch (String.fromCharCode(next)) {
case 'h':
var nextNext = HEAP8[((textIndex+2)|0)];
if (nextNext == 104) {
textIndex++;
argSize = 1; // char (actually i32 in varargs)
} else {
argSize = 2; // short (actually i32 in varargs)
}
break;
case 'l':
var nextNext = HEAP8[((textIndex+2)|0)];
if (nextNext == 108) {
textIndex++;
argSize = 8; // long long
} else {
argSize = 4; // long
}
break;
case 'L': // long long
case 'q': // int64_t
case 'j': // intmax_t
argSize = 8;
break;
case 'z': // size_t
case 't': // ptrdiff_t
case 'I': // signed ptrdiff_t or unsigned size_t
argSize = 4;
break;
default:
argSize = null;
}
if (argSize) textIndex++;
next = HEAP8[((textIndex+1)|0)];
// Handle type specifier.
switch (String.fromCharCode(next)) {
case 'd': case 'i': case 'u': case 'o': case 'x': case 'X': case 'p': {
// Integer.
var signed = next == 100 || next == 105;
argSize = argSize || 4;
var currArg = getNextArg('i' + (argSize * 8));
var origArg = currArg;
var argText;
// Flatten i64-1 [low, high] into a (slightly rounded) double
if (argSize == 8) {
currArg = Runtime.makeBigInt(currArg[0], currArg[1], next == 117);
}
// Truncate to requested size.
if (argSize <= 4) {
var limit = Math.pow(256, argSize) - 1;
currArg = (signed ? reSign : unSign)(currArg & limit, argSize * 8);
}
// Format the number.
var currAbsArg = Math.abs(currArg);
var prefix = '';
if (next == 100 || next == 105) {
if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], null); else
argText = reSign(currArg, 8 * argSize, 1).toString(10);
} else if (next == 117) {
if (argSize == 8 && i64Math) argText = i64Math.stringify(origArg[0], origArg[1], true); else
argText = unSign(currArg, 8 * argSize, 1).toString(10);
currArg = Math.abs(currArg);
} else if (next == 111) {
argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);
} else if (next == 120 || next == 88) {
prefix = (flagAlternative && currArg != 0) ? '0x' : '';
if (argSize == 8 && i64Math) {
if (origArg[1]) {
argText = (origArg[1]>>>0).toString(16);
var lower = (origArg[0]>>>0).toString(16);
while (lower.length < 8) lower = '0' + lower;
argText += lower;
} else {
argText = (origArg[0]>>>0).toString(16);
}
} else
if (currArg < 0) {
// Represent negative numbers in hex as 2's complement.
currArg = -currArg;
argText = (currAbsArg - 1).toString(16);
var buffer = [];
for (var i = 0; i < argText.length; i++) {
buffer.push((0xF - parseInt(argText[i], 16)).toString(16));
}
argText = buffer.join('');
while (argText.length < argSize * 2) argText = 'f' + argText;
} else {
argText = currAbsArg.toString(16);
}
if (next == 88) {
prefix = prefix.toUpperCase();
argText = argText.toUpperCase();
}
} else if (next == 112) {
if (currAbsArg === 0) {
argText = '(nil)';
} else {
prefix = '0x';
argText = currAbsArg.toString(16);
}
}
if (precisionSet) {
while (argText.length < precision) {
argText = '0' + argText;
}
}
// Add sign if needed
if (flagAlwaysSigned) {
if (currArg < 0) {
prefix = '-' + prefix;
} else {
prefix = '+' + prefix;
}
}
// Add padding.
while (prefix.length + argText.length < width) {
if (flagLeftAlign) {
argText += ' ';
} else {
if (flagZeroPad) {
argText = '0' + argText;
} else {
prefix = ' ' + prefix;
}
}
}
// Insert the result into the buffer.
argText = prefix + argText;
argText.split('').forEach(function(chr) {
ret.push(chr.charCodeAt(0));
});
break;
}
case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': {
// Float.
var currArg = getNextArg('double');
var argText;
if (isNaN(currArg)) {
argText = 'nan';
flagZeroPad = false;
} else if (!isFinite(currArg)) {
argText = (currArg < 0 ? '-' : '') + 'inf';
flagZeroPad = false;
} else {
var isGeneral = false;
var effectivePrecision = Math.min(precision, 20);
// Convert g/G to f/F or e/E, as per:
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html
if (next == 103 || next == 71) {
isGeneral = true;
precision = precision || 1;
var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);
if (precision > exponent && exponent >= -4) {
next = ((next == 103) ? 'f' : 'F').charCodeAt(0);
precision -= exponent + 1;
} else {
next = ((next == 103) ? 'e' : 'E').charCodeAt(0);
precision--;
}
effectivePrecision = Math.min(precision, 20);
}
if (next == 101 || next == 69) {
argText = currArg.toExponential(effectivePrecision);
// Make sure the exponent has at least 2 digits.
if (/[eE][-+]\d$/.test(argText)) {
argText = argText.slice(0, -1) + '0' + argText.slice(-1);
}
} else if (next == 102 || next == 70) {
argText = currArg.toFixed(effectivePrecision);
if (currArg === 0 && __reallyNegative(currArg)) {
argText = '-' + argText;
}
}
var parts = argText.split('e');
if (isGeneral && !flagAlternative) {
// Discard trailing zeros and periods.
while (parts[0].length > 1 && parts[0].indexOf('.') != -1 &&
(parts[0].slice(-1) == '0' || parts[0].slice(-1) == '.')) {
parts[0] = parts[0].slice(0, -1);
}
} else {
// Make sure we have a period in alternative mode.
if (flagAlternative && argText.indexOf('.') == -1) parts[0] += '.';
// Zero pad until required precision.
while (precision > effectivePrecision++) parts[0] += '0';
}
argText = parts[0] + (parts.length > 1 ? 'e' + parts[1] : '');
// Capitalize 'E' if needed.
if (next == 69) argText = argText.toUpperCase();
// Add sign.
if (flagAlwaysSigned && currArg >= 0) {
argText = '+' + argText;
}
}
// Add padding.
while (argText.length < width) {
if (flagLeftAlign) {
argText += ' ';
} else {
if (flagZeroPad && (argText[0] == '-' || argText[0] == '+')) {
argText = argText[0] + '0' + argText.slice(1);
} else {
argText = (flagZeroPad ? '0' : ' ') + argText;
}
}
}
// Adjust case.
if (next < 97) argText = argText.toUpperCase();
// Insert the result into the buffer.
argText.split('').forEach(function(chr) {
ret.push(chr.charCodeAt(0));
});
break;
}
case 's': {
// String.
var arg = getNextArg('i8*');
var argLength = arg ? _strlen(arg) : '(null)'.length;
if (precisionSet) argLength = Math.min(argLength, precision);
if (!flagLeftAlign) {
while (argLength < width--) {
ret.push(32);
}
}
if (arg) {
for (var i = 0; i < argLength; i++) {
ret.push(HEAPU8[((arg++)|0)]);
}
} else {
ret = ret.concat(intArrayFromString('(null)'.substr(0, argLength), true));
}
if (flagLeftAlign) {
while (argLength < width--) {
ret.push(32);
}
}
break;
}
case 'c': {
// Character.
if (flagLeftAlign) ret.push(getNextArg('i8'));
while (--width > 0) {
ret.push(32);
}
if (!flagLeftAlign) ret.push(getNextArg('i8'));
break;
}
case 'n': {
// Write the length written so far to the next parameter.
var ptr = getNextArg('i32*');
HEAP32[((ptr)>>2)]=ret.length
break;
}
case '%': {
// Literal percent sign.
ret.push(curr);
break;
}
default: {
// Unknown specifiers remain untouched.
for (var i = startTextIndex; i < textIndex + 2; i++) {
ret.push(HEAP8[(i)]);
}
}
}
textIndex += 2;
// TODO: Support a/A (hex float) and m (last error) specifiers.
// TODO: Support %1${specifier} for arg selection.
} else {
ret.push(curr);
textIndex += 1;
}
}
return ret;
}function _fprintf(stream, format, varargs) {
// int fprintf(FILE *restrict stream, const char *restrict format, ...);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html
var result = __formatString(format, varargs);
var stack = Runtime.stackSave();
var ret = _fwrite(allocate(result, 'i8', ALLOC_STACK), 1, result.length, stream);
Runtime.stackRestore(stack);
return ret;
}function _printf(format, varargs) {
// int printf(const char *restrict format, ...);
// http://pubs.opengroup.org/onlinepubs/000095399/functions/printf.html
var stdout = HEAP32[((_stdout)>>2)];
return _fprintf(stdout, format, varargs);
}
function _abort() {
Module['abort']();
}
function ___errno_location() {
return ___errno_state;
}var ___errno=___errno_location;
function _memcpy(dest, src, num) {
dest = dest|0; src = src|0; num = num|0;
var ret = 0;
ret = dest|0;
if ((dest&3) == (src&3)) {
while (dest & 3) {
if ((num|0) == 0) return ret|0;
HEAP8[(dest)]=HEAP8[(src)];
dest = (dest+1)|0;
src = (src+1)|0;
num = (num-1)|0;
}
while ((num|0) >= 4) {
HEAP32[((dest)>>2)]=HEAP32[((src)>>2)];
dest = (dest+4)|0;
src = (src+4)|0;
num = (num-4)|0;
}
}
while ((num|0) > 0) {
HEAP8[(dest)]=HEAP8[(src)];
dest = (dest+1)|0;
src = (src+1)|0;
num = (num-1)|0;
}
return ret|0;
}var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;
function _sbrk(bytes) {
// Implement a Linux-like 'memory area' for our 'process'.
// Changes the size of the memory area by |bytes|; returns the
// address of the previous top ('break') of the memory area
// We control the "dynamic" memory - DYNAMIC_BASE to DYNAMICTOP
var self = _sbrk;
if (!self.called) {
DYNAMICTOP = alignMemoryPage(DYNAMICTOP); // make sure we start out aligned
self.called = true;
assert(Runtime.dynamicAlloc);
self.alloc = Runtime.dynamicAlloc;
Runtime.dynamicAlloc = function() { abort('cannot dynamically allocate, sbrk now has control') };
}
var ret = DYNAMICTOP;
if (bytes != 0) self.alloc(bytes);
return ret; // Previous break location.
}
function _sysconf(name) {
// long sysconf(int name);
// http://pubs.opengroup.org/onlinepubs/009695399/functions/sysconf.html
switch(name) {
case 8: return PAGE_SIZE;
case 54:
case 56:
case 21:
case 61:
case 63:
case 22:
case 67:
case 23:
case 24:
case 25:
case 26:
case 27:
case 69:
case 28:
case 101:
case 70:
case 71:
case 29:
case 30:
case 199:
case 75:
case 76:
case 32:
case 43:
case 44:
case 80:
case 46:
case 47:
case 45:
case 48:
case 49:
case 42:
case 82:
case 33:
case 7:
case 108:
case 109:
case 107:
case 112:
case 119:
case 121:
return 200809;
case 13:
case 104:
case 94:
case 95:
case 34:
case 35:
case 77:
case 81:
case 83:
case 84:
case 85:
case 86:
case 87:
case 88:
case 89:
case 90:
case 91:
case 94:
case 95:
case 110:
case 111:
case 113:
case 114:
case 115:
case 116:
case 117:
case 118:
case 120:
case 40:
case 16:
case 79:
case 19:
return -1;
case 92:
case 93:
case 5:
case 72:
case 6:
case 74:
case 92:
case 93:
case 96:
case 97:
case 98:
case 99:
case 102:
case 103:
case 105:
return 1;
case 38:
case 66:
case 50:
case 51:
case 4:
return 1024;
case 15:
case 64:
case 41:
return 32;
case 55:
case 37:
case 17:
return 2147483647;
case 18:
case 1:
return 47839;
case 59:
case 57:
return 99;
case 68:
case 58:
return 2048;
case 0: return 2097152;
case 3: return 65536;
case 14: return 32768;
case 73: return 32767;
case 39: return 16384;
case 60: return 1000;
case 106: return 700;
case 52: return 256;
case 62: return 255;
case 2: return 100;
case 65: return 64;
case 36: return 20;
case 100: return 16;
case 20: return 6;
case 53: return 4;
case 10: return 1;
}
___setErrNo(ERRNO_CODES.EINVAL);
return -1;
}
function _time(ptr) {
var ret = Math.floor(Date.now()/1000);
if (ptr) {
HEAP32[((ptr)>>2)]=ret
}
return ret;
}
function _memset(ptr, value, num) {
ptr = ptr|0; value = value|0; num = num|0;
var stop = 0, value4 = 0, stop4 = 0, unaligned = 0;
stop = (ptr + num)|0;
if ((num|0) >= 20) {
// This is unaligned, but quite large, so work hard to get to aligned settings
value = value & 0xff;
unaligned = ptr & 3;
value4 = value | (value << 8) | (value << 16) | (value << 24);
stop4 = stop & ~3;
if (unaligned) {
unaligned = (ptr + 4 - unaligned)|0;
while ((ptr|0) < (unaligned|0)) { // no need to check for stop, since we have large num
HEAP8[(ptr)]=value;
ptr = (ptr+1)|0;
}
}
while ((ptr|0) < (stop4|0)) {
HEAP32[((ptr)>>2)]=value4;
ptr = (ptr+4)|0;
}
}
while ((ptr|0) < (stop|0)) {
HEAP8[(ptr)]=value;
ptr = (ptr+1)|0;
}
}
var Browser={mainLoop:{scheduler:null,shouldPause:false,paused:false,queue:[],pause:function () {
Browser.mainLoop.shouldPause = true;
},resume:function () {
if (Browser.mainLoop.paused) {
Browser.mainLoop.paused = false;
Browser.mainLoop.scheduler();
}
Browser.mainLoop.shouldPause = false;
},updateStatus:function () {
if (Module['setStatus']) {
var message = Module['statusMessage'] || 'Please wait...';
var remaining = Browser.mainLoop.remainingBlockers;
var expected = Browser.mainLoop.expectedBlockers;
if (remaining) {
if (remaining < expected) {
Module['setStatus'](message + ' (' + (expected - remaining) + '/' + expected + ')');
} else {
Module['setStatus'](message);
}
} else {
Module['setStatus']('');
}
}
}},isFullScreen:false,pointerLock:false,moduleContextCreatedCallbacks:[],workers:[],init:function () {
if (!Module["preloadPlugins"]) Module["preloadPlugins"] = []; // needs to exist even in workers
if (Browser.initted || ENVIRONMENT_IS_WORKER) return;
Browser.initted = true;
try {
new Blob();
Browser.hasBlobConstructor = true;
} catch(e) {
Browser.hasBlobConstructor = false;
console.log("warning: no blob constructor, cannot create blobs with mimetypes");
}
Browser.BlobBuilder = typeof MozBlobBuilder != "undefined" ? MozBlobBuilder : (typeof WebKitBlobBuilder != "undefined" ? WebKitBlobBuilder : (!Browser.hasBlobConstructor ? console.log("warning: no BlobBuilder") : null));
Browser.URLObject = typeof window != "undefined" ? (window.URL ? window.URL : window.webkitURL) : undefined;
if (!Module.noImageDecoding && typeof Browser.URLObject === 'undefined') {
console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available.");
Module.noImageDecoding = true;
}
// Support for plugins that can process preloaded files. You can add more of these to
// your app by creating and appending to Module.preloadPlugins.
//
// Each plugin is asked if it can handle a file based on the file's name. If it can,
// it is given the file's raw data. When it is done, it calls a callback with the file's
// (possibly modified) data. For example, a plugin might decompress a file, or it
// might create some side data structure for use later (like an Image element, etc.).
var imagePlugin = {};
imagePlugin['canHandle'] = function(name) {
return !Module.noImageDecoding && /\.(jpg|jpeg|png|bmp)$/i.test(name);
};
imagePlugin['handle'] = function(byteArray, name, onload, onerror) {
var b = null;
if (Browser.hasBlobConstructor) {
try {
b = new Blob([byteArray], { type: Browser.getMimetype(name) });
if (b.size !== byteArray.length) { // Safari bug #118630
// Safari's Blob can only take an ArrayBuffer
b = new Blob([(new Uint8Array(byteArray)).buffer], { type: Browser.getMimetype(name) });
}
} catch(e) {
Runtime.warnOnce('Blob constructor present but fails: ' + e + '; falling back to blob builder');
}
}
if (!b) {
var bb = new Browser.BlobBuilder();
bb.append((new Uint8Array(byteArray)).buffer); // we need to pass a buffer, and must copy the array to get the right data range
b = bb.getBlob();
}
var url = Browser.URLObject.createObjectURL(b);
assert(typeof url == 'string', 'createObjectURL must return a url as a string');
var img = new Image();
img.onload = function() {
assert(img.complete, 'Image ' + name + ' could not be decoded');
var canvas = document.createElement('canvas');
canvas.width = img.width;
canvas.height = img.height;
var ctx = canvas.getContext('2d');
ctx.drawImage(img, 0, 0);
Module["preloadedImages"][name] = canvas;
Browser.URLObject.revokeObjectURL(url);
if (onload) onload(byteArray);
};
img.onerror = function(event) {
console.log('Image ' + url + ' could not be decoded');
if (onerror) onerror();
};
img.src = url;
};
Module['preloadPlugins'].push(imagePlugin);
var audioPlugin = {};
audioPlugin['canHandle'] = function(name) {
return !Module.noAudioDecoding && name.substr(-4) in { '.ogg': 1, '.wav': 1, '.mp3': 1 };
};
audioPlugin['handle'] = function(byteArray, name, onload, onerror) {
var done = false;
function finish(audio) {
if (done) return;
done = true;
Module["preloadedAudios"][name] = audio;
if (onload) onload(byteArray);
}
function fail() {
if (done) return;
done = true;
Module["preloadedAudios"][name] = new Audio(); // empty shim
if (onerror) onerror();
}
if (Browser.hasBlobConstructor) {
try {
var b = new Blob([byteArray], { type: Browser.getMimetype(name) });
} catch(e) {
return fail();
}
var url = Browser.URLObject.createObjectURL(b); // XXX we never revoke this!
assert(typeof url == 'string', 'createObjectURL must return a url as a string');
var audio = new Audio();
audio.addEventListener('canplaythrough', function() { finish(audio) }, false); // use addEventListener due to chromium bug 124926
audio.onerror = function(event) {
if (done) return;
console.log('warning: browser could not fully decode audio ' + name + ', trying slower base64 approach');
function encode64(data) {
var BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var PAD = '=';
var ret = '';
var leftchar = 0;
var leftbits = 0;
for (var i = 0; i < data.length; i++) {
leftchar = (leftchar << 8) | data[i];
leftbits += 8;
while (leftbits >= 6) {
var curr = (leftchar >> (leftbits-6)) & 0x3f;
leftbits -= 6;
ret += BASE[curr];
}
}
if (leftbits == 2) {
ret += BASE[(leftchar&3) << 4];
ret += PAD + PAD;
} else if (leftbits == 4) {
ret += BASE[(leftchar&0xf) << 2];
ret += PAD;
}
return ret;
}
audio.src = 'data:audio/x-' + name.substr(-3) + ';base64,' + encode64(byteArray);
finish(audio); // we don't wait for confirmation this worked - but it's worth trying
};
audio.src = url;
// workaround for chrome bug 124926 - we do not always get oncanplaythrough or onerror
Browser.safeSetTimeout(function() {
finish(audio); // try to use it even though it is not necessarily ready to play
}, 10000);
} else {
return fail();
}
};
Module['preloadPlugins'].push(audioPlugin);
// Canvas event setup
var canvas = Module['canvas'];
canvas.requestPointerLock = canvas['requestPointerLock'] ||
canvas['mozRequestPointerLock'] ||
canvas['webkitRequestPointerLock'];
canvas.exitPointerLock = document['exitPointerLock'] ||
document['mozExitPointerLock'] ||
document['webkitExitPointerLock'] ||
function(){}; // no-op if function does not exist
canvas.exitPointerLock = canvas.exitPointerLock.bind(document);
function pointerLockChange() {
Browser.pointerLock = document['pointerLockElement'] === canvas ||
document['mozPointerLockElement'] === canvas ||
document['webkitPointerLockElement'] === canvas;
}
document.addEventListener('pointerlockchange', pointerLockChange, false);
document.addEventListener('mozpointerlockchange', pointerLockChange, false);
document.addEventListener('webkitpointerlockchange', pointerLockChange, false);
if (Module['elementPointerLock']) {
canvas.addEventListener("click", function(ev) {
if (!Browser.pointerLock && canvas.requestPointerLock) {
canvas.requestPointerLock();
ev.preventDefault();
}
}, false);
}
},createContext:function (canvas, useWebGL, setInModule) {
var ctx;
try {
if (useWebGL) {
ctx = canvas.getContext('experimental-webgl', {
alpha: false
});
} else {
ctx = canvas.getContext('2d');
}
if (!ctx) throw ':(';
} catch (e) {
Module.print('Could not create canvas - ' + e);
return null;
}
if (useWebGL) {
// Set the background of the WebGL canvas to black
canvas.style.backgroundColor = "black";
// Warn on context loss
canvas.addEventListener('webglcontextlost', function(event) {
alert('WebGL context lost. You will need to reload the page.');
}, false);
}
if (setInModule) {
Module.ctx = ctx;
Module.useWebGL = useWebGL;
Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() });
Browser.init();
}
return ctx;
},destroyContext:function (canvas, useWebGL, setInModule) {},fullScreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullScreen:function (lockPointer, resizeCanvas) {
Browser.lockPointer = lockPointer;
Browser.resizeCanvas = resizeCanvas;
if (typeof Browser.lockPointer === 'undefined') Browser.lockPointer = true;
if (typeof Browser.resizeCanvas === 'undefined') Browser.resizeCanvas = false;
var canvas = Module['canvas'];
function fullScreenChange() {
Browser.isFullScreen = false;
if ((document['webkitFullScreenElement'] || document['webkitFullscreenElement'] ||
document['mozFullScreenElement'] || document['mozFullscreenElement'] ||
document['fullScreenElement'] || document['fullscreenElement']) === canvas) {
canvas.cancelFullScreen = document['cancelFullScreen'] ||
document['mozCancelFullScreen'] ||
document['webkitCancelFullScreen'];
canvas.cancelFullScreen = canvas.cancelFullScreen.bind(document);
if (Browser.lockPointer) canvas.requestPointerLock();
Browser.isFullScreen = true;
if (Browser.resizeCanvas) Browser.setFullScreenCanvasSize();
} else if (Browser.resizeCanvas){
Browser.setWindowedCanvasSize();
}
if (Module['onFullScreen']) Module['onFullScreen'](Browser.isFullScreen);
}
if (!Browser.fullScreenHandlersInstalled) {
Browser.fullScreenHandlersInstalled = true;
document.addEventListener('fullscreenchange', fullScreenChange, false);
document.addEventListener('mozfullscreenchange', fullScreenChange, false);
document.addEventListener('webkitfullscreenchange', fullScreenChange, false);
}
canvas.requestFullScreen = canvas['requestFullScreen'] ||
canvas['mozRequestFullScreen'] ||
(canvas['webkitRequestFullScreen'] ? function() { canvas['webkitRequestFullScreen'](Element['ALLOW_KEYBOARD_INPUT']) } : null);
canvas.requestFullScreen();
},requestAnimationFrame:function (func) {
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = window['requestAnimationFrame'] ||
window['mozRequestAnimationFrame'] ||
window['webkitRequestAnimationFrame'] ||
window['msRequestAnimationFrame'] ||
window['oRequestAnimationFrame'] ||
window['setTimeout'];
}
window.requestAnimationFrame(func);
},safeCallback:function (func) {
return function() {
if (!ABORT) return func.apply(null, arguments);
};
},safeRequestAnimationFrame:function (func) {
return Browser.requestAnimationFrame(function() {
if (!ABORT) func();
});
},safeSetTimeout:function (func, timeout) {
return setTimeout(function() {
if (!ABORT) func();
}, timeout);
},safeSetInterval:function (func, timeout) {
return setInterval(function() {
if (!ABORT) func();
}, timeout);
},getMimetype:function (name) {
return {
'jpg': 'image/jpeg',
'jpeg': 'image/jpeg',
'png': 'image/png',
'bmp': 'image/bmp',
'ogg': 'audio/ogg',
'wav': 'audio/wav',
'mp3': 'audio/mpeg'
}[name.substr(name.lastIndexOf('.')+1)];
},getUserMedia:function (func) {
if(!window.getUserMedia) {
window.getUserMedia = navigator['getUserMedia'] ||
navigator['mozGetUserMedia'];
}
window.getUserMedia(func);
},getMovementX:function (event) {
return event['movementX'] ||
event['mozMovementX'] ||
event['webkitMovementX'] ||
0;
},getMovementY:function (event) {
return event['movementY'] ||
event['mozMovementY'] ||
event['webkitMovementY'] ||
0;
},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function (event) { // event should be mousemove, mousedown or mouseup
if (Browser.pointerLock) {
// When the pointer is locked, calculate the coordinates
// based on the movement of the mouse.
// Workaround for Firefox bug 764498
if (event.type != 'mousemove' &&
('mozMovementX' in event)) {
Browser.mouseMovementX = Browser.mouseMovementY = 0;
} else {
Browser.mouseMovementX = Browser.getMovementX(event);
Browser.mouseMovementY = Browser.getMovementY(event);
}
// check if SDL is available
if (typeof SDL != "undefined") {
Browser.mouseX = SDL.mouseX + Browser.mouseMovementX;
Browser.mouseY = SDL.mouseY + Browser.mouseMovementY;
} else {
// just add the mouse delta to the current absolut mouse position
// FIXME: ideally this should be clamped against the canvas size and zero
Browser.mouseX += Browser.mouseMovementX;
Browser.mouseY += Browser.mouseMovementY;
}
} else {
// Otherwise, calculate the movement based on the changes
// in the coordinates.
var rect = Module["canvas"].getBoundingClientRect();
var x, y;
if (event.type == 'touchstart' ||
event.type == 'touchend' ||
event.type == 'touchmove') {
var t = event.touches.item(0);
if (t) {
x = t.pageX - (window.scrollX + rect.left);
y = t.pageY - (window.scrollY + rect.top);
} else {
return;
}
} else {
x = event.pageX - (window.scrollX + rect.left);
y = event.pageY - (window.scrollY + rect.top);
}
// the canvas might be CSS-scaled compared to its backbuffer;
// SDL-using content will want mouse coordinates in terms
// of backbuffer units.
var cw = Module["canvas"].width;
var ch = Module["canvas"].height;
x = x * (cw / rect.width);
y = y * (ch / rect.height);
Browser.mouseMovementX = x - Browser.mouseX;
Browser.mouseMovementY = y - Browser.mouseY;
Browser.mouseX = x;
Browser.mouseY = y;
}
},xhrLoad:function (url, onload, onerror) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'arraybuffer';
xhr.onload = function() {
if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { // file URLs can return 0
onload(xhr.response);
} else {
onerror();
}
};
xhr.onerror = onerror;
xhr.send(null);
},asyncLoad:function (url, onload, onerror, noRunDep) {
Browser.xhrLoad(url, function(arrayBuffer) {
assert(arrayBuffer, 'Loading data file "' + url + '" failed (no arrayBuffer).');
onload(new Uint8Array(arrayBuffer));
if (!noRunDep) removeRunDependency('al ' + url);
}, function(event) {
if (onerror) {
onerror();
} else {
throw 'Loading data file "' + url + '" failed.';
}
});
if (!noRunDep) addRunDependency('al ' + url);
},resizeListeners:[],updateResizeListeners:function () {
var canvas = Module['canvas'];
Browser.resizeListeners.forEach(function(listener) {
listener(canvas.width, canvas.height);
});
},setCanvasSize:function (width, height, noUpdates) {
var canvas = Module['canvas'];
canvas.width = width;
canvas.height = height;
if (!noUpdates) Browser.updateResizeListeners();
},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function () {
var canvas = Module['canvas'];
this.windowedWidth = canvas.width;
this.windowedHeight = canvas.height;
canvas.width = screen.width;
canvas.height = screen.height;
// check if SDL is available
if (typeof SDL != "undefined") {
var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
flags = flags | 0x00800000; // set SDL_FULLSCREEN flag
HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
}
Browser.updateResizeListeners();
},setWindowedCanvasSize:function () {
var canvas = Module['canvas'];
canvas.width = this.windowedWidth;
canvas.height = this.windowedHeight;
// check if SDL is available
if (typeof SDL != "undefined") {
var flags = HEAPU32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)];
flags = flags & ~0x00800000; // clear SDL_FULLSCREEN flag
HEAP32[((SDL.screen+Runtime.QUANTUM_SIZE*0)>>2)]=flags
}
Browser.updateResizeListeners();
}};
FS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });__ATEXIT__.push({ func: function() { FS.quit() } });Module["FS_createFolder"] = FS.createFolder;Module["FS_createPath"] = FS.createPath;Module["FS_createDataFile"] = FS.createDataFile;Module["FS_createPreloadedFile"] = FS.createPreloadedFile;Module["FS_createLazyFile"] = FS.createLazyFile;Module["FS_createLink"] = FS.createLink;Module["FS_createDevice"] = FS.createDevice;
___errno_state = Runtime.staticAlloc(4); HEAP32[((___errno_state)>>2)]=0;
__ATINIT__.unshift({ func: function() { TTY.init() } });__ATEXIT__.push({ func: function() { TTY.shutdown() } });TTY.utf8 = new Runtime.UTF8Processor();
Module["requestFullScreen"] = function(lockPointer, resizeCanvas) { Browser.requestFullScreen(lockPointer, resizeCanvas) };
Module["requestAnimationFrame"] = function(func) { Browser.requestAnimationFrame(func) };
Module["setCanvasSize"] = function(width, height, noUpdates) { Browser.setCanvasSize(width, height, noUpdates) };
Module["pauseMainLoop"] = function() { Browser.mainLoop.pause() };
Module["resumeMainLoop"] = function() { Browser.mainLoop.resume() };
Module["getUserMedia"] = function() { Browser.getUserMedia() }
STACK_BASE = STACKTOP = Runtime.alignMemory(STATICTOP);
staticSealed = true; // seal the static portion of memory
STACK_MAX = STACK_BASE + 5242880;
DYNAMIC_BASE = DYNAMICTOP = Runtime.alignMemory(STACK_MAX);
assert(DYNAMIC_BASE < TOTAL_MEMORY); // Stack must fit in TOTAL_MEMORY; allocations from here on may enlarge TOTAL_MEMORY
var FUNCTION_TABLE = [0, 0];
// EMSCRIPTEN_START_FUNCS
function _main() {
var label = 0;
var tempVarArgs = 0;
var sp = STACKTOP; (assert((STACKTOP|0) < (STACK_MAX|0))|0);
var $1;
var $t;
$1=0;
var $2=_malloc(6);
var $3=$2;
$t=$3;
var $4=$t;
var $5=(($4)|0);
tempBigInt=4;HEAP8[($5)]=tempBigInt&0xff;tempBigInt = tempBigInt>>8;HEAP8[((($5)+(1))|0)]=tempBigInt&0xff;
var $6=$t;
var $7=(($6+2)|0);
var $8=(($7)|0);
var $9=(($8)|0);
HEAP32[(($9)>>2)]=100;
var $10=$t;
var $11=(($10)|0);
var $12=((tempInt=(HEAPU8[($11)])|(HEAPU8[((($11)+(1))|0)]<<8),(tempInt << 16) >> 16));
var $13=(($12)&(65535));
var $14=$t;
var $15=(($14+2)|0);
var $16=(($15)|0);
var $17=(($16)|0);
var $18=HEAP32[(($17)>>2)];
var $19=_printf(((8)|0), (tempVarArgs=STACKTOP,STACKTOP = (STACKTOP + 16)|0,(assert((STACKTOP|0) < (STACK_MAX|0))|0),HEAP32[((tempVarArgs)>>2)]=$13,HEAP32[(((tempVarArgs)+(8))>>2)]=$18,tempVarArgs)); STACKTOP=tempVarArgs;
STACKTOP = sp;
return 0;
}
Module["_main"] = _main;
function _malloc($bytes) {
var label = 0;
label = 1;
while(1) switch(label) {
case 1:
var $1=(($bytes)>>>(0)) < 245;
if ($1) { label = 2; break; } else { label = 78; break; }
case 2:
var $3=(($bytes)>>>(0)) < 11;
if ($3) { var $8 = 16;label = 4; break; } else { label = 3; break; }
case 3:
var $5=((($bytes)+(11))|0);
var $6=$5 & -8;
var $8 = $6;label = 4; break;
case 4:
var $8;
var $9=$8 >>> 3;
var $10=HEAP32[((((48)|0))>>2)];
var $11=$10 >>> (($9)>>>(0));
var $12=$11 & 3;
var $13=(($12)|(0))==0;
if ($13) { label = 12; break; } else { label = 5; break; }
case 5:
var $15=$11 & 1;
var $16=$15 ^ 1;
var $17=((($16)+($9))|0);
var $18=$17 << 1;
var $19=((88+($18<<2))|0);
var $20=$19;
var $_sum111=((($18)+(2))|0);
var $21=((88+($_sum111<<2))|0);
var $22=HEAP32[(($21)>>2)];
var $23=(($22+8)|0);
var $24=HEAP32[(($23)>>2)];
var $25=(($20)|(0))==(($24)|(0));
if ($25) { label = 6; break; } else { label = 7; break; }
case 6:
var $27=1 << $17;
var $28=$27 ^ -1;
var $29=$10 & $28;
HEAP32[((((48)|0))>>2)]=$29;
label = 11; break;
case 7:
var $31=$24;
var $32=HEAP32[((((64)|0))>>2)];
var $33=(($31)>>>(0)) < (($32)>>>(0));
if ($33) { label = 10; break; } else { label = 8; break; }
case 8:
var $35=(($24+12)|0);
var $36=HEAP32[(($35)>>2)];
var $37=(($36)|(0))==(($22)|(0));
if ($37) { label = 9; break; } else { label = 10; break; }
case 9:
HEAP32[(($35)>>2)]=$20;
HEAP32[(($21)>>2)]=$24;
label = 11; break;
case 10:
_abort();
throw "Reached an unreachable!";
case 11:
var $40=$17 << 3;
var $41=$40 | 3;
var $42=(($22+4)|0);
HEAP32[(($42)>>2)]=$41;
var $43=$22;
var $_sum113114=$40 | 4;
var $44=(($43+$_sum113114)|0);
var $45=$44;
var $46=HEAP32[(($45)>>2)];
var $47=$46 | 1;
HEAP32[(($45)>>2)]=$47;
var $48=$23;
var $mem_0 = $48;label = 341; break;
case 12:
var $50=HEAP32[((((56)|0))>>2)];
var $51=(($8)>>>(0)) > (($50)>>>(0));
if ($51) { label = 13; break; } else { var $nb_0 = $8;label = 160; break; }
case 13:
var $53=(($11)|(0))==0;
if ($53) { label = 27; break; } else { label = 14; break; }
case 14:
var $55=$11 << $9;
var $56=2 << $9;
var $57=(((-$56))|0);
var $58=$56 | $57;
var $59=$55 & $58;
var $60=(((-$59))|0);
var $61=$59 & $60;
var $62=((($61)-(1))|0);
var $63=$62 >>> 12;
var $64=$63 & 16;
var $65=$62 >>> (($64)>>>(0));
var $66=$65 >>> 5;
var $67=$66 & 8;
var $68=$67 | $64;
var $69=$65 >>> (($67)>>>(0));
var $70=$69 >>> 2;
var $71=$70 & 4;
var $72=$68 | $71;
var $73=$69 >>> (($71)>>>(0));
var $74=$73 >>> 1;
var $75=$74 & 2;
var $76=$72 | $75;
var $77=$73 >>> (($75)>>>(0));
var $78=$77 >>> 1;
var $79=$78 & 1;
var $80=$76 | $79;
var $81=$77 >>> (($79)>>>(0));
var $82=((($80)+($81))|0);
var $83=$82 << 1;
var $84=((88+($83<<2))|0);
var $85=$84;
var $_sum104=((($83)+(2))|0);
var $86=((88+($_sum104<<2))|0);
var $87=HEAP32[(($86)>>2)];
var $88=(($87+8)|0);
var $89=HEAP32[(($88)>>2)];
var $90=(($85)|(0))==(($89)|(0));
if ($90) { label = 15; break; } else { label = 16; break; }
case 15:
var $92=1 << $82;
var $93=$92 ^ -1;
var $94=$10 & $93;
HEAP32[((((48)|0))>>2)]=$94;
label = 20; break;
case 16:
var $96=$89;
var $97=HEAP32[((((64)|0))>>2)];
var $98=(($96)>>>(0)) < (($97)>>>(0));
if ($98) { label = 19; break; } else { label = 17; break; }
case 17:
var $100=(($89+12)|0);
var $101=HEAP32[(($100)>>2)];
var $102=(($101)|(0))==(($87)|(0));
if ($102) { label = 18; break; } else { label = 19; break; }
case 18:
HEAP32[(($100)>>2)]=$85;
HEAP32[(($86)>>2)]=$89;
label = 20; break;
case 19:
_abort();
throw "Reached an unreachable!";
case 20:
var $105=$82 << 3;
var $106=((($105)-($8))|0);
var $107=$8 | 3;
var $108=(($87+4)|0);
HEAP32[(($108)>>2)]=$107;
var $109=$87;
var $110=(($109+$8)|0);
var $111=$110;
var $112=$106 | 1;
var $_sum106107=$8 | 4;
var $113=(($109+$_sum106107)|0);
var $114=$113;
HEAP32[(($114)>>2)]=$112;
var $115=(($109+$105)|0);
var $116=$115;
HEAP32[(($116)>>2)]=$106;
var $117=HEAP32[((((56)|0))>>2)];
var $118=(($117)|(0))==0;
if ($118) { label = 26; break; } else { label = 21; break; }
case 21:
var $120=HEAP32[((((68)|0))>>2)];
var $121=$117 >>> 3;
var $122=$121 << 1;
var $123=((88+($122<<2))|0);
var $124=$123;
var $125=HEAP32[((((48)|0))>>2)];
var $126=1 << $121;
var $127=$125 & $126;
var $128=(($127)|(0))==0;
if ($128) { label = 22; break; } else { label = 23; break; }
case 22:
var $130=$125 | $126;
HEAP32[((((48)|0))>>2)]=$130;
var $_sum109_pre=((($122)+(2))|0);
var $_pre=((88+($_sum109_pre<<2))|0);
var $F4_0 = $124;var $_pre_phi = $_pre;label = 25; break;
case 23:
var $_sum110=((($122)+(2))|0);
var $132=((88+($_sum110<<2))|0);
var $133=HEAP32[(($132)>>2)];
var $134=$133;
var $135=HEAP32[((((64)|0))>>2)];
var $136=(($134)>>>(0)) < (($135)>>>(0));
if ($136) { label = 24; break; } else { var $F4_0 = $133;var $_pre_phi = $132;label = 25; break; }
case 24:
_abort();
throw "Reached an unreachable!";
case 25:
var $_pre_phi;
var $F4_0;
HEAP32[(($_pre_phi)>>2)]=$120;
var $139=(($F4_0+12)|0);
HEAP32[(($139)>>2)]=$120;
var $140=(($120+8)|0);
HEAP32[(($140)>>2)]=$F4_0;
var $141=(($120+12)|0);
HEAP32[(($141)>>2)]=$124;
label = 26; break;
case 26:
HEAP32[((((56)|0))>>2)]=$106;
HEAP32[((((68)|0))>>2)]=$111;
var $143=$88;
var $mem_0 = $143;label = 341; break;
case 27:
var $145=HEAP32[((((52)|0))>>2)];
var $146=(($145)|(0))==0;
if ($146) { var $nb_0 = $8;label = 160; break; } else { label = 28; break; }
case 28:
var $148=(((-$145))|0);
var $149=$145 & $148;
var $150=((($149)-(1))|0);
var $151=$150 >>> 12;
var $152=$151 & 16;
var $153=$150 >>> (($152)>>>(0));
var $154=$153 >>> 5;
var $155=$154 & 8;
var $156=$155 | $152;
var $157=$153 >>> (($155)>>>(0));
var $158=$157 >>> 2;
var $159=$158 & 4;
var $160=$156 | $159;
var $161=$157 >>> (($159)>>>(0));
var $162=$161 >>> 1;
var $163=$162 & 2;
var $164=$160 | $163;
var $165=$161 >>> (($163)>>>(0));
var $166=$165 >>> 1;
var $167=$166 & 1;
var $168=$164 | $167;
var $169=$165 >>> (($167)>>>(0));
var $170=((($168)+($169))|0);
var $171=((352+($170<<2))|0);
var $172=HEAP32[(($171)>>2)];
var $173=(($172+4)|0);
var $174=HEAP32[(($173)>>2)];
var $175=$174 & -8;
var $176=((($175)-($8))|0);
var $t_0_i = $172;var $v_0_i = $172;var $rsize_0_i = $176;label = 29; break;
case 29:
var $rsize_0_i;
var $v_0_i;
var $t_0_i;
var $178=(($t_0_i+16)|0);
var $179=HEAP32[(($178)>>2)];
var $180=(($179)|(0))==0;
if ($180) { label = 30; break; } else { var $185 = $179;label = 31; break; }
case 30:
var $182=(($t_0_i+20)|0);
var $183=HEAP32[(($182)>>2)];
var $184=(($183)|(0))==0;
if ($184) { label = 32; break; } else { var $185 = $183;label = 31; break; }
case 31:
var $185;
var $186=(($185+4)|0);
var $187=HEAP32[(($186)>>2)];
var $188=$187 & -8;
var $189=((($188)-($8))|0);
var $190=(($189)>>>(0)) < (($rsize_0_i)>>>(0));
var $_rsize_0_i=$190 ? $189 : $rsize_0_i;
var $_v_0_i=$190 ? $185 : $v_0_i;
var $t_0_i = $185;var $v_0_i = $_v_0_i;var $rsize_0_i = $_rsize_0_i;label = 29; break;
case 32:
var $192=$v_0_i;
var $193=HEAP32[((((64)|0))>>2)];
var $194=(($192)>>>(0)) < (($193)>>>(0));
if ($194) { label = 76; break; } else { label = 33; break; }
case 33:
var $196=(($192+$8)|0);
var $197=$196;
var $198=(($192)>>>(0)) < (($196)>>>(0));
if ($198) { label = 34; break; } else { label = 76; break; }
case 34:
var $200=(($v_0_i+24)|0);
var $201=HEAP32[(($200)>>2)];
var $202=(($v_0_i+12)|0);
var $203=HEAP32[(($202)>>2)];
var $204=(($203)|(0))==(($v_0_i)|(0));
if ($204) { label = 40; break; } else { label = 35; break; }
case 35:
var $206=(($v_0_i+8)|0);
var $207=HEAP32[(($206)>>2)];
var $208=$207;
var $209=(($208)>>>(0)) < (($193)>>>(0));
if ($209) { label = 39; break; } else { label = 36; break; }
case 36:
var $211=(($207+12)|0);
var $212=HEAP32[(($211)>>2)];
var $213=(($212)|(0))==(($v_0_i)|(0));
if ($213) { label = 37; break; } else { label = 39; break; }
case 37:
var $215=(($203+8)|0);
var $216=HEAP32[(($215)>>2)];
var $217=(($216)|(0))==(($v_0_i)|(0));
if ($217) { label = 38; break; } else { label = 39; break; }
case 38:
HEAP32[(($211)>>2)]=$203;
HEAP32[(($215)>>2)]=$207;
var $R_1_i = $203;label = 47; break;
case 39:
_abort();
throw "Reached an unreachable!";
case 40:
var $220=(($v_0_i+20)|0);
var $221=HEAP32[(($220)>>2)];
var $222=(($221)|(0))==0;
if ($222) { label = 41; break; } else { var $R_0_i = $221;var $RP_0_i = $220;label = 42; break; }
case 41:
var $224=(($v_0_i+16)|0);
var $225=HEAP32[(($224)>>2)];
var $226=(($225)|(0))==0;
if ($226) { var $R_1_i = 0;label = 47; break; } else { var $R_0_i = $225;var $RP_0_i = $224;label = 42; break; }
case 42:
var $RP_0_i;
var $R_0_i;
var $227=(($R_0_i+20)|0);
var $228=HEAP32[(($227)>>2)];
var $229=(($228)|(0))==0;
if ($229) { label = 43; break; } else { var $R_0_i = $228;var $RP_0_i = $227;label = 42; break; }
case 43:
var $231=(($R_0_i+16)|0);
var $232=HEAP32[(($231)>>2)];
var $233=(($232)|(0))==0;
if ($233) { label = 44; break; } else { var $R_0_i = $232;var $RP_0_i = $231;label = 42; break; }
case 44:
var $235=$RP_0_i;
var $236=(($235)>>>(0)) < (($193)>>>(0));
if ($236) { label = 46; break; } else { label = 45; break; }
case 45:
HEAP32[(($RP_0_i)>>2)]=0;
var $R_1_i = $R_0_i;label = 47; break;
case 46:
_abort();
throw "Reached an unreachable!";
case 47:
var $R_1_i;
var $240=(($201)|(0))==0;
if ($240) { label = 67; break; } else { label = 48; break; }
case 48:
var $242=(($v_0_i+28)|0);
var $243=HEAP32[(($242)>>2)];
var $244=((352+($243<<2))|0);
var $245=HEAP32[(($244)>>2)];
var $246=(($v_0_i)|(0))==(($245)|(0));
if ($246) { label = 49; break; } else { label = 51; break; }
case 49:
HEAP32[(($244)>>2)]=$R_1_i;
var $cond_i=(($R_1_i)|(0))==0;
if ($cond_i) { label = 50; break; } else { label = 57; break; }
case 50:
var $248=HEAP32[(($242)>>2)];
var $249=1 << $248;
var $250=$249 ^ -1;
var $251=HEAP32[((((52)|0))>>2)];
var $252=$251 & $250;
HEAP32[((((52)|0))>>2)]=$252;
label = 67; break;
case 51:
var $254=$201;
var $255=HEAP32[((((64)|0))>>2)];
var $256=(($254)>>>(0)) < (($255)>>>(0));
if ($256) { label = 55; break; } else { label = 52; break; }
case 52:
var $258=(($201+16)|0);
var $259=HEAP32[(($258)>>2)];
var $260=(($259)|(0))==(($v_0_i)|(0));
if ($260) { label = 53; break; } else { label = 54; break; }
case 53:
HEAP32[(($258)>>2)]=$R_1_i;
label = 56; break;
case 54:
var $263=(($201+20)|0);
HEAP32[(($263)>>2)]=$R_1_i;
label = 56; break;
case 55:
_abort();
throw "Reached an unreachable!";
case 56:
var $266=(($R_1_i)|(0))==0;
if ($266) { label = 67; break; } else { label = 57; break; }
case 57:
var $268=$R_1_i;
var $269=HEAP32[((((64)|0))>>2)];
var $270=(($268)>>>(0)) < (($269)>>>(0));
if ($270) { label = 66; break; } else { label = 58; break; }
case 58:
var $272=(($R_1_i+24)|0);
HEAP32[(($272)>>2)]=$201;
var $273=(($v_0_i+16)|0);
var $274=HEAP32[(($273)>>2)];
var $275=(($274)|(0))==0;
if ($275) { label = 62; break; } else { label = 59; break; }
case 59:
var $277=$274;
var $278=HEAP32[((((64)|0))>>2)];
var $279=(($277)>>>(0)) < (($278)>>>(0));
if ($279) { label = 61; break; } else { label = 60; break; }
case 60:
var $281=(($R_1_i+16)|0);
HEAP32[(($281)>>2)]=$274;
var $282=(($274+24)|0);
HEAP32[(($282)>>2)]=$R_1_i;
label = 62; break;
case 61:
_abort();
throw "Reached an unreachable!";
case 62:
var $285=(($v_0_i+20)|0);
var $286=HEAP32[(($285)>>2)];
var $287=(($286)|(0))==0;
if ($287) { label = 67; break; } else { label = 63; break; }
case 63:
var $289=$286;
var $290=HEAP32[((((64)|0))>>2)];
var $291=(($289)>>>(0)) < (($290)>>>(0));
if ($291) { label = 65; break; } else { label = 64; break; }
case 64:
var $293=(($R_1_i+20)|0);
HEAP32[(($293)>>2)]=$286;
var $294=(($286+24)|0);
HEAP32[(($294)>>2)]=$R_1_i;
label = 67; break;
case 65:
_abort();
throw "Reached an unreachable!";
case 66:
_abort();
throw "Reached an unreachable!";
case 67:
var $298=(($rsize_0_i)>>>(0)) < 16;
if ($298) { label = 68; break; } else { label = 69; break; }
case 68:
var $300=((($rsize_0_i)+($8))|0);
var $301=$300 | 3;
var $302=(($v_0_i+4)|0);
HEAP32[(($302)>>2)]=$301;
var $_sum4_i=((($300)+(4))|0);
var $303=(($192+$_sum4_i)|0);
var $304=$303;
var $305=HEAP32[(($304)>>2)];
var $306=$305 | 1;
HEAP32[(($304)>>2)]=$306;
label = 77; break;
case 69:
var $308=$8 | 3;
var $309=(($v_0_i+4)|0);
HEAP32[(($309)>>2)]=$308;
var $310=$rsize_0_i | 1;
var $_sum_i137=$8 | 4;
var $311=(($192+$_sum_i137)|0);
var $312=$311;
HEAP32[(($312)>>2)]=$310;
var $_sum1_i=((($rsize_0_i)+($8))|0);
var $313=(($192+$_sum1_i)|0);
var $314=$313;
HEAP32[(($314)>>2)]=$rsize_0_i;
var $315=HEAP32[((((56)|0))>>2)];
var $316=(($315)|(0))==0;
if ($316) { label = 75; break; } else { label = 70; break; }
case 70:
var $318=HEAP32[((((68)|0))>>2)];
var $319=$315 >>> 3;
var $320=$319 << 1;
var $321=((88+($320<<2))|0);
var $322=$321;
var $323=HEAP32[((((48)|0))>>2)];
var $324=1 << $319;
var $325=$323 & $324;
var $326=(($325)|(0))==0;
if ($326) { label = 71; break; } else { label = 72; break; }
case 71:
var $328=$323 | $324;
HEAP32[((((48)|0))>>2)]=$328;
var $_sum2_pre_i=((($320)+(2))|0);
var $_pre_i=((88+($_sum2_pre_i<<2))|0);
var $F1_0_i = $322;var $_pre_phi_i = $_pre_i;label = 74; break;
case 72:
var $_sum3_i=((($320)+(2))|0);
var $330=((88+($_sum3_i<<2))|0);
var $331=HEAP32[(($330)>>2)];
var $332=$331;
var $333=HEAP32[((((64)|0))>>2)];
var $334=(($332)>>>(0)) < (($333)>>>(0));
if ($334) { label = 73; break; } else { var $F1_0_i = $331;var $_pre_phi_i = $330;label = 74; break; }
case 73:
_abort();
throw "Reached an unreachable!";
case 74:
var $_pre_phi_i;
var $F1_0_i;
HEAP32[(($_pre_phi_i)>>2)]=$318;
var $337=(($F1_0_i+12)|0);
HEAP32[(($337)>>2)]=$318;
var $338=(($318+8)|0);
HEAP32[(($338)>>2)]=$F1_0_i;
var $339=(($318+12)|0);
HEAP32[(($339)>>2)]=$322;
label = 75; break;
case 75:
HEAP32[((((56)|0))>>2)]=$rsize_0_i;
HEAP32[((((68)|0))>>2)]=$197;
label = 77; break;
case 76:
_abort();
throw "Reached an unreachable!";
case 77:
var $342=(($v_0_i+8)|0);
var $343=$342;
var $344=(($342)|(0))==0;
if ($344) { var $nb_0 = $8;label = 160; break; } else { var $mem_0 = $343;label = 341; break; }
case 78:
var $346=(($bytes)>>>(0)) > 4294967231;
if ($346) { var $nb_0 = -1;label = 160; break; } else { label = 79; break; }
case 79:
var $348=((($bytes)+(11))|0);
var $349=$348 & -8;
var $350=HEAP32[((((52)|0))>>2)];
var $351=(($350)|(0))==0;
if ($351) { var $nb_0 = $349;label = 160; break; } else { label = 80; break; }
case 80:
var $353=(((-$349))|0);
var $354=$348 >>> 8;
var $355=(($354)|(0))==0;
if ($355) { var $idx_0_i = 0;label = 83; break; } else { label = 81; break; }
case 81:
var $357=(($349)>>>(0)) > 16777215;
if ($357) { var $idx_0_i = 31;label = 83; break; } else { label = 82; break; }
case 82:
var $359=((($354)+(1048320))|0);
var $360=$359 >>> 16;
var $361=$360 & 8;
var $362=$354 << $361;
var $363=((($362)+(520192))|0);
var $364=$363 >>> 16;
var $365=$364 & 4;
var $366=$365 | $361;
var $367=$362 << $365;
var $368=((($367)+(245760))|0);
var $369=$368 >>> 16;
var $370=$369 & 2;
var $371=$366 | $370;
var $372=(((14)-($371))|0);
var $373=$367 << $370;
var $374=$373 >>> 15;
var $375=((($372)+($374))|0);
var $376=$375 << 1;
var $377=((($375)+(7))|0);
var $378=$349 >>> (($377)>>>(0));
var $379=$378 & 1;
var $380=$379 | $376;
var $idx_0_i = $380;label = 83; break;
case 83:
var $idx_0_i;
var $382=((352+($idx_0_i<<2))|0);
var $383=HEAP32[(($382)>>2)];
var $384=(($383)|(0))==0;
if ($384) { var $v_2_i = 0;var $rsize_2_i = $353;var $t_1_i = 0;label = 90; break; } else { label = 84; break; }
case 84:
var $386=(($idx_0_i)|(0))==31;
if ($386) { var $391 = 0;label = 86; break; } else { label = 85; break; }
case 85:
var $388=$idx_0_i >>> 1;
var $389=(((25)-($388))|0);
var $391 = $389;label = 86; break;
case 86:
var $391;
var $392=$349 << $391;
var $v_0_i118 = 0;var $rsize_0_i117 = $353;var $t_0_i116 = $383;var $sizebits_0_i = $392;var $rst_0_i = 0;label = 87; break;
case 87:
var $rst_0_i;
var $sizebits_0_i;
var $t_0_i116;
var $rsize_0_i117;
var $v_0_i118;
var $394=(($t_0_i116+4)|0);
var $395=HEAP32[(($394)>>2)];
var $396=$395 & -8;
var $397=((($396)-($349))|0);
var $398=(($397)>>>(0)) < (($rsize_0_i117)>>>(0));
if ($398) { label = 88; break; } else { var $v_1_i = $v_0_i118;var $rsize_1_i = $rsize_0_i117;label = 89; break; }
case 88:
var $400=(($396)|(0))==(($349)|(0));
if ($400) { var $v_2_i = $t_0_i116;var $rsize_2_i = $397;var $t_1_i = $t_0_i116;label = 90; break; } else { var $v_1_i = $t_0_i116;var $rsize_1_i = $397;label = 89; break; }
case 89:
var $rsize_1_i;
var $v_1_i;
var $402=(($t_0_i116+20)|0);
var $403=HEAP32[(($402)>>2)];
var $404=$sizebits_0_i >>> 31;
var $405=(($t_0_i116+16+($404<<2))|0);
var $406=HEAP32[(($405)>>2)];
var $407=(($403)|(0))==0;
var $408=(($403)|(0))==(($406)|(0));
var $or_cond_i=$407 | $408;
var $rst_1_i=$or_cond_i ? $rst_0_i : $403;
var $409=(($406)|(0))==0;
var $410=$sizebits_0_i << 1;
if ($409) { var $v_2_i = $v_1_i;var $rsize_2_i = $rsize_1_i;var $t_1_i = $rst_1_i;label = 90; break; } else { var $v_0_i118 = $v_1_i;var $rsize_0_i117 = $rsize_1_i;var $t_0_i116 = $406;var $sizebits_0_i = $410;var $rst_0_i = $rst_1_i;label = 87; break; }
case 90:
var $t_1_i;
var $rsize_2_i;
var $v_2_i;
var $411=(($t_1_i)|(0))==0;
var $412=(($v_2_i)|(0))==0;
var $or_cond21_i=$411 & $412;
if ($or_cond21_i) { label = 91; break; } else { var $t_2_ph_i = $t_1_i;label = 93; break; }
case 91:
var $414=2 << $idx_0_i;
var $415=(((-$414))|0);
var $416=$414 | $415;
var $417=$350 & $416;
var $418=(($417)|(0))==0;
if ($418) { var $nb_0 = $349;label = 160; break; } else { label = 92; break; }
case 92:
var $420=(((-$417))|0);
var $421=$417 & $420;
var $422=((($421)-(1))|0);
var $423=$422 >>> 12;
var $424=$423 & 16;
var $425=$422 >>> (($424)>>>(0));
var $426=$425 >>> 5;
var $427=$426 & 8;
var $428=$427 | $424;
var $429=$425 >>> (($427)>>>(0));
var $430=$429 >>> 2;
var $431=$430 & 4;
var $432=$428 | $431;
var $433=$429 >>> (($431)>>>(0));
var $434=$433 >>> 1;
var $435=$434 & 2;
var $436=$432 | $435;
var $437=$433 >>> (($435)>>>(0));
var $438=$437 >>> 1;
var $439=$438 & 1;
var $440=$436 | $439;
var $441=$437 >>> (($439)>>>(0));
var $442=((($440)+($441))|0);
var $443=((352+($442<<2))|0);
var $444=HEAP32[(($443)>>2)];
var $t_2_ph_i = $444;label = 93; break;
case 93:
var $t_2_ph_i;
var $445=(($t_2_ph_i)|(0))==0;
if ($445) { var $rsize_3_lcssa_i = $rsize_2_i;var $v_3_lcssa_i = $v_2_i;label = 96; break; } else { var $t_228_i = $t_2_ph_i;var $rsize_329_i = $rsize_2_i;var $v_330_i = $v_2_i;label = 94; break; }
case 94:
var $v_330_i;
var $rsize_329_i;
var $t_228_i;
var $446=(($t_228_i+4)|0);
var $447=HEAP32[(($446)>>2)];
var $448=$447 & -8;
var $449=((($448)-($349))|0);
var $450=(($449)>>>(0)) < (($rsize_329_i)>>>(0));
var $_rsize_3_i=$450 ? $449 : $rsize_329_i;
var $t_2_v_3_i=$450 ? $t_228_i : $v_330_i;
var $451=(($t_228_i+16)|0);
var $452=HEAP32[(($451)>>2)];
var $453=(($452)|(0))==0;
if ($453) { label = 95; break; } else { var $t_228_i = $452;var $rsize_329_i = $_rsize_3_i;var $v_330_i = $t_2_v_3_i;label = 94; break; }
case 95:
var $454=(($t_228_i+20)|0);
var $455=HEAP32[(($454)>>2)];
var $456=(($455)|(0))==0;
if ($456) { var $rsize_3_lcssa_i = $_rsize_3_i;var $v_3_lcssa_i = $t_2_v_3_i;label = 96; break; } else { var $t_228_i = $455;var $rsize_329_i = $_rsize_3_i;var $v_330_i = $t_2_v_3_i;label = 94; break; }
case 96:
var $v_3_lcssa_i;
var $rsize_3_lcssa_i;
var $457=(($v_3_lcssa_i)|(0))==0;
if ($457) { var $nb_0 = $349;label = 160; break; } else { label = 97; break; }
case 97:
var $459=HEAP32[((((56)|0))>>2)];
var $460=((($459)-($349))|0);
var $461=(($rsize_3_lcssa_i)>>>(0)) < (($460)>>>(0));
if ($461) { label = 98; break; } else { var $nb_0 = $349;label = 160; break; }
case 98:
var $463=$v_3_lcssa_i;
var $464=HEAP32[((((64)|0))>>2)];
var $465=(($463)>>>(0)) < (($464)>>>(0));
if ($465) { label = 158; break; } else { label = 99; break; }
case 99:
var $467=(($463+$349)|0);
var $468=$467;
var $469=(($463)>>>(0)) < (($467)>>>(0));
if ($469) { label = 100; break; } else { label = 158; break; }
case 100:
var $471=(($v_3_lcssa_i+24)|0);
var $472=HEAP32[(($471)>>2)];
var $473=(($v_3_lcssa_i+12)|0);
var $474=HEAP32[(($473)>>2)];
var $475=(($474)|(0))==(($v_3_lcssa_i)|(0));
if ($475) { label = 106; break; } else { label = 101; break; }
case 101:
var $477=(($v_3_lcssa_i+8)|0);
var $478=HEAP32[(($477)>>2)];
var $479=$478;
var $480=(($479)>>>(0)) < (($464)>>>(0));
if ($480) { label = 105; break; } else { label = 102; break; }
case 102:
var $482=(($478+12)|0);
var $483=HEAP32[(($482)>>2)];
var $484=(($483)|(0))==(($v_3_lcssa_i)|(0));
if ($484) { label = 103; break; } else { label = 105; break; }
case 103:
var $486=(($474+8)|0);
var $487=HEAP32[(($486)>>2)];
var $488=(($487)|(0))==(($v_3_lcssa_i)|(0));
if ($488) { label = 104; break; } else { label = 105; break; }
case 104:
HEAP32[(($482)>>2)]=$474;
HEAP32[(($486)>>2)]=$478;
var $R_1_i122 = $474;label = 113; break;
case 105:
_abort();
throw "Reached an unreachable!";
case 106:
var $491=(($v_3_lcssa_i+20)|0);
var $492=HEAP32[(($491)>>2)];
var $493=(($492)|(0))==0;
if ($493) { label = 107; break; } else { var $R_0_i120 = $492;var $RP_0_i119 = $491;label = 108; break; }
case 107:
var $495=(($v_3_lcssa_i+16)|0);
var $496=HEAP32[(($495)>>2)];
var $497=(($496)|(0))==0;
if ($497) { var $R_1_i122 = 0;label = 113; break; } else { var $R_0_i120 = $496;var $RP_0_i119 = $495;label = 108; break; }
case 108:
var $RP_0_i119;
var $R_0_i120;
var $498=(($R_0_i120+20)|0);
var $499=HEAP32[(($498)>>2)];
var $500=(($499)|(0))==0;
if ($500) { label = 109; break; } else { var $R_0_i120 = $499;var $RP_0_i119 = $498;label = 108; break; }
case 109:
var $502=(($R_0_i120+16)|0);
var $503=HEAP32[(($502)>>2)];
var $504=(($503)|(0))==0;
if ($504) { label = 110; break; } else { var $R_0_i120 = $503;var $RP_0_i119 = $502;label = 108; break; }
case 110:
var $506=$RP_0_i119;
var $507=(($506)>>>(0)) < (($464)>>>(0));
if ($507) { label = 112; break; } else { label = 111; break; }
case 111:
HEAP32[(($RP_0_i119)>>2)]=0;
var $R_1_i122 = $R_0_i120;label = 113; break;
case 112:
_abort();
throw "Reached an unreachable!";
case 113:
var $R_1_i122;
var $511=(($472)|(0))==0;
if ($511) { label = 133; break; } else { label = 114; break; }
case 114:
var $513=(($v_3_lcssa_i+28)|0);
var $514=HEAP32[(($513)>>2)];
var $515=((352+($514<<2))|0);
var $516=HEAP32[(($515)>>2)];
var $517=(($v_3_lcssa_i)|(0))==(($516)|(0));
if ($517) { label = 115; break; } else { label = 117; break; }
case 115:
HEAP32[(($515)>>2)]=$R_1_i122;
var $cond_i123=(($R_1_i122)|(0))==0;
if ($cond_i123) { label = 116; break; } else { label = 123; break; }
case 116:
var $519=HEAP32[(($513)>>2)];
var $520=1 << $519;
var $521=$520 ^ -1;
var $522=HEAP32[((((52)|0))>>2)];
var $523=$522 & $521;
HEAP32[((((52)|0))>>2)]=$523;
label = 133; break;
case 117:
var $525=$472;
var $526=HEAP32[((((64)|0))>>2)];
var $527=(($525)>>>(0)) < (($526)>>>(0));
if ($527) { label = 121; break; } else { label = 118; break; }
case 118:
var $529=(($472+16)|0);
var $530=HEAP32[(($529)>>2)];
var $531=(($530)|(0))==(($v_3_lcssa_i)|(0));
if ($531) { label = 119; break; } else { label = 120; break; }
case 119:
HEAP32[(($529)>>2)]=$R_1_i122;
label = 122; break;
case 120:
var $534=(($472+20)|0);
HEAP32[(($534)>>2)]=$R_1_i122;
label = 122; break;
case 121:
_abort();
throw "Reached an unreachable!";
case 122:
var $537=(($R_1_i122)|(0))==0;
if ($537) { label = 133; break; } else { label = 123; break; }
case 123:
var $539=$R_1_i122;
var $540=HEAP32[((((64)|0))>>2)];
var $541=(($539)>>>(0)) < (($540)>>>(0));
if ($541) { label = 132; break; } else { label = 124; break; }
case 124:
var $543=(($R_1_i122+24)|0);
HEAP32[(($543)>>2)]=$472;
var $544=(($v_3_lcssa_i+16)|0);
var $545=HEAP32[(($544)>>2)];
var $546=(($545)|(0))==0;
if ($546) { label = 128; break; } else { label = 125; break; }
case 125:
var $548=$545;
var $549=HEAP32[((((64)|0))>>2)];
var $550=(($548)>>>(0)) < (($549)>>>(0));
if ($550) { label = 127; break; } else { label = 126; break; }
case 126:
var $552=(($R_1_i122+16)|0);
HEAP32[(($552)>>2)]=$545;
var $553=(($545+24)|0);
HEAP32[(($553)>>2)]=$R_1_i122;
label = 128; break;
case 127:
_abort();
throw "Reached an unreachable!";
case 128:
var $556=(($v_3_lcssa_i+20)|0);
var $557=HEAP32[(($556)>>2)];
var $558=(($557)|(0))==0;
if ($558) { label = 133; break; } else { label = 129; break; }
case 129:
var $560=$557;
var $561=HEAP32[((((64)|0))>>2)];
var $562=(($560)>>>(0)) < (($561)>>>(0));
if ($562) { label = 131; break; } else { label = 130; break; }
case 130:
var $564=(($R_1_i122+20)|0);
HEAP32[(($564)>>2)]=$557;
var $565=(($557+24)|0);
HEAP32[(($565)>>2)]=$R_1_i122;
label = 133; break;
case 131:
_abort();
throw "Reached an unreachable!";
case 132:
_abort();
throw "Reached an unreachable!";
case 133:
var $569=(($rsize_3_lcssa_i)>>>(0)) < 16;
if ($569) { label = 134; break; } else { label = 135; break; }
case 134:
var $571=((($rsize_3_lcssa_i)+($349))|0);
var $572=$571 | 3;
var $573=(($v_3_lcssa_i+4)|0);
HEAP32[(($573)>>2)]=$572;
var $_sum19_i=((($571)+(4))|0);
var $574=(($463+$_sum19_i)|0);
var $575=$574;
var $576=HEAP32[(($575)>>2)];
var $577=$576 | 1;
HEAP32[(($575)>>2)]=$577;
label = 159; break;
case 135:
var $579=$349 | 3;
var $580=(($v_3_lcssa_i+4)|0);
HEAP32[(($580)>>2)]=$579;
var $581=$rsize_3_lcssa_i | 1;
var $_sum_i125136=$349 | 4;
var $582=(($463+$_sum_i125136)|0);
var $583=$582;
HEAP32[(($583)>>2)]=$581;
var $_sum1_i126=((($rsize_3_lcssa_i)+($349))|0);
var $584=(($463+$_sum1_i126)|0);
var $585=$584;
HEAP32[(($585)>>2)]=$rsize_3_lcssa_i;
var $586=$rsize_3_lcssa_i >>> 3;
var $587=(($rsize_3_lcssa_i)>>>(0)) < 256;
if ($587) { label = 136; break; } else { label = 141; break; }
case 136:
var $589=$586 << 1;
var $590=((88+($589<<2))|0);
var $591=$590;
var $592=HEAP32[((((48)|0))>>2)];
var $593=1 << $586;
var $594=$592 & $593;
var $595=(($594)|(0))==0;
if ($595) { label = 137; break; } else { label = 138; break; }
case 137:
var $597=$592 | $593;
HEAP32[((((48)|0))>>2)]=$597;
var $_sum15_pre_i=((($589)+(2))|0);
var $_pre_i127=((88+($_sum15_pre_i<<2))|0);
var $F5_0_i = $591;var $_pre_phi_i128 = $_pre_i127;label = 140; break;
case 138:
var $_sum18_i=((($589)+(2))|0);
var $599=((88+($_sum18_i<<2))|0);
var $600=HEAP32[(($599)>>2)];
var $601=$600;
var $602=HEAP32[((((64)|0))>>2)];
var $603=(($601)>>>(0)) < (($602)>>>(0));
if ($603) { label = 139; break; } else { var $F5_0_i = $600;var $_pre_phi_i128 = $599;label = 140; break; }
case 139:
_abort();
throw "Reached an unreachable!";
case 140:
var $_pre_phi_i128;
var $F5_0_i;
HEAP32[(($_pre_phi_i128)>>2)]=$468;
var $606=(($F5_0_i+12)|0);
HEAP32[(($606)>>2)]=$468;
var $_sum16_i=((($349)+(8))|0);
var $607=(($463+$_sum16_i)|0);
var $608=$607;
HEAP32[(($608)>>2)]=$F5_0_i;
var $_sum17_i=((($349)+(12))|0);
var $609=(($463+$_sum17_i)|0);
var $610=$609;
HEAP32[(($610)>>2)]=$591;
label = 159; break;
case 141:
var $612=$467;
var $613=$rsize_3_lcssa_i >>> 8;
var $614=(($613)|(0))==0;
if ($614) { var $I7_0_i = 0;label = 144; break; } else { label = 142; break; }
case 142:
var $616=(($rsize_3_lcssa_i)>>>(0)) > 16777215;
if ($616) { var $I7_0_i = 31;label = 144; break; } else { label = 143; break; }
case 143:
var $618=((($613)+(1048320))|0);
var $619=$618 >>> 16;
var $620=$619 & 8;
var $621=$613 << $620;
var $622=((($621)+(520192))|0);
var $623=$622 >>> 16;
var $624=$623 & 4;
var $625=$624 | $620;
var $626=$621 << $624;
var $627=((($626)+(245760))|0);
var $628=$627 >>> 16;
var $629=$628 & 2;
var $630=$625 | $629;
var $631=(((14)-($630))|0);
var $632=$626 << $629;
var $633=$632 >>> 15;
var $634=((($631)+($633))|0);
var $635=$634 << 1;
var $636=((($634)+(7))|0);
var $637=$rsize_3_lcssa_i >>> (($636)>>>(0));
var $638=$637 & 1;
var $639=$638 | $635;
var $I7_0_i = $639;label = 144; break;
case 144:
var $I7_0_i;
var $641=((352+($I7_0_i<<2))|0);
var $_sum2_i=((($349)+(28))|0);
var $642=(($463+$_sum2_i)|0);
var $643=$642;
HEAP32[(($643)>>2)]=$I7_0_i;
var $_sum3_i129=((($349)+(16))|0);
var $644=(($463+$_sum3_i129)|0);
var $_sum4_i130=((($349)+(20))|0);
var $645=(($463+$_sum4_i130)|0);
var $646=$645;
HEAP32[(($646)>>2)]=0;
var $647=$644;
HEAP32[(($647)>>2)]=0;
var $648=HEAP32[((((52)|0))>>2)];
var $649=1 << $I7_0_i;
var $650=$648 & $649;
var $651=(($650)|(0))==0;
if ($651) { label = 145; break; } else { label = 146; break; }
case 145:
var $653=$648 | $649;
HEAP32[((((52)|0))>>2)]=$653;
HEAP32[(($641)>>2)]=$612;
var $654=$641;
var $_sum5_i=((($349)+(24))|0);
var $655=(($463+$_sum5_i)|0);
var $656=$655;
HEAP32[(($656)>>2)]=$654;
var $_sum6_i=((($349)+(12))|0);
var $657=(($463+$_sum6_i)|0);
var $658=$657;
HEAP32[(($658)>>2)]=$612;
var $_sum7_i=((($349)+(8))|0);
var $659=(($463+$_sum7_i)|0);
var $660=$659;
HEAP32[(($660)>>2)]=$612;
label = 159; break;
case 146:
var $662=HEAP32[(($641)>>2)];
var $663=(($I7_0_i)|(0))==31;
if ($663) { var $668 = 0;label = 148; break; } else { label = 147; break; }
case 147:
var $665=$I7_0_i >>> 1;
var $666=(((25)-($665))|0);
var $668 = $666;label = 148; break;
case 148:
var $668;
var $669=$rsize_3_lcssa_i << $668;
var $K12_0_i = $669;var $T_0_i = $662;label = 149; break;
case 149:
var $T_0_i;
var $K12_0_i;
var $671=(($T_0_i+4)|0);
var $672=HEAP32[(($671)>>2)];
var $673=$672 & -8;
var $674=(($673)|(0))==(($rsize_3_lcssa_i)|(0));
if ($674) { label = 154; break; } else { label = 150; break; }
case 150:
var $676=$K12_0_i >>> 31;
var $677=(($T_0_i+16+($676<<2))|0);
var $678=HEAP32[(($677)>>2)];
var $679=(($678)|(0))==0;
var $680=$K12_0_i << 1;
if ($679) { label = 151; break; } else { var $K12_0_i = $680;var $T_0_i = $678;label = 149; break; }
case 151:
var $682=$677;
var $683=HEAP32[((((64)|0))>>2)];
var $684=(($682)>>>(0)) < (($683)>>>(0));
if ($684) { label = 153; break; } else { label = 152; break; }
case 152:
HEAP32[(($677)>>2)]=$612;
var $_sum12_i=((($349)+(24))|0);
var $686=(($463+$_sum12_i)|0);
var $687=$686;
HEAP32[(($687)>>2)]=$T_0_i;
var $_sum13_i=((($349)+(12))|0);
var $688=(($463+$_sum13_i)|0);
var $689=$688;
HEAP32[(($689)>>2)]=$612;
var $_sum14_i=((($349)+(8))|0);
var $690=(($463+$_sum14_i)|0);
var $691=$690;
HEAP32[(($691)>>2)]=$612;
label = 159; break;
case 153:
_abort();
throw "Reached an unreachable!";
case 154:
var $694=(($T_0_i+8)|0);
var $695=HEAP32[(($694)>>2)];
var $696=$T_0_i;
var $697=HEAP32[((((64)|0))>>2)];
var $698=(($696)>>>(0)) < (($697)>>>(0));
if ($698) { label = 157; break; } else { label = 155; break; }
case 155:
var $700=$695;
var $701=(($700)>>>(0)) < (($697)>>>(0));
if ($701) { label = 157; break; } else { label = 156; break; }
case 156:
var $703=(($695+12)|0);
HEAP32[(($703)>>2)]=$612;
HEAP32[(($694)>>2)]=$612;
var $_sum9_i=((($349)+(8))|0);
var $704=(($463+$_sum9_i)|0);
var $705=$704;
HEAP32[(($705)>>2)]=$695;
var $_sum10_i=((($349)+(12))|0);
var $706=(($463+$_sum10_i)|0);
var $707=$706;
HEAP32[(($707)>>2)]=$T_0_i;
var $_sum11_i=((($349)+(24))|0);
var $708=(($463+$_sum11_i)|0);
var $709=$708;
HEAP32[(($709)>>2)]=0;
label = 159; break;
case 157:
_abort();
throw "Reached an unreachable!";
case 158:
_abort();
throw "Reached an unreachable!";
case 159:
var $711=(($v_3_lcssa_i+8)|0);
var $712=$711;
var $713=(($711)|(0))==0;
if ($713) { var $nb_0 = $349;label = 160; break; } else { var $mem_0 = $712;label = 341; break; }
case 160:
var $nb_0;
var $714=HEAP32[((((56)|0))>>2)];
var $715=(($nb_0)>>>(0)) > (($714)>>>(0));
if ($715) { label = 165; break; } else { label = 161; break; }
case 161:
var $717=((($714)-($nb_0))|0);
var $718=HEAP32[((((68)|0))>>2)];
var $719=(($717)>>>(0)) > 15;
if ($719) { label = 162; break; } else { label = 163; break; }
case 162:
var $721=$718;
var $722=(($721+$nb_0)|0);
var $723=$722;
HEAP32[((((68)|0))>>2)]=$723;
HEAP32[((((56)|0))>>2)]=$717;
var $724=$717 | 1;
var $_sum102=((($nb_0)+(4))|0);
var $725=(($721+$_sum102)|0);
var $726=$725;
HEAP32[(($726)>>2)]=$724;
var $727=(($721+$714)|0);
var $728=$727;
HEAP32[(($728)>>2)]=$717;
var $729=$nb_0 | 3;
var $730=(($718+4)|0);
HEAP32[(($730)>>2)]=$729;
label = 164; break;
case 163:
HEAP32[((((56)|0))>>2)]=0;
HEAP32[((((68)|0))>>2)]=0;
var $732=$714 | 3;
var $733=(($718+4)|0);
HEAP32[(($733)>>2)]=$732;
var $734=$718;
var $_sum101=((($714)+(4))|0);
var $735=(($734+$_sum101)|0);
var $736=$735;
var $737=HEAP32[(($736)>>2)];
var $738=$737 | 1;
HEAP32[(($736)>>2)]=$738;
label = 164; break;
case 164:
var $740=(($718+8)|0);
var $741=$740;
var $mem_0 = $741;label = 341; break;
case 165:
var $743=HEAP32[((((60)|0))>>2)];
var $744=(($nb_0)>>>(0)) < (($743)>>>(0));
if ($744) { label = 166; break; } else { label = 167; break; }
case 166:
var $746=((($743)-($nb_0))|0);
HEAP32[((((60)|0))>>2)]=$746;
var $747=HEAP32[((((72)|0))>>2)];
var $748=$747;
var $749=(($748+$nb_0)|0);
var $750=$749;
HEAP32[((((72)|0))>>2)]=$750;
var $751=$746 | 1;
var $_sum=((($nb_0)+(4))|0);
var $752=(($748+$_sum)|0);
var $753=$752;
HEAP32[(($753)>>2)]=$751;
var $754=$nb_0 | 3;
var $755=(($747+4)|0);
HEAP32[(($755)>>2)]=$754;
var $756=(($747+8)|0);
var $757=$756;
var $mem_0 = $757;label = 341; break;
case 167:
var $759=HEAP32[((((24)|0))>>2)];
var $760=(($759)|(0))==0;
if ($760) { label = 168; break; } else { label = 171; break; }
case 168:
var $762=_sysconf(8);
var $763=((($762)-(1))|0);
var $764=$763 & $762;
var $765=(($764)|(0))==0;
if ($765) { label = 170; break; } else { label = 169; break; }
case 169:
_abort();
throw "Reached an unreachable!";
case 170:
HEAP32[((((32)|0))>>2)]=$762;
HEAP32[((((28)|0))>>2)]=$762;
HEAP32[((((36)|0))>>2)]=-1;
HEAP32[((((40)|0))>>2)]=-1;
HEAP32[((((44)|0))>>2)]=0;
HEAP32[((((492)|0))>>2)]=0;
var $767=_time(0);
var $768=$767 & -16;
var $769=$768 ^ 1431655768;
HEAP32[((((24)|0))>>2)]=$769;
label = 171; break;
case 171:
var $771=((($nb_0)+(48))|0);
var $772=HEAP32[((((32)|0))>>2)];
var $773=((($nb_0)+(47))|0);
var $774=((($772)+($773))|0);
var $775=(((-$772))|0);
var $776=$774 & $775;
var $777=(($776)>>>(0)) > (($nb_0)>>>(0));
if ($777) { label = 172; break; } else { var $mem_0 = 0;label = 341; break; }
case 172:
var $779=HEAP32[((((488)|0))>>2)];
var $780=(($779)|(0))==0;
if ($780) { label = 174; break; } else { label = 173; break; }
case 173:
var $782=HEAP32[((((480)|0))>>2)];
var $783=((($782)+($776))|0);
var $784=(($783)>>>(0)) <= (($782)>>>(0));
var $785=(($783)>>>(0)) > (($779)>>>(0));
var $or_cond1_i=$784 | $785;
if ($or_cond1_i) { var $mem_0 = 0;label = 341; break; } else { label = 174; break; }
case 174:
var $787=HEAP32[((((492)|0))>>2)];
var $788=$787 & 4;
var $789=(($788)|(0))==0;
if ($789) { label = 175; break; } else { var $tsize_1_i = 0;label = 198; break; }
case 175:
var $791=HEAP32[((((72)|0))>>2)];
var $792=(($791)|(0))==0;
if ($792) { label = 181; break; } else { label = 176; break; }
case 176:
var $794=$791;
var $sp_0_i_i = ((496)|0);label = 177; break;
case 177:
var $sp_0_i_i;
var $796=(($sp_0_i_i)|0);
var $797=HEAP32[(($796)>>2)];
var $798=(($797)>>>(0)) > (($794)>>>(0));
if ($798) { label = 179; break; } else { label = 178; break; }
case 178:
var $800=(($sp_0_i_i+4)|0);
var $801=HEAP32[(($800)>>2)];
var $802=(($797+$801)|0);
var $803=(($802)>>>(0)) > (($794)>>>(0));
if ($803) { label = 180; break; } else { label = 179; break; }
case 179:
var $805=(($sp_0_i_i+8)|0);
var $806=HEAP32[(($805)>>2)];
var $807=(($806)|(0))==0;
if ($807) { label = 181; break; } else { var $sp_0_i_i = $806;label = 177; break; }
case 180:
var $808=(($sp_0_i_i)|(0))==0;
if ($808) { label = 181; break; } else { label = 188; break; }
case 181:
var $809=_sbrk(0);
var $810=(($809)|(0))==-1;
if ($810) { var $tsize_0303639_i = 0;label = 197; break; } else { label = 182; break; }
case 182:
var $812=$809;
var $813=HEAP32[((((28)|0))>>2)];
var $814=((($813)-(1))|0);
var $815=$814 & $812;
var $816=(($815)|(0))==0;
if ($816) { var $ssize_0_i = $776;label = 184; break; } else { label = 183; break; }
case 183:
var $818=((($814)+($812))|0);
var $819=(((-$813))|0);
var $820=$818 & $819;
var $821=((($776)-($812))|0);
var $822=((($821)+($820))|0);
var $ssize_0_i = $822;label = 184; break;
case 184:
var $ssize_0_i;
var $824=HEAP32[((((480)|0))>>2)];
var $825=((($824)+($ssize_0_i))|0);
var $826=(($ssize_0_i)>>>(0)) > (($nb_0)>>>(0));
var $827=(($ssize_0_i)>>>(0)) < 2147483647;
var $or_cond_i131=$826 & $827;
if ($or_cond_i131) { label = 185; break; } else { var $tsize_0303639_i = 0;label = 197; break; }
case 185:
var $829=HEAP32[((((488)|0))>>2)];
var $830=(($829)|(0))==0;
if ($830) { label = 187; break; } else { label = 186; break; }
case 186:
var $832=(($825)>>>(0)) <= (($824)>>>(0));
var $833=(($825)>>>(0)) > (($829)>>>(0));
var $or_cond2_i=$832 | $833;
if ($or_cond2_i) { var $tsize_0303639_i = 0;label = 197; break; } else { label = 187; break; }
case 187:
var $835=_sbrk($ssize_0_i);
var $836=(($835)|(0))==(($809)|(0));
var $ssize_0__i=$836 ? $ssize_0_i : 0;
var $__i=$836 ? $809 : -1;
var $tbase_0_i = $__i;var $tsize_0_i = $ssize_0__i;var $br_0_i = $835;var $ssize_1_i = $ssize_0_i;label = 190; break;
case 188:
var $838=HEAP32[((((60)|0))>>2)];
var $839=((($774)-($838))|0);
var $840=$839 & $775;
var $841=(($840)>>>(0)) < 2147483647;
if ($841) { label = 189; break; } else { var $tsize_0303639_i = 0;label = 197; break; }
case 189:
var $843=_sbrk($840);
var $844=HEAP32[(($796)>>2)];
var $845=HEAP32[(($800)>>2)];
var $846=(($844+$845)|0);
var $847=(($843)|(0))==(($846)|(0));
var $_3_i=$847 ? $840 : 0;
var $_4_i=$847 ? $843 : -1;
var $tbase_0_i = $_4_i;var $tsize_0_i = $_3_i;var $br_0_i = $843;var $ssize_1_i = $840;label = 190; break;
case 190:
var $ssize_1_i;
var $br_0_i;
var $tsize_0_i;
var $tbase_0_i;
var $849=(((-$ssize_1_i))|0);
var $850=(($tbase_0_i)|(0))==-1;
if ($850) { label = 191; break; } else { var $tsize_244_i = $tsize_0_i;var $tbase_245_i = $tbase_0_i;label = 201; break; }
case 191:
var $852=(($br_0_i)|(0))!=-1;
var $853=(($ssize_1_i)>>>(0)) < 2147483647;
var $or_cond5_i=$852 & $853;
var $854=(($ssize_1_i)>>>(0)) < (($771)>>>(0));
var $or_cond6_i=$or_cond5_i & $854;
if ($or_cond6_i) { label = 192; break; } else { var $ssize_2_i = $ssize_1_i;label = 196; break; }
case 192:
var $856=HEAP32[((((32)|0))>>2)];
var $857=((($773)-($ssize_1_i))|0);
var $858=((($857)+($856))|0);
var $859=(((-$856))|0);
var $860=$858 & $859;
var $861=(($860)>>>(0)) < 2147483647;
if ($861) { label = 193; break; } else { var $ssize_2_i = $ssize_1_i;label = 196; break; }
case 193:
var $863=_sbrk($860);
var $864=(($863)|(0))==-1;
if ($864) { label = 195; break; } else { label = 194; break; }
case 194:
var $866=((($860)+($ssize_1_i))|0);
var $ssize_2_i = $866;label = 196; break;
case 195:
var $868=_sbrk($849);
var $tsize_0303639_i = $tsize_0_i;label = 197; break;
case 196:
var $ssize_2_i;
var $870=(($br_0_i)|(0))==-1;
if ($870) { var $tsize_0303639_i = $tsize_0_i;label = 197; break; } else { var $tsize_244_i = $ssize_2_i;var $tbase_245_i = $br_0_i;label = 201; break; }
case 197:
var $tsize_0303639_i;
var $871=HEAP32[((((492)|0))>>2)];
var $872=$871 | 4;
HEAP32[((((492)|0))>>2)]=$872;
var $tsize_1_i = $tsize_0303639_i;label = 198; break;
case 198:
var $tsize_1_i;
var $874=(($776)>>>(0)) < 2147483647;
if ($874) { label = 199; break; } else { label = 340; break; }
case 199:
var $876=_sbrk($776);
var $877=_sbrk(0);
var $notlhs_i=(($876)|(0))!=-1;
var $notrhs_i=(($877)|(0))!=-1;
var $or_cond8_not_i=$notrhs_i & $notlhs_i;
var $878=(($876)>>>(0)) < (($877)>>>(0));
var $or_cond9_i=$or_cond8_not_i & $878;
if ($or_cond9_i) { label = 200; break; } else { label = 340; break; }
case 200:
var $879=$877;
var $880=$876;
var $881=((($879)-($880))|0);
var $882=((($nb_0)+(40))|0);
var $883=(($881)>>>(0)) > (($882)>>>(0));
var $_tsize_1_i=$883 ? $881 : $tsize_1_i;
var $_tbase_1_i=$883 ? $876 : -1;
var $884=(($_tbase_1_i)|(0))==-1;
if ($884) { label = 340; break; } else { var $tsize_244_i = $_tsize_1_i;var $tbase_245_i = $_tbase_1_i;label = 201; break; }
case 201:
var $tbase_245_i;
var $tsize_244_i;
var $885=HEAP32[((((480)|0))>>2)];
var $886=((($885)+($tsize_244_i))|0);
HEAP32[((((480)|0))>>2)]=$886;
var $887=HEAP32[((((484)|0))>>2)];
var $888=(($886)>>>(0)) > (($887)>>>(0));
if ($888) { label = 202; break; } else { label = 203; break; }
case 202:
HEAP32[((((484)|0))>>2)]=$886;
label = 203; break;
case 203:
var $890=HEAP32[((((72)|0))>>2)];
var $891=(($890)|(0))==0;
if ($891) { label = 204; break; } else { var $sp_067_i = ((496)|0);label = 211; break; }
case 204:
var $893=HEAP32[((((64)|0))>>2)];
var $894=(($893)|(0))==0;
var $895=(($tbase_245_i)>>>(0)) < (($893)>>>(0));
var $or_cond10_i=$894 | $895;
if ($or_cond10_i) { label = 205; break; } else { label = 206; break; }
case 205:
HEAP32[((((64)|0))>>2)]=$tbase_245_i;
label = 206; break;
case 206:
HEAP32[((((496)|0))>>2)]=$tbase_245_i;
HEAP32[((((500)|0))>>2)]=$tsize_244_i;
HEAP32[((((508)|0))>>2)]=0;
var $897=HEAP32[((((24)|0))>>2)];
HEAP32[((((84)|0))>>2)]=$897;
HEAP32[((((80)|0))>>2)]=-1;
var $i_02_i_i = 0;label = 207; break;
case 207:
var $i_02_i_i;
var $899=$i_02_i_i << 1;
var $900=((88+($899<<2))|0);
var $901=$900;
var $_sum_i_i=((($899)+(3))|0);
var $902=((88+($_sum_i_i<<2))|0);
HEAP32[(($902)>>2)]=$901;
var $_sum1_i_i=((($899)+(2))|0);
var $903=((88+($_sum1_i_i<<2))|0);
HEAP32[(($903)>>2)]=$901;
var $904=((($i_02_i_i)+(1))|0);
var $905=(($904)>>>(0)) < 32;
if ($905) { var $i_02_i_i = $904;label = 207; break; } else { label = 208; break; }
case 208:
var $906=((($tsize_244_i)-(40))|0);
var $907=(($tbase_245_i+8)|0);
var $908=$907;
var $909=$908 & 7;
var $910=(($909)|(0))==0;
if ($910) { var $914 = 0;label = 210; break; } else { label = 209; break; }
case 209:
var $912=(((-$908))|0);
var $913=$912 & 7;
var $914 = $913;label = 210; break;
case 210:
var $914;
var $915=(($tbase_245_i+$914)|0);
var $916=$915;
var $917=((($906)-($914))|0);
HEAP32[((((72)|0))>>2)]=$916;
HEAP32[((((60)|0))>>2)]=$917;
var $918=$917 | 1;
var $_sum_i14_i=((($914)+(4))|0);
var $919=(($tbase_245_i+$_sum_i14_i)|0);
var $920=$919;
HEAP32[(($920)>>2)]=$918;
var $_sum2_i_i=((($tsize_244_i)-(36))|0);
var $921=(($tbase_245_i+$_sum2_i_i)|0);
var $922=$921;
HEAP32[(($922)>>2)]=40;
var $923=HEAP32[((((40)|0))>>2)];
HEAP32[((((76)|0))>>2)]=$923;
label = 338; break;
case 211:
var $sp_067_i;
var $924=(($sp_067_i)|0);
var $925=HEAP32[(($924)>>2)];
var $926=(($sp_067_i+4)|0);
var $927=HEAP32[(($926)>>2)];
var $928=(($925+$927)|0);
var $929=(($tbase_245_i)|(0))==(($928)|(0));
if ($929) { label = 213; break; } else { label = 212; break; }
case 212:
var $931=(($sp_067_i+8)|0);
var $932=HEAP32[(($931)>>2)];
var $933=(($932)|(0))==0;
if ($933) { label = 218; break; } else { var $sp_067_i = $932;label = 211; break; }
case 213:
var $934=(($sp_067_i+12)|0);
var $935=HEAP32[(($934)>>2)];
var $936=$935 & 8;
var $937=(($936)|(0))==0;
if ($937) { label = 214; break; } else { label = 218; break; }
case 214:
var $939=$890;
var $940=(($939)>>>(0)) >= (($925)>>>(0));
var $941=(($939)>>>(0)) < (($tbase_245_i)>>>(0));
var $or_cond47_i=$940 & $941;
if ($or_cond47_i) { label = 215; break; } else { label = 218; break; }
case 215:
var $943=((($927)+($tsize_244_i))|0);
HEAP32[(($926)>>2)]=$943;
var $944=HEAP32[((((72)|0))>>2)];
var $945=HEAP32[((((60)|0))>>2)];
var $946=((($945)+($tsize_244_i))|0);
var $947=$944;
var $948=(($944+8)|0);
var $949=$948;
var $950=$949 & 7;
var $951=(($950)|(0))==0;
if ($951) { var $955 = 0;label = 217; break; } else { label = 216; break; }
case 216:
var $953=(((-$949))|0);
var $954=$953 & 7;
var $955 = $954;label = 217; break;
case 217:
var $955;
var $956=(($947+$955)|0);
var $957=$956;
var $958=((($946)-($955))|0);
HEAP32[((((72)|0))>>2)]=$957;
HEAP32[((((60)|0))>>2)]=$958;
var $959=$958 | 1;
var $_sum_i18_i=((($955)+(4))|0);
var $960=(($947+$_sum_i18_i)|0);
var $961=$960;
HEAP32[(($961)>>2)]=$959;
var $_sum2_i19_i=((($946)+(4))|0);
var $962=(($947+$_sum2_i19_i)|0);
var $963=$962;
HEAP32[(($963)>>2)]=40;
var $964=HEAP32[((((40)|0))>>2)];
HEAP32[((((76)|0))>>2)]=$964;
label = 338; break;
case 218:
var $965=HEAP32[((((64)|0))>>2)];
var $966=(($tbase_245_i)>>>(0)) < (($965)>>>(0));
if ($966) { label = 219; break; } else { label = 220; break; }
case 219:
HEAP32[((((64)|0))>>2)]=$tbase_245_i;
label = 220; break;
case 220:
var $968=(($tbase_245_i+$tsize_244_i)|0);
var $sp_160_i = ((496)|0);label = 221; break;
case 221:
var $sp_160_i;
var $970=(($sp_160_i)|0);
var $971=HEAP32[(($970)>>2)];
var $972=(($971)|(0))==(($968)|(0));
if ($972) { label = 223; break; } else { label = 222; break; }
case 222:
var $974=(($sp_160_i+8)|0);
var $975=HEAP32[(($974)>>2)];
var $976=(($975)|(0))==0;
if ($976) { label = 304; break; } else { var $sp_160_i = $975;label = 221; break; }
case 223:
var $977=(($sp_160_i+12)|0);
var $978=HEAP32[(($977)>>2)];
var $979=$978 & 8;
var $980=(($979)|(0))==0;
if ($980) { label = 224; break; } else { label = 304; break; }
case 224:
HEAP32[(($970)>>2)]=$tbase_245_i;
var $982=(($sp_160_i+4)|0);
var $983=HEAP32[(($982)>>2)];
var $984=((($983)+($tsize_244_i))|0);
HEAP32[(($982)>>2)]=$984;
var $985=(($tbase_245_i+8)|0);
var $986=$985;
var $987=$986 & 7;
var $988=(($987)|(0))==0;
if ($988) { var $993 = 0;label = 226; break; } else { label = 225; break; }
case 225:
var $990=(((-$986))|0);
var $991=$990 & 7;
var $993 = $991;label = 226; break;
case 226:
var $993;
var $994=(($tbase_245_i+$993)|0);
var $_sum93_i=((($tsize_244_i)+(8))|0);
var $995=(($tbase_245_i+$_sum93_i)|0);
var $996=$995;
var $997=$996 & 7;
var $998=(($997)|(0))==0;
if ($998) { var $1003 = 0;label = 228; break; } else { label = 227; break; }
case 227:
var $1000=(((-$996))|0);
var $1001=$1000 & 7;
var $1003 = $1001;label = 228; break;
case 228:
var $1003;
var $_sum94_i=((($1003)+($tsize_244_i))|0);
var $1004=(($tbase_245_i+$_sum94_i)|0);
var $1005=$1004;
var $1006=$1004;
var $1007=$994;
var $1008=((($1006)-($1007))|0);
var $_sum_i21_i=((($993)+($nb_0))|0);
var $1009=(($tbase_245_i+$_sum_i21_i)|0);
var $1010=$1009;
var $1011=((($1008)-($nb_0))|0);
var $1012=$nb_0 | 3;
var $_sum1_i22_i=((($993)+(4))|0);
var $1013=(($tbase_245_i+$_sum1_i22_i)|0);
var $1014=$1013;
HEAP32[(($1014)>>2)]=$1012;
var $1015=HEAP32[((((72)|0))>>2)];
var $1016=(($1005)|(0))==(($1015)|(0));
if ($1016) { label = 229; break; } else { label = 230; break; }
case 229:
var $1018=HEAP32[((((60)|0))>>2)];
var $1019=((($1018)+($1011))|0);
HEAP32[((((60)|0))>>2)]=$1019;
HEAP32[((((72)|0))>>2)]=$1010;
var $1020=$1019 | 1;
var $_sum46_i_i=((($_sum_i21_i)+(4))|0);
var $1021=(($tbase_245_i+$_sum46_i_i)|0);
var $1022=$1021;
HEAP32[(($1022)>>2)]=$1020;
label = 303; break;
case 230:
var $1024=HEAP32[((((68)|0))>>2)];
var $1025=(($1005)|(0))==(($1024)|(0));
if ($1025) { label = 231; break; } else { label = 232; break; }
case 231:
var $1027=HEAP32[((((56)|0))>>2)];
var $1028=((($1027)+($1011))|0);
HEAP32[((((56)|0))>>2)]=$1028;
HEAP32[((((68)|0))>>2)]=$1010;
var $1029=$1028 | 1;
var $_sum44_i_i=((($_sum_i21_i)+(4))|0);
var $1030=(($tbase_245_i+$_sum44_i_i)|0);
var $1031=$1030;
HEAP32[(($1031)>>2)]=$1029;
var $_sum45_i_i=((($1028)+($_sum_i21_i))|0);
var $1032=(($tbase_245_i+$_sum45_i_i)|0);
var $1033=$1032;
HEAP32[(($1033)>>2)]=$1028;
label = 303; break;
case 232:
var $_sum2_i23_i=((($tsize_244_i)+(4))|0);
var $_sum95_i=((($_sum2_i23_i)+($1003))|0);
var $1035=(($tbase_245_i+$_sum95_i)|0);
var $1036=$1035;
var $1037=HEAP32[(($1036)>>2)];
var $1038=$1037 & 3;
var $1039=(($1038)|(0))==1;
if ($1039) { label = 233; break; } else { var $oldfirst_0_i_i = $1005;var $qsize_0_i_i = $1011;label = 280; break; }
case 233:
var $1041=$1037 & -8;
var $1042=$1037 >>> 3;
var $1043=(($1037)>>>(0)) < 256;
if ($1043) { label = 234; break; } else { label = 246; break; }
case 234:
var $_sum3940_i_i=$1003 | 8;
var $_sum105_i=((($_sum3940_i_i)+($tsize_244_i))|0);
var $1045=(($tbase_245_i+$_sum105_i)|0);
var $1046=$1045;
var $1047=HEAP32[(($1046)>>2)];
var $_sum41_i_i=((($tsize_244_i)+(12))|0);
var $_sum106_i=((($_sum41_i_i)+($1003))|0);
var $1048=(($tbase_245_i+$_sum106_i)|0);
var $1049=$1048;
var $1050=HEAP32[(($1049)>>2)];
var $1051=$1042 << 1;
var $1052=((88+($1051<<2))|0);
var $1053=$1052;
var $1054=(($1047)|(0))==(($1053)|(0));
if ($1054) { label = 237; break; } else { label = 235; break; }
case 235:
var $1056=$1047;
var $1057=HEAP32[((((64)|0))>>2)];
var $1058=(($1056)>>>(0)) < (($1057)>>>(0));
if ($1058) { label = 245; break; } else { label = 236; break; }
case 236:
var $1060=(($1047+12)|0);
var $1061=HEAP32[(($1060)>>2)];
var $1062=(($1061)|(0))==(($1005)|(0));
if ($1062) { label = 237; break; } else { label = 245; break; }
case 237:
var $1063=(($1050)|(0))==(($1047)|(0));
if ($1063) { label = 238; break; } else { label = 239; break; }
case 238:
var $1065=1 << $1042;
var $1066=$1065 ^ -1;
var $1067=HEAP32[((((48)|0))>>2)];
var $1068=$1067 & $1066;
HEAP32[((((48)|0))>>2)]=$1068;
label = 279; break;
case 239:
var $1070=(($1050)|(0))==(($1053)|(0));
if ($1070) { label = 240; break; } else { label = 241; break; }
case 240:
var $_pre56_i_i=(($1050+8)|0);
var $_pre_phi57_i_i = $_pre56_i_i;label = 243; break;
case 241:
var $1072=$1050;
var $1073=HEAP32[((((64)|0))>>2)];
var $1074=(($1072)>>>(0)) < (($1073)>>>(0));
if ($1074) { label = 244; break; } else { label = 242; break; }
case 242:
var $1076=(($1050+8)|0);
var $1077=HEAP32[(($1076)>>2)];
var $1078=(($1077)|(0))==(($1005)|(0));
if ($1078) { var $_pre_phi57_i_i = $1076;label = 243; break; } else { label = 244; break; }
case 243:
var $_pre_phi57_i_i;
var $1079=(($1047+12)|0);
HEAP32[(($1079)>>2)]=$1050;
HEAP32[(($_pre_phi57_i_i)>>2)]=$1047;
label = 279; break;
case 244:
_abort();
throw "Reached an unreachable!";
case 245:
_abort();
throw "Reached an unreachable!";
case 246:
var $1081=$1004;
var $_sum34_i_i=$1003 | 24;
var $_sum96_i=((($_sum34_i_i)+($tsize_244_i))|0);
var $1082=(($tbase_245_i+$_sum96_i)|0);
var $1083=$1082;
var $1084=HEAP32[(($1083)>>2)];
var $_sum5_i_i=((($tsize_244_i)+(12))|0);
var $_sum97_i=((($_sum5_i_i)+($1003))|0);
var $1085=(($tbase_245_i+$_sum97_i)|0);
var $1086=$1085;
var $1087=HEAP32[(($1086)>>2)];
var $1088=(($1087)|(0))==(($1081)|(0));
if ($1088) { label = 252; break; } else { label = 247; break; }
case 247:
var $_sum3637_i_i=$1003 | 8;
var $_sum98_i=((($_sum3637_i_i)+($tsize_244_i))|0);
var $1090=(($tbase_245_i+$_sum98_i)|0);
var $1091=$1090;
var $1092=HEAP32[(($1091)>>2)];
var $1093=$1092;
var $1094=HEAP32[((((64)|0))>>2)];
var $1095=(($1093)>>>(0)) < (($1094)>>>(0));
if ($1095) { label = 251; break; } else { label = 248; break; }
case 248:
var $1097=(($1092+12)|0);
var $1098=HEAP32[(($1097)>>2)];
var $1099=(($1098)|(0))==(($1081)|(0));
if ($1099) { label = 249; break; } else { label = 251; break; }
case 249:
var $1101=(($1087+8)|0);
var $1102=HEAP32[(($1101)>>2)];
var $1103=(($1102)|(0))==(($1081)|(0));
if ($1103) { label = 250; break; } else { label = 251; break; }
case 250:
HEAP32[(($1097)>>2)]=$1087;
HEAP32[(($1101)>>2)]=$1092;
var $R_1_i_i = $1087;label = 259; break;
case 251:
_abort();
throw "Reached an unreachable!";
case 252:
var $_sum67_i_i=$1003 | 16;
var $_sum103_i=((($_sum2_i23_i)+($_sum67_i_i))|0);
var $1106=(($tbase_245_i+$_sum103_i)|0);
var $1107=$1106;
var $1108=HEAP32[(($1107)>>2)];
var $1109=(($1108)|(0))==0;
if ($1109) { label = 253; break; } else { var $R_0_i_i = $1108;var $RP_0_i_i = $1107;label = 254; break; }
case 253:
var $_sum104_i=((($_sum67_i_i)+($tsize_244_i))|0);
var $1111=(($tbase_245_i+$_sum104_i)|0);
var $1112=$1111;
var $1113=HEAP32[(($1112)>>2)];
var $1114=(($1113)|(0))==0;
if ($1114) { var $R_1_i_i = 0;label = 259; break; } else { var $R_0_i_i = $1113;var $RP_0_i_i = $1112;label = 254; break; }
case 254:
var $RP_0_i_i;
var $R_0_i_i;
var $1115=(($R_0_i_i+20)|0);
var $1116=HEAP32[(($1115)>>2)];
var $1117=(($1116)|(0))==0;
if ($1117) { label = 255; break; } else { var $R_0_i_i = $1116;var $RP_0_i_i = $1115;label = 254; break; }
case 255:
var $1119=(($R_0_i_i+16)|0);
var $1120=HEAP32[(($1119)>>2)];
var $1121=(($1120)|(0))==0;
if ($1121) { label = 256; break; } else { var $R_0_i_i = $1120;var $RP_0_i_i = $1119;label = 254; break; }
case 256:
var $1123=$RP_0_i_i;
var $1124=HEAP32[((((64)|0))>>2)];
var $1125=(($1123)>>>(0)) < (($1124)>>>(0));
if ($1125) { label = 258; break; } else { label = 257; break; }
case 257:
HEAP32[(($RP_0_i_i)>>2)]=0;
var $R_1_i_i = $R_0_i_i;label = 259; break;
case 258:
_abort();
throw "Reached an unreachable!";
case 259:
var $R_1_i_i;
var $1129=(($1084)|(0))==0;
if ($1129) { label = 279; break; } else { label = 260; break; }
case 260:
var $_sum31_i_i=((($tsize_244_i)+(28))|0);
var $_sum99_i=((($_sum31_i_i)+($1003))|0);
var $1131=(($tbase_245_i+$_sum99_i)|0);
var $1132=$1131;
var $1133=HEAP32[(($1132)>>2)];
var $1134=((352+($1133<<2))|0);
var $1135=HEAP32[(($1134)>>2)];
var $1136=(($1081)|(0))==(($1135)|(0));
if ($1136) { label = 261; break; } else { label = 263; break; }
case 261:
HEAP32[(($1134)>>2)]=$R_1_i_i;
var $cond_i_i=(($R_1_i_i)|(0))==0;
if ($cond_i_i) { label = 262; break; } else { label = 269; break; }
case 262:
var $1138=HEAP32[(($1132)>>2)];
var $1139=1 << $1138;
var $1140=$1139 ^ -1;
var $1141=HEAP32[((((52)|0))>>2)];
var $1142=$1141 & $1140;
HEAP32[((((52)|0))>>2)]=$1142;
label = 279; break;
case 263:
var $1144=$1084;
var $1145=HEAP32[((((64)|0))>>2)];
var $1146=(($1144)>>>(0)) < (($1145)>>>(0));
if ($1146) { label = 267; break; } else { label = 264; break; }
case 264:
var $1148=(($1084+16)|0);
var $1149=HEAP32[(($1148)>>2)];
var $1150=(($1149)|(0))==(($1081)|(0));
if ($1150) { label = 265; break; } else { label = 266; break; }
case 265:
HEAP32[(($1148)>>2)]=$R_1_i_i;
label = 268; break;
case 266:
var $1153=(($1084+20)|0);
HEAP32[(($1153)>>2)]=$R_1_i_i;
label = 268; break;
case 267:
_abort();
throw "Reached an unreachable!";
case 268:
var $1156=(($R_1_i_i)|(0))==0;
if ($1156) { label = 279; break; } else { label = 269; break; }
case 269:
var $1158=$R_1_i_i;
var $1159=HEAP32[((((64)|0))>>2)];
var $1160=(($1158)>>>(0)) < (($1159)>>>(0));
if ($1160) { label = 278; break; } else { label = 270; break; }
case 270:
var $1162=(($R_1_i_i+24)|0);
HEAP32[(($1162)>>2)]=$1084;
var $_sum3233_i_i=$1003 | 16;
var $_sum100_i=((($_sum3233_i_i)+($tsize_244_i))|0);
var $1163=(($tbase_245_i+$_sum100_i)|0);
var $1164=$1163;
var $1165=HEAP32[(($1164)>>2)];
var $1166=(($1165)|(0))==0;
if ($1166) { label = 274; break; } else { label = 271; break; }
case 271:
var $1168=$1165;
var $1169=HEAP32[((((64)|0))>>2)];
var $1170=(($1168)>>>(0)) < (($1169)>>>(0));
if ($1170) { label = 273; break; } else { label = 272; break; }
case 272:
var $1172=(($R_1_i_i+16)|0);
HEAP32[(($1172)>>2)]=$1165;
var $1173=(($1165+24)|0);
HEAP32[(($1173)>>2)]=$R_1_i_i;
label = 274; break;
case 273:
_abort();
throw "Reached an unreachable!";
case 274:
var $_sum101_i=((($_sum2_i23_i)+($_sum3233_i_i))|0);
var $1176=(($tbase_245_i+$_sum101_i)|0);
var $1177=$1176;
var $1178=HEAP32[(($1177)>>2)];
var $1179=(($1178)|(0))==0;
if ($1179) { label = 279; break; } else { label = 275; break; }
case 275:
var $1181=$1178;
var $1182=HEAP32[((((64)|0))>>2)];
var $1183=(($1181)>>>(0)) < (($1182)>>>(0));
if ($1183) { label = 277; break; } else { label = 276; break; }
case 276:
var $1185=(($R_1_i_i+20)|0);
HEAP32[(($1185)>>2)]=$1178;
var $1186=(($1178+24)|0);
HEAP32[(($1186)>>2)]=$R_1_i_i;
label = 279; break;
case 277:
_abort();
throw "Reached an unreachable!";
case 278:
_abort();
throw "Reached an unreachable!";
case 279:
var $_sum9_i_i=$1041 | $1003;
var $_sum102_i=((($_sum9_i_i)+($tsize_244_i))|0);
var $1190=(($tbase_245_i+$_sum102_i)|0);
var $1191=$1190;
var $1192=((($1041)+($1011))|0);
var $oldfirst_0_i_i = $1191;var $qsize_0_i_i = $1192;label = 280; break;
case 280:
var $qsize_0_i_i;
var $oldfirst_0_i_i;
var $1194=(($oldfirst_0_i_i+4)|0);
var $1195=HEAP32[(($1194)>>2)];
var $1196=$1195 & -2;
HEAP32[(($1194)>>2)]=$1196;
var $1197=$qsize_0_i_i | 1;
var $_sum10_i_i=((($_sum_i21_i)+(4))|0);
var $1198=(($tbase_245_i+$_sum10_i_i)|0);
var $1199=$1198;
HEAP32[(($1199)>>2)]=$1197;
var $_sum11_i_i=((($qsize_0_i_i)+($_sum_i21_i))|0);
var $1200=(($tbase_245_i+$_sum11_i_i)|0);
var $1201=$1200;
HEAP32[(($1201)>>2)]=$qsize_0_i_i;
var $1202=$qsize_0_i_i >>> 3;
var $1203=(($qsize_0_i_i)>>>(0)) < 256;
if ($1203) { label = 281; break; } else { label = 286; break; }
case 281:
var $1205=$1202 << 1;
var $1206=((88+($1205<<2))|0);
var $1207=$1206;
var $1208=HEAP32[((((48)|0))>>2)];
var $1209=1 << $1202;
var $1210=$1208 & $1209;
var $1211=(($1210)|(0))==0;
if ($1211) { label = 282; break; } else { label = 283; break; }
case 282:
var $1213=$1208 | $1209;
HEAP32[((((48)|0))>>2)]=$1213;
var $_sum27_pre_i_i=((($1205)+(2))|0);
var $_pre_i24_i=((88+($_sum27_pre_i_i<<2))|0);
var $F4_0_i_i = $1207;var $_pre_phi_i25_i = $_pre_i24_i;label = 285; break;
case 283:
var $_sum30_i_i=((($1205)+(2))|0);
var $1215=((88+($_sum30_i_i<<2))|0);
var $1216=HEAP32[(($1215)>>2)];
var $1217=$1216;
var $1218=HEAP32[((((64)|0))>>2)];
var $1219=(($1217)>>>(0)) < (($1218)>>>(0));
if ($1219) { label = 284; break; } else { var $F4_0_i_i = $1216;var $_pre_phi_i25_i = $1215;label = 285; break; }
case 284:
_abort();
throw "Reached an unreachable!";
case 285:
var $_pre_phi_i25_i;
var $F4_0_i_i;
HEAP32[(($_pre_phi_i25_i)>>2)]=$1010;
var $1222=(($F4_0_i_i+12)|0);
HEAP32[(($1222)>>2)]=$1010;
var $_sum28_i_i=((($_sum_i21_i)+(8))|0);
var $1223=(($tbase_245_i+$_sum28_i_i)|0);
var $1224=$1223;
HEAP32[(($1224)>>2)]=$F4_0_i_i;
var $_sum29_i_i=((($_sum_i21_i)+(12))|0);
var $1225=(($tbase_245_i+$_sum29_i_i)|0);
var $1226=$1225;
HEAP32[(($1226)>>2)]=$1207;
label = 303; break;
case 286:
var $1228=$1009;
var $1229=$qsize_0_i_i >>> 8;
var $1230=(($1229)|(0))==0;
if ($1230) { var $I7_0_i_i = 0;label = 289; break; } else { label = 287; break; }
case 287:
var $1232=(($qsize_0_i_i)>>>(0)) > 16777215;
if ($1232) { var $I7_0_i_i = 31;label = 289; break; } else { label = 288; break; }
case 288:
var $1234=((($1229)+(1048320))|0);
var $1235=$1234 >>> 16;
var $1236=$1235 & 8;
var $1237=$1229 << $1236;
var $1238=((($1237)+(520192))|0);
var $1239=$1238 >>> 16;
var $1240=$1239 & 4;
var $1241=$1240 | $1236;
var $1242=$1237 << $1240;
var $1243=((($1242)+(245760))|0);
var $1244=$1243 >>> 16;
var $1245=$1244 & 2;
var $1246=$1241 | $1245;
var $1247=(((14)-($1246))|0);
var $1248=$1242 << $1245;
var $1249=$1248 >>> 15;
var $1250=((($1247)+($1249))|0);
var $1251=$1250 << 1;
var $1252=((($1250)+(7))|0);
var $1253=$qsize_0_i_i >>> (($1252)>>>(0));
var $1254=$1253 & 1;
var $1255=$1254 | $1251;
var $I7_0_i_i = $1255;label = 289; break;
case 289:
var $I7_0_i_i;
var $1257=((352+($I7_0_i_i<<2))|0);
var $_sum12_i26_i=((($_sum_i21_i)+(28))|0);
var $1258=(($tbase_245_i+$_sum12_i26_i)|0);
var $1259=$1258;
HEAP32[(($1259)>>2)]=$I7_0_i_i;
var $_sum13_i_i=((($_sum_i21_i)+(16))|0);
var $1260=(($tbase_245_i+$_sum13_i_i)|0);
var $_sum14_i_i=((($_sum_i21_i)+(20))|0);
var $1261=(($tbase_245_i+$_sum14_i_i)|0);
var $1262=$1261;
HEAP32[(($1262)>>2)]=0;
var $1263=$1260;
HEAP32[(($1263)>>2)]=0;
var $1264=HEAP32[((((52)|0))>>2)];
var $1265=1 << $I7_0_i_i;
var $1266=$1264 & $1265;
var $1267=(($1266)|(0))==0;
if ($1267) { label = 290; break; } else { label = 291; break; }
case 290:
var $1269=$1264 | $1265;
HEAP32[((((52)|0))>>2)]=$1269;
HEAP32[(($1257)>>2)]=$1228;
var $1270=$1257;
var $_sum15_i_i=((($_sum_i21_i)+(24))|0);
var $1271=(($tbase_245_i+$_sum15_i_i)|0);
var $1272=$1271;
HEAP32[(($1272)>>2)]=$1270;
var $_sum16_i_i=((($_sum_i21_i)+(12))|0);
var $1273=(($tbase_245_i+$_sum16_i_i)|0);
var $1274=$1273;
HEAP32[(($1274)>>2)]=$1228;
var $_sum17_i_i=((($_sum_i21_i)+(8))|0);
var $1275=(($tbase_245_i+$_sum17_i_i)|0);
var $1276=$1275;
HEAP32[(($1276)>>2)]=$1228;
label = 303; break;
case 291:
var $1278=HEAP32[(($1257)>>2)];
var $1279=(($I7_0_i_i)|(0))==31;
if ($1279) { var $1284 = 0;label = 293; break; } else { label = 292; break; }
case 292:
var $1281=$I7_0_i_i >>> 1;
var $1282=(((25)-($1281))|0);
var $1284 = $1282;label = 293; break;
case 293:
var $1284;
var $1285=$qsize_0_i_i << $1284;
var $K8_0_i_i = $1285;var $T_0_i27_i = $1278;label = 294; break;
case 294:
var $T_0_i27_i;
var $K8_0_i_i;
var $1287=(($T_0_i27_i+4)|0);
var $1288=HEAP32[(($1287)>>2)];
var $1289=$1288 & -8;
var $1290=(($1289)|(0))==(($qsize_0_i_i)|(0));
if ($1290) { label = 299; break; } else { label = 295; break; }
case 295:
var $1292=$K8_0_i_i >>> 31;
var $1293=(($T_0_i27_i+16+($1292<<2))|0);
var $1294=HEAP32[(($1293)>>2)];
var $1295=(($1294)|(0))==0;
var $1296=$K8_0_i_i << 1;
if ($1295) { label = 296; break; } else { var $K8_0_i_i = $1296;var $T_0_i27_i = $1294;label = 294; break; }
case 296:
var $1298=$1293;
var $1299=HEAP32[((((64)|0))>>2)];
var $1300=(($1298)>>>(0)) < (($1299)>>>(0));
if ($1300) { label = 298; break; } else { label = 297; break; }
case 297:
HEAP32[(($1293)>>2)]=$1228;
var $_sum24_i_i=((($_sum_i21_i)+(24))|0);
var $1302=(($tbase_245_i+$_sum24_i_i)|0);
var $1303=$1302;
HEAP32[(($1303)>>2)]=$T_0_i27_i;
var $_sum25_i_i=((($_sum_i21_i)+(12))|0);
var $1304=(($tbase_245_i+$_sum25_i_i)|0);
var $1305=$1304;
HEAP32[(($1305)>>2)]=$1228;
var $_sum26_i_i=((($_sum_i21_i)+(8))|0);
var $1306=(($tbase_245_i+$_sum26_i_i)|0);
var $1307=$1306;
HEAP32[(($1307)>>2)]=$1228;
label = 303; break;
case 298:
_abort();
throw "Reached an unreachable!";
case 299:
var $1310=(($T_0_i27_i+8)|0);
var $1311=HEAP32[(($1310)>>2)];
var $1312=$T_0_i27_i;
var $1313=HEAP32[((((64)|0))>>2)];
var $1314=(($1312)>>>(0)) < (($1313)>>>(0));
if ($1314) { label = 302; break; } else { label = 300; break; }
case 300:
var $1316=$1311;
var $1317=(($1316)>>>(0)) < (($1313)>>>(0));
if ($1317) { label = 302; break; } else { label = 301; break; }
case 301:
var $1319=(($1311+12)|0);
HEAP32[(($1319)>>2)]=$1228;
HEAP32[(($1310)>>2)]=$1228;
var $_sum21_i_i=((($_sum_i21_i)+(8))|0);
var $1320=(($tbase_245_i+$_sum21_i_i)|0);
var $1321=$1320;
HEAP32[(($1321)>>2)]=$1311;
var $_sum22_i_i=((($_sum_i21_i)+(12))|0);
var $1322=(($tbase_245_i+$_sum22_i_i)|0);
var $1323=$1322;
HEAP32[(($1323)>>2)]=$T_0_i27_i;
var $_sum23_i_i=((($_sum_i21_i)+(24))|0);
var $1324=(($tbase_245_i+$_sum23_i_i)|0);
var $1325=$1324;
HEAP32[(($1325)>>2)]=0;
label = 303; break;
case 302:
_abort();
throw "Reached an unreachable!";
case 303:
var $_sum1819_i_i=$993 | 8;
var $1326=(($tbase_245_i+$_sum1819_i_i)|0);
var $mem_0 = $1326;label = 341; break;
case 304:
var $1327=$890;
var $sp_0_i_i_i = ((496)|0);label = 305; break;
case 305:
var $sp_0_i_i_i;
var $1329=(($sp_0_i_i_i)|0);
var $1330=HEAP32[(($1329)>>2)];
var $1331=(($1330)>>>(0)) > (($1327)>>>(0));
if ($1331) { label = 307; break; } else { label = 306; break; }
case 306:
var $1333=(($sp_0_i_i_i+4)|0);
var $1334=HEAP32[(($1333)>>2)];
var $1335=(($1330+$1334)|0);
var $1336=(($1335)>>>(0)) > (($1327)>>>(0));
if ($1336) { label = 308; break; } else { label = 307; break; }
case 307:
var $1338=(($sp_0_i_i_i+8)|0);
var $1339=HEAP32[(($1338)>>2)];
var $sp_0_i_i_i = $1339;label = 305; break;
case 308:
var $_sum_i15_i=((($1334)-(47))|0);
var $_sum1_i16_i=((($1334)-(39))|0);
var $1340=(($1330+$_sum1_i16_i)|0);
var $1341=$1340;
var $1342=$1341 & 7;
var $1343=(($1342)|(0))==0;
if ($1343) { var $1348 = 0;label = 310; break; } else { label = 309; break; }
case 309:
var $1345=(((-$1341))|0);
var $1346=$1345 & 7;
var $1348 = $1346;label = 310; break;
case 310:
var $1348;
var $_sum2_i17_i=((($_sum_i15_i)+($1348))|0);
var $1349=(($1330+$_sum2_i17_i)|0);
var $1350=(($890+16)|0);
var $1351=$1350;
var $1352=(($1349)>>>(0)) < (($1351)>>>(0));
var $1353=$1352 ? $1327 : $1349;
var $1354=(($1353+8)|0);
var $1355=$1354;
var $1356=((($tsize_244_i)-(40))|0);
var $1357=(($tbase_245_i+8)|0);
var $1358=$1357;
var $1359=$1358 & 7;
var $1360=(($1359)|(0))==0;
if ($1360) { var $1364 = 0;label = 312; break; } else { label = 311; break; }
case 311:
var $1362=(((-$1358))|0);
var $1363=$1362 & 7;
var $1364 = $1363;label = 312; break;
case 312:
var $1364;
var $1365=(($tbase_245_i+$1364)|0);
var $1366=$1365;
var $1367=((($1356)-($1364))|0);
HEAP32[((((72)|0))>>2)]=$1366;
HEAP32[((((60)|0))>>2)]=$1367;
var $1368=$1367 | 1;
var $_sum_i_i_i=((($1364)+(4))|0);
var $1369=(($tbase_245_i+$_sum_i_i_i)|0);
var $1370=$1369;
HEAP32[(($1370)>>2)]=$1368;
var $_sum2_i_i_i=((($tsize_244_i)-(36))|0);
var $1371=(($tbase_245_i+$_sum2_i_i_i)|0);
var $1372=$1371;
HEAP32[(($1372)>>2)]=40;
var $1373=HEAP32[((((40)|0))>>2)];
HEAP32[((((76)|0))>>2)]=$1373;
var $1374=(($1353+4)|0);
var $1375=$1374;
HEAP32[(($1375)>>2)]=27;
assert(16 % 1 === 0);HEAP32[(($1354)>>2)]=HEAP32[(((((496)|0)))>>2)];HEAP32[((($1354)+(4))>>2)]=HEAP32[((((((496)|0)))+(4))>>2)];HEAP32[((($1354)+(8))>>2)]=HEAP32[((((((496)|0)))+(8))>>2)];HEAP32[((($1354)+(12))>>2)]=HEAP32[((((((496)|0)))+(12))>>2)];
HEAP32[((((496)|0))>>2)]=$tbase_245_i;
HEAP32[((((500)|0))>>2)]=$tsize_244_i;
HEAP32[((((508)|0))>>2)]=0;
HEAP32[((((504)|0))>>2)]=$1355;
var $1376=(($1353+28)|0);
var $1377=$1376;
HEAP32[(($1377)>>2)]=7;
var $1378=(($1353+32)|0);
var $1379=(($1378)>>>(0)) < (($1335)>>>(0));
if ($1379) { var $1380 = $1377;label = 313; break; } else { label = 314; break; }
case 313:
var $1380;
var $1381=(($1380+4)|0);
HEAP32[(($1381)>>2)]=7;
var $1382=(($1380+8)|0);
var $1383=$1382;
var $1384=(($1383)>>>(0)) < (($1335)>>>(0));
if ($1384) { var $1380 = $1381;label = 313; break; } else { label = 314; break; }
case 314:
var $1385=(($1353)|(0))==(($1327)|(0));
if ($1385) { label = 338; break; } else { label = 315; break; }
case 315:
var $1387=$1353;
var $1388=$890;
var $1389=((($1387)-($1388))|0);
var $1390=(($1327+$1389)|0);
var $_sum3_i_i=((($1389)+(4))|0);
var $1391=(($1327+$_sum3_i_i)|0);
var $1392=$1391;
var $1393=HEAP32[(($1392)>>2)];
var $1394=$1393 & -2;
HEAP32[(($1392)>>2)]=$1394;
var $1395=$1389 | 1;
var $1396=(($890+4)|0);
HEAP32[(($1396)>>2)]=$1395;
var $1397=$1390;
HEAP32[(($1397)>>2)]=$1389;
var $1398=$1389 >>> 3;
var $1399=(($1389)>>>(0)) < 256;
if ($1399) { label = 316; break; } else { label = 321; break; }
case 316:
var $1401=$1398 << 1;
var $1402=((88+($1401<<2))|0);
var $1403=$1402;
var $1404=HEAP32[((((48)|0))>>2)];
var $1405=1 << $1398;
var $1406=$1404 & $1405;
var $1407=(($1406)|(0))==0;
if ($1407) { label = 317; break; } else { label = 318; break; }
case 317:
var $1409=$1404 | $1405;
HEAP32[((((48)|0))>>2)]=$1409;
var $_sum11_pre_i_i=((($1401)+(2))|0);
var $_pre_i_i=((88+($_sum11_pre_i_i<<2))|0);
var $F_0_i_i = $1403;var $_pre_phi_i_i = $_pre_i_i;label = 320; break;
case 318:
var $_sum12_i_i=((($1401)+(2))|0);
var $1411=((88+($_sum12_i_i<<2))|0);
var $1412=HEAP32[(($1411)>>2)];
var $1413=$1412;
var $1414=HEAP32[((((64)|0))>>2)];
var $1415=(($1413)>>>(0)) < (($1414)>>>(0));
if ($1415) { label = 319; break; } else { var $F_0_i_i = $1412;var $_pre_phi_i_i = $1411;label = 320; break; }
case 319:
_abort();
throw "Reached an unreachable!";
case 320:
var $_pre_phi_i_i;
var $F_0_i_i;
HEAP32[(($_pre_phi_i_i)>>2)]=$890;
var $1418=(($F_0_i_i+12)|0);
HEAP32[(($1418)>>2)]=$890;
var $1419=(($890+8)|0);
HEAP32[(($1419)>>2)]=$F_0_i_i;
var $1420=(($890+12)|0);
HEAP32[(($1420)>>2)]=$1403;
label = 338; break;
case 321:
var $1422=$890;
var $1423=$1389 >>> 8;
var $1424=(($1423)|(0))==0;
if ($1424) { var $I1_0_i_i = 0;label = 324; break; } else { label = 322; break; }
case 322:
var $1426=(($1389)>>>(0)) > 16777215;
if ($1426) { var $I1_0_i_i = 31;label = 324; break; } else { label = 323; break; }
case 323:
var $1428=((($1423)+(1048320))|0);
var $1429=$1428 >>> 16;
var $1430=$1429 & 8;
var $1431=$1423 << $1430;
var $1432=((($1431)+(520192))|0);
var $1433=$1432 >>> 16;
var $1434=$1433 & 4;
var $1435=$1434 | $1430;
var $1436=$1431 << $1434;
var $1437=((($1436)+(245760))|0);
var $1438=$1437 >>> 16;
var $1439=$1438 & 2;
var $1440=$1435 | $1439;
var $1441=(((14)-($1440))|0);
var $1442=$1436 << $1439;
var $1443=$1442 >>> 15;
var $1444=((($1441)+($1443))|0);
var $1445=$1444 << 1;
var $1446=((($1444)+(7))|0);
var $1447=$1389 >>> (($1446)>>>(0));
var $1448=$1447 & 1;
var $1449=$1448 | $1445;
var $I1_0_i_i = $1449;label = 324; break;
case 324:
var $I1_0_i_i;
var $1451=((352+($I1_0_i_i<<2))|0);
var $1452=(($890+28)|0);
var $I1_0_c_i_i=$I1_0_i_i;
HEAP32[(($1452)>>2)]=$I1_0_c_i_i;
var $1453=(($890+20)|0);
HEAP32[(($1453)>>2)]=0;
var $1454=(($890+16)|0);
HEAP32[(($1454)>>2)]=0;
var $1455=HEAP32[((((52)|0))>>2)];
var $1456=1 << $I1_0_i_i;
var $1457=$1455 & $1456;
var $1458=(($1457)|(0))==0;
if ($1458) { label = 325; break; } else { label = 326; break; }
case 325:
var $1460=$1455 | $1456;
HEAP32[((((52)|0))>>2)]=$1460;
HEAP32[(($1451)>>2)]=$1422;
var $1461=(($890+24)|0);
var $_c_i_i=$1451;
HEAP32[(($1461)>>2)]=$_c_i_i;
var $1462=(($890+12)|0);
HEAP32[(($1462)>>2)]=$890;
var $1463=(($890+8)|0);
HEAP32[(($1463)>>2)]=$890;
label = 338; break;
case 326:
var $1465=HEAP32[(($1451)>>2)];
var $1466=(($I1_0_i_i)|(0))==31;
if ($1466) { var $1471 = 0;label = 328; break; } else { label = 327; break; }
case 327:
var $1468=$I1_0_i_i >>> 1;
var $1469=(((25)-($1468))|0);
var $1471 = $1469;label = 328; break;
case 328:
var $1471;
var $1472=$1389 << $1471;
var $K2_0_i_i = $1472;var $T_0_i_i = $1465;label = 329; break;
case 329:
var $T_0_i_i;
var $K2_0_i_i;
var $1474=(($T_0_i_i+4)|0);
var $1475=HEAP32[(($1474)>>2)];
var $1476=$1475 & -8;
var $1477=(($1476)|(0))==(($1389)|(0));
if ($1477) { label = 334; break; } else { label = 330; break; }
case 330:
var $1479=$K2_0_i_i >>> 31;
var $1480=(($T_0_i_i+16+($1479<<2))|0);
var $1481=HEAP32[(($1480)>>2)];
var $1482=(($1481)|(0))==0;
var $1483=$K2_0_i_i << 1;
if ($1482) { label = 331; break; } else { var $K2_0_i_i = $1483;var $T_0_i_i = $1481;label = 329; break; }
case 331:
var $1485=$1480;
var $1486=HEAP32[((((64)|0))>>2)];
var $1487=(($1485)>>>(0)) < (($1486)>>>(0));
if ($1487) { label = 333; break; } else { label = 332; break; }
case 332:
HEAP32[(($1480)>>2)]=$1422;
var $1489=(($890+24)|0);
var $T_0_c8_i_i=$T_0_i_i;
HEAP32[(($1489)>>2)]=$T_0_c8_i_i;
var $1490=(($890+12)|0);
HEAP32[(($1490)>>2)]=$890;
var $1491=(($890+8)|0);
HEAP32[(($1491)>>2)]=$890;
label = 338; break;
case 333:
_abort();
throw "Reached an unreachable!";
case 334:
var $1494=(($T_0_i_i+8)|0);
var $1495=HEAP32[(($1494)>>2)];
var $1496=$T_0_i_i;
var $1497=HEAP32[((((64)|0))>>2)];
var $1498=(($1496)>>>(0)) < (($1497)>>>(0));
if ($1498) { label = 337; break; } else { label = 335; break; }
case 335:
var $1500=$1495;
var $1501=(($1500)>>>(0)) < (($1497)>>>(0));
if ($1501) { label = 337; break; } else { label = 336; break; }
case 336:
var $1503=(($1495+12)|0);
HEAP32[(($1503)>>2)]=$1422;
HEAP32[(($1494)>>2)]=$1422;
var $1504=(($890+8)|0);
var $_c7_i_i=$1495;
HEAP32[(($1504)>>2)]=$_c7_i_i;
var $1505=(($890+12)|0);
var $T_0_c_i_i=$T_0_i_i;
HEAP32[(($1505)>>2)]=$T_0_c_i_i;
var $1506=(($890+24)|0);
HEAP32[(($1506)>>2)]=0;
label = 338; break;
case 337:
_abort();
throw "Reached an unreachable!";
case 338:
var $1507=HEAP32[((((60)|0))>>2)];
var $1508=(($1507)>>>(0)) > (($nb_0)>>>(0));
if ($1508) { label = 339; break; } else { label = 340; break; }
case 339:
var $1510=((($1507)-($nb_0))|0);
HEAP32[((((60)|0))>>2)]=$1510;
var $1511=HEAP32[((((72)|0))>>2)];
var $1512=$1511;
var $1513=(($1512+$nb_0)|0);
var $1514=$1513;
HEAP32[((((72)|0))>>2)]=$1514;
var $1515=$1510 | 1;
var $_sum_i134=((($nb_0)+(4))|0);
var $1516=(($1512+$_sum_i134)|0);
var $1517=$1516;
HEAP32[(($1517)>>2)]=$1515;
var $1518=$nb_0 | 3;
var $1519=(($1511+4)|0);
HEAP32[(($1519)>>2)]=$1518;
var $1520=(($1511+8)|0);
var $1521=$1520;
var $mem_0 = $1521;label = 341; break;
case 340:
var $1522=___errno_location();
HEAP32[(($1522)>>2)]=12;
var $mem_0 = 0;label = 341; break;
case 341:
var $mem_0;
return $mem_0;
default: assert(0, "bad label: " + label);
}
}
Module["_malloc"] = _malloc;
function _free($mem) {
var label = 0;
label = 1;
while(1) switch(label) {
case 1:
var $1=(($mem)|(0))==0;
if ($1) { label = 140; break; } else { label = 2; break; }
case 2:
var $3=((($mem)-(8))|0);
var $4=$3;
var $5=HEAP32[((((64)|0))>>2)];
var $6=(($3)>>>(0)) < (($5)>>>(0));
if ($6) { label = 139; break; } else { label = 3; break; }
case 3:
var $8=((($mem)-(4))|0);
var $9=$8;
var $10=HEAP32[(($9)>>2)];
var $11=$10 & 3;
var $12=(($11)|(0))==1;
if ($12) { label = 139; break; } else { label = 4; break; }
case 4:
var $14=$10 & -8;
var $_sum=((($14)-(8))|0);
var $15=(($mem+$_sum)|0);
var $16=$15;
var $17=$10 & 1;
var $18=(($17)|(0))==0;
if ($18) { label = 5; break; } else { var $p_0 = $4;var $psize_0 = $14;label = 56; break; }
case 5:
var $20=$3;
var $21=HEAP32[(($20)>>2)];
var $22=(($11)|(0))==0;
if ($22) { label = 140; break; } else { label = 6; break; }
case 6:
var $_sum232=(((-8)-($21))|0);
var $24=(($mem+$_sum232)|0);
var $25=$24;
var $26=((($21)+($14))|0);
var $27=(($24)>>>(0)) < (($5)>>>(0));
if ($27) { label = 139; break; } else { label = 7; break; }
case 7:
var $29=HEAP32[((((68)|0))>>2)];
var $30=(($25)|(0))==(($29)|(0));
if ($30) { label = 54; break; } else { label = 8; break; }
case 8:
var $32=$21 >>> 3;
var $33=(($21)>>>(0)) < 256;
if ($33) { label = 9; break; } else { label = 21; break; }
case 9:
var $_sum276=((($_sum232)+(8))|0);
var $35=(($mem+$_sum276)|0);
var $36=$35;
var $37=HEAP32[(($36)>>2)];
var $_sum277=((($_sum232)+(12))|0);
var $38=(($mem+$_sum277)|0);
var $39=$38;
var $40=HEAP32[(($39)>>2)];
var $41=$32 << 1;
var $42=((88+($41<<2))|0);
var $43=$42;
var $44=(($37)|(0))==(($43)|(0));
if ($44) { label = 12; break; } else { label = 10; break; }
case 10:
var $46=$37;
var $47=(($46)>>>(0)) < (($5)>>>(0));
if ($47) { label = 20; break; } else { label = 11; break; }
case 11:
var $49=(($37+12)|0);
var $50=HEAP32[(($49)>>2)];
var $51=(($50)|(0))==(($25)|(0));
if ($51) { label = 12; break; } else { label = 20; break; }
case 12:
var $52=(($40)|(0))==(($37)|(0));
if ($52) { label = 13; break; } else { label = 14; break; }
case 13:
var $54=1 << $32;
var $55=$54 ^ -1;
var $56=HEAP32[((((48)|0))>>2)];
var $57=$56 & $55;
HEAP32[((((48)|0))>>2)]=$57;
var $p_0 = $25;var $psize_0 = $26;label = 56; break;
case 14:
var $59=(($40)|(0))==(($43)|(0));
if ($59) { label = 15; break; } else { label = 16; break; }
case 15:
var $_pre305=(($40+8)|0);
var $_pre_phi306 = $_pre305;label = 18; break;
case 16:
var $61=$40;
var $62=(($61)>>>(0)) < (($5)>>>(0));
if ($62) { label = 19; break; } else { label = 17; break; }
case 17:
var $64=(($40+8)|0);
var $65=HEAP32[(($64)>>2)];
var $66=(($65)|(0))==(($25)|(0));
if ($66) { var $_pre_phi306 = $64;label = 18; break; } else { label = 19; break; }
case 18:
var $_pre_phi306;
var $67=(($37+12)|0);
HEAP32[(($67)>>2)]=$40;
HEAP32[(($_pre_phi306)>>2)]=$37;
var $p_0 = $25;var $psize_0 = $26;label = 56; break;
case 19:
_abort();
throw "Reached an unreachable!";
case 20:
_abort();
throw "Reached an unreachable!";
case 21:
var $69=$24;
var $_sum266=((($_sum232)+(24))|0);
var $70=(($mem+$_sum266)|0);
var $71=$70;
var $72=HEAP32[(($71)>>2)];
var $_sum267=((($_sum232)+(12))|0);
var $73=(($mem+$_sum267)|0);
var $74=$73;
var $75=HEAP32[(($74)>>2)];
var $76=(($75)|(0))==(($69)|(0));
if ($76) { label = 27; break; } else { label = 22; break; }
case 22:
var $_sum273=((($_sum232)+(8))|0);
var $78=(($mem+$_sum273)|0);
var $79=$78;
var $80=HEAP32[(($79)>>2)];
var $81=$80;
var $82=(($81)>>>(0)) < (($5)>>>(0));
if ($82) { label = 26; break; } else { label = 23; break; }
case 23:
var $84=(($80+12)|0);
var $85=HEAP32[(($84)>>2)];
var $86=(($85)|(0))==(($69)|(0));
if ($86) { label = 24; break; } else { label = 26; break; }
case 24:
var $88=(($75+8)|0);
var $89=HEAP32[(($88)>>2)];
var $90=(($89)|(0))==(($69)|(0));
if ($90) { label = 25; break; } else { label = 26; break; }
case 25:
HEAP32[(($84)>>2)]=$75;
HEAP32[(($88)>>2)]=$80;
var $R_1 = $75;label = 34; break;
case 26:
_abort();
throw "Reached an unreachable!";
case 27:
var $_sum269=((($_sum232)+(20))|0);
var $93=(($mem+$_sum269)|0);
var $94=$93;
var $95=HEAP32[(($94)>>2)];
var $96=(($95)|(0))==0;
if ($96) { label = 28; break; } else { var $R_0 = $95;var $RP_0 = $94;label = 29; break; }
case 28:
var $_sum268=((($_sum232)+(16))|0);
var $98=(($mem+$_sum268)|0);
var $99=$98;
var $100=HEAP32[(($99)>>2)];
var $101=(($100)|(0))==0;
if ($101) { var $R_1 = 0;label = 34; break; } else { var $R_0 = $100;var $RP_0 = $99;label = 29; break; }
case 29:
var $RP_0;
var $R_0;
var $102=(($R_0+20)|0);
var $103=HEAP32[(($102)>>2)];
var $104=(($103)|(0))==0;
if ($104) { label = 30; break; } else { var $R_0 = $103;var $RP_0 = $102;label = 29; break; }
case 30:
var $106=(($R_0+16)|0);
var $107=HEAP32[(($106)>>2)];
var $108=(($107)|(0))==0;
if ($108) { label = 31; break; } else { var $R_0 = $107;var $RP_0 = $106;label = 29; break; }
case 31:
var $110=$RP_0;
var $111=(($110)>>>(0)) < (($5)>>>(0));
if ($111) { label = 33; break; } else { label = 32; break; }
case 32:
HEAP32[(($RP_0)>>2)]=0;
var $R_1 = $R_0;label = 34; break;
case 33:
_abort();
throw "Reached an unreachable!";
case 34:
var $R_1;
var $115=(($72)|(0))==0;
if ($115) { var $p_0 = $25;var $psize_0 = $26;label = 56; break; } else { label = 35; break; }
case 35:
var $_sum270=((($_sum232)+(28))|0);
var $117=(($mem+$_sum270)|0);
var $118=$117;
var $119=HEAP32[(($118)>>2)];
var $120=((352+($119<<2))|0);
var $121=HEAP32[(($120)>>2)];
var $122=(($69)|(0))==(($121)|(0));
if ($122) { label = 36; break; } else { label = 38; break; }
case 36:
HEAP32[(($120)>>2)]=$R_1;
var $cond=(($R_1)|(0))==0;
if ($cond) { label = 37; break; } else { label = 44; break; }
case 37:
var $124=HEAP32[(($118)>>2)];
var $125=1 << $124;
var $126=$125 ^ -1;
var $127=HEAP32[((((52)|0))>>2)];
var $128=$127 & $126;
HEAP32[((((52)|0))>>2)]=$128;
var $p_0 = $25;var $psize_0 = $26;label = 56; break;
case 38:
var $130=$72;
var $131=HEAP32[((((64)|0))>>2)];
var $132=(($130)>>>(0)) < (($131)>>>(0));
if ($132) { label = 42; break; } else { label = 39; break; }
case 39:
var $134=(($72+16)|0);
var $135=HEAP32[(($134)>>2)];
var $136=(($135)|(0))==(($69)|(0));
if ($136) { label = 40; break; } else { label = 41; break; }
case 40:
HEAP32[(($134)>>2)]=$R_1;
label = 43; break;
case 41:
var $139=(($72+20)|0);
HEAP32[(($139)>>2)]=$R_1;
label = 43; break;
case 42:
_abort();
throw "Reached an unreachable!";
case 43:
var $142=(($R_1)|(0))==0;
if ($142) { var $p_0 = $25;var $psize_0 = $26;label = 56; break; } else { label = 44; break; }
case 44:
var $144=$R_1;
var $145=HEAP32[((((64)|0))>>2)];
var $146=(($144)>>>(0)) < (($145)>>>(0));
if ($146) { label = 53; break; } else { label = 45; break; }
case 45:
var $148=(($R_1+24)|0);
HEAP32[(($148)>>2)]=$72;
var $_sum271=((($_sum232)+(16))|0);
var $149=(($mem+$_sum271)|0);
var $150=$149;
var $151=HEAP32[(($150)>>2)];
var $152=(($151)|(0))==0;
if ($152) { label = 49; break; } else { label = 46; break; }
case 46:
var $154=$151;
var $155=HEAP32[((((64)|0))>>2)];
var $156=(($154)>>>(0)) < (($155)>>>(0));
if ($156) { label = 48; break; } else { label = 47; break; }
case 47:
var $158=(($R_1+16)|0);
HEAP32[(($158)>>2)]=$151;
var $159=(($151+24)|0);
HEAP32[(($159)>>2)]=$R_1;
label = 49; break;
case 48:
_abort();
throw "Reached an unreachable!";
case 49:
var $_sum272=((($_sum232)+(20))|0);
var $162=(($mem+$_sum272)|0);
var $163=$162;
var $164=HEAP32[(($163)>>2)];
var $165=(($164)|(0))==0;
if ($165) { var $p_0 = $25;var $psize_0 = $26;label = 56; break; } else { label = 50; break; }
case 50:
var $167=$164;
var $168=HEAP32[((((64)|0))>>2)];
var $169=(($167)>>>(0)) < (($168)>>>(0));
if ($169) { label = 52; break; } else { label = 51; break; }
case 51:
var $171=(($R_1+20)|0);
HEAP32[(($171)>>2)]=$164;
var $172=(($164+24)|0);
HEAP32[(($172)>>2)]=$R_1;
var $p_0 = $25;var $psize_0 = $26;label = 56; break;
case 52:
_abort();
throw "Reached an unreachable!";
case 53:
_abort();
throw "Reached an unreachable!";
case 54:
var $_sum233=((($14)-(4))|0);
var $176=(($mem+$_sum233)|0);
var $177=$176;
var $178=HEAP32[(($177)>>2)];
var $179=$178 & 3;
var $180=(($179)|(0))==3;
if ($180) { label = 55; break; } else { var $p_0 = $25;var $psize_0 = $26;label = 56; break; }
case 55:
HEAP32[((((56)|0))>>2)]=$26;
var $182=HEAP32[(($177)>>2)];
var $183=$182 & -2;
HEAP32[(($177)>>2)]=$183;
var $184=$26 | 1;
var $_sum264=((($_sum232)+(4))|0);
var $185=(($mem+$_sum264)|0);
var $186=$185;
HEAP32[(($186)>>2)]=$184;
var $187=$15;
HEAP32[(($187)>>2)]=$26;
label = 140; break;
case 56:
var $psize_0;
var $p_0;
var $189=$p_0;
var $190=(($189)>>>(0)) < (($15)>>>(0));
if ($190) { label = 57; break; } else { label = 139; break; }
case 57:
var $_sum263=((($14)-(4))|0);
var $192=(($mem+$_sum263)|0);
var $193=$192;
var $194=HEAP32[(($193)>>2)];
var $195=$194 & 1;
var $phitmp=(($195)|(0))==0;
if ($phitmp) { label = 139; break; } else { label = 58; break; }
case 58:
var $197=$194 & 2;
var $198=(($197)|(0))==0;
if ($198) { label = 59; break; } else { label = 112; break; }
case 59:
var $200=HEAP32[((((72)|0))>>2)];
var $201=(($16)|(0))==(($200)|(0));
if ($201) { label = 60; break; } else { label = 62; break; }
case 60:
var $203=HEAP32[((((60)|0))>>2)];
var $204=((($203)+($psize_0))|0);
HEAP32[((((60)|0))>>2)]=$204;
HEAP32[((((72)|0))>>2)]=$p_0;
var $205=$204 | 1;
var $206=(($p_0+4)|0);
HEAP32[(($206)>>2)]=$205;
var $207=HEAP32[((((68)|0))>>2)];
var $208=(($p_0)|(0))==(($207)|(0));
if ($208) { label = 61; break; } else { label = 140; break; }
case 61:
HEAP32[((((68)|0))>>2)]=0;
HEAP32[((((56)|0))>>2)]=0;
label = 140; break;
case 62:
var $211=HEAP32[((((68)|0))>>2)];
var $212=(($16)|(0))==(($211)|(0));
if ($212) { label = 63; break; } else { label = 64; break; }
case 63:
var $214=HEAP32[((((56)|0))>>2)];
var $215=((($214)+($psize_0))|0);
HEAP32[((((56)|0))>>2)]=$215;
HEAP32[((((68)|0))>>2)]=$p_0;
var $216=$215 | 1;
var $217=(($p_0+4)|0);
HEAP32[(($217)>>2)]=$216;
var $218=(($189+$215)|0);
var $219=$218;
HEAP32[(($219)>>2)]=$215;
label = 140; break;
case 64:
var $221=$194 & -8;
var $222=((($221)+($psize_0))|0);
var $223=$194 >>> 3;
var $224=(($194)>>>(0)) < 256;
if ($224) { label = 65; break; } else { label = 77; break; }
case 65:
var $226=(($mem+$14)|0);
var $227=$226;
var $228=HEAP32[(($227)>>2)];
var $_sum257258=$14 | 4;
var $229=(($mem+$_sum257258)|0);
var $230=$229;
var $231=HEAP32[(($230)>>2)];
var $232=$223 << 1;
var $233=((88+($232<<2))|0);
var $234=$233;
var $235=(($228)|(0))==(($234)|(0));
if ($235) { label = 68; break; } else { label = 66; break; }
case 66:
var $237=$228;
var $238=HEAP32[((((64)|0))>>2)];
var $239=(($237)>>>(0)) < (($238)>>>(0));
if ($239) { label = 76; break; } else { label = 67; break; }
case 67:
var $241=(($228+12)|0);
var $242=HEAP32[(($241)>>2)];
var $243=(($242)|(0))==(($16)|(0));
if ($243) { label = 68; break; } else { label = 76; break; }
case 68:
var $244=(($231)|(0))==(($228)|(0));
if ($244) { label = 69; break; } else { label = 70; break; }
case 69:
var $246=1 << $223;
var $247=$246 ^ -1;
var $248=HEAP32[((((48)|0))>>2)];
var $249=$248 & $247;
HEAP32[((((48)|0))>>2)]=$249;
label = 110; break;
case 70:
var $251=(($231)|(0))==(($234)|(0));
if ($251) { label = 71; break; } else { label = 72; break; }
case 71:
var $_pre303=(($231+8)|0);
var $_pre_phi304 = $_pre303;label = 74; break;
case 72:
var $253=$231;
var $254=HEAP32[((((64)|0))>>2)];
var $255=(($253)>>>(0)) < (($254)>>>(0));
if ($255) { label = 75; break; } else { label = 73; break; }
case 73:
var $257=(($231+8)|0);
var $258=HEAP32[(($257)>>2)];
var $259=(($258)|(0))==(($16)|(0));
if ($259) { var $_pre_phi304 = $257;label = 74; break; } else { label = 75; break; }
case 74:
var $_pre_phi304;
var $260=(($228+12)|0);
HEAP32[(($260)>>2)]=$231;
HEAP32[(($_pre_phi304)>>2)]=$228;
label = 110; break;
case 75:
_abort();
throw "Reached an unreachable!";
case 76:
_abort();
throw "Reached an unreachable!";
case 77:
var $262=$15;
var $_sum235=((($14)+(16))|0);
var $263=(($mem+$_sum235)|0);
var $264=$263;
var $265=HEAP32[(($264)>>2)];
var $_sum236237=$14 | 4;
var $266=(($mem+$_sum236237)|0);
var $267=$266;
var $268=HEAP32[(($267)>>2)];
var $269=(($268)|(0))==(($262)|(0));
if ($269) { label = 83; break; } else { label = 78; break; }
case 78:
var $271=(($mem+$14)|0);
var $272=$271;
var $273=HEAP32[(($272)>>2)];
var $274=$273;
var $275=HEAP32[((((64)|0))>>2)];
var $276=(($274)>>>(0)) < (($275)>>>(0));
if ($276) { label = 82; break; } else { label = 79; break; }
case 79:
var $278=(($273+12)|0);
var $279=HEAP32[(($278)>>2)];
var $280=(($279)|(0))==(($262)|(0));
if ($280) { label = 80; break; } else { label = 82; break; }
case 80:
var $282=(($268+8)|0);
var $283=HEAP32[(($282)>>2)];
var $284=(($283)|(0))==(($262)|(0));
if ($284) { label = 81; break; } else { label = 82; break; }
case 81:
HEAP32[(($278)>>2)]=$268;
HEAP32[(($282)>>2)]=$273;
var $R7_1 = $268;label = 90; break;
case 82:
_abort();
throw "Reached an unreachable!";
case 83:
var $_sum239=((($14)+(12))|0);
var $287=(($mem+$_sum239)|0);
var $288=$287;
var $289=HEAP32[(($288)>>2)];
var $290=(($289)|(0))==0;
if ($290) { label = 84; break; } else { var $R7_0 = $289;var $RP9_0 = $288;label = 85; break; }
case 84:
var $_sum238=((($14)+(8))|0);
var $292=(($mem+$_sum238)|0);
var $293=$292;
var $294=HEAP32[(($293)>>2)];
var $295=(($294)|(0))==0;
if ($295) { var $R7_1 = 0;label = 90; break; } else { var $R7_0 = $294;var $RP9_0 = $293;label = 85; break; }
case 85:
var $RP9_0;
var $R7_0;
var $296=(($R7_0+20)|0);
var $297=HEAP32[(($296)>>2)];
var $298=(($297)|(0))==0;
if ($298) { label = 86; break; } else { var $R7_0 = $297;var $RP9_0 = $296;label = 85; break; }
case 86:
var $300=(($R7_0+16)|0);
var $301=HEAP32[(($300)>>2)];
var $302=(($301)|(0))==0;
if ($302) { label = 87; break; } else { var $R7_0 = $301;var $RP9_0 = $300;label = 85; break; }
case 87:
var $304=$RP9_0;
var $305=HEAP32[((((64)|0))>>2)];
var $306=(($304)>>>(0)) < (($305)>>>(0));
if ($306) { label = 89; break; } else { label = 88; break; }
case 88:
HEAP32[(($RP9_0)>>2)]=0;
var $R7_1 = $R7_0;label = 90; break;
case 89:
_abort();
throw "Reached an unreachable!";
case 90:
var $R7_1;
var $310=(($265)|(0))==0;
if ($310) { label = 110; break; } else { label = 91; break; }
case 91:
var $_sum250=((($14)+(20))|0);
var $312=(($mem+$_sum250)|0);
var $313=$312;
var $314=HEAP32[(($313)>>2)];
var $315=((352+($314<<2))|0);
var $316=HEAP32[(($315)>>2)];
var $317=(($262)|(0))==(($316)|(0));
if ($317) { label = 92; break; } else { label = 94; break; }
case 92:
HEAP32[(($315)>>2)]=$R7_1;
var $cond298=(($R7_1)|(0))==0;
if ($cond298) { label = 93; break; } else { label = 100; break; }
case 93:
var $319=HEAP32[(($313)>>2)];
var $320=1 << $319;
var $321=$320 ^ -1;
var $322=HEAP32[((((52)|0))>>2)];
var $323=$322 & $321;
HEAP32[((((52)|0))>>2)]=$323;
label = 110; break;
case 94:
var $325=$265;
var $326=HEAP32[((((64)|0))>>2)];
var $327=(($325)>>>(0)) < (($326)>>>(0));
if ($327) { label = 98; break; } else { label = 95; break; }
case 95:
var $329=(($265+16)|0);
var $330=HEAP32[(($329)>>2)];
var $331=(($330)|(0))==(($262)|(0));
if ($331) { label = 96; break; } else { label = 97; break; }
case 96:
HEAP32[(($329)>>2)]=$R7_1;
label = 99; break;
case 97:
var $334=(($265+20)|0);
HEAP32[(($334)>>2)]=$R7_1;
label = 99; break;
case 98:
_abort();
throw "Reached an unreachable!";
case 99:
var $337=(($R7_1)|(0))==0;
if ($337) { label = 110; break; } else { label = 100; break; }
case 100:
var $339=$R7_1;
var $340=HEAP32[((((64)|0))>>2)];
var $341=(($339)>>>(0)) < (($340)>>>(0));
if ($341) { label = 109; break; } else { label = 101; break; }
case 101:
var $343=(($R7_1+24)|0);
HEAP32[(($343)>>2)]=$265;
var $_sum251=((($14)+(8))|0);
var $344=(($mem+$_sum251)|0);
var $345=$344;
var $346=HEAP32[(($345)>>2)];
var $347=(($346)|(0))==0;
if ($347) { label = 105; break; } else { label = 102; break; }
case 102:
var $349=$346;
var $350=HEAP32[((((64)|0))>>2)];
var $351=(($349)>>>(0)) < (($350)>>>(0));
if ($351) { label = 104; break; } else { label = 103; break; }
case 103:
var $353=(($R7_1+16)|0);
HEAP32[(($353)>>2)]=$346;
var $354=(($346+24)|0);
HEAP32[(($354)>>2)]=$R7_1;
label = 105; break;
case 104:
_abort();
throw "Reached an unreachable!";
case 105:
var $_sum252=((($14)+(12))|0);
var $357=(($mem+$_sum252)|0);
var $358=$357;
var $359=HEAP32[(($358)>>2)];
var $360=(($359)|(0))==0;
if ($360) { label = 110; break; } else { label = 106; break; }
case 106:
var $362=$359;
var $363=HEAP32[((((64)|0))>>2)];
var $364=(($362)>>>(0)) < (($363)>>>(0));
if ($364) { label = 108; break; } else { label = 107; break; }
case 107:
var $366=(($R7_1+20)|0);
HEAP32[(($366)>>2)]=$359;
var $367=(($359+24)|0);
HEAP32[(($367)>>2)]=$R7_1;
label = 110; break;
case 108:
_abort();
throw "Reached an unreachable!";
case 109:
_abort();
throw "Reached an unreachable!";
case 110:
var $371=$222 | 1;
var $372=(($p_0+4)|0);
HEAP32[(($372)>>2)]=$371;
var $373=(($189+$222)|0);
var $374=$373;
HEAP32[(($374)>>2)]=$222;
var $375=HEAP32[((((68)|0))>>2)];
var $376=(($p_0)|(0))==(($375)|(0));
if ($376) { label = 111; break; } else { var $psize_1 = $222;label = 113; break; }
case 111:
HEAP32[((((56)|0))>>2)]=$222;
label = 140; break;
case 112:
var $379=$194 & -2;
HEAP32[(($193)>>2)]=$379;
var $380=$psize_0 | 1;
var $381=(($p_0+4)|0);
HEAP32[(($381)>>2)]=$380;
var $382=(($189+$psize_0)|0);
var $383=$382;
HEAP32[(($383)>>2)]=$psize_0;
var $psize_1 = $psize_0;label = 113; break;
case 113:
var $psize_1;
var $385=$psize_1 >>> 3;
var $386=(($psize_1)>>>(0)) < 256;
if ($386) { label = 114; break; } else { label = 119; break; }
case 114:
var $388=$385 << 1;
var $389=((88+($388<<2))|0);
var $390=$389;
var $391=HEAP32[((((48)|0))>>2)];
var $392=1 << $385;
var $393=$391 & $392;
var $394=(($393)|(0))==0;
if ($394) { label = 115; break; } else { label = 116; break; }
case 115:
var $396=$391 | $392;
HEAP32[((((48)|0))>>2)]=$396;
var $_sum248_pre=((($388)+(2))|0);
var $_pre=((88+($_sum248_pre<<2))|0);
var $F16_0 = $390;var $_pre_phi = $_pre;label = 118; break;
case 116:
var $_sum249=((($388)+(2))|0);
var $398=((88+($_sum249<<2))|0);
var $399=HEAP32[(($398)>>2)];
var $400=$399;
var $401=HEAP32[((((64)|0))>>2)];
var $402=(($400)>>>(0)) < (($401)>>>(0));
if ($402) { label = 117; break; } else { var $F16_0 = $399;var $_pre_phi = $398;label = 118; break; }
case 117:
_abort();
throw "Reached an unreachable!";
case 118:
var $_pre_phi;
var $F16_0;
HEAP32[(($_pre_phi)>>2)]=$p_0;
var $405=(($F16_0+12)|0);
HEAP32[(($405)>>2)]=$p_0;
var $406=(($p_0+8)|0);
HEAP32[(($406)>>2)]=$F16_0;
var $407=(($p_0+12)|0);
HEAP32[(($407)>>2)]=$390;
label = 140; break;
case 119:
var $409=$p_0;
var $410=$psize_1 >>> 8;
var $411=(($410)|(0))==0;
if ($411) { var $I18_0 = 0;label = 122; break; } else { label = 120; break; }
case 120:
var $413=(($psize_1)>>>(0)) > 16777215;
if ($413) { var $I18_0 = 31;label = 122; break; } else { label = 121; break; }
case 121:
var $415=((($410)+(1048320))|0);
var $416=$415 >>> 16;
var $417=$416 & 8;
var $418=$410 << $417;
var $419=((($418)+(520192))|0);
var $420=$419 >>> 16;
var $421=$420 & 4;
var $422=$421 | $417;
var $423=$418 << $421;
var $424=((($423)+(245760))|0);
var $425=$424 >>> 16;
var $426=$425 & 2;
var $427=$422 | $426;
var $428=(((14)-($427))|0);
var $429=$423 << $426;
var $430=$429 >>> 15;
var $431=((($428)+($430))|0);
var $432=$431 << 1;
var $433=((($431)+(7))|0);
var $434=$psize_1 >>> (($433)>>>(0));
var $435=$434 & 1;
var $436=$435 | $432;
var $I18_0 = $436;label = 122; break;
case 122:
var $I18_0;
var $438=((352+($I18_0<<2))|0);
var $439=(($p_0+28)|0);
var $I18_0_c=$I18_0;
HEAP32[(($439)>>2)]=$I18_0_c;
var $440=(($p_0+20)|0);
HEAP32[(($440)>>2)]=0;
var $441=(($p_0+16)|0);
HEAP32[(($441)>>2)]=0;
var $442=HEAP32[((((52)|0))>>2)];
var $443=1 << $I18_0;
var $444=$442 & $443;
var $445=(($444)|(0))==0;
if ($445) { label = 123; break; } else { label = 124; break; }
case 123:
var $447=$442 | $443;
HEAP32[((((52)|0))>>2)]=$447;
HEAP32[(($438)>>2)]=$409;
var $448=(($p_0+24)|0);
var $_c=$438;
HEAP32[(($448)>>2)]=$_c;
var $449=(($p_0+12)|0);
HEAP32[(($449)>>2)]=$p_0;
var $450=(($p_0+8)|0);
HEAP32[(($450)>>2)]=$p_0;
label = 136; break;
case 124:
var $452=HEAP32[(($438)>>2)];
var $453=(($I18_0)|(0))==31;
if ($453) { var $458 = 0;label = 126; break; } else { label = 125; break; }
case 125:
var $455=$I18_0 >>> 1;
var $456=(((25)-($455))|0);
var $458 = $456;label = 126; break;
case 126:
var $458;
var $459=$psize_1 << $458;
var $K19_0 = $459;var $T_0 = $452;label = 127; break;
case 127:
var $T_0;
var $K19_0;
var $461=(($T_0+4)|0);
var $462=HEAP32[(($461)>>2)];
var $463=$462 & -8;
var $464=(($463)|(0))==(($psize_1)|(0));
if ($464) { label = 132; break; } else { label = 128; break; }
case 128:
var $466=$K19_0 >>> 31;
var $467=(($T_0+16+($466<<2))|0);
var $468=HEAP32[(($467)>>2)];
var $469=(($468)|(0))==0;
var $470=$K19_0 << 1;
if ($469) { label = 129; break; } else { var $K19_0 = $470;var $T_0 = $468;label = 127; break; }
case 129:
var $472=$467;
var $473=HEAP32[((((64)|0))>>2)];
var $474=(($472)>>>(0)) < (($473)>>>(0));
if ($474) { label = 131; break; } else { label = 130; break; }
case 130:
HEAP32[(($467)>>2)]=$409;
var $476=(($p_0+24)|0);
var $T_0_c245=$T_0;
HEAP32[(($476)>>2)]=$T_0_c245;
var $477=(($p_0+12)|0);
HEAP32[(($477)>>2)]=$p_0;
var $478=(($p_0+8)|0);
HEAP32[(($478)>>2)]=$p_0;
label = 136; break;
case 131:
_abort();
throw "Reached an unreachable!";
case 132:
var $481=(($T_0+8)|0);
var $482=HEAP32[(($481)>>2)];
var $483=$T_0;
var $484=HEAP32[((((64)|0))>>2)];
var $485=(($483)>>>(0)) < (($484)>>>(0));
if ($485) { label = 135; break; } else { label = 133; break; }
case 133:
var $487=$482;
var $488=(($487)>>>(0)) < (($484)>>>(0));
if ($488) { label = 135; break; } else { label = 134; break; }
case 134:
var $490=(($482+12)|0);
HEAP32[(($490)>>2)]=$409;
HEAP32[(($481)>>2)]=$409;
var $491=(($p_0+8)|0);
var $_c244=$482;
HEAP32[(($491)>>2)]=$_c244;
var $492=(($p_0+12)|0);
var $T_0_c=$T_0;
HEAP32[(($492)>>2)]=$T_0_c;
var $493=(($p_0+24)|0);
HEAP32[(($493)>>2)]=0;
label = 136; break;
case 135:
_abort();
throw "Reached an unreachable!";
case 136:
var $495=HEAP32[((((80)|0))>>2)];
var $496=((($495)-(1))|0);
HEAP32[((((80)|0))>>2)]=$496;
var $497=(($496)|(0))==0;
if ($497) { var $sp_0_in_i = ((504)|0);label = 137; break; } else { label = 140; break; }
case 137:
var $sp_0_in_i;
var $sp_0_i=HEAP32[(($sp_0_in_i)>>2)];
var $498=(($sp_0_i)|(0))==0;
var $499=(($sp_0_i+8)|0);
if ($498) { label = 138; break; } else { var $sp_0_in_i = $499;label = 137; break; }
case 138:
HEAP32[((((80)|0))>>2)]=-1;
label = 140; break;
case 139:
_abort();
throw "Reached an unreachable!";
case 140:
return;
default: assert(0, "bad label: " + label);
}
}
Module["_free"] = _free;
// EMSCRIPTEN_END_FUNCS
// EMSCRIPTEN_END_FUNCS
// Warning: printing of i64 values may be slightly rounded! No deep i64 math used, so precise i64 code not included
var i64Math = null;
// === Auto-generated postamble setup entry stuff ===
function ExitStatus(status) {
this.name = "ExitStatus";
this.message = "Program terminated with exit(" + status + ")";
this.status = status;
};
ExitStatus.prototype = new Error();
ExitStatus.prototype.constructor = ExitStatus;
var initialStackTop;
var preloadStartTime = null;
Module['callMain'] = Module.callMain = function callMain(args) {
assert(runDependencies == 0, 'cannot call main when async dependencies remain! (listen on __ATMAIN__)');
assert(__ATPRERUN__.length == 0, 'cannot call main when preRun functions remain to be called');
args = args || [];
if (ENVIRONMENT_IS_WEB && preloadStartTime !== null) {
Module.printErr('preload time: ' + (Date.now() - preloadStartTime) + ' ms');
}
ensureInitRuntime();
var argc = args.length+1;
function pad() {
for (var i = 0; i < 4-1; i++) {
argv.push(0);
}
}
var argv = [allocate(intArrayFromString("/bin/this.program"), 'i8', ALLOC_NORMAL) ];
pad();
for (var i = 0; i < argc-1; i = i + 1) {
argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_NORMAL));
pad();
}
argv.push(0);
argv = allocate(argv, 'i32', ALLOC_NORMAL);
initialStackTop = STACKTOP;
try {
var ret = Module['_main'](argc, argv, 0);
// if we're not running an evented main loop, it's time to exit
if (!Module['noExitRuntime']) {
exit(ret);
}
}
catch(e) {
if (e instanceof ExitStatus) {
// exit() throws this once it's done to make sure execution
// has been stopped completely
return;
} else if (e == 'SimulateInfiniteLoop') {
// running an evented main loop, don't immediately exit
Module['noExitRuntime'] = true;
return;
} else {
throw e;
}
}
}
function run(args) {
args = args || Module['arguments'];
if (preloadStartTime === null) preloadStartTime = Date.now();
if (runDependencies > 0) {
Module.printErr('run() called, but dependencies remain, so not running');
return;
}
preRun();
if (runDependencies > 0) {
// a preRun added a dependency, run will be called later
return;
}
function doRun() {
ensureInitRuntime();
preMain();
calledRun = true;
if (Module['_main'] && shouldRunNow) {
Module['callMain'](args);
}
postRun();
}
if (Module['setStatus']) {
Module['setStatus']('Running...');
setTimeout(function() {
setTimeout(function() {
Module['setStatus']('');
}, 1);
if (!ABORT) doRun();
}, 1);
} else {
doRun();
}
}
Module['run'] = Module.run = run;
function exit(status) {
ABORT = true;
EXITSTATUS = status;
STACKTOP = initialStackTop;
// exit the runtime
exitRuntime();
// throw an exception to halt the current execution
throw new ExitStatus(status);
}
Module['exit'] = Module.exit = exit;
function abort(text) {
if (text) {
Module.print(text);
Module.printErr(text);
}
ABORT = true;
EXITSTATUS = 1;
throw 'abort() at ' + (new Error().stack);
}
Module['abort'] = Module.abort = abort;
// {{PRE_RUN_ADDITIONS}}
if (Module['preInit']) {
if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];
while (Module['preInit'].length > 0) {
Module['preInit'].pop()();
}
}
// shouldRunNow refers to calling main(), not run().
var shouldRunNow = true;
if (Module['noInitialRun']) {
shouldRunNow = false;
}
run();
// {{POST_RUN_ADDITIONS}}
// {{MODULE_ADDITIONS}}
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
typedef struct __attribute__((__packed__))
{
uint16_t length;
struct
{
int32_t int32;
} value[];
} Tuple;
int main() {
Tuple *t = malloc(sizeof(Tuple)+4);
t->length = 4;
t->value->int32 = 100;
printf("(%d, %d)", t->length, t->value->int32);
return 0;
}
// Clang outputs (4, 100)
// Emscripten outputs (100, 100)
@1998112
Copy link

1998112 commented Jan 15, 2015

Prest backspace on the illumi corp website cuz i fell on it by accident accident AHHA noo figured out all this with my head... did press on the backspace. bamm goes down to the bottom of the site and i see ~ Est: 1776 ~ soo like i did beafor and found github i wrote the code %230op again figured this out alone no member or what soo ever contacted me. i wrote ~ Est: 1776 ~%230op and this came up .. look i want too help u in some way i know i can i am usefull and let me proove it dont want too fuck up no ones plan i respect ur plans.. wright me back please

@1998112
Copy link

1998112 commented Jan 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment