Skip to content

Instantly share code, notes, and snippets.

@ziz

ziz/emcc-0-ll.js Secret

Created January 3, 2012 23:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziz/4e286d64ccfd24e5af82 to your computer and use it in GitHub Desktop.
Save ziz/4e286d64ccfd24e5af82 to your computer and use it in GitHub Desktop.
; ModuleID = '/var/folders/3l/kh8mjcln3s90hm6q5pswr6mc0000gn/T/tmpvVYMu1/src.cpp.o.bc'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"
%struct.gc_generation = type { %union.PyGC_Head, i32, i32 }
%union.PyGC_Head = type { %struct.anon }
%struct.anon = type { %union.PyGC_Head*, %union.PyGC_Head*, i32 }
@.str = private unnamed_addr constant [27 x i8] c"*%d,%d,%d,%d,%d,%d,%d,%d*\0A\00", align 1 ; [#uses=1 type=[27 x i8]*]
@.str1 = private unnamed_addr constant [12 x i8] c"*%d,%d,%d*\0A\00", align 1 ; [#uses=1 type=[12 x i8]*]
@_ZL11generations = internal global [3 x %struct.gc_generation] [%struct.gc_generation { %union.PyGC_Head { %struct.anon { %union.PyGC_Head* getelementptr inbounds ([3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 0, i32 0), %union.PyGC_Head* getelementptr inbounds ([3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 0, i32 0), i32 0 } }, i32 700, i32 0 }, %struct.gc_generation { %union.PyGC_Head { %struct.anon { %union.PyGC_Head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @_ZL11generations to i8*), i64 20) to %union.PyGC_Head*), %union.PyGC_Head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @_ZL11generations to i8*), i64 20) to %union.PyGC_Head*), i32 0 } }, i32 10, i32 0 }, %struct.gc_generation { %union.PyGC_Head { %struct.anon { %union.PyGC_Head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @_ZL11generations to i8*), i64 40) to %union.PyGC_Head*), %union.PyGC_Head* bitcast (i8* getelementptr (i8* bitcast ([3 x %struct.gc_generation]* @_ZL11generations to i8*), i64 40) to %union.PyGC_Head*), i32 0 } }, i32 10, i32 0 }], align 4 ; [#uses=8 type=[3 x %struct.gc_generation]*]
@.str2 = private unnamed_addr constant [6 x i8] c"*%d*\0A\00", align 1 ; [#uses=1 type=[6 x i8]*]
@.str3 = private unnamed_addr constant [10 x i8] c"%d:%d,%d\0A\00", align 1 ; [#uses=1 type=[10 x i8]*]
; [#uses=0]
define i32 @main() ssp {
%1 = alloca i32, align 4 ; [#uses=2 type=i32*]
%n = alloca %struct.gc_generation*, align 4 ; [#uses=9 type=%struct.gc_generation**]
%x1 = alloca i32, align 4 ; [#uses=2 type=i32*]
%x2 = alloca i32, align 4 ; [#uses=2 type=i32*]
%i = alloca i32, align 4 ; [#uses=6 type=i32*]
%list = alloca %union.PyGC_Head*, align 4 ; [#uses=5 type=%union.PyGC_Head**]
store i32 0, i32* %1
call void @llvm.dbg.declare(metadata !{%struct.gc_generation** %n}, metadata !36), !dbg !39 ; [debug line = 34:28] [debug variable = n]
store %struct.gc_generation* null, %struct.gc_generation** %n, align 4, !dbg !40 ; [debug line = 34:36]
%2 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%3 = getelementptr inbounds %struct.gc_generation* %2, i32 0, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%4 = ptrtoint %struct.gc_generation* %3 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%5 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%6 = getelementptr inbounds %struct.gc_generation* %5, i32 0, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%7 = getelementptr inbounds %struct.gc_generation* %6, i32 0, i32 0, !dbg !41 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 35:13]
%8 = ptrtoint %union.PyGC_Head* %7 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%9 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%10 = getelementptr inbounds %struct.gc_generation* %9, i32 0, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%11 = getelementptr inbounds %struct.gc_generation* %10, i32 0, i32 0, !dbg !41 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 35:13]
%12 = bitcast %union.PyGC_Head* %11 to %struct.anon*, !dbg !41 ; [#uses=1 type=%struct.anon*] [debug line = 35:13]
%13 = getelementptr inbounds %struct.anon* %12, i32 0, i32 0, !dbg !41 ; [#uses=1 type=%union.PyGC_Head**] [debug line = 35:13]
%14 = ptrtoint %union.PyGC_Head** %13 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%15 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%16 = getelementptr inbounds %struct.gc_generation* %15, i32 0, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%17 = getelementptr inbounds %struct.gc_generation* %16, i32 0, i32 0, !dbg !41 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 35:13]
%18 = bitcast %union.PyGC_Head* %17 to %struct.anon*, !dbg !41 ; [#uses=1 type=%struct.anon*] [debug line = 35:13]
%19 = getelementptr inbounds %struct.anon* %18, i32 0, i32 1, !dbg !41 ; [#uses=1 type=%union.PyGC_Head**] [debug line = 35:13]
%20 = ptrtoint %union.PyGC_Head** %19 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%21 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%22 = getelementptr inbounds %struct.gc_generation* %21, i32 0, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%23 = getelementptr inbounds %struct.gc_generation* %22, i32 0, i32 0, !dbg !41 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 35:13]
%24 = bitcast %union.PyGC_Head* %23 to %struct.anon*, !dbg !41 ; [#uses=1 type=%struct.anon*] [debug line = 35:13]
%25 = getelementptr inbounds %struct.anon* %24, i32 0, i32 2, !dbg !41 ; [#uses=1 type=i32*] [debug line = 35:13]
%26 = ptrtoint i32* %25 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%27 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%28 = getelementptr inbounds %struct.gc_generation* %27, i32 0, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%29 = getelementptr inbounds %struct.gc_generation* %28, i32 0, i32 1, !dbg !41 ; [#uses=1 type=i32*] [debug line = 35:13]
%30 = ptrtoint i32* %29 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%31 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%32 = getelementptr inbounds %struct.gc_generation* %31, i32 0, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%33 = getelementptr inbounds %struct.gc_generation* %32, i32 0, i32 2, !dbg !41 ; [#uses=1 type=i32*] [debug line = 35:13]
%34 = ptrtoint i32* %33 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%35 = load %struct.gc_generation** %n, align 4, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%36 = getelementptr inbounds %struct.gc_generation* %35, i32 1, !dbg !41 ; [#uses=1 type=%struct.gc_generation*] [debug line = 35:13]
%37 = ptrtoint %struct.gc_generation* %36 to i32, !dbg !41 ; [#uses=1 type=i32] [debug line = 35:13]
%38 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([27 x i8]* @.str, i32 0, i32 0), i32 %4, i32 %8, i32 %14, i32 %20, i32 %26, i32 %30, i32 %34, i32 %37), !dbg !41 ; [#uses=0 type=i32] [debug line = 35:13]
%39 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str1, i32 0, i32 0), i32 1, i32 zext (i1 icmp eq (i32 ptrtoint ([3 x %struct.gc_generation]* @_ZL11generations to i32), i32 ptrtoint (%union.PyGC_Head** getelementptr inbounds ([3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 0, i32 0, i32 0, i32 1) to i32)) to i32), i32 zext (i1 icmp eq (i32 ptrtoint ([3 x %struct.gc_generation]* @_ZL11generations to i32), i32 ptrtoint (%struct.gc_generation* getelementptr inbounds ([3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 1) to i32)) to i32)), !dbg !42 ; [#uses=0 type=i32] [debug line = 43:13]
call void @llvm.dbg.declare(metadata !{i32* %x1}, metadata !43), !dbg !44 ; [debug line = 51:17] [debug variable = x1]
store i32 ptrtoint ([3 x %struct.gc_generation]* @_ZL11generations to i32), i32* %x1, align 4, !dbg !45 ; [debug line = 51:44]
call void @llvm.dbg.declare(metadata !{i32* %x2}, metadata !46), !dbg !47 ; [debug line = 52:17] [debug variable = x2]
store i32 ptrtoint (%struct.gc_generation* getelementptr inbounds ([3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 1) to i32), i32* %x2, align 4, !dbg !48 ; [debug line = 52:44]
%40 = load i32* %x1, align 4, !dbg !49 ; [#uses=1 type=i32] [debug line = 53:13]
%41 = load i32* %x2, align 4, !dbg !49 ; [#uses=1 type=i32] [debug line = 53:13]
%42 = icmp eq i32 %40, %41, !dbg !49 ; [#uses=1 type=i1] [debug line = 53:13]
%43 = zext i1 %42 to i32, !dbg !49 ; [#uses=1 type=i32] [debug line = 53:13]
%44 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8]* @.str2, i32 0, i32 0), i32 %43), !dbg !49 ; [#uses=0 type=i32] [debug line = 53:13]
call void @llvm.dbg.declare(metadata !{i32* %i}, metadata !50), !dbg !52 ; [debug line = 54:22] [debug variable = i]
store i32 0, i32* %i, align 4, !dbg !53 ; [debug line = 54:27]
br label %45, !dbg !53 ; [debug line = 54:27]
; <label>:45 ; preds = %72, %0
%46 = load i32* %i, align 4, !dbg !53 ; [#uses=1 type=i32] [debug line = 54:27]
%47 = icmp slt i32 %46, 3, !dbg !53 ; [#uses=1 type=i1] [debug line = 54:27]
br i1 %47, label %48, label %75, !dbg !53 ; [debug line = 54:27]
; <label>:48 ; preds = %45
call void @llvm.dbg.declare(metadata !{%union.PyGC_Head** %list}, metadata !54), !dbg !56 ; [debug line = 55:26] [debug variable = list]
%49 = load i32* %i, align 4, !dbg !57 ; [#uses=1 type=i32] [debug line = 55:44]
%50 = getelementptr inbounds [3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 %49, !dbg !57 ; [#uses=1 type=%struct.gc_generation*] [debug line = 55:44]
%51 = getelementptr inbounds %struct.gc_generation* %50, i32 0, i32 0, !dbg !57 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 55:44]
store %union.PyGC_Head* %51, %union.PyGC_Head** %list, align 4, !dbg !57 ; [debug line = 55:44]
%52 = load i32* %i, align 4, !dbg !58 ; [#uses=1 type=i32] [debug line = 56:15]
%53 = load %union.PyGC_Head** %list, align 4, !dbg !58 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 56:15]
%54 = ptrtoint %union.PyGC_Head* %53 to i32, !dbg !58 ; [#uses=1 type=i32] [debug line = 56:15]
%55 = load %union.PyGC_Head** %list, align 4, !dbg !58 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 56:15]
%56 = bitcast %union.PyGC_Head* %55 to %struct.anon*, !dbg !58 ; [#uses=1 type=%struct.anon*] [debug line = 56:15]
%57 = getelementptr inbounds %struct.anon* %56, i32 0, i32 1, !dbg !58 ; [#uses=1 type=%union.PyGC_Head**] [debug line = 56:15]
%58 = load %union.PyGC_Head** %57, align 4, !dbg !58 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 56:15]
%59 = ptrtoint %union.PyGC_Head* %58 to i32, !dbg !58 ; [#uses=1 type=i32] [debug line = 56:15]
%60 = icmp eq i32 %54, %59, !dbg !58 ; [#uses=1 type=i1] [debug line = 56:15]
%61 = zext i1 %60 to i32, !dbg !58 ; [#uses=1 type=i32] [debug line = 56:15]
%62 = load %union.PyGC_Head** %list, align 4, !dbg !58 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 56:15]
%63 = ptrtoint %union.PyGC_Head* %62 to i32, !dbg !58 ; [#uses=1 type=i32] [debug line = 56:15]
%64 = load %union.PyGC_Head** %list, align 4, !dbg !58 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 56:15]
%65 = bitcast %union.PyGC_Head* %64 to %struct.anon*, !dbg !58 ; [#uses=1 type=%struct.anon*] [debug line = 56:15]
%66 = getelementptr inbounds %struct.anon* %65, i32 0, i32 0, !dbg !58 ; [#uses=1 type=%union.PyGC_Head**] [debug line = 56:15]
%67 = load %union.PyGC_Head** %66, align 4, !dbg !58 ; [#uses=1 type=%union.PyGC_Head*] [debug line = 56:15]
%68 = ptrtoint %union.PyGC_Head* %67 to i32, !dbg !58 ; [#uses=1 type=i32] [debug line = 56:15]
%69 = icmp eq i32 %63, %68, !dbg !58 ; [#uses=1 type=i1] [debug line = 56:15]
%70 = zext i1 %69 to i32, !dbg !58 ; [#uses=1 type=i32] [debug line = 56:15]
%71 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8]* @.str3, i32 0, i32 0), i32 %52, i32 %61, i32 %70), !dbg !58 ; [#uses=0 type=i32] [debug line = 56:15]
br label %72, !dbg !59 ; [debug line = 57:13]
; <label>:72 ; preds = %48
%73 = load i32* %i, align 4, !dbg !60 ; [#uses=1 type=i32] [debug line = 54:50]
%74 = add nsw i32 %73, 1, !dbg !60 ; [#uses=1 type=i32] [debug line = 54:50]
store i32 %74, i32* %i, align 4, !dbg !60 ; [debug line = 54:50]
br label %45, !dbg !60 ; [debug line = 54:50]
; <label>:75 ; preds = %45
%76 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8]* @.str1, i32 0, i32 0), i32 12, i32 20, i32 sub (i32 ptrtoint (%union.PyGC_Head* getelementptr inbounds ([3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 2, i32 0) to i32), i32 ptrtoint (%union.PyGC_Head* getelementptr inbounds ([3 x %struct.gc_generation]* @_ZL11generations, i32 0, i32 1, i32 0) to i32))), !dbg !61 ; [#uses=0 type=i32] [debug line = 58:13]
%77 = load i32* %1, !dbg !62 ; [#uses=1 type=i32] [debug line = 59:11]
ret i32 %77, !dbg !62 ; [debug line = 59:11]
}
; [#uses=5]
declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
; [#uses=5]
declare i32 @printf(i8*, ...)
!llvm.dbg.cu = !{!0}
!0 = metadata !{i32 720913, i32 0, i32 4, metadata !"/tmp/foo/emscripten_test_default_HG3a7B/src.cpp", metadata !"/private/tmp/foo/emscripten_test_default_HG3a7B", metadata !"clang version 3.0 (trunk 139974)", i1 true, i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !3, metadata !12} ; [ DW_TAG_compile_unit ]
!1 = metadata !{metadata !2}
!2 = metadata !{i32 0}
!3 = metadata !{metadata !4}
!4 = metadata !{metadata !5}
!5 = metadata !{i32 720942, i32 0, metadata !6, metadata !"main", metadata !"main", metadata !"", metadata !6, i32 33, metadata !7, i1 false, i1 true, i32 0, i32 0, i32 0, i32 256, i1 false, i32 ()* @main, null, null, metadata !10} ; [ DW_TAG_subprogram ]
!6 = metadata !{i32 720937, metadata !"/tmp/foo/emscripten_test_default_HG3a7B/src.cpp", metadata !"/private/tmp/foo/emscripten_test_default_HG3a7B", null} ; [ DW_TAG_file_type ]
!7 = metadata !{i32 720917, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i32 0, i32 0, i32 0, metadata !8, i32 0, i32 0} ; [ DW_TAG_subroutine_type ]
!8 = metadata !{metadata !9}
!9 = metadata !{i32 720932, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
!10 = metadata !{metadata !11}
!11 = metadata !{i32 720932} ; [ DW_TAG_base_type ]
!12 = metadata !{metadata !13}
!13 = metadata !{metadata !14}
!14 = metadata !{i32 720948, i32 0, null, metadata !"generations", metadata !"generations", metadata !"_ZL11generations", metadata !6, i32 25, metadata !15, i32 1, i32 1, [3 x %struct.gc_generation]* @_ZL11generations} ; [ DW_TAG_variable ]
!15 = metadata !{i32 720897, null, metadata !"", null, i32 0, i64 480, i64 32, i32 0, i32 0, metadata !16, metadata !34, i32 0, i32 0} ; [ DW_TAG_array_type ]
!16 = metadata !{i32 720898, null, metadata !"gc_generation", metadata !6, i32 14, i64 160, i64 32, i32 0, i32 0, null, metadata !17, i32 0, null, null} ; [ DW_TAG_class_type ]
!17 = metadata !{metadata !18, metadata !32, metadata !33}
!18 = metadata !{i32 720909, metadata !16, metadata !"head", metadata !6, i32 15, i64 96, i64 32, i64 0, i32 0, metadata !19} ; [ DW_TAG_member ]
!19 = metadata !{i32 720919, null, metadata !"PyGC_Head", metadata !6, i32 5, i64 96, i64 32, i64 0, i32 0, i32 0, metadata !20, i32 0, i32 0} ; [ DW_TAG_union_type ]
!20 = metadata !{metadata !21, metadata !30}
!21 = metadata !{i32 720909, metadata !19, metadata !"gc", metadata !6, i32 10, i64 96, i64 32, i64 0, i32 0, metadata !22} ; [ DW_TAG_member ]
!22 = metadata !{i32 720898, metadata !19, metadata !"", metadata !6, i32 6, i64 96, i64 32, i32 0, i32 0, null, metadata !23, i32 0, null, null} ; [ DW_TAG_class_type ]
!23 = metadata !{metadata !24, metadata !26, metadata !27}
!24 = metadata !{i32 720909, metadata !22, metadata !"gc_next", metadata !6, i32 7, i64 32, i64 32, i64 0, i32 0, metadata !25} ; [ DW_TAG_member ]
!25 = metadata !{i32 720911, null, metadata !"", null, i32 0, i64 32, i64 32, i64 0, i32 0, metadata !19} ; [ DW_TAG_pointer_type ]
!26 = metadata !{i32 720909, metadata !22, metadata !"gc_prev", metadata !6, i32 8, i64 32, i64 32, i64 32, i32 0, metadata !25} ; [ DW_TAG_member ]
!27 = metadata !{i32 720909, metadata !22, metadata !"gc_refs", metadata !6, i32 9, i64 32, i64 32, i64 64, i32 0, metadata !28} ; [ DW_TAG_member ]
!28 = metadata !{i32 720918, null, metadata !"size_t", metadata !6, i32 35, i64 0, i64 0, i64 0, i32 0, metadata !29} ; [ DW_TAG_typedef ]
!29 = metadata !{i32 720932, null, metadata !"unsigned int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 7} ; [ DW_TAG_base_type ]
!30 = metadata !{i32 720909, metadata !19, metadata !"dummy", metadata !6, i32 11, i64 96, i64 32, i64 0, i32 0, metadata !31} ; [ DW_TAG_member ]
!31 = metadata !{i32 720932, null, metadata !"long double", null, i32 0, i64 96, i64 32, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ]
!32 = metadata !{i32 720909, metadata !16, metadata !"threshold", metadata !6, i32 16, i64 32, i64 32, i64 96, i32 0, metadata !9} ; [ DW_TAG_member ]
!33 = metadata !{i32 720909, metadata !16, metadata !"count", metadata !6, i32 17, i64 32, i64 32, i64 128, i32 0, metadata !9} ; [ DW_TAG_member ]
!34 = metadata !{metadata !35}
!35 = metadata !{i32 720929, i64 0, i64 2} ; [ DW_TAG_subrange_type ]
!36 = metadata !{i32 721152, metadata !37, metadata !"n", metadata !6, i32 34, metadata !38, i32 0, i32 0} ; [ DW_TAG_auto_variable ]
!37 = metadata !{i32 720907, metadata !5, i32 33, i32 11, metadata !6, i32 0} ; [ DW_TAG_lexical_block ]
!38 = metadata !{i32 720911, null, metadata !"", null, i32 0, i64 32, i64 32, i64 0, i32 0, metadata !16} ; [ DW_TAG_pointer_type ]
!39 = metadata !{i32 34, i32 28, metadata !37, null}
!40 = metadata !{i32 34, i32 36, metadata !37, null}
!41 = metadata !{i32 35, i32 13, metadata !37, null}
!42 = metadata !{i32 43, i32 13, metadata !37, null}
!43 = metadata !{i32 721152, metadata !37, metadata !"x1", metadata !6, i32 51, metadata !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ]
!44 = metadata !{i32 51, i32 17, metadata !37, null}
!45 = metadata !{i32 51, i32 44, metadata !37, null}
!46 = metadata !{i32 721152, metadata !37, metadata !"x2", metadata !6, i32 52, metadata !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ]
!47 = metadata !{i32 52, i32 17, metadata !37, null}
!48 = metadata !{i32 52, i32 44, metadata !37, null}
!49 = metadata !{i32 53, i32 13, metadata !37, null}
!50 = metadata !{i32 721152, metadata !51, metadata !"i", metadata !6, i32 54, metadata !9, i32 0, i32 0} ; [ DW_TAG_auto_variable ]
!51 = metadata !{i32 720907, metadata !37, i32 54, i32 13, metadata !6, i32 1} ; [ DW_TAG_lexical_block ]
!52 = metadata !{i32 54, i32 22, metadata !51, null}
!53 = metadata !{i32 54, i32 27, metadata !51, null}
!54 = metadata !{i32 721152, metadata !55, metadata !"list", metadata !6, i32 55, metadata !25, i32 0, i32 0} ; [ DW_TAG_auto_variable ]
!55 = metadata !{i32 720907, metadata !51, i32 54, i32 55, metadata !6, i32 2} ; [ DW_TAG_lexical_block ]
!56 = metadata !{i32 55, i32 26, metadata !55, null}
!57 = metadata !{i32 55, i32 44, metadata !55, null}
!58 = metadata !{i32 56, i32 15, metadata !55, null}
!59 = metadata !{i32 57, i32 13, metadata !55, null}
!60 = metadata !{i32 54, i32 50, metadata !51, null}
!61 = metadata !{i32 58, i32 13, metadata !37, null}
!62 = metadata !{i32 59, i32 11, metadata !37, null}
// 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.
// TODO: " u s e s t r i c t ";
// *** Environment setup code ***
var arguments_ = [];
var ENVIRONMENT_IS_NODE = typeof process === 'object';
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
print = function(x) {
process['stdout'].write(x + '\n');
};
printErr = function(x) {
process['stderr'].write(x + '\n');
};
var nodeFS = require('fs');
read = function(filename) {
var ret = nodeFS['readFileSync'](filename).toString();
if (!ret && filename[0] != '/') {
filename = __dirname.split('/').slice(0, -1).join('/') + '/src/' + filename;
ret = nodeFS['readFileSync'](filename).toString();
}
return ret;
};
arguments_ = process['argv'].slice(2);
} else if (ENVIRONMENT_IS_SHELL) {
// Polyfill over SpiderMonkey/V8 differences
if (!this['read']) {
read = function(f) { snarf(f) };
}
if (!this['arguments']) {
arguments_ = scriptArgs;
} else {
arguments_ = arguments;
}
} else if (ENVIRONMENT_IS_WEB) {
print = printErr = function(x) {
console.log(x);
};
read = function(url) {
var xhr = new XMLHttpRequest();
xhr.open('GET', url, false);
xhr.send(null);
return xhr.responseText;
};
if (this['arguments']) {
arguments_ = arguments;
}
} else if (ENVIRONMENT_IS_WORKER) {
// We can do very little here...
load = importScripts;
} else {
throw 'Unknown runtime environment. Where are we?';
}
function globalEval(x) {
eval.call(null, x);
}
if (typeof load == 'undefined' && typeof read != 'undefined') {
load = function(f) {
globalEval(read(f));
};
}
if (typeof printErr === 'undefined') {
printErr = function(){};
}
if (typeof print === 'undefined') {
print = printErr;
}
// *** Environment setup code ***
try {
this['Module'] = Module;
} catch(e) {
this['Module'] = Module = {};
}
if (!Module.arguments) {
Module.arguments = arguments_;
}
if (Module.print) {
print = Module.print;
}
// === 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 (isNumber(target) && isNumber(quantum)) {
return Math.ceil(target/quantum)*quantum;
} else {
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 (/^\[\d+\ x\ (.*)\]/.test(type)) return true; // [15 x ?] blocks. Like structs
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 && type[type.length-1] == '*') {
size = Runtime.QUANTUM_SIZE; // A pointer
}
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;
},
calculateStructAlignment: function calculateStructAlignment(type) {
type.flatSize = 0;
type.alignSize = 0;
var diffs = [];
var prev = -1;
type.flatIndexes = type.fields.map(function(field) {
var size, alignSize;
if (Runtime.isNumberType(field) || Runtime.isPointerType(field)) {
size = Runtime.getNativeTypeSize(field); // pack char; char; in structs, also char[X]s.
alignSize = size;
} else if (Runtime.isStructType(field)) {
size = Types.types[field].flatSize;
alignSize = Types.types[field].alignSize;
} else {
throw 'Unclear type in struct: ' + field + ', in ' + type.name_ + ' :: ' + dump(Types.types[type.name_]);
}
alignSize = type.packed ? 1 : Math.min(alignSize, Runtime.QUANTUM_SIZE);
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 (!struct) struct = (typeof Types === 'undefined' ? Runtime : Types).structMetadata[typeName.replace(/.*\./, '')];
if (!struct) return null;
assert(type.fields.length === struct.length, 'Number of named fields must match the type for ' + typeName + '. Perhaps due to inheritance, which is not supported yet?');
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;
},
stackAlloc: function stackAlloc(size) { var ret = STACKTOP; STACKTOP += size;STACKTOP = Math.ceil((STACKTOP)/4)*4;; assert(STACKTOP < STACK_ROOT + STACK_MAX, "Ran out of stack"); return ret; },
staticAlloc: function staticAlloc(size) { var ret = STATICTOP; STATICTOP += size;STATICTOP = Math.ceil((STATICTOP)/4)*4;; if (STATICTOP >= TOTAL_MEMORY) enlargeMemory();; return ret; },
alignMemory: function alignMemory(size,quantum) { var ret = size = Math.ceil((size)/(quantum ? quantum : 4))*(quantum ? quantum : 4);; return ret; },
QUANTUM_SIZE: 4,
__dummy__: 0
}
var CorrectionsMonitor = {
MAX_ALLOWED: 0, // XXX
corrections: 0,
sigs: {},
note: function(type, succeed, sig) {
if (!succeed) {
this.corrections++;
if (this.corrections >= this.MAX_ALLOWED) abort('\n\nToo many corrections!');
}
},
print: function() {
var items = [];
for (var sig in this.sigs) {
items.push({
sig: sig,
fails: this.sigs[sig][0],
succeeds: this.sigs[sig][1],
total: this.sigs[sig][0] + this.sigs[sig][1]
});
}
items.sort(function(x, y) { return y.total - x.total; });
for (var i = 0; i < items.length; i++) {
var item = items[i];
print(item.sig + ' : ' + item.total + ' hits, %' + (Math.ceil(100*item.fails/item.total)) + ' failures');
}
}
};
//========================================
// Runtime essentials
//========================================
var __globalConstructor__ = function globalConstructor() {
};
var __THREW__ = false; // Used in checking for thrown exceptions.
var __ATEXIT__ = [];
var ABORT = false;
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 tempDoubleBuffer = new ArrayBuffer(8);
var tempDoubleI32 = new Int32Array(tempDoubleBuffer);
var tempDoubleF64 = new Float64Array(tempDoubleBuffer);
function abort(text) {
print(text + ':\n' + (new Error).stack);
ABORT = true;
throw "Assertion: " + text;
}
function assert(condition, text) {
if (!condition) {
abort('Assertion failed: ' + text);
}
}
// 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.
function setValue(ptr, value, type, noSafe) {
type = type || 'i8';
if (type[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': (HEAP32[((ptr)>>2)]=value[0],HEAP32[((ptr+4)>>2)]=value[1]); break;
case 'float': HEAPF32[((ptr)>>2)]=value; break;
case 'double': (tempDoubleF64[0]=value,HEAP32[((ptr)>>2)]=tempDoubleI32[0],HEAP32[((ptr+4)>>2)]=tempDoubleI32[1]); break;
default: abort('invalid type for setValue: ' + type);
}
}
Module['setValue'] = setValue;
// Parallel to setValue.
function getValue(ptr, type, noSafe) {
type = type || 'i8';
if (type[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 [HEAPU32[((ptr)>>2)],HEAPU32[((ptr+4)>>2)]];
case 'float': return HEAPF32[((ptr)>>2)];
case 'double': return (tempDoubleI32[0]=HEAP32[((ptr)>>2)],tempDoubleI32[1]=HEAP32[((ptr+4)>>2)],tempDoubleF64[0]);
default: abort('invalid type for setValue: ' + type);
}
return null;
}
Module['getValue'] = getValue;
// Allocates memory for some data and initializes it properly.
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
Module['ALLOC_NORMAL'] = ALLOC_NORMAL;
Module['ALLOC_STACK'] = ALLOC_STACK;
Module['ALLOC_STATIC'] = ALLOC_STATIC;
function allocate(slab, types, allocator) {
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 = [_malloc, Runtime.stackAlloc, Runtime.staticAlloc][allocator === undefined ? ALLOC_STATIC : allocator](Math.max(size, singleType ? 1 : types.length));
var i = 0, type;
while (i < size) {
var curr = zeroinit ? 0 : 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);
i += Runtime.getNativeTypeSize(type);
}
return ret;
}
Module['allocate'] = allocate;
function Pointer_stringify(ptr) {
var ret = "";
var i = 0;
var t;
var nullByte = String.fromCharCode(0);
while (1) {
t = String.fromCharCode(HEAPU8[(ptr+i)]);
if (t == nullByte) { break; } else {}
ret += t;
i += 1;
}
return ret;
}
Module['Pointer_stringify'] = Pointer_stringify;
function Array_stringify(array) {
var ret = "";
for (var i = 0; i < array.length; i++) {
ret += String.fromCharCode(array[i]);
}
return ret;
}
Module['Array_stringify'] = Array_stringify;
// Memory management
var FUNCTION_TABLE; // XXX: In theory the indexes here can be equal to pointers to stacked or malloced memory. Such comparisons should
// be false, but can turn out true. We should probably set the top bit to prevent such issues.
var PAGE_SIZE = 4096;
function alignMemoryPage(x) {
return Math.ceil(x/PAGE_SIZE)*PAGE_SIZE;
}
var HEAP;
var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32;
var STACK_ROOT, STACKTOP, STACK_MAX;
var STATICTOP;
function enlargeMemory() {
// TOTAL_MEMORY is the current size of the actual array, and STATICTOP is the new top.
printErr('Warning: Enlarging memory arrays, this is not fast! ' + [STATICTOP, TOTAL_MEMORY]);
assert(STATICTOP >= TOTAL_MEMORY);
assert(TOTAL_MEMORY > 4); // So the loop below will not be infinite
while (TOTAL_MEMORY <= STATICTOP) { // Simple heuristic. Override enlargeMemory() if your program has something more optimal for it
TOTAL_MEMORY = alignMemoryPage(TOTAL_MEMORY*1.25);
}
var oldHEAP8 = HEAP8;
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);
HEAP8.set(oldHEAP8);
}
var TOTAL_MEMORY = Module['TOTAL_MEMORY'] || 10485760;
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);
// 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');
var base = intArrayFromString('(null)'); // So printing %s of NULL gives '(null)'
// Also this ensures we leave 0 as an invalid address, 'NULL'
STATICTOP = base.length;
for (var i = 0; i < base.length; i++) {
HEAP8[(i)]=base[i]
}
Module['HEAP'] = HEAP;
Module['HEAP8'] = HEAP8;
Module['HEAP16'] = HEAP16;
Module['HEAP32'] = HEAP32;
Module['HEAPU8'] = HEAPU8;
Module['HEAPU16'] = HEAPU16;
Module['HEAPU32'] = HEAPU32;
Module['HEAPF32'] = HEAPF32;
STACK_ROOT = STACKTOP = alignMemoryPage(10);
var TOTAL_STACK = 1024*1024; // XXX: Changing this value can lead to bad perf on v8!
STACK_MAX = STACK_ROOT + TOTAL_STACK;
STATICTOP = alignMemoryPage(STACK_MAX);
function __shutdownRuntime__() {
while(__ATEXIT__.length > 0) {
var atexit = __ATEXIT__.pop();
var func = atexit.func;
if (typeof func === 'number') {
func = FUNCTION_TABLE[func];
}
func(atexit.arg === undefined ? null : atexit.arg);
}
// allow browser to GC, set heaps to null?
// Print summary of correction activity
CorrectionsMonitor.print();
}
// Copies a list of num items on the HEAP into a
// a normal JavaScript array of numbers
function Array_copy(ptr, num) {
return Array.prototype.slice.call(HEAP8.subarray(ptr, ptr+num)); // Make a normal array out of the typed 'view'
// Consider making a typed array here, for speed?
return HEAP.slice(ptr, ptr+num);
}
Module['Array_copy'] = Array_copy;
function String_len(ptr) {
var i = 0;
while (HEAP8[(ptr+i)]) i++; // Note: should be |!= 0|, technically. But this helps catch bugs with undefineds
return i;
}
Module['String_len'] = String_len;
// Copies a C-style string, terminated by a zero, from the HEAP into
// a normal JavaScript array of numbers
function String_copy(ptr, addZero) {
var len = String_len(ptr);
if (addZero) len++;
var ret = Array_copy(ptr, len);
if (addZero) ret[len-1] = 0;
return ret;
}
Module['String_copy'] = String_copy;
// 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) {
var ret = [];
var t;
var i = 0;
while (i < stringy.length) {
var chr = stringy.charCodeAt(i);
if (chr > 0xFF) {
assert(false, 'Character code ' + chr + ' (' + stringy[i] + ') at offset ' + i + ' not in 0x00-0xFF.');
chr &= 0xFF;
}
ret.push(chr);
i = i + 1;
}
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;
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;
// TODO: clean up previous line
}
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;
}
// === Body ===
function _main() {
;
var __label__;
__label__ = -1;
while(1) switch(__label__) {
case -1: // $0
var $1;
var $n;
var $x1;
var $x2;
var $i;
var $list;
$1=0;
$n=0; //@line 34 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $2=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $3=(($2)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $4=($3); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $5=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $6=(($5)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $7=(($6)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $8=($7); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $9=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $10=(($9)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $11=(($10)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $12=$11; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $13=(($12)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $14=($13); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $15=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $16=(($15)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $17=(($16)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $18=$17; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $19=(($18+4)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $20=($19); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $21=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $22=(($21)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $23=(($22)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $24=$23; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $25=(($24+8)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $26=($25); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $27=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $28=(($27)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $29=(($28+12)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $30=($29); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $31=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $32=(($31)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $33=(($32+16)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $34=($33); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $35=$n; //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $36=(($35+20)|0); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $37=($36); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $38=_printf(((__str)|0), allocate([$4,0,0,0,$8,0,0,0,$14,0,0,0,$20,0,0,0,$26,0,0,0,$30,0,0,0,$34,0,0,0,$37,0,0,0], ["i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0], ALLOC_STACK)); //@line 35 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $39=_printf(((__str1)|0), allocate([1,0,0,0,(((((((__ZL11generations)))|0)==((((((__ZL11generations+4)|0))))|0)))&1),0,0,0,(((((((__ZL11generations)))|0)==((((((__ZL11generations+20)|0))))|0)))&1),0,0,0], ["i32",0,0,0,"i32",0,0,0,"i32",0,0,0], ALLOC_STACK)); //@line 43 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
$x1=(__ZL11generations); //@line 51 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
$x2=(((__ZL11generations+20)|0)); //@line 52 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $40=$x1; //@line 53 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $41=$x2; //@line 53 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $42=((($40))|0)==((($41))|0); //@line 53 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $43=((($42))&1); //@line 53 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $44=_printf(((__str2)|0), allocate([$43,0,0,0], ["i32",0,0,0], ALLOC_STACK)); //@line 53 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
$i=0; //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
__label__ = 1; break; //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
case 1: // $45
var $46=$i; //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $47=((($46))|0) < 3; //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
if ($47) { __label__ = 2; break; } else { __label__ = 4; break; } //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
case 2: // $48
var $49=$i; //@line 55 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $50=((__ZL11generations+$49*20)|0); //@line 55 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $51=(($50)|0); //@line 55 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
$list=$51; //@line 55 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $52=$i; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $53=$list; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $54=($53); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $55=$list; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $56=$55; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $57=(($56+4)|0); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $58=HEAP32[(($57)>>2)]; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $59=($58); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $60=((($54))|0)==((($59))|0); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $61=((($60))&1); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $62=$list; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $63=($62); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $64=$list; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $65=$64; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $66=(($65)|0); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $67=HEAP32[(($66)>>2)]; //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $68=($67); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $69=((($63))|0)==((($68))|0); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $70=((($69))&1); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $71=_printf(((__str3)|0), allocate([$52,0,0,0,$61,0,0,0,$70,0,0,0], ["i32",0,0,0,"i32",0,0,0,"i32",0,0,0], ALLOC_STACK)); //@line 56 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
__label__ = 3; break; //@line 57 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
case 3: // $72
var $73=$i; //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $74=((($73)+1)|0); //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
$i=$74; //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
__label__ = 1; break; //@line 54 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
case 4: // $75
var $76=_printf(((__str1)|0), allocate([12,0,0,0,20,0,0,0,((((((__ZL11generations+40)|0)))-((((__ZL11generations+20)|0))))|0),0,0,0], ["i32",0,0,0,"i32",0,0,0,"i32",0,0,0], ALLOC_STACK)); //@line 58 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
var $77=$1; //@line 59 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
;
return $77; //@line 59 "/tmp/foo/emscripten_test_default_HG3a7B/src.cpp"
default: assert(0, "bad label: " + __label__);
}
}
Module["_main"] = _main;_main["X"]=1;
var _llvm_dbg_declare; // stub for _llvm_dbg_declare
var ERRNO_CODES={E2BIG:7,EACCES:13,EADDRINUSE:98,EADDRNOTAVAIL:99,EAFNOSUPPORT:97,EAGAIN:11,EALREADY:114,EBADF:9,EBADMSG:74,EBUSY:16,ECANCELED:125,ECHILD:10,ECONNABORTED:103,ECONNREFUSED:111,ECONNRESET:104,EDEADLK:35,EDESTADDRREQ:89,EDOM:33,EDQUOT:122,EEXIST:17,EFAULT:14,EFBIG:27,EHOSTUNREACH:113,EIDRM:43,EILSEQ:84,EINPROGRESS:115,EINTR:4,EINVAL:22,EIO:5,EISCONN:106,EISDIR:21,ELOOP:40,EMFILE:24,EMLINK:31,EMSGSIZE:90,EMULTIHOP:72,ENAMETOOLONG:36,ENETDOWN:100,ENETRESET:102,ENETUNREACH:101,ENFILE:23,ENOBUFS:105,ENODATA:61,ENODEV:19,ENOENT:2,ENOEXEC:8,ENOLCK:37,ENOLINK:67,ENOMEM:12,ENOMSG:42,ENOPROTOOPT:92,ENOSPC:28,ENOSR:63,ENOSTR:60,ENOSYS:38,ENOTCONN:107,ENOTDIR:20,ENOTEMPTY:39,ENOTRECOVERABLE:131,ENOTSOCK:88,ENOTSUP:95,ENOTTY:25,ENXIO:6,EOVERFLOW:75,EOWNERDEAD:130,EPERM:1,EPIPE:32,EPROTO:71,EPROTONOSUPPORT:93,EPROTOTYPE:91,ERANGE:34,EROFS:30,ESPIPE:29,ESRCH:3,ESTALE:116,ETIME:62,ETIMEDOUT:110,ETXTBSY:26,EWOULDBLOCK:11,EXDEV:18};
function ___setErrNo(value) {
// For convenient setting and returning of errno.
if (!___setErrNo.ret) ___setErrNo.ret = allocate([0], 'i32', ALLOC_STATIC);
HEAP32[((___setErrNo.ret)>>2)]=value
return value;
}
var _stdin=0;
var _stdout=0;
var _stderr=0;
var __impure_ptr=0;var FS={currentPath:"/",nextInode:2,streams:[null],ignorePermissions:true,absolutePath:function (relative, base) {
if (typeof relative !== 'string') return null;
if (base === undefined) base = FS.currentPath;
if (relative && relative[0] == '/') base = '';
var full = base + '/' + relative;
var parts = full.split('/').reverse();
var absolute = [''];
while (parts.length) {
var part = parts.pop();
if (part == '' || part == '.') {
// Nothing.
} else if (part == '..') {
if (absolute.length > 1) absolute.pop();
} else {
absolute.push(part);
}
}
return absolute.length == 1 ? '/' : absolute.join('/');
},analyzePath:function (path, dontResolveLastLink, linksVisited) {
var ret = {
isRoot: false,
exists: false,
error: 0,
name: null,
path: null,
object: null,
parentExists: false,
parentPath: null,
parentObject: null
};
path = FS.absolutePath(path);
if (path == '/') {
ret.isRoot = true;
ret.exists = ret.parentExists = true;
ret.name = '/';
ret.path = ret.parentPath = '/';
ret.object = ret.parentObject = FS.root;
} else if (path !== null) {
linksVisited = linksVisited || 0;
path = path.slice(1).split('/');
var current = FS.root;
var traversed = [''];
while (path.length) {
if (path.length == 1 && current.isFolder) {
ret.parentExists = true;
ret.parentPath = traversed.length == 1 ? '/' : traversed.join('/');
ret.parentObject = current;
ret.name = path[0];
}
var target = path.shift();
if (!current.isFolder) {
ret.error = ERRNO_CODES.ENOTDIR;
break;
} else if (!current.read) {
ret.error = ERRNO_CODES.EACCES;
break;
} else if (!current.contents.hasOwnProperty(target)) {
ret.error = ERRNO_CODES.ENOENT;
break;
}
current = current.contents[target];
if (current.link && !(dontResolveLastLink && path.length == 0)) {
if (linksVisited > 40) { // Usual Linux SYMLOOP_MAX.
ret.error = ERRNO_CODES.ELOOP;
break;
}
var link = FS.absolutePath(current.link, traversed.join('/'));
return FS.analyzePath([link].concat(path).join('/'),
dontResolveLastLink, linksVisited + 1);
}
traversed.push(target);
if (path.length == 0) {
ret.exists = true;
ret.path = traversed.join('/');
ret.object = current;
}
}
return ret;
}
return ret;
},findObject:function (path, dontResolveLastLink) {
FS.ensureRoot();
var ret = FS.analyzePath(path, dontResolveLastLink);
if (ret.exists) {
return ret.object;
} else {
___setErrNo(ret.error);
return null;
}
},createObject:function (parent, name, properties, canRead, canWrite) {
if (!parent) parent = '/';
if (typeof parent === 'string') parent = FS.findObject(parent);
if (!parent) {
___setErrNo(ERRNO_CODES.EACCES);
throw new Error('Parent path must exist.');
}
if (!parent.isFolder) {
___setErrNo(ERRNO_CODES.ENOTDIR);
throw new Error('Parent must be a folder.');
}
if (!parent.write && !FS.ignorePermissions) {
___setErrNo(ERRNO_CODES.EACCES);
throw new Error('Parent folder must be writeable.');
}
if (!name || name == '.' || name == '..') {
___setErrNo(ERRNO_CODES.ENOENT);
throw new Error('Name must not be empty.');
}
if (parent.contents.hasOwnProperty(name)) {
___setErrNo(ERRNO_CODES.EEXIST);
throw new Error("Can't overwrite object.");
}
parent.contents[name] = {
read: canRead === undefined ? true : canRead,
write: canWrite === undefined ? false : canWrite,
timestamp: Date.now(),
inodeNumber: FS.nextInode++
};
for (var key in properties) {
if (properties.hasOwnProperty(key)) {
parent.contents[name][key] = properties[key];
}
}
return parent.contents[name];
},createFolder:function (parent, name, canRead, canWrite) {
var properties = {isFolder: true, isDevice: false, contents: {}};
return FS.createObject(parent, name, properties, canRead, canWrite);
},createPath:function (parent, path, canRead, canWrite) {
var current = FS.findObject(parent);
if (current === null) throw new Error('Invalid parent.');
path = path.split('/').reverse();
while (path.length) {
var part = path.pop();
if (!part) continue;
if (!current.contents.hasOwnProperty(part)) {
FS.createFolder(current, part, canRead, canWrite);
}
current = current.contents[part];
}
return current;
},createFile:function (parent, name, properties, canRead, canWrite) {
properties.isFolder = false;
return FS.createObject(parent, name, properties, canRead, canWrite);
},createDataFile:function (parent, name, data, canRead, canWrite) {
if (typeof data === 'string') {
var dataArray = [];
for (var i = 0; i < data.length; i++) dataArray.push(data.charCodeAt(i));
data = dataArray;
}
var properties = {isDevice: false, contents: data};
return FS.createFile(parent, name, properties, canRead, canWrite);
},createLazyFile:function (parent, name, url, canRead, canWrite) {
var properties = {isDevice: false, url: url};
return FS.createFile(parent, name, properties, canRead, canWrite);
},createLink:function (parent, name, target, canRead, canWrite) {
var properties = {isDevice: false, link: target};
return FS.createFile(parent, name, properties, canRead, canWrite);
},createDevice:function (parent, name, input, output) {
if (!(input || output)) {
throw new Error('A device must have at least one callback defined.');
}
var ops = {isDevice: true, input: input, output: output};
return FS.createFile(parent, name, ops, Boolean(input), Boolean(output));
},forceLoadFile:function (obj) {
if (obj.isDevice || obj.isFolder || obj.link || obj.contents) return true;
var success = true;
if (typeof XMLHttpRequest !== 'undefined') {
// Browser.
// TODO: Use mozResponseArrayBuffer, responseStream, etc. if available.
var xhr = new XMLHttpRequest();
xhr.open('GET', obj.url, false);
// 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 != 0) success = false;
if (xhr.response !== undefined) {
obj.contents = new Uint8Array(xhr.response || []);
} else {
obj.contents = intArrayFromString(xhr.responseText || '', true);
}
} else if (typeof read !== 'undefined') {
// 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(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;
},ensureRoot:function () {
if (FS.root) return;
// The main file system tree. All the contents are inside this.
FS.root = {
read: true,
write: false,
isFolder: true,
isDevice: false,
timestamp: Date.now(),
inodeNumber: 1,
contents: {}
};
},init:function (input, output, error) {
// Make sure we initialize only once.
if (FS.init.initialized) return;
FS.init.initialized = true;
FS.ensureRoot();
// Default handlers.
if (!input) input = function() {
if (!input.cache || !input.cache.length) {
var result;
if (typeof window != 'undefined' &&
typeof window.prompt == 'function') {
// Browser.
result = window.prompt('Input: ');
} else if (typeof readline == 'function') {
// Command line.
result = readline();
}
if (!result) result = '';
input.cache = intArrayFromString(result + '\n', true);
}
return input.cache.shift();
};
if (!output) output = function(val) {
if (val === null || val === '\n'.charCodeAt(0)) {
output.printer(output.buffer.join(''));
output.buffer = [];
} else {
output.buffer.push(String.fromCharCode(val));
}
};
if (!output.printer) output.printer = print;
if (!output.buffer) output.buffer = [];
if (!error) error = output;
// Create the temporary folder.
FS.createFolder('/', 'tmp', true, true);
// Create the I/O devices.
var devFolder = FS.createFolder('/', 'dev', true, false);
var stdin = FS.createDevice(devFolder, 'stdin', input);
var stdout = FS.createDevice(devFolder, 'stdout', null, output);
var stderr = FS.createDevice(devFolder, 'stderr', null, error);
FS.createDevice(devFolder, 'tty', input, output);
// Create default streams.
FS.streams[1] = {
path: '/dev/stdin',
object: stdin,
position: 0,
isRead: true,
isWrite: false,
isAppend: false,
error: false,
eof: false,
ungotten: []
};
FS.streams[2] = {
path: '/dev/stdout',
object: stdout,
position: 0,
isRead: false,
isWrite: true,
isAppend: false,
error: false,
eof: false,
ungotten: []
};
FS.streams[3] = {
path: '/dev/stderr',
object: stderr,
position: 0,
isRead: false,
isWrite: true,
isAppend: false,
error: false,
eof: false,
ungotten: []
};
_stdin = allocate([1], 'void*', ALLOC_STATIC);
_stdout = allocate([2], 'void*', ALLOC_STATIC);
_stderr = allocate([3], 'void*', ALLOC_STATIC);
// Newlib initialization
FS.streams[_stdin] = FS.streams[1];
FS.streams[_stdout] = FS.streams[2];
FS.streams[_stderr] = FS.streams[3];
__impure_ptr = allocate([ allocate(
[0, 0, 0, 0, _stdin, 0, 0, 0, _stdout, 0, 0, 0, _stderr, 0, 0, 0],
'void*', ALLOC_STATIC) ], 'void*', ALLOC_STATIC);
},quit:function () {
if (!FS.init.initialized) return;
// Flush any partially-printed lines in stdout and stderr
if (FS.streams[2].object.output.buffer.length > 0) FS.streams[2].object.output('\n'.charCodeAt(0));
if (FS.streams[3].object.output.buffer.length > 0) FS.streams[3].object.output('\n'.charCodeAt(0));
}};
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.streams[fildes];
if (!stream || stream.object.isDevice) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
} else if (!stream.isWrite) {
___setErrNo(ERRNO_CODES.EACCES);
return -1;
} else if (stream.object.isFolder) {
___setErrNo(ERRNO_CODES.EISDIR);
return -1;
} else if (nbyte < 0 || offset < 0) {
___setErrNo(ERRNO_CODES.EINVAL);
return -1;
} else {
var contents = stream.object.contents;
while (contents.length < offset) contents.push(0);
for (var i = 0; i < nbyte; i++) {
contents[offset + i] = HEAPU8[(buf+i)];
}
stream.object.timestamp = Date.now();
return i;
}
}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.streams[fildes];
if (!stream) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;
} else if (!stream.isWrite) {
___setErrNo(ERRNO_CODES.EACCES);
return -1;
} else if (nbyte < 0) {
___setErrNo(ERRNO_CODES.EINVAL);
return -1;
} else {
if (stream.object.isDevice) {
if (stream.object.output) {
for (var i = 0; i < nbyte; i++) {
try {
stream.object.output(HEAP8[(buf+i)]);
} catch (e) {
___setErrNo(ERRNO_CODES.EIO);
return -1;
}
}
stream.object.timestamp = Date.now();
return i;
} else {
___setErrNo(ERRNO_CODES.ENXIO);
return -1;
}
} else {
var bytesWritten = _pwrite(fildes, buf, nbyte, stream.position);
if (bytesWritten != -1) stream.position += bytesWritten;
return bytesWritten;
}
}
}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) {
if (FS.streams[stream]) FS.streams[stream].error = true;
return -1;
} else {
return Math.floor(bytesWritten / size);
}
}
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 = (tempDoubleI32[0]=HEAP32[((varargs+argIndex)>>2)],tempDoubleI32[1]=HEAP32[((varargs+argIndex+4)>>2)],tempDoubleF64[0]);
} else if (type == 'i64') {
ret = [HEAP32[((varargs+argIndex)>>2)],
HEAP32[((varargs+argIndex+4)>>2)]];
ret = unSign(ret[0], 32) + unSign(ret[1], 32)*Math.pow(2, 32); // Unsigned in this notation. Signed later if needed. // XXX - loss of precision
} else {
type = 'i32'; // varargs are always i32, i64, or double
ret = HEAP32[((varargs+argIndex)>>2)];
}
argIndex += Runtime.getNativeFieldSize(type);
return Number(ret);
}
var ret = [];
var curr, next, currArg;
while(1) {
var startTextIndex = textIndex;
curr = HEAP8[(textIndex)];
if (curr === 0) break;
next = HEAP8[(textIndex+1)];
if (curr == '%'.charCodeAt(0)) {
// Handle flags.
var flagAlwaysSigned = false;
var flagLeftAlign = false;
var flagAlternative = false;
var flagZeroPad = false;
flagsLoop: while (1) {
switch (next) {
case '+'.charCodeAt(0):
flagAlwaysSigned = true;
break;
case '-'.charCodeAt(0):
flagLeftAlign = true;
break;
case '#'.charCodeAt(0):
flagAlternative = true;
break;
case '0'.charCodeAt(0):
if (flagZeroPad) {
break flagsLoop;
} else {
flagZeroPad = true;
break;
}
default:
break flagsLoop;
}
textIndex++;
next = HEAP8[(textIndex+1)];
}
// Handle width.
var width = 0;
if (next == '*'.charCodeAt(0)) {
width = getNextArg('i32');
textIndex++;
next = HEAP8[(textIndex+1)];
} else {
while (next >= '0'.charCodeAt(0) && next <= '9'.charCodeAt(0)) {
width = width * 10 + (next - '0'.charCodeAt(0));
textIndex++;
next = HEAP8[(textIndex+1)];
}
}
// Handle precision.
var precisionSet = false;
if (next == '.'.charCodeAt(0)) {
var precision = 0;
precisionSet = true;
textIndex++;
next = HEAP8[(textIndex+1)];
if (next == '*'.charCodeAt(0)) {
precision = getNextArg('i32');
textIndex++;
} else {
while(1) {
var precisionChr = HEAP8[(textIndex+1)];
if (precisionChr < '0'.charCodeAt(0) ||
precisionChr > '9'.charCodeAt(0)) break;
precision = precision * 10 + (precisionChr - '0'.charCodeAt(0));
textIndex++;
}
}
next = HEAP8[(textIndex+1)];
} 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)];
if (nextNext == 'h'.charCodeAt(0)) {
textIndex++;
argSize = 1; // char (actually i32 in varargs)
} else {
argSize = 2; // short (actually i32 in varargs)
}
break;
case 'l':
var nextNext = HEAP8[(textIndex+2)];
if (nextNext == 'l'.charCodeAt(0)) {
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)];
// Handle type specifier.
if (['d', 'i', 'u', 'o', 'x', 'X', 'p'].indexOf(String.fromCharCode(next)) != -1) {
// Integer.
var signed = next == 'd'.charCodeAt(0) || next == 'i'.charCodeAt(0);
argSize = argSize || 4;
var currArg = getNextArg('i' + (argSize * 8));
// 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 argText;
var prefix = '';
if (next == 'd'.charCodeAt(0) || next == 'i'.charCodeAt(0)) {
argText = reSign(currArg, 8 * argSize, 1).toString(10);
} else if (next == 'u'.charCodeAt(0)) {
argText = unSign(currArg, 8 * argSize, 1).toString(10);
currArg = Math.abs(currArg);
} else if (next == 'o'.charCodeAt(0)) {
argText = (flagAlternative ? '0' : '') + currAbsArg.toString(8);
} else if (next == 'x'.charCodeAt(0) || next == 'X'.charCodeAt(0)) {
prefix = flagAlternative ? '0x' : '';
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 == 'X'.charCodeAt(0)) {
prefix = prefix.toUpperCase();
argText = argText.toUpperCase();
}
} else if (next == 'p'.charCodeAt(0)) {
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));
});
} else if (['f', 'F', 'e', 'E', 'g', 'G'].indexOf(String.fromCharCode(next)) != -1) {
// 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 == 'g'.charCodeAt(0) || next == 'G'.charCodeAt(0)) {
isGeneral = true;
precision = precision || 1;
var exponent = parseInt(currArg.toExponential(effectivePrecision).split('e')[1], 10);
if (precision > exponent && exponent >= -4) {
next = ((next == 'g'.charCodeAt(0)) ? 'f' : 'F').charCodeAt(0);
precision -= exponent + 1;
} else {
next = ((next == 'g'.charCodeAt(0)) ? 'e' : 'E').charCodeAt(0);
precision--;
}
effectivePrecision = Math.min(precision, 20);
}
if (next == 'e'.charCodeAt(0) || next == 'E'.charCodeAt(0)) {
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 == 'f'.charCodeAt(0) || next == 'F'.charCodeAt(0)) {
argText = currArg.toFixed(effectivePrecision);
}
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 == 'E'.charCodeAt(0)) 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 < 'a'.charCodeAt(0)) argText = argText.toUpperCase();
// Insert the result into the buffer.
argText.split('').forEach(function(chr) {
ret.push(chr.charCodeAt(0));
});
} else if (next == 's'.charCodeAt(0)) {
// String.
var arg = getNextArg('i8*');
var copiedString;
if (arg) {
copiedString = String_copy(arg);
if (precisionSet && copiedString.length > precision) {
copiedString = copiedString.slice(0, precision);
}
} else {
copiedString = intArrayFromString('(null)', true);
}
if (!flagLeftAlign) {
while (copiedString.length < width--) {
ret.push(' '.charCodeAt(0));
}
}
ret = ret.concat(copiedString);
if (flagLeftAlign) {
while (copiedString.length < width--) {
ret.push(' '.charCodeAt(0));
}
}
} else if (next == 'c'.charCodeAt(0)) {
// Character.
if (flagLeftAlign) ret.push(getNextArg('i8'));
while (--width > 0) {
ret.push(' '.charCodeAt(0));
}
if (!flagLeftAlign) ret.push(getNextArg('i8'));
} else if (next == 'n'.charCodeAt(0)) {
// Write the length written so far to the next parameter.
var ptr = getNextArg('i32*');
HEAP32[((ptr)>>2)]=ret.length
} else if (next == '%'.charCodeAt(0)) {
// Literal percent sign.
ret.push(curr);
} else {
// 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 _memset(ptr, value, num) {
var dest, stop, stop4, fast, value;
dest = ptr;
stop = dest + num;
value = value;
if (value < 0) value += 256;
value = value + (value<<8) + (value<<16) + (value*16777216);
while (dest%4 !== 0 && dest < stop) {
;; HEAP8[dest++] = value;
}
dest >>= 2;
stop4 = stop >> 2;
while (dest < stop4) {
;;;;;;; HEAP32[dest++] = value;
}
dest <<= 2;
while (dest < stop) {
;; HEAP8[dest++] = value;
}
}
function _malloc(bytes) {
return Runtime.staticAlloc(bytes || 1); // accept 0 as an input because libc implementations tend to
}
function _free(){}
FS.init(); __ATEXIT__.push({ func: function() { FS.quit() } });
___setErrNo(0);
// === Auto-generated postamble setup entry stuff ===
Module.callMain = function callMain(args) {
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_STATIC) ];
pad();
for (var i = 0; i < argc-1; i = i + 1) {
argv.push(allocate(intArrayFromString(args[i]), 'i8', ALLOC_STATIC));
pad();
}
argv.push(0);
argv = allocate(argv, 'i32', ALLOC_STATIC);
return _main(argc, argv, 0);
}
var __str;
var __str1;
var __ZL11generations;
var __str2;
var __str3;
__str=allocate([42,37,100,44,37,100,44,37,100,44,37,100,44,37,100,44,37,100,44,37,100,44,37,100,42,10,0] /* _%d,%d,%d,%d,%d,%d,% */, "i8", ALLOC_STATIC);
__str1=allocate([42,37,100,44,37,100,44,37,100,42,10,0] /* _%d,%d,%d_\0A\00 */, "i8", ALLOC_STATIC);
__ZL11generations=allocate([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0], ["%union.PyGC_Head*",0,0,0,"%union.PyGC_Head*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"%union.PyGC_Head*",0,0,0,"%union.PyGC_Head*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0,"%union.PyGC_Head*",0,0,0,"%union.PyGC_Head*",0,0,0,"i32",0,0,0,"i32",0,0,0,"i32",0,0,0], ALLOC_STATIC);
__str2=allocate([42,37,100,42,10,0] /* _%d_\0A\00 */, "i8", ALLOC_STATIC);
__str3=allocate([37,100,58,37,100,44,37,100,10,0] /* %d:%d,%d\0A\00 */, "i8", ALLOC_STATIC);
HEAP32[((__ZL11generations)>>2)]=((__ZL11generations)|0);
HEAP32[((__ZL11generations+4)>>2)]=((__ZL11generations)|0);
HEAP32[((__ZL11generations+20)>>2)]=((((__ZL11generations)+20)|0));
HEAP32[((__ZL11generations+24)>>2)]=((((__ZL11generations)+20)|0));
HEAP32[((__ZL11generations+40)>>2)]=((((__ZL11generations)+40)|0));
HEAP32[((__ZL11generations+44)>>2)]=((((__ZL11generations)+40)|0));
FUNCTION_TABLE = [0,0]; Module["FUNCTION_TABLE"] = FUNCTION_TABLE;
function run(args) {
args = args || Module['arguments'];
__globalConstructor__();
var ret = null;
if (Module['_main']) {
ret = Module.callMain(args);
__shutdownRuntime__();
}
return ret;
}
Module['run'] = run;
// {{PRE_RUN_ADDITIONS}}
// In a hackish way, we disable permissions until now, so setup code works, but enable them for runtime so compile code works with permissions
try {
FS.ignorePermissions = false;
} catch(e){}
if (!Module['noInitialRun']) {
var ret = run();
}
// {{POST_RUN_ADDITIONS}}
// {{MODULE_ADDITIONS}}
// EMSCRIPTEN_GENERATED_FUNCTIONS: ["_main"]
(Emscripten: Running sanity checks)
test_pystruct (__main__.default) ... emcc: /Users/devesine/Source/personal/jsmess/emscripten/emcc /tmp/foo/emscripten_test_default_HG3a7B/src.cpp.o.ll -s QUANTUM_SIZE=4 -s INCLUDE_FULL_LIBRARY=0 -s RELOOP=0 -s CLOSURE_ANNOTATIONS=0 -s RUNTIME_LINKED_LIBS=[] -s INLINE_LIBRARY_FUNCS=1 -s LIBRARY_DEBUG=0 -s ASSERTIONS=1 -s FAKE_X86_FP80=0 -s CLOSURE_INLINE_PREVENTION_LINES=50 -s TOTAL_MEMORY=10485760 -s CHECK_OVERFLOWS=0 -s INIT_STACK=0 -s EXPORTED_GLOBALS=[] -s CORRECT_OVERFLOWS=1 -s EXCEPTION_DEBUG=1 -s CATCH_EXIT_CODE=0 -s DOUBLE_MODE=1 -s CORRECT_ROUNDINGS=1 -s MICRO_OPTS=1 -s PROFILE=0 -s LABEL_DEBUG=0 -s CHECK_SIGNS=0 -s SAFE_HEAP=0 -s FAST_MEMORY=2097152 -s EXPORTED_FUNCTIONS=["_main"] -s SKIP_STACK_IN_SMALL=1 -s USE_TYPED_ARRAYS=2 -s C_DEFINES={"math_errhandling": "1", "_CS_V7_ENV": "20", "_SC_XOPEN_VERSION": "106", "F_UNLCK": "3", "_SC_BARRIERS": "56", "_IFLNK": "0120000", "O_CREAT": "512", "SHRT_MAX": "32767", "_XOPEN_ENH_I18N": "1", "_IFCHR": "0020000", "ABDAY_7": "20", "ABDAY_6": "19", "ABDAY_5": "18", "ABDAY_4": "17", "ABDAY_3": "16", "ABDAY_2": "15", "ABDAY_1": "14", "F_UNLKSYS": "4", "M_PI_2": "1.57079632679", "M_PI_4": "0.785398163397", "FEXLOCK": "256", "_FNDELAY": "16384", "SIGEV_NONE": "1", "_SC_OPEN_MAX": "4", "_SC_THREADS": "42", "_FSHLOCK": "128", "_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS": "6", "SIGILL": "4", "POLLIN": "1", "_SC_THREAD_KEYS_MAX": "38", "__LARGE64_FILES": "1", "_SC_2_PBS": "113", "FNOCTTY": "32768", "_SC_REGEXP": "72", "_CS_POSIX_V6_LP64_OFF64_CFLAGS": "9", "_POSIX_RAW_SOCKETS": "200112", "S_IRWXG": "0000040", "PTHREAD_PROCESS_PRIVATE": "0", "RADIXCHAR": "50", "S_IRWXO": "0000004", "S_IRWXU": "0000400", "AM_STR": "5", "__BUFSIZ__": "16", "_NL_CTYPE_MB_CUR_MAX": "85", "___int16_t_defined": "1", "MALLOC_ALIGNMENT": "16", "PTHREAD_CREATE_DETACHED": "0", "_POSIX2_VERSION": "200112", "PM_STR": "6", "_POSIX_SHELL": "1", "O_WRONLY": "1", "_POSIX_VERSION": "200112", "M_LN2LO": "1.90821492927e-10", "MON_10": "30", "O_SYNC": "8192", "YESEXPR": "52", "_PC_PATH_MAX": "4", "_POSIX_SYNCHRONIZED_IO": "200112", "SIGXFSZ": "25", "_POSIX_MAPPED_FILES": "200112", "_CS_POSIX_V6_LPBIG_OFFBIG_LIBS": "15", "_PC_MAX_INPUT": "2", "F_TLOCK": "2", "_SC_VERSION": "7", "_SC_CLK_TCK": "2", "_SC_THREAD_ROBUST_PRIO_PROTECT": "123", "M_1_PI": "0.318309886184", "_SC_AIO_MAX": "35", "SIGCLD": "20", "M_2_PI": "0.636619772368", "_PC_2_SYMLINKS": "13", "_O_WRONLY": "1", "_CS_XBS5_LP64_OFF64_CFLAGS": "9", "MON_2": "22", "MON_3": "23", "MON_1": "21", "_REENT_SIGNAL_SIZE": "24", "MON_7": "27", "MON_4": "24", "MON_5": "25", "_SC_SPAWN": "75", "MON_8": "28", "MON_9": "29", "_CS_POSIX_V6_ILP32_OFF32_LDFLAGS": "2", "_SC_TRACE_EVENT_NAME_MAX": "85", "SA_SIGINFO": "2", "_FNONBLOCK": "16384", "O_BINARY": "65536", "_CS_POSIX_V6_WIDTH_RESTRICTED_ENVS": "17", "_SC_AIO_PRIO_DELTA_MAX": "36", "_SC_MONOTONIC_CLOCK": "69", "_POSIX_THREAD_SPORADIC_SERVER": "1", "SIGPROF": "27", "SIGPOLL": "23", "M_3PI_4": "2.35619449019", "F_OK": "0", "FAPPEND": "8", "_SC_XOPEN_SHM": "103", "_POSIX_DEVCTL_DIRECTION": "1", "_PC_LINK_MAX": "0", "_POSIX_THREAD_PRIO_PROTECT": "1", "_XOPEN_VERSION": "600", "_SC_TRACE_NAME_MAX": "88", "PTHREAD_STACK_MIN": "200", "O_APPEND": "8", "_SC_CPUTIME": "63", "S_IFBLK": "0060000", "SIGEMT": "7", "_POSIX_FSYNC": "200112", "F_SETLKW": "9", "_MB_EXTENDED_CHARSETS_WINDOWS": "1", "_SC_THREAD_ATTR_STACKADDR": "43", "___int_least32_t_defined": "1", "_POSIX_REGEXP": "1", "_S_IFREG": "0100000", "_SC_2_PBS_CHECKPOINT": "115", "_SC_TIMERS": "33", "MON_11": "31", "MON_12": "32", "CLOCK_DISABLED": "0", "_SC_XBS5_LPBIG_OFFBIG": "95", "_O_RDWR": "2", "_SC_SHARED_MEMORY_OBJECTS": "199", "F_GETFD": "1", "_PC_ALLOC_SIZE_MIN": "15", "_SC_READER_WRITER_LOCKS": "71", "SI_USER": "1", "T_FMT": "3", "_PC_VDISABLE": "8", "THOUSEP": "51", "PTHREAD_PROCESS_SHARED": "1", "_PC_MAX_CANON": "1", "ERA_T_FMT": "48", "FNONBIO": "16384", "_PC_NO_TRUNC": "7", "_SC_V7_ILP32_OFF32": "92", "_FAPPEND": "8", "_MB_EXTENDED_CHARSETS_ISO": "1", "F_CNVT": "12", "_POSIX_THREAD_PROCESS_SHARED": "200112", "_SC_V6_LP64_OFF64": "94", "_POSIX_ADVISORY_INFO": "200112", "_SC_HOST_NAME_MAX": "65", "_POSIX_MONOTONIC_CLOCK": "200112", "ULONG_MAX": "2147483647", "_SC_TIMEOUTS": "82", "POLLOUT": "2", "_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS": "16", "SIGFPE": "8", "_SC_2_C_DEV": "109", "PTHREAD_PRIO_INHERIT": "1", "O_NONBLOCK": "16384", "SING": "2", "_LONG_LONG_TYPE": "<type 'long'>", "M_INVLN2": "1.44269504089", "M_TWOPI": "3.14159265359", "_NL_TIME_DATE_FMT": "84", "CLOCK_ENABLED": "1", "CLK_TCK": "1000", "_XBS5_ILP32_OFF32": "-1", "SCHED_SPORADIC": "4", "SI_TIMER": "3", "DAY_2": "8", "DAY_3": "9", "DAY_1": "7", "_O_RDONLY": "0", "DAY_7": "13", "DAY_4": "10", "DAY_5": "11", "AT_REMOVEDIR": "8", "_SC_NGROUPS_MAX": "3", "_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS": "13", "_POSIX_SAVED_IDS": "1", "F_ULOCK": "0", "_POSIX_JOB_CONTROL": "1", "_SC_TRACE_LOG": "87", "_POSIX_TIMERS": "1", "FNDELAY": "16384", "_CS_XBS5_ILP32_OFF32_LINTFLAGS": "4", "_SC_THREAD_DESTRUCTOR_ITERATIONS": "53", "UINT_MAX": "2147483647", "_SC_BC_STRING_MAX": "60", "_CS_XBS5_LPBIG_OFFBIG_LIBS": "15", "no_argument": "0", "_CS_POSIX_V7_ILP32_OFF32_CFLAGS": "1", "FDEFER": "32", "FP_NAN": "0", "F_SETOWN": "6", "_SC_ARG_MAX": "0", "_POSIX_V6_ILP32_OFF32": "-1", "_POSIX_REALTIME_SIGNALS": "200112", "MB_LEN_MAX": "1", "_PC_REC_INCR_XFER_SIZE": "16", "_CS_POSIX_V6_LP64_OFF64_LDFLAGS": "10", "NOSTR": "55", "_SC_THREAD_STACK_MIN": "39", "_POSIX_V6_LPBIG_OFFBIG": "-1", "FSYNC": "8192", "_CS_XBS5_ILP32_OFFBIG_CFLAGS": "5", "O_TEXT": "131072", "_POSIX_THREAD_PRIO_INHERIT": "1", "_XBS5_ILP32_OFFBIG": "1", "PLOSS": "6", "_POSIX_THREAD_SAFE_FUNCTIONS": "200112", "_IFMT": "0170000", "_SC_SYMLOOP_MAX": "79", "_SC_XOPEN_UNIX": "105", "M_IVLN10": "0.434294481903", "NSIG": "32", "SIGINT": "2", "H8300": "1", "_CS_POSIX_V7_LP64_OFF64_CFLAGS": "9", "M_2_SQRTPI": "1.1283791671", "S_IROTH": "0000004", "_SC_V6_LPBIG_OFFBIG": "95", "_SC_EXPR_NEST_MAX": "64", "_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS": "5", "UTIME_OMIT": "-1", "_PC_REC_MAX_XFER_SIZE": "17", "FASYNC": "64", "_SC_DELAYTIMER_MAX": "37", "_SC_TIMER_MAX": "19", "PTHREAD_MUTEX_NORMAL": "0", "MON_6": "26", "R_OK": "4", "FTRUNC": "1024", "_SC_SIGQUEUE_MAX": "18", "_O_APPEND": "8", "_SC_TZNAME_MAX": "20", "_O_RAW": "65536", "_POSIX_BARRIERS": "200112", "SEEK_SET": "0", "S_IREAD": "0000400", "INT_MAX": "2147483647", "_POSIX_V6_ILP32_OFFBIG": "1", "_SC_MESSAGE_PASSING": "27", "_CS_XBS5_LPBIG_OFFBIG_LDFLAGS": "14", "S_IXGRP": "0000010", "_XBS5_LPBIG_OFFBIG": "-1", "O_EXCL": "2048", "S_IWGRP": "0000020", "_SC_TRACE_USER_EVENT_MAX": "90", "FP_NORMAL": "4", "_SC_RAW_SOCKETS": "70", "FD_CLOEXEC": "1", "_DATE_FMT": "84", "_SC_RTSIG_MAX": "15", "_POSIX_DEVICE_CONTROL": "1", "_SC_REALTIME_SIGNALS": "29", "_NULL": "0", "_O_TEXT": "131072", "SIGBUS": "10", "_PC_FILESIZEBITS": "12", "_SC_XBS5_ILP32_OFF32": "92", "_SC_V6_ILP32_OFF32": "92", "PTHREAD_MUTEX_ERRORCHECK": "2", "_POSIX2_RE_DUP_MAX": "255", "O_RDONLY": "0", "YESSTR": "54", "_SC_TRACE": "83", "_POSIX_INTERRUPT_CONTROL": "1", "_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS": "14", "DOMAIN": "1", "O_ACCMODE": "3", "_RAND48_SEED_1": "43981", "_RAND48_SEED_0": "13070", "_RAND48_SEED_2": "4660", "FOPEN": "-1", "F_RGETLK": "10", "F_DUPFD": "0", "_IFREG": "0100000", "FP_SUBNORMAL": "3", "SA_NOCLDSTOP": "1", "required_argument": "1", "_POSIX2_CHAR_TERM": "200112", "F_SETLK": "8", "_SC_ATEXIT_MAX": "55", "_POSIX_MEMLOCK_RANGE": "200112", "_SC_SAVED_IDS": "6", "PTHREAD_INHERIT_SCHED": "1", "SEEK_CUR": "1", "S_IFLNK": "0120000", "_S_IFIFO": "0010000", "_POSIX2_UPE": "200112", "_SC_2_PBS_TRACK": "118", "_POSIX_CPUTIME": "1", "DAY_6": "12", "FNBIO": "4096", "_CS_XBS5_LP64_OFF64_LIBS": "11", "_PC_TIMESTAMP_RESOLUTION": "20", "SIGRTMIN": "27", "_CS_XBS5_ILP32_OFFBIG_LINTFLAGS": "8", "SIGEV_SIGNAL": "2", "_POSIX_SPAWN": "1", "_SC_THREAD_ROBUST_PRIO_INHERIT": "122", "_CS_XBS5_ILP32_OFF32_LDFLAGS": "2", "SIGTERM": "15", "_SC_COLL_WEIGHTS_MAX": "62", "SIGUSR2": "31", "_FEXCL": "2048", "ITIMER_REAL": "0", "SIGIOT": "6", "SIGCONT": "19", "FSHLOCK": "128", "STDOUT_FILENO": "1", "SIGIO": "23", "_O_BINARY": "65536", "_POSIX2_SW_DEV": "200112", "_LARGEFILE64_SOURCE": "1", "_XOPEN_CRYPT": "1", "_FMARK": "16", "_POSIX_IPV6": "200112", "_SC_ASYNCHRONOUS_IO": "21", "_SC_2_CHAR_TERM": "107", "_RAND48_ADD": "11", "MAXPATHLEN": "1024", "M_SQRT3": "1.73205080757", "M_SQRT2": "1.41421356237", "ABMON_12": "44", "ABMON_11": "43", "ABMON_10": "42", "SIGTTOU": "22", "_SC_TTY_NAME_MAX": "41", "S_IWRITE": "0000200", "M_SQRTPI": "1.77245385091", "_NL_MESSAGES_CODESET": "86", "DEFFILEMODE": "0000400", "M_LOG10E": "0.434294481903", "_S_IFMT": "0170000", "_M_LN2": "0.69314718056", "USHRT_MAX": "65535", "_SC_XOPEN_LEGACY": "98", "_SC_BC_DIM_MAX": "58", "S_IFDIR": "0040000", "_IFDIR": "0040000", "__long_double_t": "<type 'long'>", "_FCREAT": "512", "_SC_NPROCESSORS_CONF": "9", "F_DUPFD_CLOEXEC": "14", "_CS_POSIX_V6_LP64_OFF64_LIBS": "11", "_POSIX_SHARED_MEMORY_OBJECTS": "200112", "M_PI": "3.14159265359", "_SC_V6_ILP32_OFFBIG": "93", "SIGSTOP": "17", "NBBY": "8", "PTHREAD_CREATE_JOINABLE": "1", "_SC_MEMLOCK": "24", "SIGWINCH": "28", "UTIME_NOW": "-2", "__INT_MAX__": "2147483647", "_XBS5_LP64_OFF64": "-1", "M_E": "2.71828182846", "SIGTRAP": "5", "_SC_SS_REPL_MAX": "78", "O_RDWR": "2", "_POSIX_V6_LP64_OFF64": "-1", "_SC_TRACE_INHERIT": "86", "PTHREAD_PRIO_NONE": "0", "___int64_t_defined": "1", "S_IFREG": "0100000", "S_IFMT": "0170000", "F_SETLK64": "21", "_S_IEXEC": "0000100", "_SC_XOPEN_CRYPT": "96", "M_LN10": "2.30258509299", "OPTIONAL_ARG": "2", "_PC_CHOWN_RESTRICTED": "6", "SCHAR_MAX": "127", "S_BLKSIZE": "1024", "SIGSYS": "12", "ALT_DIGITS": "49", "F_RSETLKW": "13", "SIGXCPU": "24", "_SC_MQ_PRIO_MAX": "14", "_FTRUNC": "1024", "SCHED_RR": "2", "_PC_POSIX_SECURITY": "91", "_SC_2_LOCALEDEF": "112", "_SC_STREAM_MAX": "100", "_CS_POSIX_V7_ILP32_OFF32_LIBS": "3", "_POSIX2_C_BIND": "200112", "S_IFIFO": "0010000", "SCHED_FIFO": "1", "_CS_XBS5_ILP32_OFF32_LIBS": "3", "_CS_POSIX_V6_ILP32_OFFBIG_LIBS": "7", "_PC_REC_MIN_XFER_SIZE": "18", "_SC_SPORADIC_SERVER": "77", "_SC_NPROCESSORS_ONLN": "10", "REQUIRED_ARG": "1", "F_GETLK64": "20", "HUGE_VAL": "inf", "AT_EACCESS": "1", "ABMON_3": "35", "ABMON_2": "34", "ABMON_1": "33", "ABMON_7": "39", "ABMON_6": "38", "ABMON_5": "37", "ABMON_4": "36", "ABMON_9": "41", "ABMON_8": "40", "UNDERFLOW": "4", "_CS_XBS5_ILP32_OFFBIG_LIBS": "7", "ERA": "45", "S_IXUSR": "0000100", "_SC_THREAD_PRIO_INHERIT": "46", "SIG_BLOCK": "1", "_ATEXIT_SIZE": "32", "_POSIX_PRIORITY_SCHEDULING": "200112", "_FBINARY": "65536", "PTHREAD_PRIO_PROTECT": "2", "POLLERR": "8", "SIGVTALRM": "26", "ITIMER_PROF": "2", "_REENT_EMERGENCY_SIZE": "25", "S_IEXEC": "0000100", "_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS": "13", "SIGEV_THREAD": "3", "ITIMER_VIRTUAL": "1", "_SC_TRACE_SYS_MAX": "89", "_POSIX_NO_TRUNC": "1", "_CS_POSIX_V7_THREADS_CFLAGS": "18", "_POSIX2_C_DEV": "200112", "_FNOINHERIT": "262144", "_SC_XOPEN_ENH_I18N": "97", "F_SETLKW64": "22", "_FDEFER": "32", "CLOCK_DISALLOWED": "0", "_SC_MEMORY_PROTECTION": "26", "LONG_MAX": "2147483647", "_SC_SPIN_LOCKS": "76", "M_LN2HI": "0.693147180369", "_LIBC_LIMITS_H_": "1", "NOEXPR": "53", "FEXCL": "2048", "_SC_GETGR_R_SIZE_MAX": "50", "SCHAR_MIN": "-128", "_CS_XBS5_LP64_OFF64_LINTFLAGS": "12", "_SC_XOPEN_STREAMS": "104", "_SC_GETPW_R_SIZE_MAX": "51", "_POSIX_ASYNCHRONOUS_IO": "1", "_POINTER_INT": "<type 'long'>", "UCHAR_MAX": "255", "_SC_XBS5_ILP32_OFFBIG": "93", "FMARK": "16", "T_FMT_AMPM": "4", "_POSIX_SEMAPHORES": "200112", "SIGALRM": "14", "___int32_t_defined": "1", "_CS_POSIX_V7_ILP32_OFF32_LDFLAGS": "2", "CHAR_BIT": "8", "_N_LISTS": "30", "_SC_2_FORT_RUN": "111", "PTHREAD_MUTEX_DEFAULT": "3", "_SC_RE_DUP_MAX": "73", "F_RSETLK": "11", "_SC_THREAD_PRIO_PROTECT": "47", "S_IFSOCK": "0140000", "_O_CREAT": "512", "_PC_POSIX_PERMISSIONS": "90", "_POSIX_SPIN_LOCKS": "200112", "_FREAD": "1", "F_RDLCK": "1", "_POSIX_C_SOURCE": "2", "FREAD": "1", "_SC_MEMLOCK_RANGE": "25", "_SC_PRIORITY_SCHEDULING": "101", "optional_argument": "2", "_SC_TRACE_EVENT_FILTER": "84", "SIGQUIT": "3", "_SC_THREAD_THREADS_MAX": "40", "_SC_LOGIN_NAME_MAX": "52", "M_LOG2E": "1.44269504089", "_SC_2_C_BIND": "108", "_FNBIO": "4096", "PTHREAD_EXPLICIT_SCHED": "2", "SCHED_OTHER": "0", "_CS_GNU_LIBC_VERSION": "42", "_SC_SEM_VALUE_MAX": "17", "__LONG_MAX__": "2147483647", "S_ENFMT": "0002000", "_SC_MQ_OPEN_MAX": "13", "SIG_UNBLOCK": "2", "_CS_XBS5_ILP32_OFF32_CFLAGS": "1", "ARG_MAX": "4096", "_SC_CHILD_MAX": "1", "__RAND_MAX": "2147483647", "NL_ARGMAX": "32", "_SC_2_PBS_MESSAGE": "117", "TIMER_ABSTIME": "4", "_NL_CTYPE_CODESET_NAME": "0", "S_IXOTH": "0000001", "FP_ZERO": "2", "SIGLOST": "29", "_PC_REC_XFER_ALIGN": "19", "CLOCKS_PER_SEC": "1000", "_READ_WRITE_RETURN_TYPE": "<type 'int'>", "ERA_D_T_FMT": "47", "_CS_XBS5_ILP32_OFFBIG_LDFLAGS": "6", "_TIME_T_": "<type 'long'>", "D_FMT": "2", "_SC_THREAD_PRIO_CEILING": "47", "_PC_ASYNC_IO": "9", "_FOPEN": "-1", "SI_ASYNCIO": "4", "_POSIX_READER_WRITER_LOCKS": "200112", "PATH_MAX": "4096", "_POSIX_TIMEOUTS": "1", "_SC_MAPPED_FILES": "23", "_FSYNC": "8192", "MATH_ERRNO": "1", "SI_MESGQ": "5", "_SC_SEMAPHORES": "30", "__FILENAME_MAX__": "255", "SIGTSTP": "18", "F_WRLCK": "2", "FLT_EVAL_METHOD": "0", "_XOPEN_SHM": "1", "_POSIX_CHOWN_RESTRICTED": "1", "AT_SYMLINK_NOFOLLOW": "2", "_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS": "14", "_POSIX_THREAD_CPUTIME": "1", "F_LOCK": "1", "_FLOAT_ARG": "<type 'float'>", "M_LN2": "0.69314718056", "_POSIX_MEMORY_PROTECTION": "200112", "_SC_XOPEN_UUCP": "124", "_SC_2_SW_DEV": "119", "CHAR_MIN": "-128", "PTHREAD_SCOPE_SYSTEM": "1", "FP_INFINITE": "1", "_S_IWRITE": "0000200", "_S_IFDIR": "0040000", "_SC_THREAD_PRIORITY_SCHEDULING": "45", "F_GETLK": "7", "SIGTTIN": "21", "_CS_POSIX_V7_WIDTH_RESTRICTED_ENVS": "17", "_POSIX_SPORADIC_SERVER": "1", "_SC_THREAD_CPUTIME": "80", "_CS_POSIX_V7_ILP32_OFFBIG_LIBS": "7", "_CS_POSIX_V6_ILP32_OFF32_LIBS": "3", "_SC_SYNCHRONIZED_IO": "32", "_UNIX98_THREAD_MUTEX_ATTRIBUTES": "1", "__SIGLASTNOTRT": "31", "ERA_D_FMT": "46", "_CS_POSIX_V6_ILP32_OFF32_CFLAGS": "1", "SIG_SETMASK": "0", "S_ISGID": "0002000", "__SIGFIRSTNOTRT": "1", "AT_SYMLINK_FOLLOW": "4", "__USE_XOPEN2K": "1", "_IFSOCK": "0140000", "_IFIFO": "0010000", "SIGPIPE": "13", "O_TRUNC": "1024", "STDERR_FILENO": "2", "_CS_XBS5_LPBIG_OFFBIG_CFLAGS": "13", "_SC_V7_LP64_OFF64": "94", "_O_NOINHERIT": "262144", "D_MD_ORDER": "57", "_SC_SHELL": "74", "ALLPERMS": "0004000", "F_SETFD": "2", "F_SETFL": "4", "___int8_t_defined": "1", "SIGKILL": "9", "_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS": "5", "PTHREAD_MUTEX_RECURSIVE": "1", "S_IWUSR": "0000200", "M_LOG2_E": "0.69314718056", "FWRITE": "2", "SIGUSR1": "30", "FP_ILOGBNAN": "2147483647", "_SC_V7_LPBIG_OFFBIG": "95", "_SC_CLOCK_SELECTION": "61", "_PC_PRIO_IO": "10", "S_ISVTX": "0001000", "_CS_POSIX_V7_THREADS_LDFLAGS": "19", "_SC_PAGESIZE": "8", "_SC_V7_ILP32_OFFBIG": "93", "_RAND48_MULT_0": "58989", "_RAND48_MULT_1": "57068", "_RAND48_MULT_2": "5", "_O_TRUNC": "1024", "W_OK": "2", "_IFBLK": "0060000", "_SC_XBS5_LP64_OFF64": "94", "STDIN_FILENO": "0", "_CS_POSIX_V7_LPBIG_OFFBIG_LIBS": "15", "_POSIX_MESSAGE_PASSING": "200112", "S_ISUID": "0004000", "_POSIX_THREAD_PRIORITY_SCHEDULING": "200112", "_CS_PATH": "0", "___int_least8_t_defined": "1", "_SC_PHYS_PAGES": "11", "_SC_THREAD_SAFE_FUNCTIONS": "49", "SIGRTMAX": "31", "_PC_NAME_MAX": "3", "_SC_AVPHYS_PAGES": "12", "_SC_PRIORITIZED_IO": "28", "CODESET": "0", "CHAR_MAX": "127", "_FASYNC": "64", "S_IRUSR": "0000400", "_O_EXCL": "2048", "SIGURG": "16", "_POSIX_THREAD_ATTR_STACKSIZE": "200112", "_CS_POSIX_V7_LP64_OFF64_LIBS": "11", "_CS_GNU_LIBPTHREAD_VERSION": "43", "_REENT_ASCTIME_SIZE": "26", "_SC_2_PBS_LOCATE": "116", "SIGCHLD": "20", "SHRT_MIN": "-32768", "_PC_SYNC_IO": "11", "M_SQRT1_2": "0.707106781187", "_SC_2_UPE": "120", "_SC_SEM_NSEMS_MAX": "16", "_SC_IOV_MAX": "66", "S_IRGRP": "0000040", "_POSIX_MEMLOCK": "1", "_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS": "6", "PTHREAD_SCOPE_PROCESS": "0", "TLOSS": "5", "O_NOCTTY": "32768", "_SC_THREAD_SPORADIC_SERVER": "81", "_SC_LINE_MAX": "68", "D_T_FMT": "1", "_S_IFCHR": "0020000", "_SC_FSYNC": "22", "_CS_XBS5_LP64_OFF64_LDFLAGS": "10", "_FNOCTTY": "32768", "CRNCYSTR": "56", "S_IWOTH": "0000002", "SEEK_END": "2", "SIGSEGV": "11", "F_GETFL": "3", "_FWRITE": "2", "_SC_2_FORT_DEV": "110", "_SC_BC_BASE_MAX": "57", "_S_IREAD": "0000400", "_LIMITS_H": "1", "OVERFLOW": "3", "POLLNVAL": "4", "_SC_THREAD_PROCESS_SHARED": "48", "_SC_JOB_CONTROL": "5", "O_CLOEXEC": "262144", "SIGABRT": "6", "ACCESSPERMS": "0000400", "_POSIX_PRIORITIZED_IO": "1", "_SC_IPV6": "67", "_SC_ADVISORY_INFO": "54", "_SC_XOPEN_REALTIME_THREADS": "102", "_PC_SYMLINK_MAX": "14", "X_OK": "1", "NO_ARG": "0", "O_NOINHERIT": "262144", "_FEXLOCK": "256", "_SC_XOPEN_REALTIME": "99", "SIGPWR": "19", "_PC_PIPE_BUF": "5", "SIGHUP": "1", "F_GETOWN": "5", "CLOCK_ALLOWED": "1", "_SC_2_PBS_ACCOUNTING": "114", "F_TEST": "3", "_CLOCKS_PER_SEC_": "1000", "_SC_THREAD_ATTR_STACKSIZE": "44", "_SC_PAGE_SIZE": "8", "_SC_2_VERSION": "121", "S_IFCHR": "0020000", "___int_least16_t_defined": "1", "_FTEXT": "131072", "FD_SETSIZE": "64", "_SC_TYPED_MEMORY_OBJECTS": "91", "_SC_AIO_LISTIO_MAX": "34", "FCREAT": "512", "_SC_BC_SCALE_MAX": "59", "MATH_ERREXCEPT": "2", "_POSIX_THREAD_ATTR_STACKADDR": "1", "_POSIX_THREADS": "200112", "SI_QUEUE": "2", "AT_FDCWD": "-2", "_CS_POSIX_V7_LP64_OFF64_LDFLAGS": "10"} -s CHECK_SIGNED_OVERFLOWS=0 -s I64_MODE=1 -s EMULATE_UNALIGNED_ACCESSES=0 -s SHOW_LABELS=0 -s INIT_HEAP=0 -s EXECUTION_TIMEOUT=-1 -s DISABLE_EXCEPTION_CATCHING=0 -s INVOKE_RUN=1 -s USE_FHEAP=1 -s CORRECT_SIGNS=1 -s DEBUG_TAGS_SHOWING=[] -s BUILD_AS_SHARED_LIB=0 -s PGO=0 -s SAFE_HEAP_LOG=0 -s RUNTIME_TYPE_INFO=0 -s IGNORED_FUNCTIONS=[] -o /tmp/foo/emscripten_test_default_HG3a7B/src.cpp.o.js
emcc: compiling to bitcode
emcc: assembling assembly file: /tmp/foo/emscripten_test_default_HG3a7B/src.cpp.o.ll
emcc: generating JavaScript
emcc: saving intermediate processing steps to /tmp/foo/emscripten_temp
ok
----------------------------------------------------------------------
Ran 1 test in 1.714s
OK
Running Emscripten tests...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment