diff options
Diffstat (limited to 'tests')
221 files changed, 24456 insertions, 1370 deletions
diff --git a/tests/799.cpp b/tests/799.cpp index 6c4c9b18..aa3213af 100644 --- a/tests/799.cpp +++ b/tests/799.cpp @@ -6,7 +6,7 @@ #include <sys/socket.h> #include <netinet/in.h> -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <arpa/inet.h> #endif diff --git a/tests/aniso.c b/tests/aniso.c index 443e50aa..b925149d 100644 --- a/tests/aniso.c +++ b/tests/aniso.c @@ -208,7 +208,7 @@ int main(int argc, char *argv[]) */ SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(2000); #endif diff --git a/tests/asmjs-unknown-emscripten.c b/tests/asmjs-unknown-emscripten.c new file mode 100644 index 00000000..36071964 --- /dev/null +++ b/tests/asmjs-unknown-emscripten.c @@ -0,0 +1,98 @@ +#ifndef __EMSCRIPTEN__ +#error __EMSCRIPTEN__ is not defined +#endif +#ifndef __asmjs__ +#error __asmjs__ is not defined +#endif +#ifdef __cplusplus +#ifndef _GNU_SOURCE +#error _GNU_SOURCE is not defined in C++ +#endif +#endif +#ifndef __unix__ +#error __unix__ is not defined +#endif +#ifndef __LITTLE_ENDIAN__ +#error __LITTLE_ENDIAN__ is not defined +#endif + +#ifdef __clang__ +#if __has_feature(pnacl) +#error has feature pnacl +#endif +#endif + +#ifdef __native_client__ +#error __native_client__ is defined +#endif +#ifdef __pnacl__ +#error __pnacl__ is defined +#endif +#ifdef __ELF__ +#error __ELF__ is defined +#endif +#ifdef __i386__ +#error __i386__ is defined +#endif +#ifdef __i386 +#error __i386 is defined +#endif +#ifdef i386 +#error i386 is defined +#endif +#ifdef __SSE__ +#error __SSE__ is defined +#endif +#ifdef __SSE2__ +#error __SSE2__ is defined +#endif +#ifdef __SSE_MATH__ +#error __SSE_MATH__ is defined +#endif +#ifdef __SSE2_MATH__ +#error __SSE2_MATH__ is defined +#endif +#ifdef __MMX__ +#error __MMX__ is defined +#endif +#ifdef __APPLE__ +#error __APPLE__ is defined +#endif +#ifdef __linux__ +#error __linux__ is defined +#endif +#ifdef __BIG_ENDIAN__ +#error __BIG_ENDIAN__ is defined +#endif +#ifdef __LP64__ +#error __LP64__ is defined +#endif + +// We prefer to use __EMSCRIPTEN__, but for compatibility, we define +// EMSCRIPTEN too. +#ifndef EMSCRIPTEN +#error EMSCRIPTEN is not defined +#endif + +#include <stdint.h> +#include <stddef.h> +#include <string.h> +#include <assert.h> + +#define STRINGIZE_HELPER(x) #x +#define STRINGIZE(x) STRINGIZE_HELPER(x) + +int main() { + assert(sizeof(void*) == 4); + assert(sizeof(long) == 4); + assert(sizeof(intmax_t) == 8); + assert(__alignof(double) == 8); + assert(sizeof(long double) == 8); + assert(__alignof(long double) == 8); + assert(sizeof(intptr_t) == 4); + assert(sizeof(size_t) == 4); + assert(sizeof(ptrdiff_t) == 4); + assert(__FLT_EVAL_METHOD__ == 0); + assert(strcmp(STRINGIZE(__USER_LABEL_PREFIX__), "") == 0); + return 0; +} diff --git a/tests/box2d/Benchmark.cpp b/tests/box2d/Benchmark.cpp index 4fd79651..6c9b3c5b 100644 --- a/tests/box2d/Benchmark.cpp +++ b/tests/box2d/Benchmark.cpp @@ -25,7 +25,7 @@ typedef struct { #include <time.h> #include <math.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -131,7 +131,7 @@ int main(int argc, char **argv) { world->Step(1.0f/60.0f, 3, 3); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ responsive_main_loop = argc > 2 ? argv[2][0] - '0' : 0; if (responsive_main_loop) { printf("responsive main loop\n"); @@ -141,7 +141,7 @@ int main(int argc, char **argv) { do { iter(); } while (frameCounter <= FRAMES); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ } #endif @@ -173,7 +173,7 @@ void iter() { printf("frame averages: %.3f +- %.3f, range: %.3f to %.3f \n", result.mean, result.stddev, float(minn)/CLOCKS_PER_SEC * 1000, float(maxx)/CLOCKS_PER_SEC * 1000); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_run_script("if (Module.reportCompletion) Module.reportCompletion()"); if (responsive_main_loop) emscripten_cancel_main_loop(); #endif diff --git a/tests/cases/2xi40.ll b/tests/cases/2xi40.ll index 592f1ba4..fe249528 100644 --- a/tests/cases/2xi40.ll +++ b/tests/cases/2xi40.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpe4Pk1F/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.pair = type { [5 x i8], [5 x i8] } diff --git a/tests/cases/514_ta2.ll b/tests/cases/514_ta2.ll index ab363242..caf69fb5 100644 --- a/tests/cases/514_ta2.ll +++ b/tests/cases/514_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpxFUbAg/test_emcc1.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.c_s = type { i8, float, i32 } diff --git a/tests/cases/aliasbitcast.ll b/tests/cases/aliasbitcast.ll index 5e5f13aa..926b386d 100644 --- a/tests/cases/aliasbitcast.ll +++ b/tests/cases/aliasbitcast.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/aliasbitcast2_noasm.ll b/tests/cases/aliasbitcast2_noasm.ll index 8537e272..5387f2c0 100644 --- a/tests/cases/aliasbitcast2_noasm.ll +++ b/tests/cases/aliasbitcast2_noasm.ll @@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu" ; [#uses=2] define void @original() { entry: - %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0] br label %return return: ; preds = %entry diff --git a/tests/cases/aliasbitcast3_noasm.ll b/tests/cases/aliasbitcast3_noasm.ll index 4ff969e3..19d3ff14 100644 --- a/tests/cases/aliasbitcast3_noasm.ll +++ b/tests/cases/aliasbitcast3_noasm.ll @@ -11,7 +11,7 @@ target triple = "i386-pc-linux-gnu" ; [#uses=2] define void @original() { entry: - %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0] br label %return return: ; preds = %entry @@ -24,6 +24,6 @@ declare i32 @puts(i8*) ; [#uses=0] define i32 @main() { entry: - call void @thriceremoved() + call void @thriceremoved(i32 0) ret i32 0 } diff --git a/tests/cases/aliasbitcastdollar_noasm.ll b/tests/cases/aliasbitcastdollar_noasm.ll index 1ecf6047..558289b7 100644 --- a/tests/cases/aliasbitcastdollar_noasm.ll +++ b/tests/cases/aliasbitcastdollar_noasm.ll @@ -9,7 +9,7 @@ target triple = "i386-pc-linux-gnu" ; [#uses=2] define void @original() { entry: - %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0] br label %return return: ; preds = %entry diff --git a/tests/cases/aliases_fastcomp.ll b/tests/cases/aliases_fastcomp.ll new file mode 100644 index 00000000..2b8746eb --- /dev/null +++ b/tests/cases/aliases_fastcomp.ll @@ -0,0 +1,41 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +@.str = private unnamed_addr constant [18 x i8] c"hello, world! %d\0A\00", align 1 ; [#uses=1 type=[18 x i8]*] + +@othername = alias internal void (i32)* @doit +@othername2 = alias internal void (i32)* @othername +@othername3 = alias internal void (i32)* @othername2 + +@value = global i32 17 +@value2 = alias i32* @value +@value3 = alias i32* @value + +define internal void @doit(i32 %x) { + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %x) ; [#uses=0 type=i32] + ret void +} + +define i32 @main() { +entry: + %fp = ptrtoint void (i32)* @othername3 to i32 + %fp1 = add i32 %fp, 0 + %pf = inttoptr i32 %fp1 to void (i32)* + %x = load i32* @value3 + call void (i32)* %pf(i32 %x) + %x1 = load i32* @value2 + call void (i32)* @othername3(i32 %x1) + %x2 = load i32* @value + call void (i32)* @othername2(i32 %x2) + store i32 18, i32* @value + %x3 = load i32* @value + call void (i32)* @othername(i32 %x3) + store i32 19, i32* @value3 + %x4 = load i32* @value3 + call void (i32)* @doit(i32 %x4) + ret i32 1 +} + +declare i32 @printf(i8*, ...) + diff --git a/tests/cases/aliases_fastcomp.txt b/tests/cases/aliases_fastcomp.txt new file mode 100644 index 00000000..ae30c63c --- /dev/null +++ b/tests/cases/aliases_fastcomp.txt @@ -0,0 +1,5 @@ +hello, world! 17 +hello, world! 17 +hello, world! 17 +hello, world! 18 +hello, world! 19 diff --git a/tests/cases/atomicrmw.ll b/tests/cases/atomicrmw.ll index 31529250..20a68baa 100644 --- a/tests/cases/atomicrmw.ll +++ b/tests/cases/atomicrmw.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, %d,%d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/atomicrmw_dec.ll b/tests/cases/atomicrmw_dec.ll index 0ff08a5d..819c3a2a 100644 --- a/tests/cases/atomicrmw_dec.ll +++ b/tests/cases/atomicrmw_dec.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, %d,%d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/atomicrmw_unaligned.ll b/tests/cases/atomicrmw_unaligned.ll index 31529250..20a68baa 100644 --- a/tests/cases/atomicrmw_unaligned.ll +++ b/tests/cases/atomicrmw_unaligned.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, %d,%d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/bigdouble.ll b/tests/cases/bigdouble.ll index cd58c08b..472adadd 100644 --- a/tests/cases/bigdouble.ll +++ b/tests/cases/bigdouble.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpijH2sB/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 diff --git a/tests/cases/boolret_fastcomp.ll b/tests/cases/boolret_fastcomp.ll index a20cd001..e6320bab 100644 --- a/tests/cases/boolret_fastcomp.ll +++ b/tests/cases/boolret_fastcomp.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"helloworld%d.\0A\00", align 1 diff --git a/tests/cases/breakinthemiddle.ll b/tests/cases/breakinthemiddle.ll index 6e05b853..39aaa922 100644 --- a/tests/cases/breakinthemiddle.ll +++ b/tests/cases/breakinthemiddle.ll @@ -1,5 +1,5 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/breakinthemiddle2.ll b/tests/cases/breakinthemiddle2.ll index 2f8c1c91..db1cb7b6 100644 --- a/tests/cases/breakinthemiddle2.ll +++ b/tests/cases/breakinthemiddle2.ll @@ -1,5 +1,5 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/caall.ll b/tests/cases/caall.ll index 2cc231ec..0d92a498 100644 --- a/tests/cases/caall.ll +++ b/tests/cases/caall.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/callwithstructural64_ta2.ll b/tests/cases/callwithstructural64_ta2.ll index d16b0e87..103adcd0 100644 --- a/tests/cases/callwithstructural64_ta2.ll +++ b/tests/cases/callwithstructural64_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'foo.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %ac = type { i8*, i64 } diff --git a/tests/cases/callwithstructural_ta2.ll b/tests/cases/callwithstructural_ta2.ll index bc6f852a..00cde791 100644 --- a/tests/cases/callwithstructural_ta2.ll +++ b/tests/cases/callwithstructural_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'foo.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %ac = type { i8*, i32 } diff --git a/tests/cases/complexphi.ll b/tests/cases/complexphi.ll index e79e6f1b..871cbe27 100644 --- a/tests/cases/complexphi.ll +++ b/tests/cases/complexphi.ll @@ -1,6 +1,6 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] @_dispatchTable = internal global i64 0 diff --git a/tests/cases/ctors_cast.ll b/tests/cases/ctors_cast.ll index d94b1d63..69baa17d 100644 --- a/tests/cases/ctors_cast.ll +++ b/tests/cases/ctors_cast.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpHcVUBJ/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.Other = type { i8 } diff --git a/tests/cases/dash.ll b/tests/cases/dash.ll index 6833a42e..0104cf7c 100644 --- a/tests/cases/dash.ll +++ b/tests/cases/dash.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpqfApGD/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @other-name = alias i32 ()* @main diff --git a/tests/cases/dollar.ll b/tests/cases/dollar.ll index 7d730d6a..3bd203cf 100644 --- a/tests/cases/dollar.ll +++ b/tests/cases/dollar.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/emptyalloca.ll b/tests/cases/emptyalloca.ll index f12a4161..59ff2955 100644 --- a/tests/cases/emptyalloca.ll +++ b/tests/cases/emptyalloca.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpjSNiky/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [30 x i8] c"Module.print('hello, world!')\00", align 1 diff --git a/tests/cases/emptyasm_le32.ll b/tests/cases/emptyasm_aue.ll index 8f6b606e..24805591 100644 --- a/tests/cases/emptyasm_le32.ll +++ b/tests/cases/emptyasm_aue.ll @@ -1,5 +1,5 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" ; ModuleID = 'tests/hello_world.bc' diff --git a/tests/cases/emptystruct.ll b/tests/cases/emptystruct.ll index ecf0e295..b32ac803 100644 --- a/tests/cases/emptystruct.ll +++ b/tests/cases/emptystruct.ll @@ -13,7 +13,7 @@ entry: %z = alloca %struct.s, align 4 %0 = bitcast %struct.s* %z to i8* call void @llvm.memset.p0i8.i32(i8* %0, i8 0, i32 4, i32 4, i1 false) - %1 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + %1 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0] ret i32 0 } diff --git a/tests/cases/entry3.ll b/tests/cases/entry3.ll index 6888d0a8..822e6b7f 100644 --- a/tests/cases/entry3.ll +++ b/tests/cases/entry3.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpKnA2D3/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [11 x i8] c"getgid=%d\0A\00", align 1 @.str1 = private unnamed_addr constant [6 x i8] c"f=%d\0A\00", align 1 diff --git a/tests/cases/fixablebadcasts_fastcomp.ll b/tests/cases/fixablebadcasts_fastcomp.ll new file mode 100644 index 00000000..3870e0e0 --- /dev/null +++ b/tests/cases/fixablebadcasts_fastcomp.ll @@ -0,0 +1,27 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +@.str = private unnamed_addr constant [18 x i8] c"hello, world %d!\0A\00", align 1 + +; [#uses=0] +define i32 @main() { +entry: + %retval = alloca i32, align 4 ; [#uses=1 type=i32*] + store i32 0, i32* %retval + %a = call i32 bitcast (i32 (i32)* @twoparam to i32 (i32, i32)*)(i32 5, i32 6) + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %a) ; [#uses=0 type=i32] + call void bitcast (void (i32, i32*, i32*)* @_ZN7WebCore33signedPublicKeyAndChallengeStringEjRKN3WTF6StringERKNS_3URLE to void (i32*, i32, i32*, i32*)*)(i32* sret null, i32 0, i32* null, i32* null) + ret i32 1 +} + +define i32 @twoparam(i32 %x) { + ret i32 %x +} + +define void @_ZN7WebCore33signedPublicKeyAndChallengeStringEjRKN3WTF6StringERKNS_3URLE(i32, i32* nocapture, i32* nocapture) { + ret void +} + +; [#uses=1] +declare i32 @printf(i8*, ...) diff --git a/tests/cases/fixablebadcasts_fastcomp.txt b/tests/cases/fixablebadcasts_fastcomp.txt new file mode 100644 index 00000000..47abd748 --- /dev/null +++ b/tests/cases/fixablebadcasts_fastcomp.txt @@ -0,0 +1 @@ +hello, world 5! diff --git a/tests/cases/fptosi.ll b/tests/cases/fptosi.ll index 71bc6af8..5c6477bf 100644 --- a/tests/cases/fptosi.ll +++ b/tests/cases/fptosi.ll @@ -1,6 +1,6 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [8 x i8] c"*%.3f*\0A\00", align 1 ; [#uses=1 type=[8 x i8]*] @.str2 = private unnamed_addr constant [6 x i8] c"*%d*\0A\00", align 1 ; [#uses=1 type=[6 x i8]*] diff --git a/tests/cases/funcptr.ll b/tests/cases/funcptr.ll index ef869c33..4c1c9990 100644 --- a/tests/cases/funcptr.ll +++ b/tests/cases/funcptr.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [17 x i8] c"hello %d world!\0A\00", align 1 ; [#uses=1 type=[17 x i8]*] diff --git a/tests/cases/fuzz6_ta2.ll b/tests/cases/fuzz6_ta2.ll index dea3a21d..a30bf61f 100644 --- a/tests/cases/fuzz6_ta2.ll +++ b/tests/cases/fuzz6_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'emcc-0-basebc.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.S3 = type { i32, i32 } %struct.S1 = type { i32, i32, i8, i16 } diff --git a/tests/cases/gepaddoverflow.ll b/tests/cases/gepaddoverflow.ll index 11246c1d..4346ce20 100644 --- a/tests/cases/gepaddoverflow.ll +++ b/tests/cases/gepaddoverflow.ll @@ -1,6 +1,6 @@ ; ModuleID = 'new.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" declare i32 @printf(i8* noalias, ...) nounwind diff --git a/tests/cases/i24_ce_fastcomp.ll b/tests/cases/i24_ce_fastcomp.ll new file mode 100644 index 00000000..69b580a2 --- /dev/null +++ b/tests/cases/i24_ce_fastcomp.ll @@ -0,0 +1,11393 @@ +; ModuleID = 'emcc-0-basebc.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +; Tests i24 constantExprs nested heavily + +%struct.S0 = type { i16, i8, i32 } +%struct.malloc_state = type { i32, i32, i32, i32, i8*, %struct.malloc_chunk*, %struct.malloc_chunk*, i32, i32, i32, [66 x %struct.malloc_chunk*], [32 x %struct.malloc_tree_chunk*], i32, i32, i32, i32, %struct.malloc_segment, i8*, i32 } +%struct.malloc_chunk = type { i32, i32, %struct.malloc_chunk*, %struct.malloc_chunk* } +%struct.malloc_tree_chunk = type { i32, i32, %struct.malloc_tree_chunk*, %struct.malloc_tree_chunk*, [2 x %struct.malloc_tree_chunk*], %struct.malloc_tree_chunk*, i32 } +%struct.malloc_segment = type { i8*, i32, %struct.malloc_segment*, i32 } +%struct.malloc_params = type { i32, i32, i32, i32, i32, i32 } +%struct._IO_FILE = type { i32, i8*, i8*, i32 (%struct._IO_FILE*)*, i8*, i8*, i8*, i8*, i32 (%struct._IO_FILE*, i8*, i32)*, i32 (%struct._IO_FILE*, i8*, i32)*, i32 (%struct._IO_FILE*, i32, i32)*, i8*, i32, %struct._IO_FILE*, %struct._IO_FILE*, i32, i32, i32, i16, i8, i8, i32, i32, i8*, i32, i8*, i8*, i8*, i32, i32 } +%"struct.std::nothrow_t" = type { i8 } +%"class.std::bad_alloc" = type { %"class.std::exception" } +%"class.std::exception" = type { i32 (...)** } +%"class.std::bad_array_new_length" = type { %"class.std::bad_alloc" } +%"class.std::bad_array_length" = type { %"class.std::bad_alloc" } +%struct.__locale_struct = type opaque +%struct.__locale_struct.0 = type opaque +%struct.__locale_struct.1 = type opaque +%union.U1 = type { i8* } +%struct.mallinfo = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } +%struct._IO_FILE.3 = type { i32, i8*, i8*, {}*, i8*, i8*, i8*, i8*, i32 (%struct._IO_FILE.3*, i8*, i32)*, i32 (%struct._IO_FILE.3*, i8*, i32)*, i32 (%struct._IO_FILE.3*, i32, i32)*, i8*, i32, %struct._IO_FILE.3*, %struct._IO_FILE.3*, i32, i32, i32, i16, i8, i8, i32, i32, i8*, i32, i8*, i8*, i8*, i32, i32 } +%struct._IO_FILE.4 = type { i32, i8*, i8*, {}*, i8*, i8*, i8*, i8*, i32 (%struct._IO_FILE.4*, i8*, i32)*, i32 (%struct._IO_FILE.4*, i8*, i32)*, i32 (%struct._IO_FILE.4*, i32, i32)*, i8*, i32, %struct._IO_FILE.4*, %struct._IO_FILE.4*, i32, i32, i32, i16, i8, i8, i32, i32, i8*, i32, i8*, i8*, i8*, i32, i32 } + +@.str = private unnamed_addr constant [2 x i8] c"1\00", align 1 +@_ZL3g_2 = internal global i32 -8, align 4 +@.str1 = private unnamed_addr constant [4 x i8] c"g_2\00", align 1 +@_ZL4g_52 = internal global [4 x [6 x [6 x i8]]] [[6 x [6 x i8]] [[6 x i8] c"\00\02Q\07\07Q", [6 x i8] c"\09\09\8F\01\00\00", [6 x i8] c"\FFO\09\07\00\8F", [6 x i8] c"\D1\FF\09\02\09\00", [6 x i8] c"\FD\02\8FE\FFQ", [6 x i8] c"E\FFQ\01\D1\D1"], [6 x [6 x i8]] [[6 x i8] c"EOOE\FD\8F", [6 x i8] c"\FD\09\01\02E\D1", [6 x i8] c"\D1\02M\07EQ", [6 x i8] c"\FF\09\01\01\FD\00", [6 x i8] c"\09O\02\07\D1\8F", [6 x i8] c"\00\FF\02\02\FF\00"], [6 x [6 x i8]] [[6 x i8] c"\00\02\01E\09Q", [6 x i8] c"\07\FFM\01\00\D1", [6 x i8] c"\07O\01E\00\8F", [6 x i8] c"\00\09O\02\07\D1", [6 x i8] c"\00\02Q\07\07Q", [6 x i8] c"\09\09\8F\01\00\00"], [6 x [6 x i8]] [[6 x i8] c"\FFO\09\07\00\8F", [6 x i8] c"\D1\FF\09\02\09\00", [6 x i8] c"\FD\02\8FE\FFQ", [6 x i8] c"E\FFQ\01\D1\D1", [6 x i8] c"EOOE\FD\8F", [6 x i8] c"\FD\09\01\02E\D1"]], align 1 +@.str2 = private unnamed_addr constant [14 x i8] c"g_52[i][j][k]\00", align 1 +@.str3 = private unnamed_addr constant [22 x i8] c"index = [%d][%d][%d]\0A\00", align 1 +@_ZL4g_53 = internal global i32 -1550080695, align 4 +@.str4 = private unnamed_addr constant [5 x i8] c"g_53\00", align 1 +@.str5 = private unnamed_addr constant [8 x i8] c"g_74.f0\00", align 1 +@.str6 = private unnamed_addr constant [8 x i8] c"g_74.f4\00", align 1 +@_ZL4g_77 = internal global i16 1, align 2 +@.str7 = private unnamed_addr constant [5 x i8] c"g_77\00", align 1 +@_ZL4g_79 = internal global i16 -1, align 2 +@.str8 = private unnamed_addr constant [5 x i8] c"g_79\00", align 1 +@_ZL4g_82 = internal global i16 -4597, align 2 +@.str9 = private unnamed_addr constant [5 x i8] c"g_82\00", align 1 +@_ZL4g_83 = internal global %struct.S0 { i16 -20724, i8 -72, i32 1 }, align 8 +@.str10 = private unnamed_addr constant [8 x i8] c"g_83.f0\00", align 1 +@.str11 = private unnamed_addr constant [8 x i8] c"g_83.f1\00", align 1 +@.str12 = private unnamed_addr constant [8 x i8] c"g_83.f2\00", align 1 +@_ZL4g_93 = internal global i32 -911546352, align 4 +@.str13 = private unnamed_addr constant [5 x i8] c"g_93\00", align 1 +@_ZL5g_103 = internal global i16 -1, align 2 +@.str14 = private unnamed_addr constant [6 x i8] c"g_103\00", align 1 +@_ZL5g_126 = internal global i8 6, align 1 +@.str15 = private unnamed_addr constant [6 x i8] c"g_126\00", align 1 +@_ZL5g_132 = internal global i32 -782244254, align 4 +@.str16 = private unnamed_addr constant [6 x i8] c"g_132\00", align 1 +@_ZL5g_133 = internal unnamed_addr global i8 -17, align 1 +@.str17 = private unnamed_addr constant [6 x i8] c"g_133\00", align 1 +@_ZL5g_135 = internal global i32 -3, align 4 +@.str18 = private unnamed_addr constant [6 x i8] c"g_135\00", align 1 +@_ZL5g_136 = internal global i8 -1, align 1 +@.str19 = private unnamed_addr constant [6 x i8] c"g_136\00", align 1 +@_ZL5g_138 = internal global i32 1083335064, align 4 +@.str20 = private unnamed_addr constant [6 x i8] c"g_138\00", align 1 +@_ZL5g_162 = internal global i16 17495, align 2 +@.str21 = private unnamed_addr constant [6 x i8] c"g_162\00", align 1 +@_ZL5g_168 = internal global i16 8, align 2 +@.str22 = private unnamed_addr constant [6 x i8] c"g_168\00", align 1 +@_ZL5g_170 = internal global i8 -109, align 1 +@.str23 = private unnamed_addr constant [6 x i8] c"g_170\00", align 1 +@_ZL5g_171 = internal global [8 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF", align 1 +@.str24 = private unnamed_addr constant [9 x i8] c"g_171[i]\00", align 1 +@.str25 = private unnamed_addr constant [14 x i8] c"index = [%d]\0A\00", align 1 +@_ZL5g_172 = internal global i16 0, align 2 +@.str26 = private unnamed_addr constant [6 x i8] c"g_172\00", align 1 +@_ZL5g_257 = internal global i32 2067456055, align 4 +@.str27 = private unnamed_addr constant [6 x i8] c"g_257\00", align 1 +@_ZL5g_304 = internal global i8 1, align 1 +@.str28 = private unnamed_addr constant [6 x i8] c"g_304\00", align 1 +@_ZL5g_308 = internal global i16 -3, align 2 +@.str29 = private unnamed_addr constant [6 x i8] c"g_308\00", align 1 +@_ZL5g_361 = internal global i16 1, align 2 +@.str30 = private unnamed_addr constant [6 x i8] c"g_361\00", align 1 +@_ZL5g_400 = internal global i32 711639049, align 4 +@.str31 = private unnamed_addr constant [6 x i8] c"g_400\00", align 1 +@.str32 = private unnamed_addr constant [6 x i8] c"g_428\00", align 1 +@_ZL5g_471 = internal global %struct.S0 { i16 0, i8 6, i32 1033957816 }, align 8 +@.str33 = private unnamed_addr constant [9 x i8] c"g_471.f0\00", align 1 +@.str34 = private unnamed_addr constant [9 x i8] c"g_471.f1\00", align 1 +@.str35 = private unnamed_addr constant [9 x i8] c"g_471.f2\00", align 1 +@_ZL5g_546 = internal global i32 1, align 4 +@.str36 = private unnamed_addr constant [6 x i8] c"g_546\00", align 1 +@.str37 = private unnamed_addr constant [6 x i8] c"g_687\00", align 1 +@.str38 = private unnamed_addr constant [6 x i8] c"g_711\00", align 1 +@_ZL5g_935 = internal unnamed_addr constant [10 x i32] [i32 -533036994, i32 -533036994, i32 1950933783, i32 -533036994, i32 -533036994, i32 1950933783, i32 -533036994, i32 -533036994, i32 1950933783, i32 -533036994], align 4 +@.str39 = private unnamed_addr constant [9 x i8] c"g_935[i]\00", align 1 +@_ZL6g_1010 = internal global i8 1, align 1 +@.str40 = private unnamed_addr constant [7 x i8] c"g_1010\00", align 1 +@_ZL6g_1025 = internal unnamed_addr global i8 -7, align 1 +@.str41 = private unnamed_addr constant [7 x i8] c"g_1025\00", align 1 +@_ZL6g_1136 = internal unnamed_addr global i8 -108, align 1 +@.str42 = private unnamed_addr constant [7 x i8] c"g_1136\00", align 1 +@.str43 = private unnamed_addr constant [7 x i8] c"g_1165\00", align 1 +@.str44 = private unnamed_addr constant [7 x i8] c"g_1176\00", align 1 +@_ZL6g_1198 = internal global i32 1, align 4 +@.str45 = private unnamed_addr constant [7 x i8] c"g_1198\00", align 1 +@_ZL6g_1442 = internal unnamed_addr constant [8 x i32] [i32 -3, i32 -1424736723, i32 -1424736723, i32 -3, i32 -1424736723, i32 -1424736723, i32 -3, i32 -1424736723], align 4 +@.str46 = private unnamed_addr constant [10 x i8] c"g_1442[i]\00", align 1 +@_ZL13crc32_context = internal unnamed_addr global i32 -1, align 4 +@.str47 = private unnamed_addr constant [15 x i8] c"checksum = %X\0A\00", align 1 +@_ZL4g_74 = internal global { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, align 4 +@.str48 = private unnamed_addr constant [36 x i8] c"...checksum after hashing %s : %lX\0A\00", align 1 +@_ZL9crc32_tab = internal unnamed_addr global [256 x i32] zeroinitializer, align 4 +@_ZZL6func_1vE6l_1011 = private unnamed_addr constant [7 x [1 x [7 x %struct.S0]]] [[1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 -9, i8 50, i32 -865011421 }, %struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 -9, i8 50, i32 -865011421 }, %struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 -9, i8 50, i32 -865011421 }, %struct.S0 { i16 9338, i8 45, i32 -5 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 -15215, i8 -5, i32 -963383367 }, %struct.S0 { i16 10188, i8 44, i32 -40550910 }]], [1 x [7 x %struct.S0]] [[7 x %struct.S0] [%struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 7185, i8 -3, i32 -2 }, %struct.S0 { i16 -4, i8 -5, i32 879602046 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }, %struct.S0 { i16 -25965, i8 -51, i32 7 }, %struct.S0 { i16 32067, i8 -3, i32 -1554043524 }]]], align 8 +@_ZL5g_984 = internal global i8** @_ZL5g_985, align 4 +@_ZZL6func_1vE6l_1499 = private unnamed_addr constant [9 x i8] c"\98\98\98\98\98\98\98\98\98", align 1 +@_ZZL6func_1vE6l_1006 = private unnamed_addr constant [10 x [7 x [3 x i32]]] [[7 x [3 x i32]] [[3 x i32] [i32 1841884517, i32 -1, i32 -1613798643], [3 x i32] [i32 2091444926, i32 -2138639918, i32 0], [3 x i32] [i32 283017736, i32 -7, i32 1698185546], [3 x i32] [i32 1628157269, i32 0, i32 1044216359], [3 x i32] [i32 1547065395, i32 -1, i32 -7], [3 x i32] [i32 8, i32 -1, i32 1], [3 x i32] [i32 1841884517, i32 0, i32 2]], [7 x [3 x i32]] [[3 x i32] [i32 7, i32 -7, i32 2087377514], [3 x i32] [i32 834421965, i32 -2138639918, i32 2], [3 x i32] [i32 1, i32 -1, i32 1044216359], [3 x i32] [i32 7, i32 -10, i32 -1], [3 x i32] [i32 7, i32 -1, i32 -328727838], [3 x i32] [i32 360433363, i32 -2138639918, i32 -1613798643], [3 x i32] [i32 1547065395, i32 -7, i32 -1]], [7 x [3 x i32]] [[3 x i32] [i32 0, i32 0, i32 -1129666350], [3 x i32] [i32 -1120699426, i32 -1, i32 -8], [3 x i32] [i32 2091444926, i32 -1, i32 2087377514], [3 x i32] [i32 7, i32 0, i32 -5], [3 x i32] [i32 679230240, i32 -7, i32 -5], [3 x i32] [i32 1, i32 -2138639918, i32 -7], [3 x i32] [i32 834421965, i32 -1, i32 -1129666350]], [7 x [3 x i32]] [[3 x i32] [i32 679230240, i32 -10, i32 -4], [3 x i32] [i32 -1, i32 -1, i32 0], [3 x i32] [i32 8, i32 -2138639918, i32 -328727838], [3 x i32] [i32 -1120699426, i32 -7, i32 -4], [3 x i32] [i32 1, i32 0, i32 -1], [3 x i32] [i32 283017736, i32 -1, i32 2], [3 x i32] [i32 360433363, i32 -1, i32 -5]], [7 x [3 x i32]] [[3 x i32] [i32 -1, i32 0, i32 0], [3 x i32] [i32 555482698, i32 -7, i32 1], [3 x i32] [i32 1, i32 -2138639918, i32 -8], [3 x i32] [i32 1, i32 -1, i32 -1], [3 x i32] [i32 555482698, i32 -10, i32 1698185546], [3 x i32] [i32 1841884517, i32 -1, i32 -1613798643], [3 x i32] [i32 2091444926, i32 -2138639918, i32 0]], [7 x [3 x i32]] [[3 x i32] [i32 283017736, i32 -7, i32 1698185546], [3 x i32] [i32 1628157269, i32 0, i32 1044216359], [3 x i32] [i32 1547065395, i32 -1, i32 -7], [3 x i32] [i32 8, i32 -1, i32 1], [3 x i32] [i32 1841884517, i32 0, i32 2], [3 x i32] [i32 7, i32 -7, i32 2087377514], [3 x i32] [i32 834421965, i32 -2138639918, i32 2]], [7 x [3 x i32]] [[3 x i32] [i32 1, i32 1023954582, i32 -1], [3 x i32] [i32 -1, i32 -1579985206, i32 8], [3 x i32] [i32 2, i32 1023954582, i32 -1425719182], [3 x i32] [i32 87909934, i32 0, i32 0], [3 x i32] [i32 0, i32 7, i32 8], [3 x i32] [i32 702414371, i32 0, i32 2], [3 x i32] [i32 -328727838, i32 -2, i32 -2]], [7 x [3 x i32]] [[3 x i32] [i32 -10, i32 -2, i32 96667756], [3 x i32] [i32 2, i32 0, i32 1924945160], [3 x i32] [i32 -1, i32 7, i32 -1402097775], [3 x i32] [i32 -1, i32 0, i32 7], [3 x i32] [i32 -4, i32 1023954582, i32 2], [3 x i32] [i32 -1, i32 -1579985206, i32 73780325], [3 x i32] [i32 0, i32 1023954582, i32 -1893771394]], [7 x [3 x i32]] [[3 x i32] [i32 4, i32 0, i32 -1425719182], [3 x i32] [i32 -328727838, i32 7, i32 73780325], [3 x i32] [i32 6, i32 0, i32 -2], [3 x i32] [i32 -1613798643, i32 -2, i32 -1986717165], [3 x i32] [i32 87909934, i32 -2, i32 -1402097775], [3 x i32] zeroinitializer, [3 x i32] [i32 320804302, i32 7, i32 -2139698281]], [7 x [3 x i32]] [[3 x i32] [i32 1698185546, i32 0, i32 -2], [3 x i32] [i32 -1, i32 1023954582, i32 -2], [3 x i32] [i32 320804302, i32 -1579985206, i32 -1878118873], [3 x i32] [i32 -5, i32 1023954582, i32 0], [3 x i32] [i32 -10, i32 0, i32 -1893771394], [3 x i32] [i32 -1613798643, i32 7, i32 -1878118873], [3 x i32] [i32 653753375, i32 0, i32 -1]]], align 4 +@_ZL5g_983 = internal global i8*** @_ZL5g_984, align 4 +@_ZZL6func_1vE6l_1324 = private unnamed_addr constant [7 x [3 x [10 x i8****]]] [[3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]], [3 x [10 x i8****]] [[10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** null, i8**** @_ZL5g_983, i8**** @_ZL5g_983], [10 x i8****] [i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983, i8**** @_ZL5g_983]]], align 4 +@_ZZL6func_1vE6l_1346 = private unnamed_addr constant [10 x i32] [i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2, i32 -2], align 4 +@_ZZL6func_1vE6l_1519 = private unnamed_addr constant [10 x %struct.S0] [%struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }, %struct.S0 { i16 1, i8 91, i32 1 }], align 8 +@_ZL5g_189 = internal constant %struct.S0* @_ZL4g_83, align 4 +@_ZZL6func_1vE6l_1263 = private unnamed_addr constant [2 x [1 x [8 x i32]]] [[1 x [8 x i32]] [[8 x i32] [i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1]], [1 x [8 x i32]] [[8 x i32] [i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1]]], align 4 +@_ZZL6func_1vE6l_1364 = private unnamed_addr constant %struct.S0 { i16 12857, i8 -1, i32 103472530 }, align 4 +@_ZZL6func_1vE6l_1204 = private unnamed_addr constant [10 x i32*] [i32* @_ZL5g_138, i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* @_ZL5g_138, i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* @_ZL5g_138, i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZL5g_471 to i8*), i64 4) to i32*), i32* @_ZL5g_138], align 4 +@_ZZL6func_1vE6l_1278 = private unnamed_addr constant [7 x [9 x [4 x i32]]] [[9 x [4 x i32]] [[4 x i32] [i32 0, i32 -9, i32 -608911817, i32 -1137618830], [4 x i32] [i32 -1673477626, i32 1178455578, i32 -1, i32 1], [4 x i32] [i32 1749634172, i32 -608911817, i32 -1750306944, i32 5], [4 x i32] [i32 -1, i32 -267173613, i32 1, i32 -267173613], [4 x i32] [i32 342924466, i32 -1137618830, i32 5, i32 0], [4 x i32] [i32 -1, i32 5, i32 -2032672910, i32 2], [4 x i32] [i32 -267173613, i32 1687884857, i32 -7, i32 0], [4 x i32] [i32 -267173613, i32 60247711, i32 -2032672910, i32 -829052586], [4 x i32] [i32 -1, i32 0, i32 5, i32 -9]], [9 x [4 x i32]] [[4 x i32] [i32 342924466, i32 6, i32 1, i32 -1750306944], [4 x i32] [i32 -1, i32 -2032672910, i32 -1750306944, i32 1], [4 x i32] [i32 1749634172, i32 -1, i32 -1, i32 1749634172], [4 x i32] [i32 -1673477626, i32 -920516504, i32 -608911817, i32 -5], [4 x i32] [i32 0, i32 -1, i32 1687884857, i32 0], [4 x i32] [i32 -829052586, i32 -1750306944, i32 1749634172, i32 0], [4 x i32] [i32 -1137618830, i32 -1, i32 342924466, i32 -5], [4 x i32] [i32 6, i32 -920516504, i32 -829052586, i32 1749634172], [4 x i32] [i32 1178455578, i32 -1, i32 1, i32 1]], [9 x [4 x i32]] [[4 x i32] [i32 0, i32 -2032672910, i32 -920516504, i32 -1750306944], [4 x i32] [i32 -852752877, i32 6, i32 -852752877, i32 -9], [4 x i32] [i32 1, i32 0, i32 6, i32 -829052586], [4 x i32] [i32 2, i32 60247711, i32 1, i32 0], [4 x i32] [i32 -608911817, i32 6, i32 -7, i32 -5], [4 x i32] [i32 -5, i32 0, i32 1749634172, i32 -1750306944], [4 x i32] [i32 -2032672910, i32 -1, i32 2, i32 -608911817], [4 x i32] [i32 2, i32 -608911817, i32 -1673477626, i32 0], [4 x i32] [i32 -267173613, i32 1, i32 -920516504, i32 -920516504]], [9 x [4 x i32]] [[4 x i32] [i32 -1692884230, i32 -1692884230, i32 1178455578, i32 -1], [4 x i32] [i32 1749634172, i32 1687884857, i32 0, i32 -1673477626], [4 x i32] [i32 -1, i32 -1750306944, i32 -1, i32 0], [4 x i32] [i32 1178455578, i32 -1750306944, i32 6, i32 -1673477626], [4 x i32] [i32 -1750306944, i32 1687884857, i32 1, i32 -1], [4 x i32] [i32 5, i32 -1692884230, i32 -1, i32 -920516504], [4 x i32] [i32 -1, i32 1, i32 1, i32 0], [4 x i32] [i32 -1, i32 -608911817, i32 -2032672910, i32 -608911817], [4 x i32] [i32 0, i32 -1, i32 0, i32 -1750306944]], [9 x [4 x i32]] [[4 x i32] [i32 -829052586, i32 0, i32 0, i32 -5], [4 x i32] [i32 -608911817, i32 6, i32 -1137618830, i32 -267173613], [4 x i32] [i32 -608911817, i32 -9, i32 0, i32 1178455578], [4 x i32] [i32 -829052586, i32 -267173613, i32 0, i32 1687884857], [4 x i32] [i32 0, i32 1749634172, i32 -2032672910, i32 1], [4 x i32] [i32 -1, i32 0, i32 1, i32 -7], [4 x i32] [i32 -1, i32 -1, i32 -1, i32 -1], [4 x i32] [i32 5, i32 -1673477626, i32 1, i32 0], [4 x i32] [i32 -1750306944, i32 1, i32 6, i32 342924466]], [9 x [4 x i32]] [[4 x i32] [i32 1178455578, i32 1, i32 -1, i32 342924466], [4 x i32] [i32 -1, i32 1, i32 0, i32 0], [4 x i32] [i32 1749634172, i32 -1673477626, i32 1178455578, i32 -1], [4 x i32] [i32 -1692884230, i32 -1, i32 -920516504, i32 -7], [4 x i32] [i32 -267173613, i32 0, i32 -1673477626, i32 1], [4 x i32] [i32 2, i32 1749634172, i32 2, i32 1687884857], [4 x i32] [i32 -2032672910, i32 -267173613, i32 1749634172, i32 1178455578], [4 x i32] [i32 -5, i32 -9, i32 -7, i32 -267173613], [4 x i32] [i32 1, i32 6, i32 -7, i32 -5]], [9 x [4 x i32]] [[4 x i32] [i32 -5, i32 0, i32 1749634172, i32 -1750306944], [4 x i32] [i32 -2032672910, i32 -1, i32 2, i32 -608911817], [4 x i32] [i32 2, i32 -608911817, i32 -1673477626, i32 0], [4 x i32] [i32 -267173613, i32 1, i32 -920516504, i32 -920516504], [4 x i32] [i32 -1692884230, i32 -1692884230, i32 1178455578, i32 -1], [4 x i32] [i32 1749634172, i32 1687884857, i32 0, i32 -1673477626], [4 x i32] [i32 -1, i32 -1750306944, i32 -1, i32 0], [4 x i32] [i32 1178455578, i32 -1750306944, i32 6, i32 -1673477626], [4 x i32] [i32 -1750306944, i32 1687884857, i32 1, i32 -1]]], align 4 +@_ZZL6func_1vE6l_1365 = private unnamed_addr constant [8 x [3 x [5 x i16]]] [[3 x [5 x i16]] [[5 x i16] [i16 -1, i16 -10870, i16 20658, i16 0, i16 3], [5 x i16] [i16 22073, i16 24925, i16 -13292, i16 -10870, i16 -1459], [5 x i16] [i16 1, i16 138, i16 7, i16 -26288, i16 7]], [3 x [5 x i16]] [[5 x i16] [i16 1, i16 1, i16 7, i16 5, i16 24925], [5 x i16] [i16 -30784, i16 0, i16 -13292, i16 -1, i16 -26288], [5 x i16] [i16 1, i16 9699, i16 20658, i16 5708, i16 1]], [3 x [5 x i16]] [[5 x i16] [i16 22073, i16 1, i16 20658, i16 -13292, i16 7], [5 x i16] [i16 0, i16 -1459, i16 5708, i16 -1459, i16 0], [5 x i16] [i16 0, i16 22073, i16 2965, i16 1, i16 -1459]], [3 x [5 x i16]] [[5 x i16] [i16 22073, i16 5, i16 -30784, i16 2965, i16 5708], [5 x i16] [i16 2965, i16 -30784, i16 5, i16 22073, i16 -1459], [5 x i16] [i16 1, i16 2965, i16 22073, i16 0, i16 0]], [3 x [5 x i16]] [[5 x i16] [i16 -1459, i16 5708, i16 -1459, i16 0, i16 7], [5 x i16] [i16 -13292, i16 20658, i16 1, i16 22073, i16 1], [5 x i16] [i16 5708, i16 7, i16 -1, i16 2965, i16 1]], [3 x [5 x i16]] [[5 x i16] [i16 31974, i16 -10870, i16 1, i16 1, i16 5], [5 x i16] [i16 1, i16 9699, i16 -1459, i16 -1459, i16 9699], [5 x i16] [i16 1, i16 9699, i16 22073, i16 -13292, i16 3]], [3 x [5 x i16]] [[5 x i16] [i16 -30784, i16 -10870, i16 5, i16 5708, i16 138], [5 x i16] [i16 1, i16 7, i16 -30784, i16 31974, i16 -26288], [5 x i16] [i16 -30784, i16 20658, i16 2965, i16 1, i16 22073]], [3 x [5 x i16]] [[5 x i16] [i16 1, i16 5708, i16 5708, i16 1, i16 22073], [5 x i16] [i16 1, i16 2965, i16 20658, i16 -30784, i16 -26288], [5 x i16] [i16 31974, i16 -30784, i16 7, i16 1, i16 138]]], align 2 +@_ZL5g_985 = internal global i8* @_ZL5g_304, align 4 +@_ZZL6func_1vE6l_1320 = private unnamed_addr constant <{ <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> }> <{ <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -38, [3 x i8] undef }, { i8, [3 x i8] } { i8 -5, [3 x i8] undef }, { i8, [3 x i8] } { i8 -71, [3 x i8] undef }, { i8, [3 x i8] } { i8 19, [3 x i8] undef }, { i8, [3 x i8] } { i8 126, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -5, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef }, { i8, [3 x i8] } { i8 -5, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 43, [3 x i8] undef }, { i8, [3 x i8] } { i8 -125, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 19, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -21, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 8, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 0, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 -21, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef } }>, <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 3, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -4, [3 x i8] undef }, { i8, [3 x i8] } { i8 -87, [3 x i8] undef }, { i8, [3 x i8] } { i8 19, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -125, [3 x i8] undef }, { i8, [3 x i8] } { i8 43, [3 x i8] undef } }> }>, align 4 +@_ZZL6func_1vE6l_1423 = private unnamed_addr constant %struct.S0 { i16 -14979, i8 -56, i32 1 }, align 4 +@_ZZL6func_1vE6l_1460 = private unnamed_addr constant [5 x [10 x i32]] [[10 x i32] [i32 -1, i32 -1, i32 -2111769585, i32 -10, i32 3, i32 -1, i32 -7, i32 -1, i32 -1, i32 -7], [10 x i32] [i32 -88107511, i32 -1, i32 -10, i32 -10, i32 -1, i32 -88107511, i32 -392857583, i32 -1, i32 1, i32 9], [10 x i32] [i32 9, i32 -1, i32 -1, i32 1, i32 -2111769585, i32 1, i32 -88107511, i32 1, i32 -2111769585, i32 1], [10 x i32] [i32 9, i32 1, i32 9, i32 -2, i32 -7, i32 -88107511, i32 -88107511, i32 -10, i32 1, i32 -2], [10 x i32] [i32 -1, i32 -88107511, i32 -10, i32 1, i32 -2, i32 -2, i32 1, i32 -10, i32 -88107511, i32 -1]], align 4 +@_ZL5g_197 = internal global [2 x [10 x i32*]] [[10 x i32*] [i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93], [10 x i32*] [i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93]], align 4 +@_ZZL6func_1vE6l_1443 = private unnamed_addr constant [7 x [5 x i32]] [[5 x i32] [i32 520842546, i32 -856207067, i32 2, i32 -3, i32 -1686173722], [5 x i32] [i32 1184089122, i32 -1017155828, i32 -3, i32 -691016572, i32 -3], [5 x i32] [i32 -3, i32 -3, i32 0, i32 2, i32 8], [5 x i32] [i32 -3, i32 -10, i32 8, i32 9, i32 7], [5 x i32] [i32 1184089122, i32 -1176025092, i32 -1686173722, i32 -8, i32 -1], [5 x i32] [i32 520842546, i32 -10, i32 -10, i32 520842546, i32 1752169706], [5 x i32] [i32 -856207067, i32 -3, i32 -10, i32 8, i32 9]], align 4 +@_ZZL6func_1vE6l_1461 = private unnamed_addr constant [10 x [1 x i32]] [[1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1], [1 x i32] [i32 1], [1 x i32] [i32 -1]], align 4 +@_ZZL6func_1vE6l_1470 = private unnamed_addr constant %struct.S0 { i16 -30104, i8 -1, i32 6 }, align 4 +@_ZL6g_1353 = internal constant %struct.S0*** @_ZL6g_1354, align 4 +@_ZL6g_1354 = internal global %struct.S0** @_ZL6g_1355, align 4 +@_ZL6g_1355 = internal global %struct.S0* null, align 4 +@_ZL6g_1393 = internal global i32** @_ZL6g_1394, align 4 +@_ZL6g_1394 = internal global i32* @_ZL5g_546, align 4 +@_ZL5g_931 = internal global i32* @_ZL4g_53, align 4 +@_ZL6g_1162 = internal unnamed_addr global { i8, [3 x i8] } { i8 0, [3 x i8] undef }, align 4 +@_ZZL7func_20iitE4l_60 = private unnamed_addr constant %struct.S0 { i16 26262, i8 73, i32 1210384164 }, align 4 +@_ZZL7func_20iitE5l_757 = private unnamed_addr constant [1 x [9 x [4 x i16]]] [[9 x [4 x i16]] [[4 x i16] [i16 -1, i16 0, i16 0, i16 -1], [4 x i16] [i16 0, i16 -1, i16 0, i16 8], [4 x i16] [i16 0, i16 0, i16 -1, i16 0], [4 x i16] [i16 0, i16 8, i16 8, i16 0], [4 x i16] [i16 8, i16 0, i16 8, i16 8], [4 x i16] [i16 0, i16 0, i16 -1, i16 0], [4 x i16] [i16 0, i16 8, i16 8, i16 0], [4 x i16] [i16 8, i16 0, i16 8, i16 8], [4 x i16] [i16 0, i16 0, i16 -1, i16 0]]], align 2 +@_ZZL7func_20iitE5l_876 = private unnamed_addr constant [10 x i16] [i16 5, i16 0, i16 0, i16 5, i16 -9, i16 5, i16 0, i16 0, i16 5, i16 -9], align 2 +@_ZZL7func_20iitE5l_403 = private unnamed_addr constant [1 x [4 x i32*]] [[4 x i32*] [i32* @_ZL5g_135, i32* @_ZL5g_135, i32* @_ZL5g_135, i32* @_ZL5g_135]], align 4 +@_ZZL7func_20iitE5l_422 = private unnamed_addr constant %struct.S0 { i16 8, i8 95, i32 -1317782521 }, align 4 +@_ZZL7func_20iitE5l_516 = private unnamed_addr constant <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef }, { i8, [3 x i8] } { i8 118, [3 x i8] undef } }>, align 4 +@_ZZL7func_20iitE5l_519 = private unnamed_addr constant %struct.S0 { i16 -1, i8 9, i32 -1103229061 }, align 4 +@_ZZL7func_20iitE5l_548 = private unnamed_addr constant [8 x [8 x i32]] [[8 x i32] [i32 6, i32 -1608903715, i32 -2, i32 -1608903715, i32 6, i32 -2, i32 2, i32 2], [8 x i32] [i32 3, i32 -1608903715, i32 -1, i32 -1, i32 -1608903715, i32 3, i32 7, i32 -1608903715], [8 x i32] [i32 2, i32 7, i32 -1, i32 2, i32 -1, i32 7, i32 2, i32 3], [8 x i32] [i32 -1608903715, i32 6, i32 -2, i32 2, i32 2, i32 -2, i32 6, i32 -1608903715], [8 x i32] [i32 3, i32 2, i32 7, i32 -1, i32 2, i32 -1, i32 7, i32 2], [8 x i32] [i32 -1608903715, i32 7, i32 3, i32 -1608903715, i32 -1, i32 -1, i32 -1608903715, i32 3], [8 x i32] [i32 2, i32 2, i32 -2, i32 6, i32 -1608903715, i32 -2, i32 -1608903715, i32 6], [8 x i32] [i32 3, i32 6, i32 3, i32 -1, i32 6, i32 7, i32 7, i32 6]], align 4 +@_ZZL7func_20iitE5l_495 = private unnamed_addr constant %struct.S0 { i16 -5, i8 -1, i32 -768235975 }, align 4 +@_ZZL7func_20iitE5l_467 = private unnamed_addr constant [6 x i32] [i32 1631231813, i32 1631231813, i32 1631231813, i32 1631231813, i32 1631231813, i32 1631231813], align 4 +@_ZZL7func_20iitE5l_513 = private unnamed_addr constant [2 x [3 x [9 x i16*]]] [[3 x [9 x i16*]] [[9 x i16*] [i16* @_ZL4g_79, i16* @_ZL4g_79, i16* @_ZL5g_103, i16* @_ZL4g_77, i16* @_ZL5g_361, i16* @_ZL5g_172, i16* @_ZL4g_77, i16* @_ZL5g_172, i16* @_ZL5g_361], [9 x i16*] [i16* @_ZL5g_361, i16* @_ZL5g_172, i16* @_ZL5g_172, i16* @_ZL5g_361, i16* @_ZL4g_79, i16* @_ZL5g_103, i16* null, i16* @_ZL4g_77, i16* null], [9 x i16*] [i16* @_ZL4g_77, i16* null, i16* @_ZL5g_103, i16* @_ZL5g_103, i16* null, i16* @_ZL4g_77, i16* @_ZL5g_308, i16* @_ZL4g_79, i16* null]], [3 x [9 x i16*]] [[9 x i16*] [i16* @_ZL5g_308, i16* @_ZL5g_103, i16* @_ZL4g_77, i16* @_ZL4g_79, i16* @_ZL4g_79, i16* @_ZL4g_77, i16* @_ZL5g_103, i16* @_ZL5g_308, i16* @_ZL5g_172], [9 x i16*] [i16* null, i16* @_ZL5g_103, i16* @_ZL4g_82, i16* @_ZL5g_361, i16* null, i16* null, i16* @_ZL5g_361, i16* @_ZL4g_82, i16* @_ZL4g_79], [9 x i16*] [i16* @_ZL5g_172, i16* @_ZL5g_308, i16* @_ZL4g_77, i16* @_ZL5g_361, i16* null, i16* @_ZL5g_308, i16* @_ZL5g_308, i16* null, i16* @_ZL5g_361]]], align 4 +@_ZZL7func_20iitE5l_589 = private unnamed_addr constant <{ { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] }, { i8, [3 x i8] } }> <{ { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -19, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef }, { i8, [3 x i8] } { i8 -19, [3 x i8] undef }, { i8, [3 x i8] } { i8 -1, [3 x i8] undef } }>, align 4 +@_ZZL7func_20iitE5l_598 = private unnamed_addr constant [2 x [10 x %struct.S0]] [[10 x %struct.S0] [%struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }, %struct.S0 { i16 23086, i8 -45, i32 -648996750 }], [10 x %struct.S0] [%struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -25976, i8 0, i32 1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -25976, i8 0, i32 1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }, %struct.S0 { i16 -25976, i8 0, i32 1 }, %struct.S0 { i16 -6, i8 -105, i32 -1 }]], align 4 +@_ZZL7func_492S0E5l_178 = private unnamed_addr constant [3 x [5 x [9 x i16*]]] [[5 x [9 x i16*]] [[9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162], [9 x i16*] [i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* null, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0)], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0)], [9 x i16*] [i16* null, i16* @_ZL5g_162, i16* null, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0)]], [5 x [9 x i16*]] [[9 x i16*] [i16* null, i16* @_ZL5g_162, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168], [9 x i16*] [i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* @_ZL5g_162, i16* @_ZL5g_162, i16* @_ZL5g_168], [9 x i16*] [i16* null, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* null], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* null, i16* null, i16* @_ZL5g_162, i16* null, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168], [9 x i16*] [i16* @_ZL5g_162, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* null]], [5 x [9 x i16*]] [[9 x i16*] [i16* null, i16* @_ZL5g_168, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_162, i16* null, i16* @_ZL5g_162, i16* @_ZL5g_162, i16* @_ZL5g_168], [9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168], [9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168], [9 x i16*] [i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* null, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), i16* @_ZL5g_168], [9 x i16*] [i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* @_ZL5g_162, i16* @_ZL5g_168, i16* @_ZL5g_168, i16* null]]], align 4 +@_ZZL7func_492S0E5l_198 = private unnamed_addr constant [4 x [1 x i32**]] [[1 x i32**] [i32** bitcast (i8* getelementptr (i8* bitcast ([2 x [10 x i32*]]* @_ZL5g_197 to i8*), i64 76) to i32**)], [1 x i32**] zeroinitializer, [1 x i32**] [i32** bitcast (i8* getelementptr (i8* bitcast ([2 x [10 x i32*]]* @_ZL5g_197 to i8*), i64 76) to i32**)], [1 x i32**] zeroinitializer], align 4 +@_ZZL7func_492S0E5l_119 = private unnamed_addr constant { i8, [3 x i8] } { i8 -3, [3 x i8] undef }, align 4 +@_ZZL7func_492S0E5l_125 = private unnamed_addr constant [8 x [4 x [6 x i32]]] [[4 x [6 x i32]] [[6 x i32] [i32 1, i32 -9, i32 2, i32 585837050, i32 1, i32 9], [6 x i32] [i32 -9, i32 0, i32 -5, i32 9, i32 1, i32 585837050], [6 x i32] [i32 735221361, i32 -9, i32 -626661945, i32 0, i32 -875020938, i32 -9], [6 x i32] [i32 -875020938, i32 -1969890654, i32 -5, i32 -1, i32 -1, i32 -5]], [4 x [6 x i32]] [[6 x i32] [i32 -875020938, i32 -875020938, i32 2, i32 0, i32 0, i32 1], [6 x i32] [i32 735221361, i32 -626661945, i32 -1969890654, i32 9, i32 -1, i32 2], [6 x i32] [i32 -9, i32 735221361, i32 -1969890654, i32 585837050, i32 -875020938, i32 1], [6 x i32] [i32 1, i32 585837050, i32 2, i32 -9, i32 1, i32 -5]], [4 x [6 x i32]] [[6 x i32] [i32 -9, i32 1, i32 -5, i32 -5, i32 1, i32 -9], [6 x i32] [i32 735221361, i32 585837050, i32 -626661945, i32 1, i32 -875020938, i32 585837050], [6 x i32] [i32 -875020938, i32 735221361, i32 -5, i32 2, i32 -1, i32 9], [6 x i32] [i32 -875020938, i32 -626661945, i32 2, i32 1, i32 0, i32 0]], [4 x [6 x i32]] [[6 x i32] [i32 735221361, i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938], [6 x i32] [i32 735221361, i32 0, i32 0, i32 735221361, i32 0, i32 -5], [6 x i32] [i32 9, i32 735221361, i32 -626661945, i32 -1969890654, i32 9, i32 -1], [6 x i32] [i32 735221361, i32 -5, i32 2, i32 -1, i32 9, i32 -1969890654]], [4 x [6 x i32]] [[6 x i32] [i32 1, i32 735221361, i32 459562963, i32 -5, i32 0, i32 735221361], [6 x i32] [i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938, i32 2], [6 x i32] [i32 0, i32 0, i32 -626661945, i32 -5, i32 -9, i32 9], [6 x i32] [i32 1, i32 459562963, i32 0, i32 -1, i32 -875020938, i32 -626661945]], [4 x [6 x i32]] [[6 x i32] [i32 735221361, i32 1, i32 0, i32 -1969890654, i32 0, i32 9], [6 x i32] [i32 9, i32 -1969890654, i32 -626661945, i32 735221361, i32 9, i32 2], [6 x i32] [i32 735221361, i32 9, i32 2, i32 2, i32 9, i32 735221361], [6 x i32] [i32 1, i32 -1969890654, i32 459562963, i32 9, i32 0, i32 -1969890654]], [4 x [6 x i32]] [[6 x i32] [i32 0, i32 1, i32 2, i32 -626661945, i32 -875020938, i32 -1], [6 x i32] [i32 0, i32 459562963, i32 -626661945, i32 9, i32 -9, i32 -5], [6 x i32] [i32 1, i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938], [6 x i32] [i32 735221361, i32 0, i32 0, i32 735221361, i32 0, i32 -5]], [4 x [6 x i32]] [[6 x i32] [i32 9, i32 735221361, i32 -626661945, i32 -1969890654, i32 9, i32 -1], [6 x i32] [i32 735221361, i32 -5, i32 2, i32 -1, i32 9, i32 -1969890654], [6 x i32] [i32 1, i32 735221361, i32 459562963, i32 -5, i32 0, i32 735221361], [6 x i32] [i32 0, i32 0, i32 2, i32 -875020938, i32 -875020938, i32 2]]], align 4 +@_ZZL7func_492S0E5l_296 = private unnamed_addr constant [6 x [2 x [4 x i32]]] [[2 x [4 x i32]] [[4 x i32] [i32 -2, i32 5, i32 161729879, i32 884294967], [4 x i32] [i32 -1, i32 0, i32 -3, i32 884294967]], [2 x [4 x i32]] [[4 x i32] [i32 -1769297005, i32 5, i32 1, i32 0], [4 x i32] [i32 1136616794, i32 -1, i32 -1591181149, i32 -1]], [2 x [4 x i32]] [[4 x i32] [i32 5, i32 62548300, i32 -3, i32 -6], [4 x i32] [i32 59636063, i32 -2, i32 62548300, i32 59636063]], [2 x [4 x i32]] [[4 x i32] [i32 -2, i32 -1, i32 1, i32 1136616794], [4 x i32] [i32 -2, i32 -1769297005, i32 62548300, i32 884294967]], [2 x [4 x i32]] [[4 x i32] [i32 59636063, i32 1136616794, i32 -3, i32 -3], [4 x i32] [i32 5, i32 5, i32 -1591181149, i32 1136616794]], [2 x [4 x i32]] [[4 x i32] [i32 1136616794, i32 59636063, i32 1, i32 -1], [4 x i32] [i32 -1769297005, i32 -2, i32 -3, i32 1]]], align 4 +@_ZZL7func_40iaE5l_359 = private unnamed_addr constant [2 x [6 x [10 x i32*]]] [[6 x [10 x i32*]] [[10 x i32*] [i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_135, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* null, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL3g_2], [10 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL5g_257, i32* @_ZL5g_132, i32* null, i32* @_ZL3g_2, i32* @_ZL5g_132], [10 x i32*] [i32* @_ZL5g_135, i32* null, i32* null, i32* @_ZL5g_135, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_135, i32* @_ZL3g_2, i32* null, i32* @_ZL5g_135, i32* @_ZL4g_93, i32* @_ZL5g_257, i32* null, i32* null, i32* @_ZL5g_132, i32* @_ZL3g_2], [10 x i32*] [i32* null, i32* null, i32* null, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_257, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2]], [6 x [10 x i32*]] [[10 x i32*] [i32* @_ZL4g_93, i32* null, i32* null, i32* @_ZL5g_135, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL5g_135, i32* null, i32* null, i32* @_ZL4g_93], [10 x i32*] [i32* @_ZL5g_257, i32* @_ZL5g_257, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL5g_257, i32* null, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_135, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_257, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL4g_93, i32* @_ZL4g_93, i32* @_ZL4g_93], [10 x i32*] [i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL5g_132, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL5g_257, i32* @_ZL5g_257, i32* @_ZL3g_2], [10 x i32*] [i32* null, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL5g_257, i32* null, i32* @_ZL5g_135, i32* @_ZL3g_2, i32* @_ZL5g_257], [10 x i32*] [i32* @_ZL5g_132, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL4g_93, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* @_ZL3g_2]]], align 4 +@_ZZL7func_32tiPaE5l_369 = private unnamed_addr constant %struct.S0 { i16 -4, i8 1, i32 -4 }, align 4 +@_ZZL7func_32tiPaE5l_382 = private unnamed_addr constant [6 x [1 x i16*]] [[1 x i16*] [i16* @_ZL5g_308], [1 x i16*] zeroinitializer, [1 x i16*] zeroinitializer, [1 x i16*] [i16* @_ZL5g_308], [1 x i16*] zeroinitializer, [1 x i16*] zeroinitializer], align 4 +@_ZZL7func_32tiPaE5l_387 = private unnamed_addr constant %struct.S0 { i16 16776, i8 55, i32 1410444512 }, align 4 +@_ZZL7func_32tiPaE5l_392 = private unnamed_addr constant [10 x [8 x i8]] [[8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00", [8 x i8] c"\06\83r\00r\83\06\00", [8 x i8] c"\06\C7r\00r\C7\06\00"], align 1 +@_ZZL7func_26jPKaPaS1_iE5l_398 = private unnamed_addr constant [9 x [8 x i8]] [[8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o", [8 x i8] c"co\00oc\9E\00\9E", [8 x i8] c"c\9E\00\9Eco\00o"], align 1 +@_ZZL6func_8ijPasS_E6l_1016 = private unnamed_addr constant [5 x [3 x i32*]] [[3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93], [3 x i32*] [i32* @_ZL5g_257, i32* @_ZL4g_93, i32* @_ZL4g_93]], align 4 +@_ZZL6func_5PahE6l_1024 = private unnamed_addr constant [6 x i32*] [i32* null, i32* @_ZL3g_2, i32* @_ZL3g_2, i32* null, i32* @_ZL3g_2, i32* @_ZL3g_2], align 4 +@_gm_ = internal global %struct.malloc_state zeroinitializer, align 4 +@mparams = internal global %struct.malloc_params zeroinitializer, align 4 +@stderr = external constant %struct._IO_FILE* +@.str49 = private unnamed_addr constant [26 x i8] c"max system bytes = %10lu\0A\00", align 1 +@.str150 = private unnamed_addr constant [26 x i8] c"system bytes = %10lu\0A\00", align 1 +@.str251 = private unnamed_addr constant [26 x i8] c"in use bytes = %10lu\0A\00", align 1 +@_ZSt7nothrow = constant %"struct.std::nothrow_t" undef, align 1 +@_ZL13__new_handler = internal global void ()* null, align 4 +@_ZTVSt9bad_alloc = unnamed_addr constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD0Ev to i8*), i8* bitcast (i8* (%"class.std::bad_alloc"*)* @_ZNKSt9bad_alloc4whatEv to i8*)] +@.str352 = private unnamed_addr constant [15 x i8] c"std::bad_alloc\00", align 1 +@_ZTVSt20bad_array_new_length = unnamed_addr constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt20bad_array_new_length to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*), i8* bitcast (void (%"class.std::bad_array_new_length"*)* @_ZNSt20bad_array_new_lengthD0Ev to i8*), i8* bitcast (i8* (%"class.std::bad_array_new_length"*)* @_ZNKSt20bad_array_new_length4whatEv to i8*)] +@.str1453 = private unnamed_addr constant [17 x i8] c"bad_array_length\00", align 1 +@_ZTVSt16bad_array_length = unnamed_addr constant [5 x i8*] [i8* null, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt16bad_array_length to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*), i8* bitcast (void (%"class.std::bad_array_length"*)* @_ZNSt16bad_array_lengthD0Ev to i8*), i8* bitcast (i8* (%"class.std::bad_array_length"*)* @_ZNKSt16bad_array_length4whatEv to i8*)] +@.str2554 = private unnamed_addr constant [21 x i8] c"bad_array_new_length\00", align 1 +@_ZTVN10__cxxabiv120__si_class_type_infoE = external global i8* +@_ZTSSt9bad_alloc = constant [13 x i8] c"St9bad_alloc\00" +@_ZTISt9exception = external constant i8* +@_ZTISt9bad_alloc = unnamed_addr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([13 x i8]* @_ZTSSt9bad_alloc, i32 0, i32 0), i8* bitcast (i8** @_ZTISt9exception to i8*) } +@_ZTSSt20bad_array_new_length = constant [25 x i8] c"St20bad_array_new_length\00" +@_ZTISt20bad_array_new_length = unnamed_addr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([25 x i8]* @_ZTSSt20bad_array_new_length, i32 0, i32 0), i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*) } +@_ZTSSt16bad_array_length = constant [21 x i8] c"St16bad_array_length\00" +@_ZTISt16bad_array_length = unnamed_addr constant { i8*, i8*, i8* } { i8* bitcast (i8** getelementptr inbounds (i8** @_ZTVN10__cxxabiv120__si_class_type_infoE, i32 2) to i8*), i8* getelementptr inbounds ([21 x i8]* @_ZTSSt16bad_array_length, i32 0, i32 0), i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*) } +@.str655 = private unnamed_addr constant [9 x i8] c"infinity\00", align 1 +@.str1756 = private unnamed_addr constant [4 x i8] c"nan\00", align 1 +@decfloat.th = internal unnamed_addr constant [2 x i32] [i32 9007199, i32 254740991], align 4 +@decfloat.p10s = internal unnamed_addr constant [8 x i32] [i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000], align 4 + +@_ZNSt9bad_allocC1Ev = alias void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocC2Ev +@_ZNSt9bad_allocD1Ev = alias void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev +@_ZNSt20bad_array_new_lengthC1Ev = alias void (%"class.std::bad_array_new_length"*)* @_ZNSt20bad_array_new_lengthC2Ev +@_ZNSt20bad_array_new_lengthD1Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_new_length"*)*) +@_ZNSt20bad_array_new_lengthD2Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_new_length"*)*) +@_ZNSt16bad_array_lengthC1Ev = alias void (%"class.std::bad_array_length"*)* @_ZNSt16bad_array_lengthC2Ev +@_ZNSt16bad_array_lengthD1Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_length"*)*) +@_ZNSt16bad_array_lengthD2Ev = alias bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to void (%"class.std::bad_array_length"*)*) +@__strtof_l = alias weak float (i8*, i8**, %struct.__locale_struct*)* @strtof_l +@__strtod_l = alias weak double (i8*, i8**, %struct.__locale_struct.0*)* @strtod_l +@__strtold_l = alias weak double (i8*, i8**, %struct.__locale_struct.1*)* @strtold_l + +; Function Attrs: nounwind +define i32 @main(i32 %argc, i8** nocapture %argv) #0 { +entry: + %cmp = icmp eq i32 %argc, 2 + br i1 %cmp, label %land.lhs.true, label %if.end + +land.lhs.true: ; preds = %entry + %arrayidx = getelementptr inbounds i8** %argv, i32 1 + %0 = load i8** %arrayidx, align 4, !tbaa !0 + %call = tail call i32 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8]* @.str, i32 0, i32 0)) + %cmp1 = icmp eq i32 %call, 0 + %. = zext i1 %cmp1 to i32 + br label %if.end + +if.end: ; preds = %land.lhs.true, %entry + %print_hash_value.0 = phi i32 [ 0, %entry ], [ %., %land.lhs.true ] + tail call fastcc void @_ZL12crc32_gentabv() + tail call fastcc void @_ZL6func_1v() + %1 = load i32* @_ZL3g_2, align 4, !tbaa !3 + %conv = sext i32 %1 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv, i8* getelementptr inbounds ([4 x i8]* @.str1, i32 0, i32 0), i32 %print_hash_value.0) + %tobool = icmp eq i32 %print_hash_value.0, 0 + br label %for.cond4.preheader + +for.cond4.preheader: ; preds = %for.inc20, %if.end + %i.075 = phi i32 [ 0, %if.end ], [ %inc21, %for.inc20 ] + br label %for.body9 + +for.body9: ; preds = %for.inc.5, %for.cond4.preheader + %j.074 = phi i32 [ 0, %for.cond4.preheader ], [ %inc18, %for.inc.5 ] + %arrayidx12 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 0 + %2 = load i8* %arrayidx12, align 1, !tbaa !1 + %conv13 = sext i8 %2 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + br i1 %tobool, label %for.inc.1.critedge, label %if.then14 + +if.then14: ; preds = %for.body9 + %call15 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 0) + %arrayidx12.1 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 1 + %3 = load i8* %arrayidx12.1, align 1, !tbaa !1 + %conv13.1 = sext i8 %3 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.1, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + %call15.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 1) + br label %for.inc.1 + +for.inc20: ; preds = %for.inc.5 + %inc21 = add nsw i32 %i.075, 1 + %exitcond76 = icmp eq i32 %inc21, 4 + br i1 %exitcond76, label %for.body45, label %for.cond4.preheader + +for.body45: ; preds = %for.inc20 + %4 = load i32* @_ZL4g_53, align 4, !tbaa !3 + %conv23 = sext i32 %4 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv23, i8* getelementptr inbounds ([5 x i8]* @.str4, i32 0, i32 0), i32 %print_hash_value.0) + %5 = load i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1 + %conv24 = zext i8 %5 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv24, i8* getelementptr inbounds ([8 x i8]* @.str5, i32 0, i32 0), i32 %print_hash_value.0) + %6 = load i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1 + %conv25 = sext i8 %6 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv25, i8* getelementptr inbounds ([8 x i8]* @.str6, i32 0, i32 0), i32 %print_hash_value.0) + %7 = load i16* @_ZL4g_77, align 2, !tbaa !4 + %conv26 = zext i16 %7 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv26, i8* getelementptr inbounds ([5 x i8]* @.str7, i32 0, i32 0), i32 %print_hash_value.0) + %8 = load i16* @_ZL4g_79, align 2, !tbaa !4 + %conv27 = zext i16 %8 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv27, i8* getelementptr inbounds ([5 x i8]* @.str8, i32 0, i32 0), i32 %print_hash_value.0) + %9 = load i16* @_ZL4g_82, align 2, !tbaa !4 + %conv28 = zext i16 %9 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv28, i8* getelementptr inbounds ([5 x i8]* @.str9, i32 0, i32 0), i32 %print_hash_value.0) + %10 = load i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), align 8, !tbaa !4 + %conv29 = sext i16 %10 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv29, i8* getelementptr inbounds ([8 x i8]* @.str10, i32 0, i32 0), i32 %print_hash_value.0) + %11 = load i8* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 1), align 2, !tbaa !1 + %conv30 = sext i8 %11 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv30, i8* getelementptr inbounds ([8 x i8]* @.str11, i32 0, i32 0), i32 %print_hash_value.0) + %12 = load i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3 + %conv31 = zext i32 %12 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv31, i8* getelementptr inbounds ([8 x i8]* @.str12, i32 0, i32 0), i32 %print_hash_value.0) + %13 = load i32* @_ZL4g_93, align 4, !tbaa !3 + %conv32 = sext i32 %13 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv32, i8* getelementptr inbounds ([5 x i8]* @.str13, i32 0, i32 0), i32 %print_hash_value.0) + %14 = load i16* @_ZL5g_103, align 2, !tbaa !4 + %conv33 = zext i16 %14 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv33, i8* getelementptr inbounds ([6 x i8]* @.str14, i32 0, i32 0), i32 %print_hash_value.0) + %15 = load i8* @_ZL5g_126, align 1, !tbaa !1 + %conv34 = sext i8 %15 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv34, i8* getelementptr inbounds ([6 x i8]* @.str15, i32 0, i32 0), i32 %print_hash_value.0) + %16 = load i32* @_ZL5g_132, align 4, !tbaa !3 + %conv35 = sext i32 %16 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv35, i8* getelementptr inbounds ([6 x i8]* @.str16, i32 0, i32 0), i32 %print_hash_value.0) + %17 = load i8* @_ZL5g_133, align 1, !tbaa !1 + %conv36 = sext i8 %17 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv36, i8* getelementptr inbounds ([6 x i8]* @.str17, i32 0, i32 0), i32 %print_hash_value.0) + %18 = load i32* @_ZL5g_135, align 4, !tbaa !3 + %conv37 = sext i32 %18 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv37, i8* getelementptr inbounds ([6 x i8]* @.str18, i32 0, i32 0), i32 %print_hash_value.0) + %19 = load i8* @_ZL5g_136, align 1, !tbaa !1 + %conv38 = sext i8 %19 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv38, i8* getelementptr inbounds ([6 x i8]* @.str19, i32 0, i32 0), i32 %print_hash_value.0) + %20 = load i32* @_ZL5g_138, align 4, !tbaa !3 + %conv39 = zext i32 %20 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv39, i8* getelementptr inbounds ([6 x i8]* @.str20, i32 0, i32 0), i32 %print_hash_value.0) + %21 = load i16* @_ZL5g_162, align 2, !tbaa !4 + %conv40 = sext i16 %21 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv40, i8* getelementptr inbounds ([6 x i8]* @.str21, i32 0, i32 0), i32 %print_hash_value.0) + %22 = load i16* @_ZL5g_168, align 2, !tbaa !4 + %conv41 = sext i16 %22 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv41, i8* getelementptr inbounds ([6 x i8]* @.str22, i32 0, i32 0), i32 %print_hash_value.0) + %23 = load i8* @_ZL5g_170, align 1, !tbaa !1 + %conv42 = zext i8 %23 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv42, i8* getelementptr inbounds ([6 x i8]* @.str23, i32 0, i32 0), i32 %print_hash_value.0) + %tobool48 = icmp eq i32 %print_hash_value.0, 0 + %24 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 0), align 1, !tbaa !1 + %conv47 = sext i8 %24 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + br i1 %tobool48, label %for.inc52.6.thread, label %if.then49.7 + +for.inc52.6.thread: ; preds = %for.body45 + %25 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 1), align 1, !tbaa !1 + %conv47.177 = sext i8 %25 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.177, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %26 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 2), align 1, !tbaa !1 + %conv47.278 = sext i8 %26 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.278, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %27 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 3), align 1, !tbaa !1 + %conv47.379 = sext i8 %27 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.379, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %28 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 4), align 1, !tbaa !1 + %conv47.480 = sext i8 %28 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.480, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %29 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 5), align 1, !tbaa !1 + %conv47.581 = sext i8 %29 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.581, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %30 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1 + %conv47.682 = sext i8 %30 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.682, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %31 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 7), align 1, !tbaa !1 + %conv47.783 = sext i8 %31 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.783, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + br label %for.body70 + +for.body70: ; preds = %if.then49.7, %for.inc52.6.thread + %32 = load i16* @_ZL5g_172, align 2, !tbaa !4 + %conv55 = zext i16 %32 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv55, i8* getelementptr inbounds ([6 x i8]* @.str26, i32 0, i32 0), i32 %print_hash_value.0) + %33 = load i32* @_ZL5g_257, align 4, !tbaa !3 + %conv56 = sext i32 %33 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv56, i8* getelementptr inbounds ([6 x i8]* @.str27, i32 0, i32 0), i32 %print_hash_value.0) + %34 = load i8* @_ZL5g_304, align 1, !tbaa !1 + %conv57 = sext i8 %34 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv57, i8* getelementptr inbounds ([6 x i8]* @.str28, i32 0, i32 0), i32 %print_hash_value.0) + %35 = load i16* @_ZL5g_308, align 2, !tbaa !4 + %conv58 = zext i16 %35 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv58, i8* getelementptr inbounds ([6 x i8]* @.str29, i32 0, i32 0), i32 %print_hash_value.0) + %36 = load i16* @_ZL5g_361, align 2, !tbaa !4 + %conv59 = zext i16 %36 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv59, i8* getelementptr inbounds ([6 x i8]* @.str30, i32 0, i32 0), i32 %print_hash_value.0) + %37 = load i32* @_ZL5g_400, align 4, !tbaa !3 + %conv60 = sext i32 %37 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv60, i8* getelementptr inbounds ([6 x i8]* @.str31, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 -1, i8* getelementptr inbounds ([6 x i8]* @.str32, i32 0, i32 0), i32 %print_hash_value.0) + %38 = load i16* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 0), align 8, !tbaa !4 + %conv62 = sext i16 %38 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv62, i8* getelementptr inbounds ([9 x i8]* @.str33, i32 0, i32 0), i32 %print_hash_value.0) + %39 = load i8* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 1), align 2, !tbaa !1 + %conv63 = sext i8 %39 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv63, i8* getelementptr inbounds ([9 x i8]* @.str34, i32 0, i32 0), i32 %print_hash_value.0) + %40 = load i32* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 2), align 4, !tbaa !3 + %conv64 = zext i32 %40 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv64, i8* getelementptr inbounds ([9 x i8]* @.str35, i32 0, i32 0), i32 %print_hash_value.0) + %41 = load i32* @_ZL5g_546, align 4, !tbaa !3 + %conv65 = sext i32 %41 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv65, i8* getelementptr inbounds ([6 x i8]* @.str36, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2891502546, i8* getelementptr inbounds ([6 x i8]* @.str37, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 255, i8* getelementptr inbounds ([6 x i8]* @.str38, i32 0, i32 0), i32 %print_hash_value.0) + %tobool73 = icmp eq i32 %print_hash_value.0, 0 + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + br i1 %tobool73, label %for.inc77.8.thread, label %if.then74.9 + +for.inc77.8.thread: ; preds = %for.body70 + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + br label %for.body88 + +for.body88: ; preds = %if.then74.9, %for.inc77.8.thread + %42 = load i8* @_ZL6g_1010, align 1, !tbaa !1 + %conv80 = sext i8 %42 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv80, i8* getelementptr inbounds ([7 x i8]* @.str40, i32 0, i32 0), i32 %print_hash_value.0) + %43 = load i8* @_ZL6g_1025, align 1, !tbaa !1 + %conv81 = zext i8 %43 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv81, i8* getelementptr inbounds ([7 x i8]* @.str41, i32 0, i32 0), i32 %print_hash_value.0) + %44 = load i8* @_ZL6g_1136, align 1, !tbaa !1 + %conv82 = zext i8 %44 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv82, i8* getelementptr inbounds ([7 x i8]* @.str42, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 1, i8* getelementptr inbounds ([7 x i8]* @.str43, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 7, i8* getelementptr inbounds ([7 x i8]* @.str44, i32 0, i32 0), i32 %print_hash_value.0) + %45 = load i32* @_ZL6g_1198, align 4, !tbaa !3 + %conv85 = sext i32 %45 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv85, i8* getelementptr inbounds ([7 x i8]* @.str45, i32 0, i32 0), i32 %print_hash_value.0) + %tobool91 = icmp eq i32 %print_hash_value.0, 0 + tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + br i1 %tobool91, label %for.inc95.6.thread, label %if.then92.7 + +for.inc95.6.thread: ; preds = %for.body88 + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + br label %for.inc95.7 + +if.then92.7: ; preds = %for.body88 + %call93 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + %call93.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 1) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + %call93.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 2) + tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + %call93.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 3) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + %call93.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 4) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + %call93.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 5) + tail call fastcc void @_ZL15transparent_crcyPci(i64 4294967293, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + %call93.6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 6) + tail call fastcc void @_ZL15transparent_crcyPci(i64 2870230573, i8* getelementptr inbounds ([10 x i8]* @.str46, i32 0, i32 0), i32 %print_hash_value.0) + %call93.7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 7) + br label %for.inc95.7 + +for.inc95.7: ; preds = %if.then92.7, %for.inc95.6.thread + %46 = load i32* @_ZL13crc32_context, align 4, !tbaa !3 + %xor = xor i32 %46, -1 + tail call fastcc void @_ZL17platform_main_endji(i32 %xor) + ret i32 0 + +if.then74.9: ; preds = %for.body70 + %call75 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 0) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 1) + tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 2) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 3) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 4) + tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 5) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 6) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 7) + tail call fastcc void @_ZL15transparent_crcyPci(i64 1950933783, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.8 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 8) + tail call fastcc void @_ZL15transparent_crcyPci(i64 3761930302, i8* getelementptr inbounds ([9 x i8]* @.str39, i32 0, i32 0), i32 %print_hash_value.0) + %call75.9 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 9) + br label %for.body88 + +if.then49.7: ; preds = %for.body45 + %call50 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 0) + %47 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 1), align 1, !tbaa !1 + %conv47.1 = sext i8 %47 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.1, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %call50.1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 1) + %48 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 2), align 1, !tbaa !1 + %conv47.2 = sext i8 %48 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.2, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %call50.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 2) + %49 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 3), align 1, !tbaa !1 + %conv47.3 = sext i8 %49 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.3, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %call50.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 3) + %50 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 4), align 1, !tbaa !1 + %conv47.4 = sext i8 %50 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.4, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %call50.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 4) + %51 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 5), align 1, !tbaa !1 + %conv47.5 = sext i8 %51 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.5, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %call50.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 5) + %52 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1 + %conv47.6 = sext i8 %52 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.6, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %call50.6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 6) + %53 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 7), align 1, !tbaa !1 + %conv47.7 = sext i8 %53 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv47.7, i8* getelementptr inbounds ([9 x i8]* @.str24, i32 0, i32 0), i32 %print_hash_value.0) + %call50.7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([14 x i8]* @.str25, i32 0, i32 0), i32 7) + br label %for.body70 + +for.inc.1.critedge: ; preds = %for.body9 + %arrayidx12.1.c = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 1 + %54 = load i8* %arrayidx12.1.c, align 1, !tbaa !1 + %conv13.1.c = sext i8 %54 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.1.c, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + br label %for.inc.1 + +for.inc.1: ; preds = %for.inc.1.critedge, %if.then14 + %arrayidx12.2 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 2 + %55 = load i8* %arrayidx12.2, align 1, !tbaa !1 + %conv13.2 = sext i8 %55 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.2, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + br i1 %tobool, label %for.inc.3.critedge, label %if.then14.2 + +if.then14.2: ; preds = %for.inc.1 + %call15.2 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 2) + %arrayidx12.3 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 3 + %56 = load i8* %arrayidx12.3, align 1, !tbaa !1 + %conv13.3 = sext i8 %56 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.3, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + %call15.3 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 3) + br label %for.inc.3 + +for.inc.3.critedge: ; preds = %for.inc.1 + %arrayidx12.3.c = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 3 + %57 = load i8* %arrayidx12.3.c, align 1, !tbaa !1 + %conv13.3.c = sext i8 %57 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.3.c, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + br label %for.inc.3 + +for.inc.3: ; preds = %for.inc.3.critedge, %if.then14.2 + %arrayidx12.4 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 4 + %58 = load i8* %arrayidx12.4, align 1, !tbaa !1 + %conv13.4 = sext i8 %58 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.4, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + br i1 %tobool, label %for.inc.5.critedge, label %if.then14.4 + +if.then14.4: ; preds = %for.inc.3 + %call15.4 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 4) + %arrayidx12.5 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 5 + %59 = load i8* %arrayidx12.5, align 1, !tbaa !1 + %conv13.5 = sext i8 %59 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.5, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + %call15.5 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([22 x i8]* @.str3, i32 0, i32 0), i32 %i.075, i32 %j.074, i32 5) + br label %for.inc.5 + +for.inc.5.critedge: ; preds = %for.inc.3 + %arrayidx12.5.c = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %i.075, i32 %j.074, i32 5 + %60 = load i8* %arrayidx12.5.c, align 1, !tbaa !1 + %conv13.5.c = sext i8 %60 to i64 + tail call fastcc void @_ZL15transparent_crcyPci(i64 %conv13.5.c, i8* getelementptr inbounds ([14 x i8]* @.str2, i32 0, i32 0), i32 %print_hash_value.0) + br label %for.inc.5 + +for.inc.5: ; preds = %for.inc.5.critedge, %if.then14.4 + %inc18 = add nsw i32 %j.074, 1 + %exitcond = icmp eq i32 %inc18, 6 + br i1 %exitcond, label %for.inc20, label %for.body9 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL12crc32_gentabv() #0 { +entry: + br label %for.body3 + +for.body3: ; preds = %for.body3, %entry + %i.08 = phi i32 [ 0, %entry ], [ %inc, %for.body3 ] + %and = and i32 %i.08, 1 + %tobool = icmp eq i32 %and, 0 + %shr = lshr i32 %i.08, 1 + %xor = xor i32 %shr, -306674912 + %crc.1 = select i1 %tobool, i32 %shr, i32 %xor + %and.1 = and i32 %crc.1, 1 + %tobool.1 = icmp eq i32 %and.1, 0 + %shr.1 = lshr i32 %crc.1, 1 + %xor.1 = xor i32 %shr.1, -306674912 + %crc.1.1 = select i1 %tobool.1, i32 %shr.1, i32 %xor.1 + %and.2 = and i32 %crc.1.1, 1 + %tobool.2 = icmp eq i32 %and.2, 0 + %shr.2 = lshr i32 %crc.1.1, 1 + %xor.2 = xor i32 %shr.2, -306674912 + %crc.1.2 = select i1 %tobool.2, i32 %shr.2, i32 %xor.2 + %and.3 = and i32 %crc.1.2, 1 + %tobool.3 = icmp eq i32 %and.3, 0 + %shr.3 = lshr i32 %crc.1.2, 1 + %xor.3 = xor i32 %shr.3, -306674912 + %crc.1.3 = select i1 %tobool.3, i32 %shr.3, i32 %xor.3 + %and.4 = and i32 %crc.1.3, 1 + %tobool.4 = icmp eq i32 %and.4, 0 + %shr.4 = lshr i32 %crc.1.3, 1 + %xor.4 = xor i32 %shr.4, -306674912 + %crc.1.4 = select i1 %tobool.4, i32 %shr.4, i32 %xor.4 + %and.5 = and i32 %crc.1.4, 1 + %tobool.5 = icmp eq i32 %and.5, 0 + %shr.5 = lshr i32 %crc.1.4, 1 + %xor.5 = xor i32 %shr.5, -306674912 + %crc.1.5 = select i1 %tobool.5, i32 %shr.5, i32 %xor.5 + %and.6 = and i32 %crc.1.5, 1 + %tobool.6 = icmp eq i32 %and.6, 0 + %shr.6 = lshr i32 %crc.1.5, 1 + %xor.6 = xor i32 %shr.6, -306674912 + %crc.1.6 = select i1 %tobool.6, i32 %shr.6, i32 %xor.6 + %and.7 = and i32 %crc.1.6, 1 + %tobool.7 = icmp eq i32 %and.7, 0 + %shr.7 = lshr i32 %crc.1.6, 1 + %xor.7 = xor i32 %shr.7, -306674912 + %crc.1.7 = select i1 %tobool.7, i32 %shr.7, i32 %xor.7 + %arrayidx = getelementptr inbounds [256 x i32]* @_ZL9crc32_tab, i32 0, i32 %i.08 + store i32 %crc.1.7, i32* %arrayidx, align 4, !tbaa !3 + %inc = add nsw i32 %i.08, 1 + %exitcond = icmp eq i32 %inc, 256 + br i1 %exitcond, label %for.end6, label %for.body3 + +for.end6: ; preds = %for.body3 + ret void +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL6func_1v() #0 { +for.end97: + %agg.tmp = alloca i64, align 8 + %tmpcast = bitcast i64* %agg.tmp to %struct.S0* + store i32 0, i32* @_ZL3g_2, align 4, !tbaa !3 + %call = call fastcc zeroext i8 @_ZL7func_20iit(i32 0, i16 zeroext -16644) + %0 = load i32* @_ZL3g_2, align 4, !tbaa !3 + %conv98 = trunc i32 %0 to i8 + %call105 = call fastcc zeroext i16 @_ZL26safe_mul_func_uint16_t_u_utt(i16 zeroext 7, i16 zeroext 1) + %conv106 = zext i16 %call105 to i32 + %call118 = call fastcc zeroext i8 @_ZL25safe_mul_func_uint8_t_u_uhh(i8 zeroext 1, i8 zeroext 23) + %conv119 = zext i8 %call118 to i32 + %cmp120 = icmp uge i32 %conv106, %conv119 + %conv121 = zext i1 %cmp120 to i32 + %call122 = call fastcc zeroext i8 @_ZL28safe_rshift_func_uint8_t_u_shi(i8 zeroext %conv98, i32 %conv121) + %cmp124 = icmp ult i8 %call, %call122 + %conv125 = zext i1 %cmp124 to i8 + store i64 -21471878022, i64* %agg.tmp, align 8 + call fastcc void @_ZL7func_14aPaS_2S0j(i8 signext %conv125, %struct.S0* byval align 4 %tmpcast) + call fastcc void @_ZL6func_5Pah() + %1 = load i32* @_ZL6g_1198, align 4, !tbaa !3 + %tobool = icmp eq i32 %1, 0 + br i1 %tobool, label %if.else1462, label %for.end311 + +for.end311: ; preds = %for.end97 + store i8 25, i8* @_ZL6g_1136, align 1, !tbaa !1 + %bf.load = load i24* bitcast ({ i8, [3 x i8] }* @_ZL6g_1162 to i24*), align 4 + %bf.clear = and i24 %bf.load, -262144 + %bf.set = or i24 %bf.clear, zext (i1 icmp slt (i32 zext (i1 icmp sge (i32 zext (i1 icmp eq (i8* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 1), i8* @_ZL6g_1010) to i32), i32 1) to i32), i32 710400751) to i24) + store i24 %bf.set, i24* bitcast ({ i8, [3 x i8] }* @_ZL6g_1162 to i24*), align 4 + store i16 1, i16* @_ZL5g_162, align 2, !tbaa !4 + br label %cleanup1590 + +if.else1462: ; preds = %for.end97 + %2 = load i8*** @_ZL5g_984, align 4, !tbaa !0 + %3 = load i8** %2, align 4, !tbaa !0 + store i8 0, i8* %3, align 1, !tbaa !1 + %call1515 = call fastcc signext i8 @_ZL24safe_div_func_int8_t_s_saa(i8 signext 0, i8 signext 1) + %call1517 = call fastcc zeroext i8 @_ZL28safe_lshift_func_uint8_t_u_shi(i8 zeroext %call1515, i32 58) + %conv1518 = zext i8 %call1517 to i16 + %call1519 = call fastcc zeroext i16 @_ZL29safe_lshift_func_uint16_t_u_utj(i16 zeroext %conv1518, i32 14) + %cmp1522 = icmp eq i16 %call1519, 4 + %conv1523 = zext i1 %cmp1522 to i32 + %xor15271 = or i32 %conv1523, 4 + store i32 %xor15271, i32* @_ZL5g_135, align 4, !tbaa !3 + %4 = load i8* @_ZL5g_136, align 1, !tbaa !1 + %5 = load i8* @_ZL5g_133, align 1, !tbaa !1 + %and15422 = and i8 %5, %4 + %cmp1543 = icmp ne i8 %and15422, 1 + %conv1544 = zext i1 %cmp1543 to i8 + store i8 %conv1544, i8* @_ZL6g_1010, align 1, !tbaa !1 + %6 = load i32* @_ZL5g_135, align 4, !tbaa !3 + %call1565 = call fastcc i32 @_ZL25safe_sub_func_int32_t_s_sii(i32 1, i32 %6) + %conv1566 = trunc i32 %call1565 to i8 + %7 = load i8** @_ZL5g_985, align 4, !tbaa !0 + store i8 %conv1566, i8* %7, align 1, !tbaa !1 + br label %cleanup1590 + +cleanup1590: ; preds = %if.else1462, %for.end311 + ret void +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL15transparent_crcyPci(i64 %val, i8* %vname, i32 %flag) #0 { +entry: + tail call fastcc void @_ZL12crc32_8bytesy(i64 %val) + %tobool = icmp eq i32 %flag, 0 + br i1 %tobool, label %if.end, label %if.then + +if.then: ; preds = %entry + %0 = load i32* @_ZL13crc32_context, align 4, !tbaa !3 + %xor = xor i32 %0, -1 + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([36 x i8]* @.str48, i32 0, i32 0), i8* %vname, i32 %xor) + br label %if.end + +if.end: ; preds = %if.then, %entry + ret void +} + +; Function Attrs: nounwind +declare i32 @printf(i8* nocapture, ...) #0 + +; Function Attrs: nounwind +define internal fastcc void @_ZL17platform_main_endji(i32 %crc) #0 { +entry: + %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str47, i32 0, i32 0), i32 %crc) + ret void +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL12crc32_8bytesy(i64 %val) #0 { +entry: + %conv = trunc i64 %val to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv) + %shr1 = lshr i64 %val, 8 + %conv3 = trunc i64 %shr1 to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv3) + %shr4 = lshr i64 %val, 16 + %conv6 = trunc i64 %shr4 to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv6) + %shr7 = lshr i64 %val, 24 + %conv9 = trunc i64 %shr7 to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv9) + %shr10 = lshr i64 %val, 32 + %conv12 = trunc i64 %shr10 to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv12) + %shr13 = lshr i64 %val, 40 + %conv15 = trunc i64 %shr13 to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv15) + %shr16 = lshr i64 %val, 48 + %conv18 = trunc i64 %shr16 to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv18) + %shr19 = lshr i64 %val, 56 + %conv21 = trunc i64 %shr19 to i8 + tail call fastcc void @_ZL10crc32_byteh(i8 zeroext %conv21) + ret void +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL10crc32_byteh(i8 zeroext %b) #0 { +entry: + %0 = load i32* @_ZL13crc32_context, align 4, !tbaa !3 + %shr = lshr i32 %0, 8 + %conv = zext i8 %b to i32 + %.masked = and i32 %0, 255 + %and1 = xor i32 %.masked, %conv + %arrayidx = getelementptr inbounds [256 x i32]* @_ZL9crc32_tab, i32 0, i32 %and1 + %1 = load i32* %arrayidx, align 4, !tbaa !3 + %xor2 = xor i32 %shr, %1 + store i32 %xor2, i32* @_ZL13crc32_context, align 4, !tbaa !3 + ret void +} + +; Function Attrs: nounwind +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) #1 + +; Function Attrs: nounwind +define internal fastcc void @_ZL6func_5Pah() #0 { +for.end14: + %0 = load i8* @_ZL6g_1025, align 1, !tbaa !1 + %inc15 = add i8 %0, 1 + store i8 %inc15, i8* @_ZL6g_1025, align 1, !tbaa !1 + %1 = load i32* @_ZL5g_400, align 4, !tbaa !3 + %tobool = icmp eq i32 %1, 0 + br i1 %tobool, label %if.else, label %if.then + +if.then: ; preds = %for.end14 + %2 = load i64* bitcast (%struct.S0* @_ZL4g_83 to i64*), align 8 + store i64 %2, i64* bitcast (%struct.S0* @_ZL5g_471 to i64*), align 8 + br label %if.end + +if.else: ; preds = %for.end14 + %and = and i32 %1, 23 + store i32 %and, i32* @_ZL5g_400, align 4, !tbaa !3 + br label %if.end + +if.end: ; preds = %if.else, %if.then + ret void +} + +; Function Attrs: nounwind readonly +define internal fastcc i8* @_ZL6func_8ijPasS_(i16 signext %p_12) #2 { +entry: + %0 = load i8*** @_ZL5g_984, align 4, !tbaa !0 + %1 = load i8** %0, align 4, !tbaa !0 + ret i8* %1 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL7func_14aPaS_2S0j(i8 signext %p_15, %struct.S0* byval nocapture align 4 %p_18) #0 { +entry: + store i16 0, i16* @_ZL5g_172, align 2, !tbaa !4 + %0 = load i32* @_ZL4g_53, align 4, !tbaa !3 + %f0 = getelementptr inbounds %struct.S0* %p_18, i32 0, i32 0 + %1 = load i16* %f0, align 4, !tbaa !4 + %conv1 = sext i16 %1 to i32 + %f2 = getelementptr inbounds %struct.S0* %p_18, i32 0, i32 2 + %2 = load i32* %f2, align 4, !tbaa !3 + %3 = load i32* @_ZL4g_93, align 4, !tbaa !3 + %cmp2 = icmp ne i32 %2, %3 + %conv3 = zext i1 %cmp2 to i32 + %cmp4 = icmp sgt i32 %conv1, %conv3 + %conv5 = zext i1 %cmp4 to i32 + %cmp6 = icmp sge i32 %0, %conv5 + %conv7 = zext i1 %cmp6 to i16 + %call = tail call fastcc zeroext i16 @_ZL29safe_rshift_func_uint16_t_u_sti(i16 zeroext %conv7, i32 10) + %conv8 = zext i16 %call to i32 + store i32 %conv8, i32* @_ZL5g_132, align 4, !tbaa !3 + ret void +} + +; Function Attrs: nounwind +define internal fastcc zeroext i8 @_ZL7func_20iit(i32 %p_22, i16 zeroext %p_23) #0 { +for.end7: + %agg.tmp = alloca %union.U1, align 4 + %agg.tmp9 = alloca %struct.S0, align 4 + %0 = load i32* @_ZL3g_2, align 4, !tbaa !3 + %conv = trunc i32 %0 to i16 + %conv11 = trunc i32 %p_22 to i8 + store i8 %conv11, i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 1, i32 3, i32 1), align 1, !tbaa !1 + %dec = add i16 %p_23, -1 + %l_60.sroa.0.0.idx = getelementptr inbounds %struct.S0* %agg.tmp9, i32 0, i32 0 + store i16 26262, i16* %l_60.sroa.0.0.idx, align 4 + %l_60.sroa.1.2.idx = getelementptr inbounds %struct.S0* %agg.tmp9, i32 0, i32 1 + store i8 73, i8* %l_60.sroa.1.2.idx, align 2 + %l_60.sroa.2.3.raw_cast = bitcast %struct.S0* %agg.tmp9 to i8* + %l_60.sroa.2.3.raw_idx = getelementptr inbounds i8* %l_60.sroa.2.3.raw_cast, i32 3 + call void @llvm.memcpy.p0i8.p0i8.i32(i8* %l_60.sroa.2.3.raw_idx, i8* getelementptr ([5 x i8]* bitcast (i8* getelementptr (i8* bitcast (%struct.S0* @_ZZL7func_20iitE4l_60 to i8*), i32 3) to [5 x i8]*), i32 0, i32 0), i32 5, i32 1, i1 false) + call fastcc void @_ZL7func_492S0(%union.U1* sret %agg.tmp, %struct.S0* byval align 4 %agg.tmp9) + %.lobit = lshr i32 %0, 31 + %1 = trunc i32 %.lobit to i8 + %call33 = call fastcc signext i16 @_ZL7func_40ia(i8 signext %1) + %cmp35 = icmp eq i16 %call33, 3880 + %conv36 = zext i1 %cmp35 to i32 + %2 = load i16* @_ZL5g_361, align 2, !tbaa !4 + %conv37 = zext i16 %2 to i32 + %xor = xor i32 %conv37, %conv36 + %conv38 = trunc i32 %xor to i16 + store i16 %conv38, i16* @_ZL5g_361, align 2, !tbaa !4 + %call43 = call fastcc signext i8 @_ZL24safe_sub_func_int8_t_s_saa(i8 signext -1) + %conv44 = sext i8 %call43 to i32 + %call45 = call fastcc signext i16 @_ZL7func_32tiPa(i16 zeroext %conv, i32 %conv44) + %3 = load i32* @_ZL5g_400, align 4, !tbaa !3 + %and53 = and i32 %3, -98 + store i32 %and53, i32* @_ZL5g_400, align 4, !tbaa !3 + %4 = load i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 0, i32 4, i32 5), align 1, !tbaa !1 + %call104 = call fastcc zeroext i8 @_ZL28safe_rshift_func_uint8_t_u_shi(i8 zeroext %4, i32 1) + %call105 = call fastcc zeroext i8 @_ZL28safe_lshift_func_uint8_t_u_shi(i8 zeroext %call104, i32 1) + %cmp124 = icmp ne i8 %call105, 0 + %conv125 = zext i1 %cmp124 to i32 + %5 = load i16* @_ZL4g_77, align 2, !tbaa !4 + %conv571 = trunc i16 %5 to i8 + %6 = load i32* @_ZL4g_53, align 4, !tbaa !3 + %7 = load i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1 + %conv432 = sext i8 %7 to i32 + %xor434 = xor i32 %conv432, %6 + br label %lbl_496 + +lbl_496.loopexit: ; preds = %for.body302 + store i16 %call312.lobit, i16* @_ZL5g_162, align 2, !tbaa !4 + store i32 %conv357, i32* @_ZL5g_400, align 4, !tbaa !3 + %phitmp38 = add i32 %l_404.0, -1 + br label %lbl_496 + +lbl_496: ; preds = %lbl_496.loopexit, %for.end7 + %l_404.0 = phi i32 [ -1124763087, %for.end7 ], [ %phitmp38, %lbl_496.loopexit ] + %p_23.addr.0 = phi i16 [ %dec, %for.end7 ], [ %conv332, %lbl_496.loopexit ] + %p_22.addr.0 = phi i32 [ %p_22, %for.end7 ], [ %p_22.addr.235, %lbl_496.loopexit ] + store i32 0, i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3 + %tobool156 = icmp ne i32 %p_22.addr.0, 0 + %phitmp = zext i1 %tobool156 to i8 + %conv428 = trunc i32 %p_22.addr.0 to i8 + %8 = load i16* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 0), align 8, !tbaa !4 + %conv438 = sext i16 %8 to i32 + %_ZL5g_400.promoted = load i32* @_ZL5g_400, align 4, !tbaa !3 + %_ZL5g_138.promoted = load i32* @_ZL5g_138, align 4, !tbaa !3 + br label %for.body59 + +for.body59: ; preds = %lor.end440.3, %lbl_496 + %and12827 = phi i32 [ %_ZL5g_138.promoted, %lbl_496 ], [ %and128, %lor.end440.3 ] + %9 = phi i32 [ %_ZL5g_400.promoted, %lbl_496 ], [ 0, %lor.end440.3 ] + %cmp107 = icmp ult i32 %9, 255 + br i1 %cmp107, label %lor.end, label %lor.rhs + +lor.rhs: ; preds = %for.body59 + %conv117 = trunc i32 %9 to i8 + %call118 = call fastcc zeroext i8 @_ZL25safe_add_func_uint8_t_u_uhh(i8 zeroext -15, i8 zeroext %conv117) + %conv119 = zext i8 %call118 to i16 + store i16 %conv119, i16* @_ZL5g_361, align 2, !tbaa !4 + br label %lor.end + +lor.end: ; preds = %lor.rhs, %for.body59 + %10 = load i32* @_ZL4g_93, align 4, !tbaa !3 + %or127 = or i32 %9, %10 + %and128 = and i32 %and12827, %or127 + br i1 %tobool156, label %if.then, label %for.body191 + +if.then: ; preds = %lor.end + %call158 = call fastcc signext i8 @_ZL24safe_add_func_int8_t_s_saa(i8 signext -8, i8 signext -1) + %conv159 = sext i8 %call158 to i16 + store i8 -1, i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 1, i32 3, i32 1), align 1, !tbaa !1 + store i16 8, i16* @_ZL5g_361, align 2, !tbaa !4 + %call183 = call fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %conv159, i16 signext 1) + %conv184 = sext i16 %call183 to i32 + %11 = load i32* @_ZL4g_93, align 4, !tbaa !3 + %xor185 = xor i32 %11, %conv184 + store i32 %xor185, i32* @_ZL4g_93, align 4, !tbaa !3 + %tobool198 = icmp eq i32 %or127, 0 + br i1 %tobool198, label %for.body412, label %land.lhs.true + +for.body191: ; preds = %lor.end + store i32 %or127, i32* @_ZL5g_400, align 4, !tbaa !3 + store i32 %and128, i32* @_ZL5g_138, align 4, !tbaa !3 + %conv192 = trunc i32 %or127 to i8 + br label %cleanup583 + +land.lhs.true: ; preds = %if.then + %12 = load i16* @_ZL5g_361, align 2, !tbaa !4 + %conv201 = zext i16 %12 to i32 + %xor202 = xor i32 %conv201, 57244 + %conv203 = trunc i32 %xor202 to i16 + store i16 %conv203, i16* @_ZL5g_361, align 2, !tbaa !4 + %call204 = call fastcc zeroext i16 @_ZL26safe_mul_func_uint16_t_u_utt(i16 zeroext 0, i16 zeroext %conv203) + %13 = load i16* @_ZL5g_168, align 2, !tbaa !4 + %conv207 = sext i16 %13 to i32 + %cmp209 = icmp ne i16 %call204, 0 + %conv210 = zext i1 %cmp209 to i32 + %cmp212 = icmp slt i32 %conv210, %conv207 + %conv213 = zext i1 %cmp212 to i16 + store i16 %conv213, i16* @_ZL5g_168, align 2, !tbaa !4 + br i1 %cmp212, label %if.then214, label %for.body412 + +if.then214: ; preds = %land.lhs.true + store i32 %or127, i32* @_ZL5g_400, align 4, !tbaa !3 + store i32 %and128, i32* @_ZL5g_138, align 4, !tbaa !3 + %tobool295 = icmp eq i32 %or127, 0 + br i1 %tobool295, label %for.cond300.preheader, label %cleanup583 + +for.cond300.preheader: ; preds = %if.then214 + %14 = load i64* bitcast (%struct.S0* @_ZL4g_83 to i64*), align 8 + %15 = load i16* @_ZL5g_168, align 2, !tbaa !4 + %call312 = call fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext %15, i32 -1) + %call312.lobit = lshr i16 %call312, 15 + %call331 = call fastcc signext i8 @_ZL24safe_div_func_int8_t_s_saa(i8 signext 1, i8 signext -7) + %conv332 = sext i8 %call331 to i16 + %call354 = call fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext 1, i32 1631231813) + %call356 = call fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %call354, i16 signext 0) + %conv357 = sext i16 %call356 to i32 + %tobool358 = icmp eq i32 %l_404.0, 0 + br label %for.body302 + +for.cond300: ; preds = %for.body302 + %sub = add nsw i32 %p_22.addr.235, -1 + %cmp301 = icmp sgt i32 %p_22.addr.235, 0 + br i1 %cmp301, label %for.body302, label %cleanup583.loopexit32 + +for.body302: ; preds = %for.cond300, %for.cond300.preheader + %p_22.addr.235 = phi i32 [ 3, %for.cond300.preheader ], [ %sub, %for.cond300 ] + store i64 %14, i64* bitcast (%struct.S0* @_ZL5g_471 to i64*), align 8 + store i32 1, i32* getelementptr inbounds (%struct.S0* @_ZL5g_471, i32 0, i32 2), align 4, !tbaa !3 + br i1 %tobool358, label %for.cond300, label %lbl_496.loopexit + +for.body412: ; preds = %land.lhs.true, %if.then + %16 = load i16* @_ZL5g_168, align 2, !tbaa !4 + %call568 = call fastcc i32 @_ZL26safe_mod_func_uint32_t_u_ujj(i32 0, i32 -13150355) + %cmp569 = icmp ne i32 %call568, 0 + %conv570 = zext i1 %cmp569 to i8 + %call572 = call fastcc signext i8 @_ZL24safe_mul_func_int8_t_s_saa(i8 signext %conv570, i8 signext %conv571) + %conv433 = sext i16 %16 to i32 + %xor435 = xor i32 %xor434, %conv433 + %cmp436 = icmp slt i32 %xor435, %p_22.addr.0 + %conv437 = zext i1 %cmp436 to i32 + %cmp439 = icmp sgt i32 %conv437, %conv438 + %_ZL5g_361.promoted = load i16* @_ZL5g_361, align 2, !tbaa !4 + br i1 %tobool156, label %lor.end440.2.thread, label %lor.rhs421.3 + +lor.end440.2.thread: ; preds = %for.body412 + %conv44250 = zext i16 %_ZL5g_361.promoted to i32 + %xor443.257 = xor i32 %conv44250, 1 + br label %lor.end440.3 + +cleanup583.loopexit: ; preds = %lor.end440.3 + store i32 0, i32* @_ZL5g_400, align 4, !tbaa !3 + store i32 %and128, i32* @_ZL5g_138, align 4, !tbaa !3 + br label %cleanup583 + +cleanup583.loopexit32: ; preds = %for.cond300 + store i16 %call312.lobit, i16* @_ZL5g_162, align 2, !tbaa !4 + store i32 %conv357, i32* @_ZL5g_400, align 4, !tbaa !3 + br label %cleanup583 + +cleanup583: ; preds = %cleanup583.loopexit32, %cleanup583.loopexit, %if.then214, %for.body191 + %cleanup.dest.slot.2 = phi i1 [ false, %for.body191 ], [ true, %cleanup583.loopexit ], [ false, %cleanup583.loopexit32 ], [ true, %if.then214 ] + %retval.6 = phi i8 [ %conv192, %for.body191 ], [ undef, %cleanup583.loopexit ], [ -100, %cleanup583.loopexit32 ], [ undef, %if.then214 ] + %17 = load i8* @_ZL5g_170, align 1, !tbaa !1 + %.retval.6 = select i1 %cleanup.dest.slot.2, i8 %17, i8 %retval.6 + ret i8 %.retval.6 + +lor.rhs421.3: ; preds = %for.body412 + %conv441 = zext i1 %cmp439 to i32 + %conv442 = zext i16 %_ZL5g_361.promoted to i32 + %xor443 = xor i32 %conv442, %conv441 + %conv441.1 = zext i1 %cmp439 to i32 + %xor533.1 = xor i32 %xor443, %conv441.1 + %conv441.2 = zext i1 %cmp439 to i32 + %xor443.2 = xor i32 %xor533.1, %conv441.2 + %call422.3 = call fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %16, i16 signext %p_23.addr.0) + %tobool423.3 = icmp eq i16 %call422.3, 0 + %phitmp..3 = select i1 %tobool423.3, i8 %phitmp, i8 1 + %call429.3 = call fastcc zeroext i8 @_ZL25safe_sub_func_uint8_t_u_uhh(i8 zeroext %phitmp..3, i8 zeroext %conv428) + %conv430.3 = zext i8 %call429.3 to i32 + %xor431.3 = xor i32 %conv430.3, %conv125 + store i32 %xor431.3, i32* @_ZL5g_546, align 4, !tbaa !3 + br label %lor.end440.3 + +lor.end440.3: ; preds = %lor.rhs421.3, %lor.end440.2.thread + %xor443.258 = phi i32 [ %xor443.2, %lor.rhs421.3 ], [ %xor443.257, %lor.end440.2.thread ] + %18 = phi i1 [ %cmp439, %lor.rhs421.3 ], [ true, %lor.end440.2.thread ] + %conv441.3 = zext i1 %18 to i32 + %xor533.3 = xor i32 %xor443.258, %conv441.3 + %conv534.3 = trunc i32 %xor533.3 to i16 + %conv573 = sext i8 %call572 to i32 + store i32 %conv573, i32* @_ZL4g_93, align 4, !tbaa !3 + store i16 %conv534.3, i16* @_ZL5g_361, align 2, !tbaa !4 + store i8 0, i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1 + store i16 %16, i16* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 0), align 8, !tbaa !4 + %19 = load i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3 + %add581 = add i32 %19, 1 + store i32 %add581, i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3 + %cmp58 = icmp eq i32 %add581, 0 + br i1 %cmp58, label %for.body59, label %cleanup583.loopexit +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i8 @_ZL28safe_rshift_func_uint8_t_u_shi(i8 zeroext %left, i32 %right) #3 { +entry: + %0 = icmp ugt i32 %right, 31 + %conv = zext i8 %left to i32 + %shr = select i1 %0, i32 0, i32 %right + %conv.shr = lshr i32 %conv, %shr + %conv3 = trunc i32 %conv.shr to i8 + ret i8 %conv3 +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i16 @_ZL26safe_mul_func_uint16_t_u_utt(i16 zeroext %ui1, i16 zeroext %ui2) #3 { +entry: + %conv = zext i16 %ui1 to i32 + %conv1 = zext i16 %ui2 to i32 + %mul = mul i32 %conv1, %conv + %conv2 = trunc i32 %mul to i16 + ret i16 %conv2 +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i8 @_ZL25safe_mul_func_uint8_t_u_uhh(i8 zeroext %ui1, i8 zeroext %ui2) #3 { +entry: + %conv = zext i8 %ui1 to i32 + %conv1 = zext i8 %ui2 to i32 + %mul = mul i32 %conv1, %conv + %conv2 = trunc i32 %mul to i8 + ret i8 %conv2 +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i8 @_ZL25safe_sub_func_uint8_t_u_uhh(i8 zeroext %ui1, i8 zeroext %ui2) #3 { +entry: + %conv = zext i8 %ui1 to i32 + %conv1 = zext i8 %ui2 to i32 + %sub = sub nsw i32 %conv, %conv1 + %conv2 = trunc i32 %sub to i8 + ret i8 %conv2 +} + +; Function Attrs: nounwind readnone +define internal fastcc i32 @_ZL26safe_div_func_uint32_t_u_ujj(i32 %ui1, i32 %ui2) #3 { +entry: + %cmp = icmp eq i32 %ui2, 0 + br i1 %cmp, label %cond.end, label %cond.false + +cond.false: ; preds = %entry + %div = udiv i32 %ui1, %ui2 + br label %cond.end + +cond.end: ; preds = %cond.false, %entry + %cond = phi i32 [ %div, %cond.false ], [ %ui1, %entry ] + ret i32 %cond +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i16 @_ZL26safe_mod_func_uint16_t_u_utt(i16 zeroext %ui1, i16 zeroext %ui2) #3 { +entry: + %cmp = icmp eq i16 %ui2, 0 + %conv1 = zext i16 %ui1 to i32 + br i1 %cmp, label %cond.end, label %cond.false + +cond.false: ; preds = %entry + %0 = urem i16 %ui1, %ui2 + %rem = zext i16 %0 to i32 + br label %cond.end + +cond.end: ; preds = %cond.false, %entry + %cond = phi i32 [ %rem, %cond.false ], [ %conv1, %entry ] + %conv4 = trunc i32 %cond to i16 + ret i16 %conv4 +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i8 @_ZL28safe_lshift_func_uint8_t_u_shi(i8 zeroext %left, i32 %right) #3 { +entry: + %0 = icmp ugt i32 %right, 31 + br i1 %0, label %cond.true, label %lor.lhs.false2 + +lor.lhs.false2: ; preds = %entry + %conv = zext i8 %left to i32 + %shr = lshr i32 255, %right + %cmp3 = icmp sgt i32 %conv, %shr + br i1 %cmp3, label %cond.true, label %cond.false + +cond.true: ; preds = %lor.lhs.false2, %entry + %conv4 = zext i8 %left to i32 + br label %cond.end + +cond.false: ; preds = %lor.lhs.false2 + %shl = shl i32 %conv, %right + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i32 [ %conv4, %cond.true ], [ %shl, %cond.false ] + %conv6 = trunc i32 %cond to i8 + ret i8 %conv6 +} + +; Function Attrs: nounwind readnone +define internal fastcc i32 @_ZL25safe_sub_func_int32_t_s_sii(i32 %si1, i32 %si2) #3 { +entry: + %xor = xor i32 %si2, %si1 + %and = and i32 %xor, -2147483648 + %xor2 = xor i32 %and, %si1 + %sub = sub nsw i32 %xor2, %si2 + %xor3 = xor i32 %sub, %si2 + %and4 = and i32 %xor3, %xor + %cmp = icmp slt i32 %and4, 0 + %sub5 = select i1 %cmp, i32 0, i32 %si2 + %si1.sub5 = sub nsw i32 %si1, %sub5 + ret i32 %si1.sub5 +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i16 @_ZL25safe_mul_func_int16_t_s_sss(i16 signext %si1, i16 signext %si2) #3 { +entry: + %conv = sext i16 %si1 to i32 + %conv1 = sext i16 %si2 to i32 + %mul = mul nsw i32 %conv1, %conv + %conv2 = trunc i32 %mul to i16 + ret i16 %conv2 +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i16 @_ZL29safe_lshift_func_uint16_t_u_utj(i16 zeroext %left, i32 %right) #3 { +entry: + %cmp = icmp ugt i32 %right, 31 + br i1 %cmp, label %cond.true, label %lor.lhs.false + +lor.lhs.false: ; preds = %entry + %conv = zext i16 %left to i32 + %shr = lshr i32 65535, %right + %cmp1 = icmp sgt i32 %conv, %shr + br i1 %cmp1, label %cond.true, label %cond.false + +cond.true: ; preds = %lor.lhs.false, %entry + %conv2 = zext i16 %left to i32 + br label %cond.end + +cond.false: ; preds = %lor.lhs.false + %shl = shl i32 %conv, %right + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i32 [ %conv2, %cond.true ], [ %shl, %cond.false ] + %conv4 = trunc i32 %cond to i16 + ret i16 %conv4 +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext %left, i32 %right) #3 { +entry: + %conv = sext i16 %left to i32 + %cmp = icmp slt i16 %left, 0 + %cmp1 = icmp ugt i32 %right, 31 + %or.cond = or i1 %cmp, %cmp1 + %shr = lshr i32 32767, %right + %cmp4 = icmp sgt i32 %conv, %shr + %or.cond6 = or i1 %or.cond, %cmp4 + %shl = select i1 %or.cond6, i32 0, i32 %right + %cond = shl i32 %conv, %shl + %conv7 = trunc i32 %cond to i16 + ret i16 %conv7 +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i16 @_ZL25safe_sub_func_int16_t_s_sss(i16 signext %si2) #3 { +entry: + %conv11 = zext i16 %si2 to i32 + %sub = sub nsw i32 1, %conv11 + %conv2 = trunc i32 %sub to i16 + ret i16 %conv2 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL29safe_rshift_func_uint16_t_u_utj() #0 { +entry: + unreachable +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i16 @_ZL25safe_add_func_int16_t_s_sss(i16 signext %si1, i16 signext %si2) #3 { +entry: + %conv3 = zext i16 %si1 to i32 + %conv14 = zext i16 %si2 to i32 + %add = add nsw i32 %conv14, %conv3 + %conv2 = trunc i32 %add to i16 + ret i16 %conv2 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL26safe_sub_func_uint32_t_u_ujj() #0 { +entry: + unreachable +} + +; Function Attrs: nounwind readnone +define internal fastcc i32 @_ZL25safe_mod_func_int32_t_s_sii(i32 %si1, i32 %si2) #3 { +entry: + %cmp = icmp eq i32 %si2, 0 + br i1 %cmp, label %cond.end, label %lor.lhs.false + +lor.lhs.false: ; preds = %entry + %cmp1 = icmp eq i32 %si1, -2147483648 + %cmp2 = icmp eq i32 %si2, -1 + %or.cond = and i1 %cmp1, %cmp2 + br i1 %or.cond, label %cond.end, label %cond.false + +cond.false: ; preds = %lor.lhs.false + %rem = srem i32 %si1, %si2 + br label %cond.end + +cond.end: ; preds = %cond.false, %lor.lhs.false, %entry + %cond = phi i32 [ %rem, %cond.false ], [ %si1, %lor.lhs.false ], [ %si1, %entry ] + ret i32 %cond +} + +; Function Attrs: nounwind readnone +define internal fastcc i32 @_ZL25safe_add_func_int32_t_s_sii(i32 %si1) #3 { +entry: + %cmp3 = icmp sgt i32 %si1, 1806657196 + %add = add nsw i32 %si1, 340826451 + %si1.add = select i1 %cmp3, i32 %si1, i32 %add + ret i32 %si1.add +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i16 @_ZL29safe_rshift_func_uint16_t_u_sti(i16 zeroext %left, i32 %right) #3 { +entry: + %0 = icmp ugt i32 %right, 31 + %conv = zext i16 %left to i32 + %shr = select i1 %0, i32 0, i32 %right + %conv.shr = lshr i32 %conv, %shr + %conv3 = trunc i32 %conv.shr to i16 + ret i16 %conv3 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL31safe_unary_minus_func_int16_t_ss() #0 { +entry: + unreachable +} + +; Function Attrs: nounwind readnone +define internal fastcc i32 @_ZL26safe_mod_func_uint32_t_u_ujj(i32 %ui1, i32 %ui2) #3 { +entry: + %cmp = icmp eq i32 %ui2, 0 + br i1 %cmp, label %cond.end, label %cond.false + +cond.false: ; preds = %entry + %rem = urem i32 %ui1, %ui2 + br label %cond.end + +cond.end: ; preds = %cond.false, %entry + %cond = phi i32 [ %rem, %cond.false ], [ %ui1, %entry ] + ret i32 %cond +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i16 @_ZL26safe_add_func_uint16_t_u_utt(i16 zeroext %ui1, i16 zeroext %ui2) #3 { +entry: + %conv = zext i16 %ui1 to i32 + %conv1 = zext i16 %ui2 to i32 + %add = add nsw i32 %conv1, %conv + %conv2 = trunc i32 %add to i16 + ret i16 %conv2 +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i8 @_ZL25safe_add_func_uint8_t_u_uhh(i8 zeroext %ui1, i8 zeroext %ui2) #3 { +entry: + %conv = zext i8 %ui1 to i32 + %conv1 = zext i8 %ui2 to i32 + %add = add nsw i32 %conv1, %conv + %conv2 = trunc i32 %add to i8 + ret i8 %conv2 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL25safe_div_func_int32_t_s_sii() #0 { +entry: + unreachable +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i8 @_ZL27safe_lshift_func_int8_t_s_sai(i32 %right) #3 { +entry: + %0 = icmp ugt i32 %right, 31 + %shr = lshr i32 127, %right + %cmp6 = icmp slt i32 %shr, 1 + %or.cond = or i1 %0, %cmp6 + br i1 %or.cond, label %cond.end, label %cond.false + +cond.false: ; preds = %entry + %shl = shl i32 1, %right + %phitmp = trunc i32 %shl to i8 + br label %cond.end + +cond.end: ; preds = %cond.false, %entry + %cond = phi i8 [ %phitmp, %cond.false ], [ 1, %entry ] + ret i8 %cond +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i8 @_ZL24safe_sub_func_int8_t_s_saa(i8 signext %si1) #3 { +entry: + %conv1 = zext i8 %si1 to i32 + %sub = add nsw i32 %conv1, 183 + %conv2 = trunc i32 %sub to i8 + ret i8 %conv2 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL26safe_div_func_uint16_t_u_utt() #0 { +entry: + unreachable +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i16 @_ZL28safe_rshift_func_int16_t_s_usj(i16 signext %left, i32 %right) #3 { +entry: + %conv = sext i16 %left to i32 + %cmp = icmp slt i16 %left, 0 + %cmp1 = icmp ugt i32 %right, 31 + %or.cond = or i1 %cmp, %cmp1 + %shr = select i1 %or.cond, i32 0, i32 %right + %cond = ashr i32 %conv, %shr + %conv4 = trunc i32 %cond to i16 + ret i16 %conv4 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL28safe_lshift_func_uint8_t_u_uhj() #0 { +entry: + unreachable +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i8 @_ZL24safe_mod_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 { +entry: + %conv = sext i8 %si2 to i32 + %cmp = icmp eq i8 %si2, 0 + br i1 %cmp, label %cond.true, label %lor.lhs.false + +lor.lhs.false: ; preds = %entry + %cmp2 = icmp eq i8 %si1, -128 + %cmp4 = icmp eq i8 %si2, -1 + %or.cond = and i1 %cmp2, %cmp4 + br i1 %or.cond, label %cond.true, label %cond.false + +cond.true: ; preds = %lor.lhs.false, %entry + %conv5 = sext i8 %si1 to i32 + br label %cond.end + +cond.false: ; preds = %lor.lhs.false + %conv1 = sext i8 %si1 to i32 + %rem = srem i32 %conv1, %conv + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i32 [ %conv5, %cond.true ], [ %rem, %cond.false ] + %conv8 = trunc i32 %cond to i8 + ret i8 %conv8 +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i8 @_ZL24safe_div_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 { +entry: + %conv = sext i8 %si2 to i32 + %cmp = icmp eq i8 %si2, 0 + br i1 %cmp, label %cond.true, label %lor.lhs.false + +lor.lhs.false: ; preds = %entry + %cmp2 = icmp eq i8 %si1, -128 + %cmp4 = icmp eq i8 %si2, -1 + %or.cond = and i1 %cmp2, %cmp4 + br i1 %or.cond, label %cond.true, label %cond.false + +cond.true: ; preds = %lor.lhs.false, %entry + %conv5 = sext i8 %si1 to i32 + br label %cond.end + +cond.false: ; preds = %lor.lhs.false + %conv1 = sext i8 %si1 to i32 + %div = sdiv i32 %conv1, %conv + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i32 [ %conv5, %cond.true ], [ %div, %cond.false ] + %conv8 = trunc i32 %cond to i8 + ret i8 %conv8 +} + +; Function Attrs: nounwind readnone +define internal fastcc zeroext i16 @_ZL29safe_lshift_func_uint16_t_u_sti(i16 zeroext %left, i32 %right) #3 { +entry: + %0 = icmp ugt i32 %right, 31 + br i1 %0, label %cond.true, label %lor.lhs.false2 + +lor.lhs.false2: ; preds = %entry + %conv = zext i16 %left to i32 + %shr = lshr i32 65535, %right + %cmp3 = icmp sgt i32 %conv, %shr + br i1 %cmp3, label %cond.true, label %cond.false + +cond.true: ; preds = %lor.lhs.false2, %entry + %conv4 = zext i16 %left to i32 + br label %cond.end + +cond.false: ; preds = %lor.lhs.false2 + %shl = shl i32 %conv, %right + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i32 [ %conv4, %cond.true ], [ %shl, %cond.false ] + %conv6 = trunc i32 %cond to i16 + ret i16 %conv6 +} + +; Function Attrs: nounwind +define internal fastcc signext i16 @_ZL7func_32tiPa(i16 zeroext %p_33, i32 %p_34) #0 { +return: + store i32 1, i32* @_ZL5g_135, align 4, !tbaa !3 + %0 = load i8* @_ZL5g_126, align 1, !tbaa !1 + %call8 = tail call fastcc signext i8 @_ZL24safe_mod_func_int8_t_s_saa(i8 signext %0, i8 signext 0) + %conv9 = sext i8 %call8 to i32 + %1 = load i16* @_ZL5g_168, align 2, !tbaa !4 + %conv10 = sext i16 %1 to i32 + %cmp11 = icmp eq i32 %conv9, %conv10 + %conv12 = zext i1 %cmp11 to i32 + %2 = load i8* @_ZL5g_136, align 1, !tbaa !1 + %conv131 = zext i8 %2 to i32 + %or = or i32 %conv12, %conv131 + %conv14 = trunc i32 %or to i8 + store i8 %conv14, i8* @_ZL5g_136, align 1, !tbaa !1 + %3 = load i32* @_ZL5g_132, align 4, !tbaa !3 + %or27 = or i32 %3, 1 + %call28 = tail call fastcc i32 @_ZL26safe_div_func_uint32_t_u_ujj(i32 -10, i32 %or27) + %conv29 = trunc i32 %call28 to i16 + store i16 %conv29, i16* @_ZL4g_82, align 2, !tbaa !4 + %conv34 = zext i16 %p_33 to i32 + store i8 0, i8* @_ZL5g_133, align 1, !tbaa !1 + %4 = load i8* getelementptr inbounds ({ i8, [3 x i8] }* @_ZL4g_74, i32 0, i32 0), align 4, !tbaa !1 + %not.tobool68 = icmp ne i8 %4, 0 + %5 = zext i1 %not.tobool68 to i32 + %or82 = or i32 %5, %conv34 + %6 = load i8* @_ZL5g_126, align 1, !tbaa !1 + %conv832 = zext i8 %6 to i32 + %xor = xor i32 %or82, %conv832 + %conv84 = trunc i32 %xor to i8 + store i8 %conv84, i8* @_ZL5g_126, align 1, !tbaa !1 + %lnot = icmp ne i8 %conv84, 0 + %xor87 = zext i1 %lnot to i32 + store i32 %xor87, i32* @_ZL5g_132, align 4, !tbaa !3 + ret i16 -20646 +} + +; Function Attrs: nounwind +define internal fastcc signext i16 @_ZL7func_40ia(i8 signext %p_42) #0 { +entry: + %call = tail call fastcc signext i8 @_ZL24safe_mod_func_int8_t_s_saa(i8 signext 0, i8 signext 7) + %conv2 = sext i8 %call to i32 + %0 = load i32* @_ZL3g_2, align 4, !tbaa !3 + %conv3 = trunc i32 %0 to i8 + %call4 = tail call fastcc signext i8 @_ZL30safe_unary_minus_func_int8_t_sa(i8 signext %conv3) + %conv5 = sext i8 %call4 to i16 + store i16 %conv5, i16* bitcast ({ i8, [3 x i8] }* @_ZL4g_74 to i16*), align 4, !tbaa !4 + %conv6 = sext i8 %call4 to i32 + %cmp8 = icmp sgt i32 %conv6, zext (i1 icmp ne (i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 5), i8* @_ZL5g_304) to i32) + %conv9 = zext i1 %cmp8 to i32 + %cmp10 = icmp ne i32 %conv2, %conv9 + %conv11 = zext i1 %cmp10 to i16 + %call12 = tail call fastcc signext i16 @_ZL28safe_lshift_func_int16_t_s_usj(i16 signext %conv11, i32 7) + %conv13 = sext i16 %call12 to i32 + store i32 %conv13, i32* @_ZL5g_257, align 4, !tbaa !3 + %tobool = icmp eq i16 %call12, 0 + br i1 %tobool, label %land.end, label %land.rhs + +land.rhs: ; preds = %entry + %1 = load i16* @_ZL5g_308, align 2, !tbaa !4 + %conv17 = zext i16 %1 to i32 + %xor = xor i32 %conv17, %conv13 + %conv18 = trunc i32 %xor to i16 + store i16 %conv18, i16* @_ZL5g_308, align 2, !tbaa !4 + %lnot = icmp eq i16 %conv18, 0 + %conv20 = zext i1 %lnot to i32 + %2 = load i16* @_ZL4g_79, align 2, !tbaa !4 + %conv21 = zext i16 %2 to i32 + %xor22 = xor i32 %conv20, %conv21 + %conv23 = trunc i32 %xor22 to i16 + store i16 %conv23, i16* @_ZL4g_79, align 2, !tbaa !4 + %tobool24 = icmp ne i16 %conv23, 0 + %phitmp = zext i1 %tobool24 to i16 + br label %land.end + +land.end: ; preds = %land.rhs, %entry + %3 = phi i16 [ 0, %entry ], [ %phitmp, %land.rhs ] + store i16 %3, i16* bitcast ({ i8, [3 x i8] }* @_ZL4g_74 to i16*), align 4, !tbaa !4 + %conv31 = sext i8 %p_42 to i16 + ret i16 %conv31 +} + +; Function Attrs: nounwind +define internal fastcc void @_ZL7func_492S0(%union.U1* noalias nocapture sret %agg.result, %struct.S0* byval nocapture align 4 %p_50) #0 { +entry: + %l_131 = alloca i32, align 4 + %l_129 = alloca i32, align 4 + store i32 1179615507, i32* %l_131, align 4, !tbaa !3 + store i32 3, i32* @_ZL4g_53, align 4, !tbaa !3 + %f1 = getelementptr inbounds %struct.S0* %p_50, i32 0, i32 1 + %f0 = getelementptr inbounds %struct.S0* %p_50, i32 0, i32 0 + %f2 = getelementptr inbounds %struct.S0* %p_50, i32 0, i32 2 + br label %for.end86 + +for.end86: ; preds = %for.inc1370, %entry + store i32 1795078696, i32* %l_129, align 4, !tbaa !3 + store i8 0, i8* %f1, align 2, !tbaa !1 + br label %for.body90 + +for.body90: ; preds = %for.inc1329, %for.end86 + %0 = load i16* %f0, align 4, !tbaa !4 + %conv110 = sext i16 %0 to i32 + %call111 = call fastcc i32 @_ZL26safe_div_func_uint32_t_u_ujj(i32 0, i32 %conv110) + %1 = load i32* @_ZL4g_53, align 4, !tbaa !3 + %call112 = call fastcc i32 @_ZL25safe_mod_func_int32_t_s_sii(i32 %call111, i32 %1) + %cmp113 = icmp ult i32 %call112, -1508745334 + %conv114 = zext i1 %cmp113 to i32 + %2 = load i16* @_ZL4g_77, align 2, !tbaa !4 + %conv116 = zext i16 %2 to i32 + %xor117 = xor i32 %conv116, %conv114 + %conv118 = trunc i32 %xor117 to i16 + store i16 %conv118, i16* @_ZL4g_77, align 2, !tbaa !4 + store i16 %conv118, i16* @_ZL4g_79, align 2, !tbaa !4 + %and120 = and i32 %xor117, 1 + %3 = load i32* @_ZL4g_53, align 4, !tbaa !3 + %cmp121 = icmp eq i32 %and120, %3 + %conv122 = zext i1 %cmp121 to i16 + store i16 %conv122, i16* @_ZL4g_82, align 2, !tbaa !4 + %4 = load i32* %f2, align 4, !tbaa !3 + %conv127 = trunc i32 %4 to i8 + %call128 = call fastcc zeroext i8 @_ZL25safe_sub_func_uint8_t_u_uhh(i8 zeroext -5, i8 zeroext %conv127) + %tobool129 = icmp eq i8 %call128, 0 + br i1 %tobool129, label %cleanup1367, label %land.lhs.true + +land.lhs.true: ; preds = %for.body90 + %5 = load i8* %f1, align 2, !tbaa !1 + %tobool131 = icmp eq i8 %5, 0 + br i1 %tobool131, label %cleanup1367, label %for.end139 + +for.end139: ; preds = %land.lhs.true + %6 = load i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 1, i32 3, i32 1), align 1, !tbaa !1 + %tobool140 = icmp eq i8 %6, 0 + br i1 %tobool140, label %for.end582, label %for.inc1370 + +for.end582: ; preds = %for.end139 + %7 = load i8* %f1, align 2, !tbaa !1 + %conv554 = sext i8 %7 to i32 + %add = add nsw i32 %conv554, 1 + %8 = load i32* @_ZL4g_53, align 4, !tbaa !3 + %add555 = add nsw i32 %8, 1 + %arrayidx559 = getelementptr inbounds [4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 %conv554, i32 %add555, i32 %add + %9 = load i8* %arrayidx559, align 1, !tbaa !1 + %conv560 = sext i8 %9 to i32 + %10 = load i32* %f2, align 4, !tbaa !3 + %xor561 = xor i32 %conv560, %and120 + %or563 = or i32 %xor561, %10 + %xor561.1 = xor i32 %conv560, %or563 + %or563.1 = or i32 %xor561.1, %10 + %xor561.2 = xor i32 %conv560, %or563.1 + %or563.2 = or i32 %xor561.2, %10 + %xor561.3 = xor i32 %conv560, %or563.2 + %or563.3 = or i32 %xor561.3, %10 + store i32 %or563.3, i32* @_ZL4g_93, align 4, !tbaa !3 + store i16 0, i16* %f0, align 4, !tbaa !4 + %11 = load i32* getelementptr inbounds (%struct.S0* @_ZL4g_83, i32 0, i32 2), align 4, !tbaa !3 + %conv637 = trunc i32 %11 to i16 + %call638 = call fastcc signext i16 @_ZL25safe_sub_func_int16_t_s_sss(i16 signext %conv637) + %tobool639 = icmp eq i16 %call638, 0 + br i1 %tobool639, label %if.else1214, label %if.then640 + +if.then640: ; preds = %for.end582 + %12 = load i32* @_ZL5g_138, align 4, !tbaa !3 + %inc733 = add i32 %12, 1 + store i32 %inc733, i32* @_ZL5g_138, align 4, !tbaa !3 + %13 = load i8* getelementptr inbounds ([4 x [6 x [6 x i8]]]* @_ZL4g_52, i32 0, i32 0, i32 1, i32 2), align 1, !tbaa !1 + %tobool734 = icmp eq i8 %13, 0 + br i1 %tobool734, label %if.end1219.loopexit, label %for.inc1329 + +if.else1214: ; preds = %for.end582 + %14 = load i8* %f1, align 2, !tbaa !1 + %tobool1216 = icmp eq i8 %14, 0 + br i1 %tobool1216, label %if.end1219, label %for.inc1370 + +if.end1219.loopexit: ; preds = %if.then640 + store i16 -28, i16* @_ZL4g_77, align 2, !tbaa !4 + br label %if.end1219 + +if.end1219: ; preds = %if.end1219.loopexit, %if.else1214 + store i32 0, i32* %l_129, align 4, !tbaa !3 + store i32 1, i32* %l_131, align 4, !tbaa !3 + %15 = load i8* %f1, align 2, !tbaa !1 + %tobool1257 = icmp eq i8 %15, 0 + br i1 %tobool1257, label %lor.lhs.false, label %for.end1334.loopexit742 + +lor.lhs.false: ; preds = %if.end1219 + %16 = load i16* %f0, align 4, !tbaa !4 + %tobool1259 = icmp eq i16 %16, 0 + br i1 %tobool1259, label %if.else1312, label %for.end1334.loopexit742 + +if.else1312: ; preds = %lor.lhs.false + store i32* %l_129, i32** getelementptr inbounds ([2 x [10 x i32*]]* @_ZL5g_197, i32 0, i32 1, i32 9), align 4, !tbaa !0 + br label %for.inc1370 + +for.inc1329: ; preds = %if.then640 + %17 = load i8* %f1, align 2, !tbaa !1 + %conv1331700 = zext i8 %17 to i32 + %add1332 = add nsw i32 %conv1331700, 1 + %conv1333 = trunc i32 %add1332 to i8 + store i8 %conv1333, i8* %f1, align 2, !tbaa !1 + %cmp89 = icmp slt i8 %conv1333, 4 + br i1 %cmp89, label %for.body90, label %for.inc1370 + +for.end1334.loopexit742: ; preds = %lor.lhs.false, %if.end1219 + store i8 13, i8* @_ZL5g_170, align 1, !tbaa !1 + br label %for.inc1370 + +cleanup1367: ; preds = %land.lhs.true, %for.body90 + %18 = load i32* @_ZL4g_93, align 4, !tbaa !3 + %and635 = and i32 %18, -6 + store i32 %and635, i32* @_ZL4g_93, align 4, !tbaa !3 + %19 = load i8** bitcast ({ i8, [3 x i8] }* @_ZZL7func_492S0E5l_119 to i8**), align 4 + %20 = getelementptr inbounds %union.U1* %agg.result, i32 0, i32 0 + store i8* %19, i8** %20, align 4 + br label %cleanup1381 + +for.inc1370: ; preds = %for.end1334.loopexit742, %for.inc1329, %if.else1312, %if.else1214, %for.end139 + store i32* %l_131, i32** getelementptr inbounds ([2 x [10 x i32*]]* @_ZL5g_197, i32 0, i32 1, i32 7), align 4, !tbaa !0 + store i8 -1, i8* @_ZL5g_136, align 1, !tbaa !1 + %21 = load i32* @_ZL4g_53, align 4, !tbaa !3 + %sub1371 = add nsw i32 %21, -1 + store i32 %sub1371, i32* @_ZL4g_53, align 4, !tbaa !3 + %cmp = icmp sgt i32 %21, 0 + br i1 %cmp, label %for.end86, label %for.end1372 + +for.end1372: ; preds = %for.inc1370 + store i8 0, i8* getelementptr inbounds ([8 x i8]* @_ZL5g_171, i32 0, i32 6), align 1, !tbaa !1 + %22 = load i8** bitcast ({ i8, [3 x i8] }* @_ZL4g_74 to i8**), align 4 + %23 = getelementptr inbounds %union.U1* %agg.result, i32 0, i32 0 + store i8* %22, i8** %23, align 4 + br label %cleanup1381 + +cleanup1381: ; preds = %for.end1372, %cleanup1367 + ret void +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i8 @_ZL24safe_add_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 { +entry: + %conv3 = zext i8 %si1 to i32 + %conv14 = zext i8 %si2 to i32 + %add = add nsw i32 %conv14, %conv3 + %conv2 = trunc i32 %add to i8 + ret i8 %conv2 +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i8 @_ZL24safe_mul_func_int8_t_s_saa(i8 signext %si1, i8 signext %si2) #3 { +entry: + %conv = sext i8 %si1 to i32 + %conv1 = sext i8 %si2 to i32 + %mul = mul nsw i32 %conv1, %conv + %conv2 = trunc i32 %mul to i8 + ret i8 %conv2 +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i16 @_ZL28safe_rshift_func_int16_t_s_ssi(i16 signext %left) #3 { +entry: + %conv = sext i16 %left to i32 + %left.lobit = lshr i16 %left, 15 + %0 = zext i16 %left.lobit to i32 + %.not = xor i32 %0, 1 + %cond = ashr i32 %conv, %.not + %conv6 = trunc i32 %cond to i16 + ret i16 %conv6 +} + +; Function Attrs: nounwind readnone +define internal fastcc signext i8 @_ZL30safe_unary_minus_func_int8_t_sa(i8 signext %si) #3 { +entry: + %conv2 = zext i8 %si to i32 + %sub = sub nsw i32 0, %conv2 + %conv1 = trunc i32 %sub to i8 + ret i8 %conv1 +} + +; Function Attrs: nounwind readnone +define internal fastcc i32 @_ZL31safe_unary_minus_func_int32_t_si(i32 %si) #3 { +entry: + %sub = sub nsw i32 0, %si + ret i32 %sub +} + +; Function Attrs: nounwind readnone +define internal fastcc i32 @_ZL26safe_add_func_uint32_t_u_ujj(i32 %ui1, i32 %ui2) #3 { +entry: + %add = add i32 %ui2, %ui1 + ret i32 %add +} + +; Function Attrs: nounwind +define weak i8* @malloc(i32 %bytes) #0 { +entry: + %cmp = icmp ult i32 %bytes, 245 + br i1 %cmp, label %if.then, label %if.else137 + +if.then: ; preds = %entry + %cmp1 = icmp ult i32 %bytes, 11 + br i1 %cmp1, label %cond.end, label %cond.false + +cond.false: ; preds = %if.then + %add2 = add i32 %bytes, 11 + %and = and i32 %add2, -8 + br label %cond.end + +cond.end: ; preds = %cond.false, %if.then + %cond = phi i32 [ %and, %cond.false ], [ 16, %if.then ] + %shr = lshr exact i32 %cond, 3 + %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shr3 = lshr i32 %0, %shr + %and4 = and i32 %shr3, 3 + %cmp5 = icmp eq i32 %and4, 0 + br i1 %cmp5, label %if.else28, label %if.then6 + +if.then6: ; preds = %cond.end + %neg = and i32 %shr3, 1 + %and7 = xor i32 %neg, 1 + %add8 = add i32 %and7, %shr + %shl = shl nsw i32 %add8, 1 + %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl + %1 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk* + %arrayidx.sum = add i32 %shl, 2 + %2 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum + %3 = load %struct.malloc_chunk** %2, align 4, !tbaa !0 + %fd9 = getelementptr inbounds %struct.malloc_chunk* %3, i32 0, i32 2 + %4 = load %struct.malloc_chunk** %fd9, align 4, !tbaa !0 + %cmp10 = icmp eq %struct.malloc_chunk* %1, %4 + br i1 %cmp10, label %if.then11, label %if.else + +if.then11: ; preds = %if.then6 + %shl12 = shl i32 1, %add8 + %neg13 = xor i32 %shl12, -1 + %and14 = and i32 %0, %neg13 + store i32 %and14, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end21 + +if.else: ; preds = %if.then6 + %5 = bitcast %struct.malloc_chunk* %4 to i8* + %6 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp15 = icmp ult i8* %5, %6 + br i1 %cmp15, label %if.else20, label %land.rhs + +land.rhs: ; preds = %if.else + %bk = getelementptr inbounds %struct.malloc_chunk* %4, i32 0, i32 3 + %7 = load %struct.malloc_chunk** %bk, align 4, !tbaa !0 + %cmp16 = icmp eq %struct.malloc_chunk* %7, %3 + br i1 %cmp16, label %if.then17, label %if.else20, !prof !5 + +if.then17: ; preds = %land.rhs + store %struct.malloc_chunk* %1, %struct.malloc_chunk** %bk, align 4, !tbaa !0 + store %struct.malloc_chunk* %4, %struct.malloc_chunk** %2, align 4, !tbaa !0 + br label %if.end21 + +if.else20: ; preds = %land.rhs, %if.else + tail call void @abort() #6 + unreachable + +if.end21: ; preds = %if.then17, %if.then11 + %shl22 = shl i32 %add8, 3 + %or23 = or i32 %shl22, 3 + %head = getelementptr inbounds %struct.malloc_chunk* %3, i32 0, i32 1 + store i32 %or23, i32* %head, align 4, !tbaa !3 + %8 = bitcast %struct.malloc_chunk* %3 to i8* + %add.ptr.sum104 = or i32 %shl22, 4 + %head25 = getelementptr inbounds i8* %8, i32 %add.ptr.sum104 + %9 = bitcast i8* %head25 to i32* + %10 = load i32* %9, align 4, !tbaa !3 + %or26 = or i32 %10, 1 + store i32 %or26, i32* %9, align 4, !tbaa !3 + %11 = bitcast %struct.malloc_chunk** %fd9 to i8* + br label %postaction + +if.else28: ; preds = %cond.end + %12 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %cmp29 = icmp ugt i32 %cond, %12 + br i1 %cmp29, label %if.then30, label %if.end154 + +if.then30: ; preds = %if.else28 + %cmp31 = icmp eq i32 %shr3, 0 + br i1 %cmp31, label %if.else127, label %if.then32 + +if.then32: ; preds = %if.then30 + %shl35 = shl i32 %shr3, %shr + %shl37 = shl i32 2, %shr + %sub = sub i32 0, %shl37 + %or40 = or i32 %shl37, %sub + %and41 = and i32 %shl35, %or40 + %sub42 = sub i32 0, %and41 + %and43 = and i32 %and41, %sub42 + %sub44 = add i32 %and43, -1 + %shr45 = lshr i32 %sub44, 12 + %and46 = and i32 %shr45, 16 + %shr47 = lshr i32 %sub44, %and46 + %shr48 = lshr i32 %shr47, 5 + %and49 = and i32 %shr48, 8 + %add50 = or i32 %and49, %and46 + %shr51 = lshr i32 %shr47, %and49 + %shr52 = lshr i32 %shr51, 2 + %and53 = and i32 %shr52, 4 + %add54 = or i32 %add50, %and53 + %shr55 = lshr i32 %shr51, %and53 + %shr56 = lshr i32 %shr55, 1 + %and57 = and i32 %shr56, 2 + %add58 = or i32 %add54, %and57 + %shr59 = lshr i32 %shr55, %and57 + %shr60 = lshr i32 %shr59, 1 + %and61 = and i32 %shr60, 1 + %add62 = or i32 %add58, %and61 + %shr63 = lshr i32 %shr59, %and61 + %add64 = add i32 %add62, %shr63 + %shl65 = shl i32 %add64, 1 + %arrayidx66 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl65 + %13 = bitcast %struct.malloc_chunk** %arrayidx66 to %struct.malloc_chunk* + %arrayidx66.sum = add i32 %shl65, 2 + %14 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx66.sum + %15 = load %struct.malloc_chunk** %14, align 4, !tbaa !0 + %fd69 = getelementptr inbounds %struct.malloc_chunk* %15, i32 0, i32 2 + %16 = load %struct.malloc_chunk** %fd69, align 4, !tbaa !0 + %cmp70 = icmp eq %struct.malloc_chunk* %13, %16 + br i1 %cmp70, label %if.then71, label %if.else75 + +if.then71: ; preds = %if.then32 + %shl72 = shl i32 1, %add64 + %neg73 = xor i32 %shl72, -1 + %and74 = and i32 %0, %neg73 + store i32 %and74, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end89 + +if.else75: ; preds = %if.then32 + %17 = bitcast %struct.malloc_chunk* %16 to i8* + %18 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp76 = icmp ult i8* %17, %18 + br i1 %cmp76, label %if.else87, label %land.rhs77 + +land.rhs77: ; preds = %if.else75 + %bk78 = getelementptr inbounds %struct.malloc_chunk* %16, i32 0, i32 3 + %19 = load %struct.malloc_chunk** %bk78, align 4, !tbaa !0 + %cmp79 = icmp eq %struct.malloc_chunk* %19, %15 + br i1 %cmp79, label %if.then84, label %if.else87, !prof !5 + +if.then84: ; preds = %land.rhs77 + store %struct.malloc_chunk* %13, %struct.malloc_chunk** %bk78, align 4, !tbaa !0 + store %struct.malloc_chunk* %16, %struct.malloc_chunk** %14, align 4, !tbaa !0 + br label %if.end89 + +if.else87: ; preds = %land.rhs77, %if.else75 + tail call void @abort() #6 + unreachable + +if.end89: ; preds = %if.then84, %if.then71 + %shl90 = shl i32 %add64, 3 + %sub91 = sub i32 %shl90, %cond + %or93 = or i32 %cond, 3 + %head94 = getelementptr inbounds %struct.malloc_chunk* %15, i32 0, i32 1 + store i32 %or93, i32* %head94, align 4, !tbaa !3 + %20 = bitcast %struct.malloc_chunk* %15 to i8* + %add.ptr95 = getelementptr inbounds i8* %20, i32 %cond + %21 = bitcast i8* %add.ptr95 to %struct.malloc_chunk* + %or96 = or i32 %sub91, 1 + %add.ptr95.sum102 = or i32 %cond, 4 + %head97 = getelementptr inbounds i8* %20, i32 %add.ptr95.sum102 + %22 = bitcast i8* %head97 to i32* + store i32 %or96, i32* %22, align 4, !tbaa !3 + %add.ptr98 = getelementptr inbounds i8* %20, i32 %shl90 + %prev_foot = bitcast i8* %add.ptr98 to i32* + store i32 %sub91, i32* %prev_foot, align 4, !tbaa !3 + %23 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %cmp99 = icmp eq i32 %23, 0 + br i1 %cmp99, label %if.end125, label %if.then100 + +if.then100: ; preds = %if.end89 + %24 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %shr101 = lshr i32 %23, 3 + %shl102 = shl nuw nsw i32 %shr101, 1 + %arrayidx103 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl102 + %25 = bitcast %struct.malloc_chunk** %arrayidx103 to %struct.malloc_chunk* + %26 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shl105 = shl i32 1, %shr101 + %and106 = and i32 %26, %shl105 + %tobool107 = icmp eq i32 %and106, 0 + br i1 %tobool107, label %if.then108, label %if.else111 + +if.then108: ; preds = %if.then100 + %or110 = or i32 %26, %shl105 + store i32 %or110, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %arrayidx103.sum.pre = add i32 %shl102, 2 + %.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx103.sum.pre + br label %if.end120 + +if.else111: ; preds = %if.then100 + %arrayidx103.sum103 = add i32 %shl102, 2 + %27 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx103.sum103 + %28 = load %struct.malloc_chunk** %27, align 4, !tbaa !0 + %29 = bitcast %struct.malloc_chunk* %28 to i8* + %30 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp113 = icmp ult i8* %29, %30 + br i1 %cmp113, label %if.else118, label %if.end120, !prof !6 + +if.else118: ; preds = %if.else111 + tail call void @abort() #6 + unreachable + +if.end120: ; preds = %if.else111, %if.then108 + %.pre-phi = phi %struct.malloc_chunk** [ %27, %if.else111 ], [ %.pre, %if.then108 ] + %F104.0 = phi %struct.malloc_chunk* [ %28, %if.else111 ], [ %25, %if.then108 ] + store %struct.malloc_chunk* %24, %struct.malloc_chunk** %.pre-phi, align 4, !tbaa !0 + %bk122 = getelementptr inbounds %struct.malloc_chunk* %F104.0, i32 0, i32 3 + store %struct.malloc_chunk* %24, %struct.malloc_chunk** %bk122, align 4, !tbaa !0 + %fd123 = getelementptr inbounds %struct.malloc_chunk* %24, i32 0, i32 2 + store %struct.malloc_chunk* %F104.0, %struct.malloc_chunk** %fd123, align 4, !tbaa !0 + %bk124 = getelementptr inbounds %struct.malloc_chunk* %24, i32 0, i32 3 + store %struct.malloc_chunk* %25, %struct.malloc_chunk** %bk124, align 4, !tbaa !0 + br label %if.end125 + +if.end125: ; preds = %if.end120, %if.end89 + store i32 %sub91, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + store %struct.malloc_chunk* %21, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %31 = bitcast %struct.malloc_chunk** %fd69 to i8* + br label %postaction + +if.else127: ; preds = %if.then30 + %32 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %cmp128 = icmp eq i32 %32, 0 + br i1 %cmp128, label %if.end154, label %land.lhs.true + +land.lhs.true: ; preds = %if.else127 + %sub.i = sub i32 0, %32 + %and.i = and i32 %32, %sub.i + %sub2.i = add i32 %and.i, -1 + %shr.i = lshr i32 %sub2.i, 12 + %and3.i = and i32 %shr.i, 16 + %shr4.i = lshr i32 %sub2.i, %and3.i + %shr5.i = lshr i32 %shr4.i, 5 + %and6.i = and i32 %shr5.i, 8 + %add.i = or i32 %and6.i, %and3.i + %shr7.i = lshr i32 %shr4.i, %and6.i + %shr8.i = lshr i32 %shr7.i, 2 + %and9.i = and i32 %shr8.i, 4 + %add10.i = or i32 %add.i, %and9.i + %shr11.i = lshr i32 %shr7.i, %and9.i + %shr12.i = lshr i32 %shr11.i, 1 + %and13.i = and i32 %shr12.i, 2 + %add14.i = or i32 %add10.i, %and13.i + %shr15.i = lshr i32 %shr11.i, %and13.i + %shr16.i = lshr i32 %shr15.i, 1 + %and17.i = and i32 %shr16.i, 1 + %add18.i = or i32 %add14.i, %and17.i + %shr19.i = lshr i32 %shr15.i, %and17.i + %add20.i = add i32 %add18.i, %shr19.i + %arrayidx.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %add20.i + %33 = load %struct.malloc_tree_chunk** %arrayidx.i, align 4, !tbaa !0 + %head.i = getelementptr inbounds %struct.malloc_tree_chunk* %33, i32 0, i32 1 + %34 = load i32* %head.i, align 4, !tbaa !3 + %and21.i = and i32 %34, -8 + %sub22.i = sub i32 %and21.i, %cond + br label %while.cond.i + +while.cond.i: ; preds = %while.body.i, %land.lhs.true + %rsize.0.i = phi i32 [ %sub22.i, %land.lhs.true ], [ %sub31.rsize.0.i, %while.body.i ] + %v.0.i = phi %struct.malloc_tree_chunk* [ %33, %land.lhs.true ], [ %cond.v.0.i, %while.body.i ] + %t.0.i = phi %struct.malloc_tree_chunk* [ %33, %land.lhs.true ], [ %cond6.i, %while.body.i ] + %arrayidx23.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i, i32 0, i32 4, i32 0 + %35 = load %struct.malloc_tree_chunk** %arrayidx23.i, align 4, !tbaa !0 + %cmp.i = icmp eq %struct.malloc_tree_chunk* %35, null + br i1 %cmp.i, label %cond.end.i, label %while.body.i + +cond.end.i: ; preds = %while.cond.i + %arrayidx27.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i, i32 0, i32 4, i32 1 + %36 = load %struct.malloc_tree_chunk** %arrayidx27.i, align 4, !tbaa !0 + %cmp28.i = icmp eq %struct.malloc_tree_chunk* %36, null + br i1 %cmp28.i, label %while.end.i, label %while.body.i + +while.body.i: ; preds = %cond.end.i, %while.cond.i + %cond6.i = phi %struct.malloc_tree_chunk* [ %36, %cond.end.i ], [ %35, %while.cond.i ] + %head29.i = getelementptr inbounds %struct.malloc_tree_chunk* %cond6.i, i32 0, i32 1 + %37 = load i32* %head29.i, align 4, !tbaa !3 + %and30.i = and i32 %37, -8 + %sub31.i = sub i32 %and30.i, %cond + %cmp32.i = icmp ult i32 %sub31.i, %rsize.0.i + %sub31.rsize.0.i = select i1 %cmp32.i, i32 %sub31.i, i32 %rsize.0.i + %cond.v.0.i = select i1 %cmp32.i, %struct.malloc_tree_chunk* %cond6.i, %struct.malloc_tree_chunk* %v.0.i + br label %while.cond.i + +while.end.i: ; preds = %cond.end.i + %38 = bitcast %struct.malloc_tree_chunk* %v.0.i to i8* + %39 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp33.i = icmp ult i8* %38, %39 + br i1 %cmp33.i, label %if.end227.i, label %if.then34.i, !prof !6 + +if.then34.i: ; preds = %while.end.i + %add.ptr.i = getelementptr inbounds i8* %38, i32 %cond + %40 = bitcast i8* %add.ptr.i to %struct.malloc_chunk* + %cmp35.i = icmp ult i8* %38, %add.ptr.i + br i1 %cmp35.i, label %if.then39.i, label %if.end227.i, !prof !5 + +if.then39.i: ; preds = %if.then34.i + %parent.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 5 + %41 = load %struct.malloc_tree_chunk** %parent.i, align 4, !tbaa !0 + %bk.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 3 + %42 = load %struct.malloc_tree_chunk** %bk.i, align 4, !tbaa !0 + %cmp40.i = icmp eq %struct.malloc_tree_chunk* %42, %v.0.i + br i1 %cmp40.i, label %if.else59.i, label %if.then42.i + +if.then42.i: ; preds = %if.then39.i + %fd.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 2 + %43 = load %struct.malloc_tree_chunk** %fd.i, align 4, !tbaa !0 + %44 = bitcast %struct.malloc_tree_chunk* %43 to i8* + %cmp45.i = icmp ult i8* %44, %39 + br i1 %cmp45.i, label %if.else.i, label %land.lhs.true.i + +land.lhs.true.i: ; preds = %if.then42.i + %bk47.i = getelementptr inbounds %struct.malloc_tree_chunk* %43, i32 0, i32 3 + %45 = load %struct.malloc_tree_chunk** %bk47.i, align 4, !tbaa !0 + %cmp48.i = icmp eq %struct.malloc_tree_chunk* %45, %v.0.i + br i1 %cmp48.i, label %land.rhs.i, label %if.else.i + +land.rhs.i: ; preds = %land.lhs.true.i + %fd50.i = getelementptr inbounds %struct.malloc_tree_chunk* %42, i32 0, i32 2 + %46 = load %struct.malloc_tree_chunk** %fd50.i, align 4, !tbaa !0 + %cmp51.i = icmp eq %struct.malloc_tree_chunk* %46, %v.0.i + br i1 %cmp51.i, label %if.then55.i, label %if.else.i, !prof !5 + +if.then55.i: ; preds = %land.rhs.i + store %struct.malloc_tree_chunk* %42, %struct.malloc_tree_chunk** %bk47.i, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %43, %struct.malloc_tree_chunk** %fd50.i, align 4, !tbaa !0 + br label %if.end89.i + +if.else.i: ; preds = %land.rhs.i, %land.lhs.true.i, %if.then42.i + tail call void @abort() #6 + unreachable + +if.else59.i: ; preds = %if.then39.i + %arrayidx61.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 1 + %47 = load %struct.malloc_tree_chunk** %arrayidx61.i, align 4, !tbaa !0 + %cmp62.i = icmp eq %struct.malloc_tree_chunk* %47, null + br i1 %cmp62.i, label %lor.lhs.false.i, label %while.cond69.i + +lor.lhs.false.i: ; preds = %if.else59.i + %arrayidx65.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 0 + %48 = load %struct.malloc_tree_chunk** %arrayidx65.i, align 4, !tbaa !0 + %cmp66.i = icmp eq %struct.malloc_tree_chunk* %48, null + br i1 %cmp66.i, label %if.end89.i, label %while.cond69.i + +while.cond69.i: ; preds = %lor.rhs.i, %while.cond69.i, %lor.lhs.false.i, %if.else59.i + %RP.0.i = phi %struct.malloc_tree_chunk** [ %arrayidx65.i, %lor.lhs.false.i ], [ %arrayidx61.i, %if.else59.i ], [ %arrayidx71.i, %while.cond69.i ], [ %arrayidx75.i, %lor.rhs.i ] + %R.0.i = phi %struct.malloc_tree_chunk* [ %48, %lor.lhs.false.i ], [ %47, %if.else59.i ], [ %49, %while.cond69.i ], [ %50, %lor.rhs.i ] + %arrayidx71.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i, i32 0, i32 4, i32 1 + %49 = load %struct.malloc_tree_chunk** %arrayidx71.i, align 4, !tbaa !0 + %cmp72.i = icmp eq %struct.malloc_tree_chunk* %49, null + br i1 %cmp72.i, label %lor.rhs.i, label %while.cond69.i + +lor.rhs.i: ; preds = %while.cond69.i + %arrayidx75.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i, i32 0, i32 4, i32 0 + %50 = load %struct.malloc_tree_chunk** %arrayidx75.i, align 4, !tbaa !0 + %cmp76.i = icmp eq %struct.malloc_tree_chunk* %50, null + br i1 %cmp76.i, label %while.end79.i, label %while.cond69.i + +while.end79.i: ; preds = %lor.rhs.i + %51 = bitcast %struct.malloc_tree_chunk** %RP.0.i to i8* + %cmp81.i = icmp ult i8* %51, %39 + br i1 %cmp81.i, label %if.else86.i, label %if.then85.i, !prof !6 + +if.then85.i: ; preds = %while.end79.i + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i, align 4, !tbaa !0 + br label %if.end89.i + +if.else86.i: ; preds = %while.end79.i + tail call void @abort() #6 + unreachable + +if.end89.i: ; preds = %if.then85.i, %lor.lhs.false.i, %if.then55.i + %R.1.i = phi %struct.malloc_tree_chunk* [ %42, %if.then55.i ], [ %R.0.i, %if.then85.i ], [ null, %lor.lhs.false.i ] + %cmp90.i = icmp eq %struct.malloc_tree_chunk* %41, null + br i1 %cmp90.i, label %if.end173.i, label %if.then92.i + +if.then92.i: ; preds = %if.end89.i + %index.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 6 + %52 = load i32* %index.i, align 4, !tbaa !3 + %arrayidx94.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %52 + %53 = load %struct.malloc_tree_chunk** %arrayidx94.i, align 4, !tbaa !0 + %cmp95.i = icmp eq %struct.malloc_tree_chunk* %v.0.i, %53 + br i1 %cmp95.i, label %if.then97.i, label %if.else105.i + +if.then97.i: ; preds = %if.then92.i + store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %arrayidx94.i, align 4, !tbaa !0 + %cond4.i = icmp eq %struct.malloc_tree_chunk* %R.1.i, null + br i1 %cond4.i, label %if.end125.thread.i, label %if.then128.i + +if.end125.thread.i: ; preds = %if.then97.i + %shl.i = shl i32 1, %52 + %neg.i = xor i32 %shl.i, -1 + %54 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and103.i = and i32 %54, %neg.i + store i32 %and103.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end173.i + +if.else105.i: ; preds = %if.then92.i + %55 = bitcast %struct.malloc_tree_chunk* %41 to i8* + %56 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp107.i = icmp ult i8* %55, %56 + br i1 %cmp107.i, label %if.else123.i, label %if.then111.i, !prof !6 + +if.then111.i: ; preds = %if.else105.i + %arrayidx113.i = getelementptr inbounds %struct.malloc_tree_chunk* %41, i32 0, i32 4, i32 0 + %57 = load %struct.malloc_tree_chunk** %arrayidx113.i, align 4, !tbaa !0 + %cmp114.i = icmp eq %struct.malloc_tree_chunk* %57, %v.0.i + br i1 %cmp114.i, label %if.then116.i, label %if.else119.i + +if.then116.i: ; preds = %if.then111.i + store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %arrayidx113.i, align 4, !tbaa !0 + br label %if.end125.i + +if.else119.i: ; preds = %if.then111.i + %arrayidx121.i = getelementptr inbounds %struct.malloc_tree_chunk* %41, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %arrayidx121.i, align 4, !tbaa !0 + br label %if.end125.i + +if.else123.i: ; preds = %if.else105.i + tail call void @abort() #6 + unreachable + +if.end125.i: ; preds = %if.else119.i, %if.then116.i + %cmp126.i = icmp eq %struct.malloc_tree_chunk* %R.1.i, null + br i1 %cmp126.i, label %if.end173.i, label %if.then128.i + +if.then128.i: ; preds = %if.end125.i, %if.then97.i + %58 = bitcast %struct.malloc_tree_chunk* %R.1.i to i8* + %59 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp130.i = icmp ult i8* %58, %59 + br i1 %cmp130.i, label %if.else170.i, label %if.then134.i, !prof !6 + +if.then134.i: ; preds = %if.then128.i + %parent135.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 5 + store %struct.malloc_tree_chunk* %41, %struct.malloc_tree_chunk** %parent135.i, align 4, !tbaa !0 + %arrayidx137.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 0 + %60 = load %struct.malloc_tree_chunk** %arrayidx137.i, align 4, !tbaa !0 + %cmp138.i = icmp eq %struct.malloc_tree_chunk* %60, null + br i1 %cmp138.i, label %if.end152.i, label %if.then140.i + +if.then140.i: ; preds = %if.then134.i + %61 = bitcast %struct.malloc_tree_chunk* %60 to i8* + %62 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp142.i = icmp ult i8* %61, %62 + br i1 %cmp142.i, label %if.else150.i, label %if.then146.i, !prof !6 + +if.then146.i: ; preds = %if.then140.i + %arrayidx148.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %60, %struct.malloc_tree_chunk** %arrayidx148.i, align 4, !tbaa !0 + %parent149.i = getelementptr inbounds %struct.malloc_tree_chunk* %60, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %parent149.i, align 4, !tbaa !0 + br label %if.end152.i + +if.else150.i: ; preds = %if.then140.i + tail call void @abort() #6 + unreachable + +if.end152.i: ; preds = %if.then146.i, %if.then134.i + %arrayidx154.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 4, i32 1 + %63 = load %struct.malloc_tree_chunk** %arrayidx154.i, align 4, !tbaa !0 + %cmp155.i = icmp eq %struct.malloc_tree_chunk* %63, null + br i1 %cmp155.i, label %if.end173.i, label %if.then157.i + +if.then157.i: ; preds = %if.end152.i + %64 = bitcast %struct.malloc_tree_chunk* %63 to i8* + %65 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp159.i = icmp ult i8* %64, %65 + br i1 %cmp159.i, label %if.else167.i, label %if.then163.i, !prof !6 + +if.then163.i: ; preds = %if.then157.i + %arrayidx165.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %63, %struct.malloc_tree_chunk** %arrayidx165.i, align 4, !tbaa !0 + %parent166.i = getelementptr inbounds %struct.malloc_tree_chunk* %63, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1.i, %struct.malloc_tree_chunk** %parent166.i, align 4, !tbaa !0 + br label %if.end173.i + +if.else167.i: ; preds = %if.then157.i + tail call void @abort() #6 + unreachable + +if.else170.i: ; preds = %if.then128.i + tail call void @abort() #6 + unreachable + +if.end173.i: ; preds = %if.then163.i, %if.end152.i, %if.end125.i, %if.end125.thread.i, %if.end89.i + %cmp174.i = icmp ult i32 %rsize.0.i, 16 + br i1 %cmp174.i, label %if.then176.i, label %if.else184.i + +if.then176.i: ; preds = %if.end173.i + %add177.i = add i32 %rsize.0.i, %cond + %or178.i = or i32 %add177.i, 3 + %head179.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 1 + store i32 %or178.i, i32* %head179.i, align 4, !tbaa !3 + %add.ptr181.sum.i = add i32 %add177.i, 4 + %head182.i = getelementptr inbounds i8* %38, i32 %add.ptr181.sum.i + %66 = bitcast i8* %head182.i to i32* + %67 = load i32* %66, align 4, !tbaa !3 + %or183.i = or i32 %67, 1 + store i32 %or183.i, i32* %66, align 4, !tbaa !3 + br label %tmalloc_small.exit + +if.else184.i: ; preds = %if.end173.i + %or186.i = or i32 %cond, 3 + %head187.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 1 + store i32 %or186.i, i32* %head187.i, align 4, !tbaa !3 + %or188.i = or i32 %rsize.0.i, 1 + %add.ptr.sum.i173 = or i32 %cond, 4 + %head189.i = getelementptr inbounds i8* %38, i32 %add.ptr.sum.i173 + %68 = bitcast i8* %head189.i to i32* + store i32 %or188.i, i32* %68, align 4, !tbaa !3 + %add.ptr.sum1.i = add i32 %rsize.0.i, %cond + %add.ptr190.i = getelementptr inbounds i8* %38, i32 %add.ptr.sum1.i + %prev_foot.i = bitcast i8* %add.ptr190.i to i32* + store i32 %rsize.0.i, i32* %prev_foot.i, align 4, !tbaa !3 + %69 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %cmp191.i = icmp eq i32 %69, 0 + br i1 %cmp191.i, label %if.end221.i, label %if.then193.i + +if.then193.i: ; preds = %if.else184.i + %70 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %shr194.i = lshr i32 %69, 3 + %shl195.i = shl nuw nsw i32 %shr194.i, 1 + %arrayidx196.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl195.i + %71 = bitcast %struct.malloc_chunk** %arrayidx196.i to %struct.malloc_chunk* + %72 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shl198.i = shl i32 1, %shr194.i + %and199.i = and i32 %72, %shl198.i + %tobool200.i = icmp eq i32 %and199.i, 0 + br i1 %tobool200.i, label %if.then201.i, label %if.else205.i + +if.then201.i: ; preds = %if.then193.i + %or204.i = or i32 %72, %shl198.i + store i32 %or204.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %arrayidx196.sum.pre.i = add i32 %shl195.i, 2 + %.pre.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx196.sum.pre.i + br label %if.end216.i + +if.else205.i: ; preds = %if.then193.i + %arrayidx196.sum2.i = add i32 %shl195.i, 2 + %73 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx196.sum2.i + %74 = load %struct.malloc_chunk** %73, align 4, !tbaa !0 + %75 = bitcast %struct.malloc_chunk* %74 to i8* + %76 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp208.i = icmp ult i8* %75, %76 + br i1 %cmp208.i, label %if.else214.i, label %if.end216.i, !prof !6 + +if.else214.i: ; preds = %if.else205.i + tail call void @abort() #6 + unreachable + +if.end216.i: ; preds = %if.else205.i, %if.then201.i + %.pre-phi.i = phi %struct.malloc_chunk** [ %73, %if.else205.i ], [ %.pre.i, %if.then201.i ] + %F197.0.i = phi %struct.malloc_chunk* [ %74, %if.else205.i ], [ %71, %if.then201.i ] + store %struct.malloc_chunk* %70, %struct.malloc_chunk** %.pre-phi.i, align 4, !tbaa !0 + %bk218.i = getelementptr inbounds %struct.malloc_chunk* %F197.0.i, i32 0, i32 3 + store %struct.malloc_chunk* %70, %struct.malloc_chunk** %bk218.i, align 4, !tbaa !0 + %fd219.i = getelementptr inbounds %struct.malloc_chunk* %70, i32 0, i32 2 + store %struct.malloc_chunk* %F197.0.i, %struct.malloc_chunk** %fd219.i, align 4, !tbaa !0 + %bk220.i = getelementptr inbounds %struct.malloc_chunk* %70, i32 0, i32 3 + store %struct.malloc_chunk* %71, %struct.malloc_chunk** %bk220.i, align 4, !tbaa !0 + br label %if.end221.i + +if.end221.i: ; preds = %if.end216.i, %if.else184.i + store i32 %rsize.0.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + store %struct.malloc_chunk* %40, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + br label %tmalloc_small.exit + +if.end227.i: ; preds = %if.then34.i, %while.end.i + tail call void @abort() #6 + unreachable + +tmalloc_small.exit: ; preds = %if.end221.i, %if.then176.i + %add.ptr225.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.0.i, i32 0, i32 2 + %77 = bitcast %struct.malloc_tree_chunk** %add.ptr225.i to i8* + br label %postaction + +if.else137: ; preds = %entry + %cmp138 = icmp ugt i32 %bytes, -65 + br i1 %cmp138, label %if.end154, label %if.else141 + +if.else141: ; preds = %if.else137 + %add143 = add i32 %bytes, 11 + %and144 = and i32 %add143, -8 + %78 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %cmp145 = icmp eq i32 %78, 0 + br i1 %cmp145, label %if.end154, label %land.lhs.true147 + +land.lhs.true147: ; preds = %if.else141 + %sub.i105 = sub i32 0, %and144 + %shr.i106 = lshr i32 %add143, 8 + %cmp.i107 = icmp eq i32 %shr.i106, 0 + br i1 %cmp.i107, label %if.end23.i, label %if.else.i108 + +if.else.i108: ; preds = %land.lhs.true147 + %cmp1.i = icmp ugt i32 %and144, 16777215 + br i1 %cmp1.i, label %if.end23.i, label %if.else3.i + +if.else3.i: ; preds = %if.else.i108 + %sub4.i = add i32 %shr.i106, 1048320 + %shr5.i109 = lshr i32 %sub4.i, 16 + %and.i110 = and i32 %shr5.i109, 8 + %shl.i111 = shl i32 %shr.i106, %and.i110 + %sub6.i = add i32 %shl.i111, 520192 + %shr7.i112 = lshr i32 %sub6.i, 16 + %and8.i = and i32 %shr7.i112, 4 + %add.i113 = or i32 %and8.i, %and.i110 + %shl9.i = shl i32 %shl.i111, %and8.i + %sub10.i = add i32 %shl9.i, 245760 + %shr11.i114 = lshr i32 %sub10.i, 16 + %and12.i = and i32 %shr11.i114, 2 + %add13.i = or i32 %add.i113, %and12.i + %sub14.i = sub i32 14, %add13.i + %shl15.i = shl i32 %shl9.i, %and12.i + %shr16.i115 = lshr i32 %shl15.i, 15 + %add17.i = add i32 %sub14.i, %shr16.i115 + %shl18.i = shl nsw i32 %add17.i, 1 + %add19.i = add i32 %add17.i, 7 + %shr20.i = lshr i32 %and144, %add19.i + %and21.i116 = and i32 %shr20.i, 1 + %add22.i = or i32 %and21.i116, %shl18.i + br label %if.end23.i + +if.end23.i: ; preds = %if.else3.i, %if.else.i108, %land.lhs.true147 + %idx.0.i = phi i32 [ %add22.i, %if.else3.i ], [ 0, %land.lhs.true147 ], [ 31, %if.else.i108 ] + %arrayidx.i117 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %idx.0.i + %79 = load %struct.malloc_tree_chunk** %arrayidx.i117, align 4, !tbaa !0 + %cmp24.i = icmp eq %struct.malloc_tree_chunk* %79, null + br i1 %cmp24.i, label %if.end53.i, label %if.then25.i + +if.then25.i: ; preds = %if.end23.i + %cmp26.i = icmp eq i32 %idx.0.i, 31 + br i1 %cmp26.i, label %cond.end.i118, label %cond.false.i + +cond.false.i: ; preds = %if.then25.i + %shr27.i = lshr i32 %idx.0.i, 1 + %sub30.i = sub i32 25, %shr27.i + br label %cond.end.i118 + +cond.end.i118: ; preds = %cond.false.i, %if.then25.i + %cond.i = phi i32 [ %sub30.i, %cond.false.i ], [ 0, %if.then25.i ] + %shl31.i = shl i32 %and144, %cond.i + br label %for.cond.i + +for.cond.i: ; preds = %if.end39.i, %cond.end.i118 + %rst.0.i = phi %struct.malloc_tree_chunk* [ null, %cond.end.i118 ], [ %rst.1.i, %if.end39.i ] + %sizebits.0.i = phi i32 [ %shl31.i, %cond.end.i118 ], [ %shl52.i, %if.end39.i ] + %t.0.i119 = phi %struct.malloc_tree_chunk* [ %79, %cond.end.i118 ], [ %82, %if.end39.i ] + %rsize.0.i120 = phi i32 [ %sub.i105, %cond.end.i118 ], [ %rsize.1.i, %if.end39.i ] + %v.0.i121 = phi %struct.malloc_tree_chunk* [ null, %cond.end.i118 ], [ %v.1.i, %if.end39.i ] + %head.i122 = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i119, i32 0, i32 1 + %80 = load i32* %head.i122, align 4, !tbaa !3 + %and32.i = and i32 %80, -8 + %sub33.i = sub i32 %and32.i, %and144 + %cmp34.i = icmp ult i32 %sub33.i, %rsize.0.i120 + br i1 %cmp34.i, label %if.then35.i, label %if.end39.i + +if.then35.i: ; preds = %for.cond.i + %cmp36.i = icmp eq i32 %and32.i, %and144 + br i1 %cmp36.i, label %if.end53.i, label %if.end39.i + +if.end39.i: ; preds = %if.then35.i, %for.cond.i + %rsize.1.i = phi i32 [ %sub33.i, %if.then35.i ], [ %rsize.0.i120, %for.cond.i ] + %v.1.i = phi %struct.malloc_tree_chunk* [ %t.0.i119, %if.then35.i ], [ %v.0.i121, %for.cond.i ] + %arrayidx40.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i119, i32 0, i32 4, i32 1 + %81 = load %struct.malloc_tree_chunk** %arrayidx40.i, align 4, !tbaa !0 + %shr41.i = lshr i32 %sizebits.0.i, 31 + %arrayidx44.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.0.i119, i32 0, i32 4, i32 %shr41.i + %82 = load %struct.malloc_tree_chunk** %arrayidx44.i, align 4, !tbaa !0 + %cmp45.i123 = icmp eq %struct.malloc_tree_chunk* %81, null + %cmp46.i = icmp eq %struct.malloc_tree_chunk* %81, %82 + %or.cond.i = or i1 %cmp45.i123, %cmp46.i + %rst.1.i = select i1 %or.cond.i, %struct.malloc_tree_chunk* %rst.0.i, %struct.malloc_tree_chunk* %81 + %cmp49.i = icmp eq %struct.malloc_tree_chunk* %82, null + %shl52.i = shl i32 %sizebits.0.i, 1 + br i1 %cmp49.i, label %if.end53.i, label %for.cond.i + +if.end53.i: ; preds = %if.end39.i, %if.then35.i, %if.end23.i + %t.1.i = phi %struct.malloc_tree_chunk* [ null, %if.end23.i ], [ %rst.1.i, %if.end39.i ], [ %t.0.i119, %if.then35.i ] + %rsize.2.i = phi i32 [ %sub.i105, %if.end23.i ], [ %rsize.1.i, %if.end39.i ], [ %sub33.i, %if.then35.i ] + %v.2.i = phi %struct.malloc_tree_chunk* [ null, %if.end23.i ], [ %v.1.i, %if.end39.i ], [ %t.0.i119, %if.then35.i ] + %cmp54.i = icmp eq %struct.malloc_tree_chunk* %t.1.i, null + %cmp56.i = icmp eq %struct.malloc_tree_chunk* %v.2.i, null + %or.cond16.i = and i1 %cmp54.i, %cmp56.i + br i1 %or.cond16.i, label %if.then57.i, label %while.cond.preheader.i + +if.then57.i: ; preds = %if.end53.i + %shl59.i = shl i32 2, %idx.0.i + %sub62.i = sub i32 0, %shl59.i + %or.i = or i32 %shl59.i, %sub62.i + %and63.i = and i32 %78, %or.i + %cmp64.i = icmp eq i32 %and63.i, 0 + br i1 %cmp64.i, label %if.end154, label %if.then65.i + +if.then65.i: ; preds = %if.then57.i + %sub66.i = sub i32 0, %and63.i + %and67.i = and i32 %and63.i, %sub66.i + %sub69.i = add i32 %and67.i, -1 + %shr71.i = lshr i32 %sub69.i, 12 + %and72.i = and i32 %shr71.i, 16 + %shr74.i = lshr i32 %sub69.i, %and72.i + %shr75.i = lshr i32 %shr74.i, 5 + %and76.i = and i32 %shr75.i, 8 + %add77.i = or i32 %and76.i, %and72.i + %shr78.i = lshr i32 %shr74.i, %and76.i + %shr79.i = lshr i32 %shr78.i, 2 + %and80.i = and i32 %shr79.i, 4 + %add81.i = or i32 %add77.i, %and80.i + %shr82.i = lshr i32 %shr78.i, %and80.i + %shr83.i = lshr i32 %shr82.i, 1 + %and84.i = and i32 %shr83.i, 2 + %add85.i = or i32 %add81.i, %and84.i + %shr86.i = lshr i32 %shr82.i, %and84.i + %shr87.i = lshr i32 %shr86.i, 1 + %and88.i = and i32 %shr87.i, 1 + %add89.i = or i32 %add85.i, %and88.i + %shr90.i = lshr i32 %shr86.i, %and88.i + %add91.i = add i32 %add89.i, %shr90.i + %arrayidx93.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %add91.i + %83 = load %struct.malloc_tree_chunk** %arrayidx93.i, align 4, !tbaa !0 + br label %while.cond.preheader.i + +while.cond.preheader.i: ; preds = %if.then65.i, %if.end53.i + %t.2.ph.i = phi %struct.malloc_tree_chunk* [ %t.1.i, %if.end53.i ], [ %83, %if.then65.i ] + %cmp9626.i = icmp eq %struct.malloc_tree_chunk* %t.2.ph.i, null + br i1 %cmp9626.i, label %while.end.i125, label %while.body.i124 + +while.body.i124: ; preds = %while.cond.backedge.i, %while.body.i124, %while.cond.preheader.i + %v.329.i = phi %struct.malloc_tree_chunk* [ %v.2.i, %while.cond.preheader.i ], [ %t.2.v.3.i, %while.body.i124 ], [ %t.2.v.3.i, %while.cond.backedge.i ] + %rsize.328.i = phi i32 [ %rsize.2.i, %while.cond.preheader.i ], [ %sub100.rsize.3.i, %while.body.i124 ], [ %sub100.rsize.3.i, %while.cond.backedge.i ] + %t.227.i = phi %struct.malloc_tree_chunk* [ %t.2.ph.i, %while.cond.preheader.i ], [ %85, %while.body.i124 ], [ %86, %while.cond.backedge.i ] + %head98.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.227.i, i32 0, i32 1 + %84 = load i32* %head98.i, align 4, !tbaa !3 + %and99.i = and i32 %84, -8 + %sub100.i = sub i32 %and99.i, %and144 + %cmp101.i = icmp ult i32 %sub100.i, %rsize.328.i + %sub100.rsize.3.i = select i1 %cmp101.i, i32 %sub100.i, i32 %rsize.328.i + %t.2.v.3.i = select i1 %cmp101.i, %struct.malloc_tree_chunk* %t.227.i, %struct.malloc_tree_chunk* %v.329.i + %arrayidx105.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.227.i, i32 0, i32 4, i32 0 + %85 = load %struct.malloc_tree_chunk** %arrayidx105.i, align 4, !tbaa !0 + %cmp106.i = icmp eq %struct.malloc_tree_chunk* %85, null + br i1 %cmp106.i, label %while.cond.backedge.i, label %while.body.i124 + +while.cond.backedge.i: ; preds = %while.body.i124 + %arrayidx112.i = getelementptr inbounds %struct.malloc_tree_chunk* %t.227.i, i32 0, i32 4, i32 1 + %86 = load %struct.malloc_tree_chunk** %arrayidx112.i, align 4, !tbaa !0 + %cmp96.i = icmp eq %struct.malloc_tree_chunk* %86, null + br i1 %cmp96.i, label %while.end.i125, label %while.body.i124 + +while.end.i125: ; preds = %while.cond.backedge.i, %while.cond.preheader.i + %v.3.lcssa.i = phi %struct.malloc_tree_chunk* [ %v.2.i, %while.cond.preheader.i ], [ %t.2.v.3.i, %while.cond.backedge.i ] + %rsize.3.lcssa.i = phi i32 [ %rsize.2.i, %while.cond.preheader.i ], [ %sub100.rsize.3.i, %while.cond.backedge.i ] + %cmp115.i = icmp eq %struct.malloc_tree_chunk* %v.3.lcssa.i, null + br i1 %cmp115.i, label %if.end154, label %land.lhs.true116.i + +land.lhs.true116.i: ; preds = %while.end.i125 + %87 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %sub117.i = sub i32 %87, %and144 + %cmp118.i = icmp ult i32 %rsize.3.lcssa.i, %sub117.i + br i1 %cmp118.i, label %if.then119.i, label %if.end154 + +if.then119.i: ; preds = %land.lhs.true116.i + %88 = bitcast %struct.malloc_tree_chunk* %v.3.lcssa.i to i8* + %89 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp120.i = icmp ult i8* %88, %89 + br i1 %cmp120.i, label %if.end438.i, label %if.then121.i, !prof !6 + +if.then121.i: ; preds = %if.then119.i + %add.ptr.i126 = getelementptr inbounds i8* %88, i32 %and144 + %90 = bitcast i8* %add.ptr.i126 to %struct.malloc_chunk* + %cmp122.i = icmp ult i8* %88, %add.ptr.i126 + br i1 %cmp122.i, label %if.then126.i, label %if.end438.i, !prof !5 + +if.then126.i: ; preds = %if.then121.i + %parent.i127 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 5 + %91 = load %struct.malloc_tree_chunk** %parent.i127, align 4, !tbaa !0 + %bk.i128 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 3 + %92 = load %struct.malloc_tree_chunk** %bk.i128, align 4, !tbaa !0 + %cmp127.i = icmp eq %struct.malloc_tree_chunk* %92, %v.3.lcssa.i + br i1 %cmp127.i, label %if.else148.i, label %if.then129.i + +if.then129.i: ; preds = %if.then126.i + %fd.i129 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 2 + %93 = load %struct.malloc_tree_chunk** %fd.i129, align 4, !tbaa !0 + %94 = bitcast %struct.malloc_tree_chunk* %93 to i8* + %cmp132.i = icmp ult i8* %94, %89 + br i1 %cmp132.i, label %if.else146.i, label %land.lhs.true134.i + +land.lhs.true134.i: ; preds = %if.then129.i + %bk135.i = getelementptr inbounds %struct.malloc_tree_chunk* %93, i32 0, i32 3 + %95 = load %struct.malloc_tree_chunk** %bk135.i, align 4, !tbaa !0 + %cmp136.i = icmp eq %struct.malloc_tree_chunk* %95, %v.3.lcssa.i + br i1 %cmp136.i, label %land.rhs.i130, label %if.else146.i + +land.rhs.i130: ; preds = %land.lhs.true134.i + %fd138.i = getelementptr inbounds %struct.malloc_tree_chunk* %92, i32 0, i32 2 + %96 = load %struct.malloc_tree_chunk** %fd138.i, align 4, !tbaa !0 + %cmp139.i = icmp eq %struct.malloc_tree_chunk* %96, %v.3.lcssa.i + br i1 %cmp139.i, label %if.then143.i, label %if.else146.i, !prof !5 + +if.then143.i: ; preds = %land.rhs.i130 + store %struct.malloc_tree_chunk* %92, %struct.malloc_tree_chunk** %bk135.i, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %93, %struct.malloc_tree_chunk** %fd138.i, align 4, !tbaa !0 + br label %if.end178.i + +if.else146.i: ; preds = %land.rhs.i130, %land.lhs.true134.i, %if.then129.i + tail call void @abort() #6 + unreachable + +if.else148.i: ; preds = %if.then126.i + %arrayidx150.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 1 + %97 = load %struct.malloc_tree_chunk** %arrayidx150.i, align 4, !tbaa !0 + %cmp151.i = icmp eq %struct.malloc_tree_chunk* %97, null + br i1 %cmp151.i, label %lor.lhs.false.i133, label %while.cond158.i + +lor.lhs.false.i133: ; preds = %if.else148.i + %arrayidx154.i131 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 0 + %98 = load %struct.malloc_tree_chunk** %arrayidx154.i131, align 4, !tbaa !0 + %cmp155.i132 = icmp eq %struct.malloc_tree_chunk* %98, null + br i1 %cmp155.i132, label %if.end178.i, label %while.cond158.i + +while.cond158.i: ; preds = %lor.rhs.i136, %while.cond158.i, %lor.lhs.false.i133, %if.else148.i + %RP.0.i134 = phi %struct.malloc_tree_chunk** [ %arrayidx154.i131, %lor.lhs.false.i133 ], [ %arrayidx150.i, %if.else148.i ], [ %arrayidx160.i, %while.cond158.i ], [ %arrayidx164.i, %lor.rhs.i136 ] + %R.0.i135 = phi %struct.malloc_tree_chunk* [ %98, %lor.lhs.false.i133 ], [ %97, %if.else148.i ], [ %99, %while.cond158.i ], [ %100, %lor.rhs.i136 ] + %arrayidx160.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i135, i32 0, i32 4, i32 1 + %99 = load %struct.malloc_tree_chunk** %arrayidx160.i, align 4, !tbaa !0 + %cmp161.i = icmp eq %struct.malloc_tree_chunk* %99, null + br i1 %cmp161.i, label %lor.rhs.i136, label %while.cond158.i + +lor.rhs.i136: ; preds = %while.cond158.i + %arrayidx164.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i135, i32 0, i32 4, i32 0 + %100 = load %struct.malloc_tree_chunk** %arrayidx164.i, align 4, !tbaa !0 + %cmp165.i = icmp eq %struct.malloc_tree_chunk* %100, null + br i1 %cmp165.i, label %while.end168.i, label %while.cond158.i + +while.end168.i: ; preds = %lor.rhs.i136 + %101 = bitcast %struct.malloc_tree_chunk** %RP.0.i134 to i8* + %cmp170.i = icmp ult i8* %101, %89 + br i1 %cmp170.i, label %if.else175.i, label %if.then174.i, !prof !6 + +if.then174.i: ; preds = %while.end168.i + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i134, align 4, !tbaa !0 + br label %if.end178.i + +if.else175.i: ; preds = %while.end168.i + tail call void @abort() #6 + unreachable + +if.end178.i: ; preds = %if.then174.i, %lor.lhs.false.i133, %if.then143.i + %R.1.i137 = phi %struct.malloc_tree_chunk* [ %92, %if.then143.i ], [ %R.0.i135, %if.then174.i ], [ null, %lor.lhs.false.i133 ] + %cmp179.i = icmp eq %struct.malloc_tree_chunk* %91, null + br i1 %cmp179.i, label %if.end263.i, label %if.then181.i + +if.then181.i: ; preds = %if.end178.i + %index.i138 = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 6 + %102 = load i32* %index.i138, align 4, !tbaa !3 + %arrayidx183.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %102 + %103 = load %struct.malloc_tree_chunk** %arrayidx183.i, align 4, !tbaa !0 + %cmp184.i = icmp eq %struct.malloc_tree_chunk* %v.3.lcssa.i, %103 + br i1 %cmp184.i, label %if.then186.i, label %if.else195.i + +if.then186.i: ; preds = %if.then181.i + store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %arrayidx183.i, align 4, !tbaa !0 + %cond18.i = icmp eq %struct.malloc_tree_chunk* %R.1.i137, null + br i1 %cond18.i, label %if.end215.thread.i, label %if.then218.i + +if.end215.thread.i: ; preds = %if.then186.i + %shl191.i = shl i32 1, %102 + %neg.i139 = xor i32 %shl191.i, -1 + %104 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and193.i = and i32 %104, %neg.i139 + store i32 %and193.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end263.i + +if.else195.i: ; preds = %if.then181.i + %105 = bitcast %struct.malloc_tree_chunk* %91 to i8* + %106 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp197.i = icmp ult i8* %105, %106 + br i1 %cmp197.i, label %if.else213.i, label %if.then201.i140, !prof !6 + +if.then201.i140: ; preds = %if.else195.i + %arrayidx203.i = getelementptr inbounds %struct.malloc_tree_chunk* %91, i32 0, i32 4, i32 0 + %107 = load %struct.malloc_tree_chunk** %arrayidx203.i, align 4, !tbaa !0 + %cmp204.i = icmp eq %struct.malloc_tree_chunk* %107, %v.3.lcssa.i + br i1 %cmp204.i, label %if.then206.i, label %if.else209.i + +if.then206.i: ; preds = %if.then201.i140 + store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %arrayidx203.i, align 4, !tbaa !0 + br label %if.end215.i + +if.else209.i: ; preds = %if.then201.i140 + %arrayidx211.i = getelementptr inbounds %struct.malloc_tree_chunk* %91, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %arrayidx211.i, align 4, !tbaa !0 + br label %if.end215.i + +if.else213.i: ; preds = %if.else195.i + tail call void @abort() #6 + unreachable + +if.end215.i: ; preds = %if.else209.i, %if.then206.i + %cmp216.i = icmp eq %struct.malloc_tree_chunk* %R.1.i137, null + br i1 %cmp216.i, label %if.end263.i, label %if.then218.i + +if.then218.i: ; preds = %if.end215.i, %if.then186.i + %108 = bitcast %struct.malloc_tree_chunk* %R.1.i137 to i8* + %109 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp220.i = icmp ult i8* %108, %109 + br i1 %cmp220.i, label %if.else260.i, label %if.then224.i, !prof !6 + +if.then224.i: ; preds = %if.then218.i + %parent225.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i137, i32 0, i32 5 + store %struct.malloc_tree_chunk* %91, %struct.malloc_tree_chunk** %parent225.i, align 4, !tbaa !0 + %arrayidx227.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 0 + %110 = load %struct.malloc_tree_chunk** %arrayidx227.i, align 4, !tbaa !0 + %cmp228.i = icmp eq %struct.malloc_tree_chunk* %110, null + br i1 %cmp228.i, label %if.end242.i, label %if.then230.i + +if.then230.i: ; preds = %if.then224.i + %111 = bitcast %struct.malloc_tree_chunk* %110 to i8* + %112 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp232.i = icmp ult i8* %111, %112 + br i1 %cmp232.i, label %if.else240.i, label %if.then236.i, !prof !6 + +if.then236.i: ; preds = %if.then230.i + %arrayidx238.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i137, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %110, %struct.malloc_tree_chunk** %arrayidx238.i, align 4, !tbaa !0 + %parent239.i = getelementptr inbounds %struct.malloc_tree_chunk* %110, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %parent239.i, align 4, !tbaa !0 + br label %if.end242.i + +if.else240.i: ; preds = %if.then230.i + tail call void @abort() #6 + unreachable + +if.end242.i: ; preds = %if.then236.i, %if.then224.i + %arrayidx244.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 4, i32 1 + %113 = load %struct.malloc_tree_chunk** %arrayidx244.i, align 4, !tbaa !0 + %cmp245.i = icmp eq %struct.malloc_tree_chunk* %113, null + br i1 %cmp245.i, label %if.end263.i, label %if.then247.i + +if.then247.i: ; preds = %if.end242.i + %114 = bitcast %struct.malloc_tree_chunk* %113 to i8* + %115 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp249.i = icmp ult i8* %114, %115 + br i1 %cmp249.i, label %if.else257.i, label %if.then253.i, !prof !6 + +if.then253.i: ; preds = %if.then247.i + %arrayidx255.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i137, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %arrayidx255.i, align 4, !tbaa !0 + %parent256.i = getelementptr inbounds %struct.malloc_tree_chunk* %113, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1.i137, %struct.malloc_tree_chunk** %parent256.i, align 4, !tbaa !0 + br label %if.end263.i + +if.else257.i: ; preds = %if.then247.i + tail call void @abort() #6 + unreachable + +if.else260.i: ; preds = %if.then218.i + tail call void @abort() #6 + unreachable + +if.end263.i: ; preds = %if.then253.i, %if.end242.i, %if.end215.i, %if.end215.thread.i, %if.end178.i + %cmp264.i = icmp ult i32 %rsize.3.lcssa.i, 16 + br i1 %cmp264.i, label %if.then266.i, label %if.else275.i + +if.then266.i: ; preds = %if.end263.i + %add267.i = add i32 %rsize.3.lcssa.i, %and144 + %or269.i = or i32 %add267.i, 3 + %head270.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 1 + store i32 %or269.i, i32* %head270.i, align 4, !tbaa !3 + %add.ptr272.sum.i = add i32 %add267.i, 4 + %head273.i = getelementptr inbounds i8* %88, i32 %add.ptr272.sum.i + %116 = bitcast i8* %head273.i to i32* + %117 = load i32* %116, align 4, !tbaa !3 + %or274.i = or i32 %117, 1 + store i32 %or274.i, i32* %116, align 4, !tbaa !3 + br label %tmalloc_large.exit + +if.else275.i: ; preds = %if.end263.i + %or277.i = or i32 %and144, 3 + %head278.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 1 + store i32 %or277.i, i32* %head278.i, align 4, !tbaa !3 + %or279.i = or i32 %rsize.3.lcssa.i, 1 + %add.ptr.sum.i141172 = or i32 %and144, 4 + %head280.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum.i141172 + %118 = bitcast i8* %head280.i to i32* + store i32 %or279.i, i32* %118, align 4, !tbaa !3 + %add.ptr.sum1.i142 = add i32 %rsize.3.lcssa.i, %and144 + %add.ptr281.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum1.i142 + %prev_foot.i143 = bitcast i8* %add.ptr281.i to i32* + store i32 %rsize.3.lcssa.i, i32* %prev_foot.i143, align 4, !tbaa !3 + %shr282.i = lshr i32 %rsize.3.lcssa.i, 3 + %cmp283.i = icmp ult i32 %rsize.3.lcssa.i, 256 + br i1 %cmp283.i, label %if.then285.i, label %if.else313.i + +if.then285.i: ; preds = %if.else275.i + %shl287.i = shl nuw nsw i32 %shr282.i, 1 + %arrayidx288.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl287.i + %119 = bitcast %struct.malloc_chunk** %arrayidx288.i to %struct.malloc_chunk* + %120 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shl290.i = shl i32 1, %shr282.i + %and291.i = and i32 %120, %shl290.i + %tobool292.i = icmp eq i32 %and291.i, 0 + br i1 %tobool292.i, label %if.then293.i, label %if.else297.i + +if.then293.i: ; preds = %if.then285.i + %or296.i = or i32 %120, %shl290.i + store i32 %or296.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %arrayidx288.sum.pre.i = add i32 %shl287.i, 2 + %.pre.i144 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx288.sum.pre.i + br label %if.end308.i + +if.else297.i: ; preds = %if.then285.i + %arrayidx288.sum15.i = add i32 %shl287.i, 2 + %121 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx288.sum15.i + %122 = load %struct.malloc_chunk** %121, align 4, !tbaa !0 + %123 = bitcast %struct.malloc_chunk* %122 to i8* + %124 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp300.i = icmp ult i8* %123, %124 + br i1 %cmp300.i, label %if.else306.i, label %if.end308.i, !prof !6 + +if.else306.i: ; preds = %if.else297.i + tail call void @abort() #6 + unreachable + +if.end308.i: ; preds = %if.else297.i, %if.then293.i + %.pre-phi.i145 = phi %struct.malloc_chunk** [ %121, %if.else297.i ], [ %.pre.i144, %if.then293.i ] + %F289.0.i = phi %struct.malloc_chunk* [ %122, %if.else297.i ], [ %119, %if.then293.i ] + store %struct.malloc_chunk* %90, %struct.malloc_chunk** %.pre-phi.i145, align 4, !tbaa !0 + %bk310.i = getelementptr inbounds %struct.malloc_chunk* %F289.0.i, i32 0, i32 3 + store %struct.malloc_chunk* %90, %struct.malloc_chunk** %bk310.i, align 4, !tbaa !0 + %add.ptr.sum13.i = add i32 %and144, 8 + %fd311.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum13.i + %125 = bitcast i8* %fd311.i to %struct.malloc_chunk** + store %struct.malloc_chunk* %F289.0.i, %struct.malloc_chunk** %125, align 4, !tbaa !0 + %add.ptr.sum14.i = add i32 %and144, 12 + %bk312.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum14.i + %126 = bitcast i8* %bk312.i to %struct.malloc_chunk** + store %struct.malloc_chunk* %119, %struct.malloc_chunk** %126, align 4, !tbaa !0 + br label %tmalloc_large.exit + +if.else313.i: ; preds = %if.else275.i + %127 = bitcast i8* %add.ptr.i126 to %struct.malloc_tree_chunk* + %shr317.i = lshr i32 %rsize.3.lcssa.i, 8 + %cmp318.i = icmp eq i32 %shr317.i, 0 + br i1 %cmp318.i, label %if.end352.i, label %if.else321.i + +if.else321.i: ; preds = %if.else313.i + %cmp322.i = icmp ugt i32 %rsize.3.lcssa.i, 16777215 + br i1 %cmp322.i, label %if.end352.i, label %if.else325.i + +if.else325.i: ; preds = %if.else321.i + %sub328.i = add i32 %shr317.i, 1048320 + %shr329.i = lshr i32 %sub328.i, 16 + %and330.i = and i32 %shr329.i, 8 + %shl332.i = shl i32 %shr317.i, %and330.i + %sub333.i = add i32 %shl332.i, 520192 + %shr334.i = lshr i32 %sub333.i, 16 + %and335.i = and i32 %shr334.i, 4 + %add336.i = or i32 %and335.i, %and330.i + %shl337.i = shl i32 %shl332.i, %and335.i + %sub338.i = add i32 %shl337.i, 245760 + %shr339.i = lshr i32 %sub338.i, 16 + %and340.i = and i32 %shr339.i, 2 + %add341.i = or i32 %add336.i, %and340.i + %sub342.i = sub i32 14, %add341.i + %shl343.i = shl i32 %shl337.i, %and340.i + %shr344.i = lshr i32 %shl343.i, 15 + %add345.i = add i32 %sub342.i, %shr344.i + %shl346.i = shl nsw i32 %add345.i, 1 + %add347.i = add i32 %add345.i, 7 + %shr348.i = lshr i32 %rsize.3.lcssa.i, %add347.i + %and349.i = and i32 %shr348.i, 1 + %add350.i = or i32 %and349.i, %shl346.i + br label %if.end352.i + +if.end352.i: ; preds = %if.else325.i, %if.else321.i, %if.else313.i + %I315.0.i = phi i32 [ %add350.i, %if.else325.i ], [ 0, %if.else313.i ], [ 31, %if.else321.i ] + %arrayidx354.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I315.0.i + %add.ptr.sum2.i = add i32 %and144, 28 + %index355.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum2.i + %128 = bitcast i8* %index355.i to i32* + store i32 %I315.0.i, i32* %128, align 4, !tbaa !3 + %add.ptr.sum3.i = add i32 %and144, 16 + %child356.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum3.i + %child356.sum.i = add i32 %and144, 20 + %arrayidx357.i = getelementptr inbounds i8* %88, i32 %child356.sum.i + %129 = bitcast i8* %arrayidx357.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %129, align 4, !tbaa !0 + %arrayidx359.i = bitcast i8* %child356.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %arrayidx359.i, align 4, !tbaa !0 + %130 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %shl361.i = shl i32 1, %I315.0.i + %and362.i = and i32 %130, %shl361.i + %tobool363.i = icmp eq i32 %and362.i, 0 + br i1 %tobool363.i, label %if.then364.i, label %if.else371.i + +if.then364.i: ; preds = %if.end352.i + %or367.i = or i32 %130, %shl361.i + store i32 %or367.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %arrayidx354.i, align 4, !tbaa !0 + %131 = bitcast %struct.malloc_tree_chunk** %arrayidx354.i to %struct.malloc_tree_chunk* + %add.ptr.sum4.i = add i32 %and144, 24 + %parent368.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum4.i + %132 = bitcast i8* %parent368.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %131, %struct.malloc_tree_chunk** %132, align 4, !tbaa !0 + %add.ptr.sum5.i = add i32 %and144, 12 + %bk369.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum5.i + %133 = bitcast i8* %bk369.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %133, align 4, !tbaa !0 + %add.ptr.sum6.i = add i32 %and144, 8 + %fd370.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum6.i + %134 = bitcast i8* %fd370.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %134, align 4, !tbaa !0 + br label %tmalloc_large.exit + +if.else371.i: ; preds = %if.end352.i + %135 = load %struct.malloc_tree_chunk** %arrayidx354.i, align 4, !tbaa !0 + %cmp373.i = icmp eq i32 %I315.0.i, 31 + br i1 %cmp373.i, label %cond.end381.i, label %cond.false376.i + +cond.false376.i: ; preds = %if.else371.i + %shr377.i = lshr i32 %I315.0.i, 1 + %sub380.i = sub i32 25, %shr377.i + br label %cond.end381.i + +cond.end381.i: ; preds = %cond.false376.i, %if.else371.i + %cond382.i = phi i32 [ %sub380.i, %cond.false376.i ], [ 0, %if.else371.i ] + %head38520.i = getelementptr inbounds %struct.malloc_tree_chunk* %135, i32 0, i32 1 + %136 = load i32* %head38520.i, align 4, !tbaa !3 + %and38621.i = and i32 %136, -8 + %cmp38722.i = icmp eq i32 %and38621.i, %rsize.3.lcssa.i + br i1 %cmp38722.i, label %if.else410.i, label %if.then389.lr.ph.i + +if.then389.lr.ph.i: ; preds = %cond.end381.i + %shl383.i = shl i32 %rsize.3.lcssa.i, %cond382.i + br label %if.then389.i + +for.cond384.i: ; preds = %if.then389.i + %shl394.i = shl i32 %K372.024.i, 1 + %head385.i = getelementptr inbounds %struct.malloc_tree_chunk* %138, i32 0, i32 1 + %137 = load i32* %head385.i, align 4, !tbaa !3 + %and386.i = and i32 %137, -8 + %cmp387.i = icmp eq i32 %and386.i, %rsize.3.lcssa.i + br i1 %cmp387.i, label %if.else410.i, label %if.then389.i + +if.then389.i: ; preds = %for.cond384.i, %if.then389.lr.ph.i + %K372.024.i = phi i32 [ %shl383.i, %if.then389.lr.ph.i ], [ %shl394.i, %for.cond384.i ] + %T.023.i = phi %struct.malloc_tree_chunk* [ %135, %if.then389.lr.ph.i ], [ %138, %for.cond384.i ] + %shr390.i = lshr i32 %K372.024.i, 31 + %arrayidx393.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.023.i, i32 0, i32 4, i32 %shr390.i + %138 = load %struct.malloc_tree_chunk** %arrayidx393.i, align 4, !tbaa !0 + %cmp395.i = icmp eq %struct.malloc_tree_chunk* %138, null + br i1 %cmp395.i, label %if.else398.i, label %for.cond384.i + +if.else398.i: ; preds = %if.then389.i + %139 = bitcast %struct.malloc_tree_chunk** %arrayidx393.i to i8* + %140 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp400.i = icmp ult i8* %139, %140 + br i1 %cmp400.i, label %if.else408.i, label %if.then404.i, !prof !6 + +if.then404.i: ; preds = %if.else398.i + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %arrayidx393.i, align 4, !tbaa !0 + %add.ptr.sum10.i = add i32 %and144, 24 + %parent405.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum10.i + %141 = bitcast i8* %parent405.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %T.023.i, %struct.malloc_tree_chunk** %141, align 4, !tbaa !0 + %add.ptr.sum11.i = add i32 %and144, 12 + %bk406.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum11.i + %142 = bitcast i8* %bk406.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %142, align 4, !tbaa !0 + %add.ptr.sum12.i = add i32 %and144, 8 + %fd407.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum12.i + %143 = bitcast i8* %fd407.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %143, align 4, !tbaa !0 + br label %tmalloc_large.exit + +if.else408.i: ; preds = %if.else398.i + tail call void @abort() #6 + unreachable + +if.else410.i: ; preds = %for.cond384.i, %cond.end381.i + %T.0.lcssa.i = phi %struct.malloc_tree_chunk* [ %135, %cond.end381.i ], [ %138, %for.cond384.i ] + %fd412.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa.i, i32 0, i32 2 + %144 = load %struct.malloc_tree_chunk** %fd412.i, align 4, !tbaa !0 + %145 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i to i8* + %146 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp414.i = icmp ult i8* %145, %146 + br i1 %cmp414.i, label %if.else430.i, label %land.rhs416.i + +land.rhs416.i: ; preds = %if.else410.i + %147 = bitcast %struct.malloc_tree_chunk* %144 to i8* + %cmp418.i = icmp ult i8* %147, %146 + br i1 %cmp418.i, label %if.else430.i, label %if.then424.i, !prof !6 + +if.then424.i: ; preds = %land.rhs416.i + %bk425.i = getelementptr inbounds %struct.malloc_tree_chunk* %144, i32 0, i32 3 + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %bk425.i, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %127, %struct.malloc_tree_chunk** %fd412.i, align 4, !tbaa !0 + %add.ptr.sum7.i = add i32 %and144, 8 + %fd427.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum7.i + %148 = bitcast i8* %fd427.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %144, %struct.malloc_tree_chunk** %148, align 4, !tbaa !0 + %add.ptr.sum8.i = add i32 %and144, 12 + %bk428.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum8.i + %149 = bitcast i8* %bk428.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %T.0.lcssa.i, %struct.malloc_tree_chunk** %149, align 4, !tbaa !0 + %add.ptr.sum9.i = add i32 %and144, 24 + %parent429.i = getelementptr inbounds i8* %88, i32 %add.ptr.sum9.i + %150 = bitcast i8* %parent429.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %150, align 4, !tbaa !0 + br label %tmalloc_large.exit + +if.else430.i: ; preds = %land.rhs416.i, %if.else410.i + tail call void @abort() #6 + unreachable + +if.end438.i: ; preds = %if.then121.i, %if.then119.i + tail call void @abort() #6 + unreachable + +tmalloc_large.exit: ; preds = %if.then424.i, %if.then404.i, %if.then364.i, %if.end308.i, %if.then266.i + %add.ptr436.i = getelementptr inbounds %struct.malloc_tree_chunk* %v.3.lcssa.i, i32 0, i32 2 + %151 = bitcast %struct.malloc_tree_chunk** %add.ptr436.i to i8* + br label %postaction + +if.end154: ; preds = %land.lhs.true116.i, %while.end.i125, %if.then57.i, %if.else141, %if.else137, %if.else127, %if.else28 + %nb.0 = phi i32 [ %cond, %if.else127 ], [ %cond, %if.else28 ], [ -1, %if.else137 ], [ %and144, %if.else141 ], [ %and144, %while.end.i125 ], [ %and144, %land.lhs.true116.i ], [ %and144, %if.then57.i ] + %152 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %cmp155 = icmp ugt i32 %nb.0, %152 + br i1 %cmp155, label %if.else182, label %if.then157 + +if.then157: ; preds = %if.end154 + %sub159 = sub i32 %152, %nb.0 + %153 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp161 = icmp ugt i32 %sub159, 15 + br i1 %cmp161, label %if.then163, label %if.else173 + +if.then163: ; preds = %if.then157 + %154 = bitcast %struct.malloc_chunk* %153 to i8* + %add.ptr165 = getelementptr inbounds i8* %154, i32 %nb.0 + %155 = bitcast i8* %add.ptr165 to %struct.malloc_chunk* + store %struct.malloc_chunk* %155, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + store i32 %sub159, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %or166 = or i32 %sub159, 1 + %add.ptr165.sum = add i32 %nb.0, 4 + %head167 = getelementptr inbounds i8* %154, i32 %add.ptr165.sum + %156 = bitcast i8* %head167 to i32* + store i32 %or166, i32* %156, align 4, !tbaa !3 + %add.ptr168 = getelementptr inbounds i8* %154, i32 %152 + %prev_foot169 = bitcast i8* %add.ptr168 to i32* + store i32 %sub159, i32* %prev_foot169, align 4, !tbaa !3 + %or171 = or i32 %nb.0, 3 + %head172 = getelementptr inbounds %struct.malloc_chunk* %153, i32 0, i32 1 + store i32 %or171, i32* %head172, align 4, !tbaa !3 + br label %if.end180 + +if.else173: ; preds = %if.then157 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %or175 = or i32 %152, 3 + %head176 = getelementptr inbounds %struct.malloc_chunk* %153, i32 0, i32 1 + store i32 %or175, i32* %head176, align 4, !tbaa !3 + %157 = bitcast %struct.malloc_chunk* %153 to i8* + %add.ptr177.sum = add i32 %152, 4 + %head178 = getelementptr inbounds i8* %157, i32 %add.ptr177.sum + %158 = bitcast i8* %head178 to i32* + %159 = load i32* %158, align 4, !tbaa !3 + %or179 = or i32 %159, 1 + store i32 %or179, i32* %158, align 4, !tbaa !3 + br label %if.end180 + +if.end180: ; preds = %if.else173, %if.then163 + %add.ptr181 = getelementptr inbounds %struct.malloc_chunk* %153, i32 0, i32 2 + %160 = bitcast %struct.malloc_chunk** %add.ptr181 to i8* + br label %postaction + +if.else182: ; preds = %if.end154 + %161 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %cmp183 = icmp ult i32 %nb.0, %161 + br i1 %cmp183, label %if.then185, label %if.end198 + +if.then185: ; preds = %if.else182 + %sub187 = sub i32 %161, %nb.0 + store i32 %sub187, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %162 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %163 = bitcast %struct.malloc_chunk* %162 to i8* + %add.ptr190 = getelementptr inbounds i8* %163, i32 %nb.0 + %164 = bitcast i8* %add.ptr190 to %struct.malloc_chunk* + store %struct.malloc_chunk* %164, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %or191 = or i32 %sub187, 1 + %add.ptr190.sum = add i32 %nb.0, 4 + %head192 = getelementptr inbounds i8* %163, i32 %add.ptr190.sum + %165 = bitcast i8* %head192 to i32* + store i32 %or191, i32* %165, align 4, !tbaa !3 + %or194 = or i32 %nb.0, 3 + %head195 = getelementptr inbounds %struct.malloc_chunk* %162, i32 0, i32 1 + store i32 %or194, i32* %head195, align 4, !tbaa !3 + %add.ptr196 = getelementptr inbounds %struct.malloc_chunk* %162, i32 0, i32 2 + %166 = bitcast %struct.malloc_chunk** %add.ptr196 to i8* + br label %postaction + +if.end198: ; preds = %if.else182 + %167 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp.i146 = icmp eq i32 %167, 0 + br i1 %cmp.i146, label %if.then.i.i, label %if.end8.i + +if.then.i.i: ; preds = %if.end198 + %call.i.i = tail call i32 @sysconf(i32 30) #1 + %sub.i.i = add i32 %call.i.i, -1 + %and.i.i = and i32 %sub.i.i, %call.i.i + %cmp1.i.i = icmp eq i32 %and.i.i, 0 + br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i + +if.then5.i.i: ; preds = %if.then.i.i + tail call void @abort() #6 + unreachable + +init_mparams.exit.i: ; preds = %if.then.i.i + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i.i = tail call i32 @time(i32* null) #1 + %xor.i.i = and i32 %call6.i.i, -16 + %and7.i.i = xor i32 %xor.i.i, 1431655768 + store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end8.i + +if.end8.i: ; preds = %init_mparams.exit.i, %if.end198 + %add.i147 = add i32 %nb.0, 48 + %168 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + %sub.i148 = add i32 %nb.0, 47 + %add9.i = add i32 %168, %sub.i148 + %neg.i149 = sub i32 0, %168 + %and11.i = and i32 %add9.i, %neg.i149 + %cmp12.i = icmp ugt i32 %and11.i, %nb.0 + br i1 %cmp12.i, label %if.end14.i, label %postaction + +if.end14.i: ; preds = %if.end8.i + %169 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3 + %cmp15.i = icmp eq i32 %169, 0 + br i1 %cmp15.i, label %if.end24.i, label %if.then16.i + +if.then16.i: ; preds = %if.end14.i + %170 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %add17.i150 = add i32 %170, %and11.i + %cmp19.i = icmp ule i32 %add17.i150, %170 + %cmp21.i = icmp ugt i32 %add17.i150, %169 + %or.cond1.i = or i1 %cmp19.i, %cmp21.i + br i1 %or.cond1.i, label %postaction, label %if.end24.i + +if.end24.i: ; preds = %if.then16.i, %if.end14.i + %171 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %and26.i = and i32 %171, 4 + %tobool27.i = icmp eq i32 %and26.i, 0 + br i1 %tobool27.i, label %if.then28.i, label %if.end121.i + +if.then28.i: ; preds = %if.end24.i + %172 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp29.i = icmp eq %struct.malloc_chunk* %172, null + br i1 %cmp29.i, label %if.then33.i, label %cond.false.i151 + +cond.false.i151: ; preds = %if.then28.i + %173 = bitcast %struct.malloc_chunk* %172 to i8* + br label %for.cond.i.i + +for.cond.i.i: ; preds = %if.end.i10.i, %cond.false.i151 + %sp.0.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %cond.false.i151 ], [ %176, %if.end.i10.i ] + %base.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 0 + %174 = load i8** %base.i.i, align 4, !tbaa !0 + %cmp.i9.i = icmp ugt i8* %174, %173 + br i1 %cmp.i9.i, label %if.end.i10.i, label %land.lhs.true.i.i + +land.lhs.true.i.i: ; preds = %for.cond.i.i + %size.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 1 + %175 = load i32* %size.i.i, align 4, !tbaa !3 + %add.ptr.i.i = getelementptr inbounds i8* %174, i32 %175 + %cmp2.i.i = icmp ugt i8* %add.ptr.i.i, %173 + br i1 %cmp2.i.i, label %cond.end.i153, label %if.end.i10.i + +if.end.i10.i: ; preds = %land.lhs.true.i.i, %for.cond.i.i + %next.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 2 + %176 = load %struct.malloc_segment** %next.i.i, align 4, !tbaa !0 + %cmp3.i.i = icmp eq %struct.malloc_segment* %176, null + br i1 %cmp3.i.i, label %if.then33.i, label %for.cond.i.i + +cond.end.i153: ; preds = %land.lhs.true.i.i + %cmp32.i152 = icmp eq %struct.malloc_segment* %sp.0.i.i, null + br i1 %cmp32.i152, label %if.then33.i, label %if.else.i159 + +if.then33.i: ; preds = %cond.end.i153, %if.end.i10.i, %if.then28.i + %call34.i = tail call i8* @sbrk(i32 0) #1 + %cmp35.i154 = icmp eq i8* %call34.i, inttoptr (i32 -1 to i8*) + br i1 %cmp35.i154, label %if.else117.i, label %if.then36.i + +if.then36.i: ; preds = %if.then33.i + %177 = ptrtoint i8* %call34.i to i32 + %178 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + %sub38.i = add i32 %178, -1 + %and39.i = and i32 %sub38.i, %177 + %cmp40.i155 = icmp eq i32 %and39.i, 0 + br i1 %cmp40.i155, label %if.end49.i, label %if.then41.i + +if.then41.i: ; preds = %if.then36.i + %add43.i = add i32 %sub38.i, %177 + %neg45.i = sub i32 0, %178 + %and46.i = and i32 %add43.i, %neg45.i + %sub47.i = sub i32 %and11.i, %177 + %add48.i = add i32 %sub47.i, %and46.i + br label %if.end49.i + +if.end49.i: ; preds = %if.then41.i, %if.then36.i + %ssize.0.i = phi i32 [ %and11.i, %if.then36.i ], [ %add48.i, %if.then41.i ] + %179 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %add51.i = add i32 %179, %ssize.0.i + %cmp52.i = icmp ugt i32 %ssize.0.i, %nb.0 + %cmp54.i156 = icmp ult i32 %ssize.0.i, 2147483647 + %or.cond.i157 = and i1 %cmp52.i, %cmp54.i156 + br i1 %or.cond.i157, label %land.lhs.true55.i, label %if.else117.i + +land.lhs.true55.i: ; preds = %if.end49.i + %180 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3 + %cmp57.i = icmp eq i32 %180, 0 + br i1 %cmp57.i, label %land.lhs.true64.i, label %lor.lhs.false58.i + +lor.lhs.false58.i: ; preds = %land.lhs.true55.i + %cmp60.i = icmp ule i32 %add51.i, %179 + %cmp63.i = icmp ugt i32 %add51.i, %180 + %or.cond2.i = or i1 %cmp60.i, %cmp63.i + br i1 %or.cond2.i, label %if.else117.i, label %land.lhs.true64.i + +land.lhs.true64.i: ; preds = %lor.lhs.false58.i, %land.lhs.true55.i + %call65.i = tail call i8* @sbrk(i32 %ssize.0.i) #1 + %cmp66.i158 = icmp eq i8* %call65.i, %call34.i + %ssize.0..i = select i1 %cmp66.i158, i32 %ssize.0.i, i32 0 + %call34..i = select i1 %cmp66.i158, i8* %call34.i, i8* inttoptr (i32 -1 to i8*) + br label %if.end85.i + +if.else.i159: ; preds = %cond.end.i153 + %181 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add74.i = sub i32 %add9.i, %181 + %and77.i = and i32 %add74.i, %neg.i149 + %cmp78.i = icmp ult i32 %and77.i, 2147483647 + br i1 %cmp78.i, label %land.lhs.true79.i, label %if.else117.i + +land.lhs.true79.i: ; preds = %if.else.i159 + %call80.i = tail call i8* @sbrk(i32 %and77.i) #1 + %182 = load i8** %base.i.i, align 4, !tbaa !0 + %183 = load i32* %size.i.i, align 4, !tbaa !3 + %add.ptr.i160 = getelementptr inbounds i8* %182, i32 %183 + %cmp82.i = icmp eq i8* %call80.i, %add.ptr.i160 + %and77..i = select i1 %cmp82.i, i32 %and77.i, i32 0 + %call80..i = select i1 %cmp82.i, i8* %call80.i, i8* inttoptr (i32 -1 to i8*) + br label %if.end85.i + +if.end85.i: ; preds = %land.lhs.true79.i, %land.lhs.true64.i + %ssize.1.i = phi i32 [ %ssize.0.i, %land.lhs.true64.i ], [ %and77.i, %land.lhs.true79.i ] + %br.0.i = phi i8* [ %call65.i, %land.lhs.true64.i ], [ %call80.i, %land.lhs.true79.i ] + %tsize.0.i = phi i32 [ %ssize.0..i, %land.lhs.true64.i ], [ %and77..i, %land.lhs.true79.i ] + %tbase.0.i = phi i8* [ %call34..i, %land.lhs.true64.i ], [ %call80..i, %land.lhs.true79.i ] + %sub109.i = sub i32 0, %ssize.1.i + %cmp86.i = icmp eq i8* %tbase.0.i, inttoptr (i32 -1 to i8*) + br i1 %cmp86.i, label %if.then87.i, label %if.then145.i + +if.then87.i: ; preds = %if.end85.i + %cmp88.i = icmp ne i8* %br.0.i, inttoptr (i32 -1 to i8*) + %cmp90.i161 = icmp ult i32 %ssize.1.i, 2147483647 + %or.cond3.i = and i1 %cmp88.i, %cmp90.i161 + %cmp93.i = icmp ult i32 %ssize.1.i, %add.i147 + %or.cond4.i = and i1 %or.cond3.i, %cmp93.i + br i1 %or.cond4.i, label %if.then94.i, label %if.end114.i + +if.then94.i: ; preds = %if.then87.i + %184 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + %sub96.i = sub i32 %sub.i148, %ssize.1.i + %add98.i = add i32 %sub96.i, %184 + %neg100.i = sub i32 0, %184 + %and101.i = and i32 %add98.i, %neg100.i + %cmp102.i = icmp ult i32 %and101.i, 2147483647 + br i1 %cmp102.i, label %if.then103.i, label %if.end114.i + +if.then103.i: ; preds = %if.then94.i + %call104.i = tail call i8* @sbrk(i32 %and101.i) #1 + %cmp105.i = icmp eq i8* %call104.i, inttoptr (i32 -1 to i8*) + br i1 %cmp105.i, label %if.else108.i, label %if.then106.i + +if.then106.i: ; preds = %if.then103.i + %add107.i = add i32 %and101.i, %ssize.1.i + br label %if.end114.i + +if.else108.i: ; preds = %if.then103.i + %call110.i = tail call i8* @sbrk(i32 %sub109.i) #1 + br label %if.else117.i + +if.end114.i: ; preds = %if.then106.i, %if.then94.i, %if.then87.i + %ssize.2.i = phi i32 [ %add107.i, %if.then106.i ], [ %ssize.1.i, %if.then94.i ], [ %ssize.1.i, %if.then87.i ] + %cmp115.i162 = icmp eq i8* %br.0.i, inttoptr (i32 -1 to i8*) + br i1 %cmp115.i162, label %if.else117.i, label %if.then145.i + +if.else117.i: ; preds = %if.end114.i, %if.else108.i, %if.else.i159, %lor.lhs.false58.i, %if.end49.i, %if.then33.i + %tsize.0748284.i = phi i32 [ %tsize.0.i, %if.else108.i ], [ 0, %if.else.i159 ], [ 0, %if.then33.i ], [ 0, %if.end49.i ], [ 0, %lor.lhs.false58.i ], [ %tsize.0.i, %if.end114.i ] + %185 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %or.i163 = or i32 %185, 4 + store i32 %or.i163, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + br label %if.end121.i + +if.end121.i: ; preds = %if.else117.i, %if.end24.i + %tsize.1.i = phi i32 [ 0, %if.end24.i ], [ %tsize.0748284.i, %if.else117.i ] + %cmp124.i = icmp ult i32 %and11.i, 2147483647 + br i1 %cmp124.i, label %if.then125.i, label %if.end264.i + +if.then125.i: ; preds = %if.end121.i + %call128.i = tail call i8* @sbrk(i32 %and11.i) #1 + %call129.i = tail call i8* @sbrk(i32 0) #1 + %notlhs.i = icmp ne i8* %call128.i, inttoptr (i32 -1 to i8*) + %notrhs.i = icmp ne i8* %call129.i, inttoptr (i32 -1 to i8*) + %or.cond6.not.i = and i1 %notrhs.i, %notlhs.i + %cmp134.i = icmp ult i8* %call128.i, %call129.i + %or.cond7.i = and i1 %or.cond6.not.i, %cmp134.i + br i1 %or.cond7.i, label %if.end143.i, label %if.end264.i + +if.end143.i: ; preds = %if.then125.i + %sub.ptr.lhs.cast.i = ptrtoint i8* %call129.i to i32 + %sub.ptr.rhs.cast.i = ptrtoint i8* %call128.i to i32 + %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i + %add137.i = add i32 %nb.0, 40 + %cmp138.i164 = icmp ugt i32 %sub.ptr.sub.i, %add137.i + %sub.ptr.sub.tsize.1.i = select i1 %cmp138.i164, i32 %sub.ptr.sub.i, i32 %tsize.1.i + br i1 %cmp138.i164, label %if.then145.i, label %if.end264.i + +if.then145.i: ; preds = %if.end143.i, %if.end114.i, %if.end85.i + %tbase.291.i = phi i8* [ %tbase.0.i, %if.end85.i ], [ %br.0.i, %if.end114.i ], [ %call128.i, %if.end143.i ] + %tsize.290.i = phi i32 [ %tsize.0.i, %if.end85.i ], [ %ssize.2.i, %if.end114.i ], [ %sub.ptr.sub.tsize.1.i, %if.end143.i ] + %186 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %add147.i = add i32 %186, %tsize.290.i + store i32 %add147.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %187 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3 + %cmp148.i = icmp ugt i32 %add147.i, %187 + br i1 %cmp148.i, label %if.then149.i, label %if.end152.i165 + +if.then149.i: ; preds = %if.then145.i + store i32 %add147.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3 + br label %if.end152.i165 + +if.end152.i165: ; preds = %if.then149.i, %if.then145.i + %188 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp154.i = icmp eq %struct.malloc_chunk* %188, null + br i1 %cmp154.i, label %if.then155.i, label %land.rhs.i167 + +if.then155.i: ; preds = %if.end152.i165 + %189 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp156.i = icmp eq i8* %189, null + %cmp159.i166 = icmp ult i8* %tbase.291.i, %189 + %or.cond8.i = or i1 %cmp156.i, %cmp159.i166 + br i1 %or.cond8.i, label %if.then160.i, label %if.end162.i + +if.then160.i: ; preds = %if.then155.i + store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + br label %if.end162.i + +if.end162.i: ; preds = %if.then160.i, %if.then155.i + store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 0), align 4, !tbaa !0 + store i32 %tsize.290.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 1), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 3), align 4, !tbaa !3 + %190 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + store i32 %190, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 9), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3 + br label %for.body.i.i + +for.body.i.i: ; preds = %for.body.i.i, %if.end162.i + %i.02.i.i = phi i32 [ 0, %if.end162.i ], [ %inc.i.i, %for.body.i.i ] + %shl.i.i = shl i32 %i.02.i.i, 1 + %arrayidx.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl.i.i + %191 = bitcast %struct.malloc_chunk** %arrayidx.i.i to %struct.malloc_chunk* + %arrayidx.sum.i.i = add i32 %shl.i.i, 3 + %192 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum.i.i + store %struct.malloc_chunk* %191, %struct.malloc_chunk** %192, align 4, !tbaa !0 + %arrayidx.sum1.i.i = add i32 %shl.i.i, 2 + %193 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum1.i.i + store %struct.malloc_chunk* %191, %struct.malloc_chunk** %193, align 4, !tbaa !0 + %inc.i.i = add i32 %i.02.i.i, 1 + %exitcond.i.i = icmp eq i32 %inc.i.i, 32 + br i1 %exitcond.i.i, label %init_bins.exit.i, label %for.body.i.i + +init_bins.exit.i: ; preds = %for.body.i.i + %sub169.i = add i32 %tsize.290.i, -40 + %add.ptr.i11.i = getelementptr inbounds i8* %tbase.291.i, i32 8 + %194 = ptrtoint i8* %add.ptr.i11.i to i32 + %and.i12.i = and i32 %194, 7 + %cmp.i13.i = icmp eq i32 %and.i12.i, 0 + br i1 %cmp.i13.i, label %init_top.exit.i, label %cond.false.i.i + +cond.false.i.i: ; preds = %init_bins.exit.i + %195 = sub i32 0, %194 + %and3.i.i = and i32 %195, 7 + br label %init_top.exit.i + +init_top.exit.i: ; preds = %cond.false.i.i, %init_bins.exit.i + %cond.i.i = phi i32 [ %and3.i.i, %cond.false.i.i ], [ 0, %init_bins.exit.i ] + %add.ptr4.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %cond.i.i + %196 = bitcast i8* %add.ptr4.i.i to %struct.malloc_chunk* + %sub5.i.i = sub i32 %sub169.i, %cond.i.i + store %struct.malloc_chunk* %196, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + store i32 %sub5.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %or.i.i = or i32 %sub5.i.i, 1 + %add.ptr4.sum.i.i = add i32 %cond.i.i, 4 + %head.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum.i.i + %197 = bitcast i8* %head.i.i to i32* + store i32 %or.i.i, i32* %197, align 4, !tbaa !3 + %add.ptr6.sum.i.i = add i32 %tsize.290.i, -36 + %head7.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr6.sum.i.i + %198 = bitcast i8* %head7.i.i to i32* + store i32 40, i32* %198, align 4, !tbaa !3 + %199 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 %199, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3 + br label %if.end248.i + +land.rhs.i167: ; preds = %while.body.i168, %if.end152.i165 + %sp.0109.i = phi %struct.malloc_segment* [ %202, %while.body.i168 ], [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.end152.i165 ] + %base184.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 0 + %200 = load i8** %base184.i, align 4, !tbaa !0 + %size185.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 1 + %201 = load i32* %size185.i, align 4, !tbaa !3 + %add.ptr186.i = getelementptr inbounds i8* %200, i32 %201 + %cmp187.i = icmp eq i8* %tbase.291.i, %add.ptr186.i + br i1 %cmp187.i, label %land.lhs.true189.i, label %while.body.i168 + +while.body.i168: ; preds = %land.rhs.i167 + %next.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 2 + %202 = load %struct.malloc_segment** %next.i, align 4, !tbaa !0 + %cmp183.i = icmp eq %struct.malloc_segment* %202, null + br i1 %cmp183.i, label %if.else213.i169, label %land.rhs.i167 + +land.lhs.true189.i: ; preds = %land.rhs.i167 + %sflags190.i = getelementptr inbounds %struct.malloc_segment* %sp.0109.i, i32 0, i32 3 + %203 = load i32* %sflags190.i, align 4, !tbaa !3 + %and191.i = and i32 %203, 8 + %tobool192.i = icmp eq i32 %and191.i, 0 + br i1 %tobool192.i, label %land.lhs.true197.i, label %if.else213.i169 + +land.lhs.true197.i: ; preds = %land.lhs.true189.i + %204 = bitcast %struct.malloc_chunk* %188 to i8* + %cmp200.i = icmp uge i8* %204, %200 + %cmp206.i = icmp ult i8* %204, %tbase.291.i + %or.cond93.i = and i1 %cmp200.i, %cmp206.i + br i1 %or.cond93.i, label %if.then207.i, label %if.else213.i169 + +if.then207.i: ; preds = %land.lhs.true197.i + %add209.i = add i32 %201, %tsize.290.i + store i32 %add209.i, i32* %size185.i, align 4, !tbaa !3 + %205 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add212.i = add i32 %205, %tsize.290.i + %add.ptr.i22.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2 + %206 = ptrtoint %struct.malloc_chunk** %add.ptr.i22.i to i32 + %and.i23.i = and i32 %206, 7 + %cmp.i24.i = icmp eq i32 %and.i23.i, 0 + br i1 %cmp.i24.i, label %init_top.exit36.i, label %cond.false.i26.i + +cond.false.i26.i: ; preds = %if.then207.i + %207 = sub i32 0, %206 + %and3.i25.i = and i32 %207, 7 + br label %init_top.exit36.i + +init_top.exit36.i: ; preds = %cond.false.i26.i, %if.then207.i + %cond.i27.i = phi i32 [ %and3.i25.i, %cond.false.i26.i ], [ 0, %if.then207.i ] + %add.ptr4.i28.i = getelementptr inbounds i8* %204, i32 %cond.i27.i + %208 = bitcast i8* %add.ptr4.i28.i to %struct.malloc_chunk* + %sub5.i29.i = sub i32 %add212.i, %cond.i27.i + store %struct.malloc_chunk* %208, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + store i32 %sub5.i29.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %or.i30.i = or i32 %sub5.i29.i, 1 + %add.ptr4.sum.i31.i = add i32 %cond.i27.i, 4 + %head.i32.i = getelementptr inbounds i8* %204, i32 %add.ptr4.sum.i31.i + %209 = bitcast i8* %head.i32.i to i32* + store i32 %or.i30.i, i32* %209, align 4, !tbaa !3 + %add.ptr6.sum.i33.i = add i32 %add212.i, 4 + %head7.i34.i = getelementptr inbounds i8* %204, i32 %add.ptr6.sum.i33.i + %210 = bitcast i8* %head7.i34.i to i32* + store i32 40, i32* %210, align 4, !tbaa !3 + %211 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 %211, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3 + br label %if.end248.i + +if.else213.i169: ; preds = %land.lhs.true197.i, %land.lhs.true189.i, %while.body.i168 + %212 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp215.i = icmp ult i8* %tbase.291.i, %212 + br i1 %cmp215.i, label %if.then216.i, label %while.cond220.preheader.i + +if.then216.i: ; preds = %if.else213.i169 + store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + br label %while.cond220.preheader.i + +while.cond220.preheader.i: ; preds = %if.then216.i, %if.else213.i169 + %add.ptr224.i = getelementptr inbounds i8* %tbase.291.i, i32 %tsize.290.i + br label %land.rhs222.i + +land.rhs222.i: ; preds = %while.body227.i, %while.cond220.preheader.i + %sp.1105.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %while.cond220.preheader.i ], [ %214, %while.body227.i ] + %base223.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 0 + %213 = load i8** %base223.i, align 4, !tbaa !0 + %cmp225.i = icmp eq i8* %213, %add.ptr224.i + br i1 %cmp225.i, label %land.lhs.true231.i, label %while.body227.i + +while.body227.i: ; preds = %land.rhs222.i + %next228.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 2 + %214 = load %struct.malloc_segment** %next228.i, align 4, !tbaa !0 + %cmp221.i = icmp eq %struct.malloc_segment* %214, null + br i1 %cmp221.i, label %if.else245.i, label %land.rhs222.i + +land.lhs.true231.i: ; preds = %land.rhs222.i + %sflags232.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 3 + %215 = load i32* %sflags232.i, align 4, !tbaa !3 + %and233.i = and i32 %215, 8 + %tobool234.i = icmp eq i32 %and233.i, 0 + br i1 %tobool234.i, label %if.then239.i, label %if.else245.i + +if.then239.i: ; preds = %land.lhs.true231.i + store i8* %tbase.291.i, i8** %base223.i, align 4, !tbaa !0 + %size242.i = getelementptr inbounds %struct.malloc_segment* %sp.1105.i, i32 0, i32 1 + %216 = load i32* %size242.i, align 4, !tbaa !3 + %add243.i = add i32 %216, %tsize.290.i + store i32 %add243.i, i32* %size242.i, align 4, !tbaa !3 + %add.ptr.i37.i = getelementptr inbounds i8* %tbase.291.i, i32 8 + %217 = ptrtoint i8* %add.ptr.i37.i to i32 + %and.i38.i = and i32 %217, 7 + %cmp.i39.i = icmp eq i32 %and.i38.i, 0 + br i1 %cmp.i39.i, label %cond.end.i45.i, label %cond.false.i41.i + +cond.false.i41.i: ; preds = %if.then239.i + %218 = sub i32 0, %217 + %and3.i40.i = and i32 %218, 7 + br label %cond.end.i45.i + +cond.end.i45.i: ; preds = %cond.false.i41.i, %if.then239.i + %cond.i42.i = phi i32 [ %and3.i40.i, %cond.false.i41.i ], [ 0, %if.then239.i ] + %add.ptr4.i43.i = getelementptr inbounds i8* %tbase.291.i, i32 %cond.i42.i + %add.ptr224.sum.i = add i32 %tsize.290.i, 8 + %add.ptr5.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum.i + %219 = ptrtoint i8* %add.ptr5.i.i to i32 + %and6.i44.i = and i32 %219, 7 + %cmp7.i.i = icmp eq i32 %and6.i44.i, 0 + br i1 %cmp7.i.i, label %cond.end14.i.i, label %cond.false9.i.i + +cond.false9.i.i: ; preds = %cond.end.i45.i + %220 = sub i32 0, %219 + %and13.i.i = and i32 %220, 7 + br label %cond.end14.i.i + +cond.end14.i.i: ; preds = %cond.false9.i.i, %cond.end.i45.i + %cond15.i.i = phi i32 [ %and13.i.i, %cond.false9.i.i ], [ 0, %cond.end.i45.i ] + %add.ptr224.sum131.i = add i32 %cond15.i.i, %tsize.290.i + %add.ptr16.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum131.i + %221 = bitcast i8* %add.ptr16.i.i to %struct.malloc_chunk* + %sub.ptr.lhs.cast.i46.i = ptrtoint i8* %add.ptr16.i.i to i32 + %sub.ptr.rhs.cast.i47.i = ptrtoint i8* %add.ptr4.i43.i to i32 + %sub.ptr.sub.i48.i = sub i32 %sub.ptr.lhs.cast.i46.i, %sub.ptr.rhs.cast.i47.i + %add.ptr4.sum.i49.i = add i32 %cond.i42.i, %nb.0 + %add.ptr17.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum.i49.i + %222 = bitcast i8* %add.ptr17.i.i to %struct.malloc_chunk* + %sub18.i.i = sub i32 %sub.ptr.sub.i48.i, %nb.0 + %or19.i.i = or i32 %nb.0, 3 + %add.ptr4.sum1.i.i = add i32 %cond.i42.i, 4 + %head.i50.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum1.i.i + %223 = bitcast i8* %head.i50.i to i32* + store i32 %or19.i.i, i32* %223, align 4, !tbaa !3 + %224 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp20.i.i = icmp eq %struct.malloc_chunk* %221, %224 + br i1 %cmp20.i.i, label %if.then.i51.i, label %if.else.i.i + +if.then.i51.i: ; preds = %cond.end14.i.i + %225 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add.i.i = add i32 %225, %sub18.i.i + store i32 %add.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + store %struct.malloc_chunk* %222, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %or22.i.i = or i32 %add.i.i, 1 + %add.ptr17.sum35.i.i = add i32 %add.ptr4.sum.i49.i, 4 + %head23.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum35.i.i + %226 = bitcast i8* %head23.i.i to i32* + store i32 %or22.i.i, i32* %226, align 4, !tbaa !3 + br label %prepend_alloc.exit.i + +if.else.i.i: ; preds = %cond.end14.i.i + %227 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp24.i.i = icmp eq %struct.malloc_chunk* %221, %227 + br i1 %cmp24.i.i, label %if.then25.i.i, label %if.else31.i.i + +if.then25.i.i: ; preds = %if.else.i.i + %228 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %add26.i.i = add i32 %228, %sub18.i.i + store i32 %add26.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + store %struct.malloc_chunk* %222, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %or28.i.i = or i32 %add26.i.i, 1 + %add.ptr17.sum33.i.i = add i32 %add.ptr4.sum.i49.i, 4 + %head29.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum33.i.i + %229 = bitcast i8* %head29.i.i to i32* + store i32 %or28.i.i, i32* %229, align 4, !tbaa !3 + %add.ptr17.sum34.i.i = add i32 %add26.i.i, %add.ptr4.sum.i49.i + %add.ptr30.i52.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum34.i.i + %prev_foot.i53.i = bitcast i8* %add.ptr30.i52.i to i32* + store i32 %add26.i.i, i32* %prev_foot.i53.i, align 4, !tbaa !3 + br label %prepend_alloc.exit.i + +if.else31.i.i: ; preds = %if.else.i.i + %add.ptr16.sum.i.i = add i32 %tsize.290.i, 4 + %add.ptr224.sum132.i = add i32 %add.ptr16.sum.i.i, %cond15.i.i + %head32.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum132.i + %230 = bitcast i8* %head32.i.i to i32* + %231 = load i32* %230, align 4, !tbaa !3 + %and33.i.i = and i32 %231, 3 + %cmp34.i.i = icmp eq i32 %and33.i.i, 1 + br i1 %cmp34.i.i, label %if.then35.i.i, label %if.end207.i.i + +if.then35.i.i: ; preds = %if.else31.i.i + %and37.i.i = and i32 %231, -8 + %shr.i54.i = lshr i32 %231, 3 + %cmp38.i.i = icmp ult i32 %231, 256 + br i1 %cmp38.i.i, label %if.then39.i.i, label %if.else73.i.i + +if.then39.i.i: ; preds = %if.then35.i.i + %add.ptr16.sum3031.i.i = or i32 %cond15.i.i, 8 + %add.ptr224.sum142.i = add i32 %add.ptr16.sum3031.i.i, %tsize.290.i + %fd.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum142.i + %232 = bitcast i8* %fd.i.i to %struct.malloc_chunk** + %233 = load %struct.malloc_chunk** %232, align 4, !tbaa !0 + %add.ptr16.sum32.i.i = add i32 %tsize.290.i, 12 + %add.ptr224.sum143.i = add i32 %add.ptr16.sum32.i.i, %cond15.i.i + %bk.i55.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum143.i + %234 = bitcast i8* %bk.i55.i to %struct.malloc_chunk** + %235 = load %struct.malloc_chunk** %234, align 4, !tbaa !0 + %shl.i56.i = shl nuw nsw i32 %shr.i54.i, 1 + %arrayidx.i57.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl.i56.i + %236 = bitcast %struct.malloc_chunk** %arrayidx.i57.i to %struct.malloc_chunk* + %cmp41.i.i = icmp eq %struct.malloc_chunk* %233, %236 + br i1 %cmp41.i.i, label %if.then45.i.i, label %lor.rhs.i.i + +lor.rhs.i.i: ; preds = %if.then39.i.i + %237 = bitcast %struct.malloc_chunk* %233 to i8* + %238 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp42.i.i = icmp ult i8* %237, %238 + br i1 %cmp42.i.i, label %if.else71.i.i, label %land.rhs.i58.i + +land.rhs.i58.i: ; preds = %lor.rhs.i.i + %bk43.i.i = getelementptr inbounds %struct.malloc_chunk* %233, i32 0, i32 3 + %239 = load %struct.malloc_chunk** %bk43.i.i, align 4, !tbaa !0 + %cmp44.i.i = icmp eq %struct.malloc_chunk* %239, %221 + br i1 %cmp44.i.i, label %if.then45.i.i, label %if.else71.i.i, !prof !5 + +if.then45.i.i: ; preds = %land.rhs.i58.i, %if.then39.i.i + %cmp46.i59.i = icmp eq %struct.malloc_chunk* %235, %233 + br i1 %cmp46.i59.i, label %if.then47.i.i, label %if.else50.i60.i + +if.then47.i.i: ; preds = %if.then45.i.i + %shl48.i.i = shl i32 1, %shr.i54.i + %neg.i.i = xor i32 %shl48.i.i, -1 + %240 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %and49.i.i = and i32 %240, %neg.i.i + store i32 %and49.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end204.i.i + +if.else50.i60.i: ; preds = %if.then45.i.i + %cmp54.i.i = icmp eq %struct.malloc_chunk* %235, %236 + br i1 %cmp54.i.i, label %if.else50.if.then66_crit_edge.i.i, label %lor.rhs55.i.i + +if.else50.if.then66_crit_edge.i.i: ; preds = %if.else50.i60.i + %fd68.pre.i.i = getelementptr inbounds %struct.malloc_chunk* %235, i32 0, i32 2 + br label %if.then66.i.i + +lor.rhs55.i.i: ; preds = %if.else50.i60.i + %241 = bitcast %struct.malloc_chunk* %235 to i8* + %242 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp57.i.i = icmp ult i8* %241, %242 + br i1 %cmp57.i.i, label %if.else69.i.i, label %land.rhs58.i.i + +land.rhs58.i.i: ; preds = %lor.rhs55.i.i + %fd59.i.i = getelementptr inbounds %struct.malloc_chunk* %235, i32 0, i32 2 + %243 = load %struct.malloc_chunk** %fd59.i.i, align 4, !tbaa !0 + %cmp60.i.i = icmp eq %struct.malloc_chunk* %243, %221 + br i1 %cmp60.i.i, label %if.then66.i.i, label %if.else69.i.i, !prof !5 + +if.then66.i.i: ; preds = %land.rhs58.i.i, %if.else50.if.then66_crit_edge.i.i + %fd68.pre-phi.i.i = phi %struct.malloc_chunk** [ %fd68.pre.i.i, %if.else50.if.then66_crit_edge.i.i ], [ %fd59.i.i, %land.rhs58.i.i ] + %bk67.i.i = getelementptr inbounds %struct.malloc_chunk* %233, i32 0, i32 3 + store %struct.malloc_chunk* %235, %struct.malloc_chunk** %bk67.i.i, align 4, !tbaa !0 + store %struct.malloc_chunk* %233, %struct.malloc_chunk** %fd68.pre-phi.i.i, align 4, !tbaa !0 + br label %if.end204.i.i + +if.else69.i.i: ; preds = %land.rhs58.i.i, %lor.rhs55.i.i + tail call void @abort() #6 + unreachable + +if.else71.i.i: ; preds = %land.rhs.i58.i, %lor.rhs.i.i + tail call void @abort() #6 + unreachable + +if.else73.i.i: ; preds = %if.then35.i.i + %244 = bitcast i8* %add.ptr16.i.i to %struct.malloc_tree_chunk* + %add.ptr16.sum23.i.i = or i32 %cond15.i.i, 24 + %add.ptr224.sum133.i = add i32 %add.ptr16.sum23.i.i, %tsize.290.i + %parent.i61.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum133.i + %245 = bitcast i8* %parent.i61.i to %struct.malloc_tree_chunk** + %246 = load %struct.malloc_tree_chunk** %245, align 4, !tbaa !0 + %add.ptr16.sum4.i.i = add i32 %tsize.290.i, 12 + %add.ptr224.sum134.i = add i32 %add.ptr16.sum4.i.i, %cond15.i.i + %bk74.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum134.i + %247 = bitcast i8* %bk74.i.i to %struct.malloc_tree_chunk** + %248 = load %struct.malloc_tree_chunk** %247, align 4, !tbaa !0 + %cmp75.i.i = icmp eq %struct.malloc_tree_chunk* %248, %244 + br i1 %cmp75.i.i, label %if.else95.i.i, label %if.then76.i.i + +if.then76.i.i: ; preds = %if.else73.i.i + %add.ptr16.sum2829.i.i = or i32 %cond15.i.i, 8 + %add.ptr224.sum135.i = add i32 %add.ptr16.sum2829.i.i, %tsize.290.i + %fd78.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum135.i + %249 = bitcast i8* %fd78.i.i to %struct.malloc_tree_chunk** + %250 = load %struct.malloc_tree_chunk** %249, align 4, !tbaa !0 + %251 = bitcast %struct.malloc_tree_chunk* %250 to i8* + %252 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp81.i.i = icmp ult i8* %251, %252 + br i1 %cmp81.i.i, label %if.else93.i.i, label %land.lhs.true.i62.i + +land.lhs.true.i62.i: ; preds = %if.then76.i.i + %bk82.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %250, i32 0, i32 3 + %253 = load %struct.malloc_tree_chunk** %bk82.i.i, align 4, !tbaa !0 + %cmp83.i.i = icmp eq %struct.malloc_tree_chunk* %253, %244 + br i1 %cmp83.i.i, label %land.rhs84.i.i, label %if.else93.i.i + +land.rhs84.i.i: ; preds = %land.lhs.true.i62.i + %fd85.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %248, i32 0, i32 2 + %254 = load %struct.malloc_tree_chunk** %fd85.i.i, align 4, !tbaa !0 + %cmp86.i.i = icmp eq %struct.malloc_tree_chunk* %254, %244 + br i1 %cmp86.i.i, label %if.then90.i.i, label %if.else93.i.i, !prof !5 + +if.then90.i.i: ; preds = %land.rhs84.i.i + store %struct.malloc_tree_chunk* %248, %struct.malloc_tree_chunk** %bk82.i.i, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %250, %struct.malloc_tree_chunk** %fd85.i.i, align 4, !tbaa !0 + br label %if.end119.i.i + +if.else93.i.i: ; preds = %land.rhs84.i.i, %land.lhs.true.i62.i, %if.then76.i.i + tail call void @abort() #6 + unreachable + +if.else95.i.i: ; preds = %if.else73.i.i + %add.ptr16.sum56.i.i = or i32 %cond15.i.i, 16 + %add.ptr224.sum140.i = add i32 %add.ptr16.sum.i.i, %add.ptr16.sum56.i.i + %arrayidx96.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum140.i + %255 = bitcast i8* %arrayidx96.i.i to %struct.malloc_tree_chunk** + %256 = load %struct.malloc_tree_chunk** %255, align 4, !tbaa !0 + %cmp97.i.i = icmp eq %struct.malloc_tree_chunk* %256, null + br i1 %cmp97.i.i, label %lor.lhs.false.i.i, label %while.cond.i.i + +lor.lhs.false.i.i: ; preds = %if.else95.i.i + %add.ptr224.sum141.i = add i32 %add.ptr16.sum56.i.i, %tsize.290.i + %child.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum141.i + %arrayidx99.i.i = bitcast i8* %child.i.i to %struct.malloc_tree_chunk** + %257 = load %struct.malloc_tree_chunk** %arrayidx99.i.i, align 4, !tbaa !0 + %cmp100.i.i = icmp eq %struct.malloc_tree_chunk* %257, null + br i1 %cmp100.i.i, label %if.end119.i.i, label %while.cond.i.i + +while.cond.i.i: ; preds = %lor.rhs105.i.i, %while.cond.i.i, %lor.lhs.false.i.i, %if.else95.i.i + %RP.0.i.i = phi %struct.malloc_tree_chunk** [ %arrayidx99.i.i, %lor.lhs.false.i.i ], [ %255, %if.else95.i.i ], [ %arrayidx103.i.i, %while.cond.i.i ], [ %arrayidx107.i.i, %lor.rhs105.i.i ] + %R.0.i.i = phi %struct.malloc_tree_chunk* [ %257, %lor.lhs.false.i.i ], [ %256, %if.else95.i.i ], [ %258, %while.cond.i.i ], [ %259, %lor.rhs105.i.i ] + %arrayidx103.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i.i, i32 0, i32 4, i32 1 + %258 = load %struct.malloc_tree_chunk** %arrayidx103.i.i, align 4, !tbaa !0 + %cmp104.i.i = icmp eq %struct.malloc_tree_chunk* %258, null + br i1 %cmp104.i.i, label %lor.rhs105.i.i, label %while.cond.i.i + +lor.rhs105.i.i: ; preds = %while.cond.i.i + %arrayidx107.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.0.i.i, i32 0, i32 4, i32 0 + %259 = load %struct.malloc_tree_chunk** %arrayidx107.i.i, align 4, !tbaa !0 + %cmp108.i.i = icmp eq %struct.malloc_tree_chunk* %259, null + br i1 %cmp108.i.i, label %while.end.i.i, label %while.cond.i.i + +while.end.i.i: ; preds = %lor.rhs105.i.i + %260 = bitcast %struct.malloc_tree_chunk** %RP.0.i.i to i8* + %261 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp112.i.i = icmp ult i8* %260, %261 + br i1 %cmp112.i.i, label %if.else116.i.i, label %if.then115.i.i, !prof !6 + +if.then115.i.i: ; preds = %while.end.i.i + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0.i.i, align 4, !tbaa !0 + br label %if.end119.i.i + +if.else116.i.i: ; preds = %while.end.i.i + tail call void @abort() #6 + unreachable + +if.end119.i.i: ; preds = %if.then115.i.i, %lor.lhs.false.i.i, %if.then90.i.i + %R.1.i.i = phi %struct.malloc_tree_chunk* [ %248, %if.then90.i.i ], [ %R.0.i.i, %if.then115.i.i ], [ null, %lor.lhs.false.i.i ] + %cmp120.i63.i = icmp eq %struct.malloc_tree_chunk* %246, null + br i1 %cmp120.i63.i, label %if.end204.i.i, label %if.then122.i65.i + +if.then122.i65.i: ; preds = %if.end119.i.i + %add.ptr16.sum25.i.i = add i32 %tsize.290.i, 28 + %add.ptr224.sum136.i = add i32 %add.ptr16.sum25.i.i, %cond15.i.i + %index.i64.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum136.i + %262 = bitcast i8* %index.i64.i to i32* + %263 = load i32* %262, align 4, !tbaa !3 + %arrayidx123.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %263 + %264 = load %struct.malloc_tree_chunk** %arrayidx123.i.i, align 4, !tbaa !0 + %cmp124.i.i = icmp eq %struct.malloc_tree_chunk* %244, %264 + br i1 %cmp124.i.i, label %if.then126.i.i, label %if.else135.i.i + +if.then126.i.i: ; preds = %if.then122.i65.i + store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %arrayidx123.i.i, align 4, !tbaa !0 + %cond37.i.i = icmp eq %struct.malloc_tree_chunk* %R.1.i.i, null + br i1 %cond37.i.i, label %if.end155.thread.i.i, label %if.then158.i.i + +if.end155.thread.i.i: ; preds = %if.then126.i.i + %shl131.i.i = shl i32 1, %263 + %neg132.i.i = xor i32 %shl131.i.i, -1 + %265 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and133.i.i = and i32 %265, %neg132.i.i + store i32 %and133.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end204.i.i + +if.else135.i.i: ; preds = %if.then122.i65.i + %266 = bitcast %struct.malloc_tree_chunk* %246 to i8* + %267 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp137.i.i = icmp ult i8* %266, %267 + br i1 %cmp137.i.i, label %if.else153.i.i, label %if.then141.i.i, !prof !6 + +if.then141.i.i: ; preds = %if.else135.i.i + %arrayidx143.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %246, i32 0, i32 4, i32 0 + %268 = load %struct.malloc_tree_chunk** %arrayidx143.i.i, align 4, !tbaa !0 + %cmp144.i.i = icmp eq %struct.malloc_tree_chunk* %268, %244 + br i1 %cmp144.i.i, label %if.then146.i.i, label %if.else149.i.i + +if.then146.i.i: ; preds = %if.then141.i.i + store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %arrayidx143.i.i, align 4, !tbaa !0 + br label %if.end155.i.i + +if.else149.i.i: ; preds = %if.then141.i.i + %arrayidx151.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %246, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %arrayidx151.i.i, align 4, !tbaa !0 + br label %if.end155.i.i + +if.else153.i.i: ; preds = %if.else135.i.i + tail call void @abort() #6 + unreachable + +if.end155.i.i: ; preds = %if.else149.i.i, %if.then146.i.i + %cmp156.i.i = icmp eq %struct.malloc_tree_chunk* %R.1.i.i, null + br i1 %cmp156.i.i, label %if.end204.i.i, label %if.then158.i.i + +if.then158.i.i: ; preds = %if.end155.i.i, %if.then126.i.i + %269 = bitcast %struct.malloc_tree_chunk* %R.1.i.i to i8* + %270 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp160.i.i = icmp ult i8* %269, %270 + br i1 %cmp160.i.i, label %if.else200.i.i, label %if.then164.i.i, !prof !6 + +if.then164.i.i: ; preds = %if.then158.i.i + %parent165.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 5 + store %struct.malloc_tree_chunk* %246, %struct.malloc_tree_chunk** %parent165.i.i, align 4, !tbaa !0 + %add.ptr16.sum2627.i.i = or i32 %cond15.i.i, 16 + %add.ptr224.sum137.i = add i32 %add.ptr16.sum2627.i.i, %tsize.290.i + %child166.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum137.i + %arrayidx167.i.i = bitcast i8* %child166.i.i to %struct.malloc_tree_chunk** + %271 = load %struct.malloc_tree_chunk** %arrayidx167.i.i, align 4, !tbaa !0 + %cmp168.i.i = icmp eq %struct.malloc_tree_chunk* %271, null + br i1 %cmp168.i.i, label %if.end182.i.i, label %if.then170.i.i + +if.then170.i.i: ; preds = %if.then164.i.i + %272 = bitcast %struct.malloc_tree_chunk* %271 to i8* + %273 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp172.i.i = icmp ult i8* %272, %273 + br i1 %cmp172.i.i, label %if.else180.i.i, label %if.then176.i.i, !prof !6 + +if.then176.i.i: ; preds = %if.then170.i.i + %arrayidx178.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %271, %struct.malloc_tree_chunk** %arrayidx178.i.i, align 4, !tbaa !0 + %parent179.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %271, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %parent179.i.i, align 4, !tbaa !0 + br label %if.end182.i.i + +if.else180.i.i: ; preds = %if.then170.i.i + tail call void @abort() #6 + unreachable + +if.end182.i.i: ; preds = %if.then176.i.i, %if.then164.i.i + %add.ptr224.sum138.i = add i32 %add.ptr16.sum.i.i, %add.ptr16.sum2627.i.i + %arrayidx184.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum138.i + %274 = bitcast i8* %arrayidx184.i.i to %struct.malloc_tree_chunk** + %275 = load %struct.malloc_tree_chunk** %274, align 4, !tbaa !0 + %cmp185.i.i = icmp eq %struct.malloc_tree_chunk* %275, null + br i1 %cmp185.i.i, label %if.end204.i.i, label %if.then187.i.i + +if.then187.i.i: ; preds = %if.end182.i.i + %276 = bitcast %struct.malloc_tree_chunk* %275 to i8* + %277 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp189.i.i = icmp ult i8* %276, %277 + br i1 %cmp189.i.i, label %if.else197.i.i, label %if.then193.i.i, !prof !6 + +if.then193.i.i: ; preds = %if.then187.i.i + %arrayidx195.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %R.1.i.i, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %275, %struct.malloc_tree_chunk** %arrayidx195.i.i, align 4, !tbaa !0 + %parent196.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %275, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1.i.i, %struct.malloc_tree_chunk** %parent196.i.i, align 4, !tbaa !0 + br label %if.end204.i.i + +if.else197.i.i: ; preds = %if.then187.i.i + tail call void @abort() #6 + unreachable + +if.else200.i.i: ; preds = %if.then158.i.i + tail call void @abort() #6 + unreachable + +if.end204.i.i: ; preds = %if.then193.i.i, %if.end182.i.i, %if.end155.i.i, %if.end155.thread.i.i, %if.end119.i.i, %if.then66.i.i, %if.then47.i.i + %add.ptr16.sum7.i.i = or i32 %and37.i.i, %cond15.i.i + %add.ptr224.sum139.i = add i32 %add.ptr16.sum7.i.i, %tsize.290.i + %add.ptr205.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr224.sum139.i + %278 = bitcast i8* %add.ptr205.i.i to %struct.malloc_chunk* + %add206.i.i = add i32 %and37.i.i, %sub18.i.i + br label %if.end207.i.i + +if.end207.i.i: ; preds = %if.end204.i.i, %if.else31.i.i + %qsize.0.i.i = phi i32 [ %sub18.i.i, %if.else31.i.i ], [ %add206.i.i, %if.end204.i.i ] + %oldfirst.0.i.i = phi %struct.malloc_chunk* [ %221, %if.else31.i.i ], [ %278, %if.end204.i.i ] + %head208.i.i = getelementptr inbounds %struct.malloc_chunk* %oldfirst.0.i.i, i32 0, i32 1 + %279 = load i32* %head208.i.i, align 4, !tbaa !3 + %and209.i.i = and i32 %279, -2 + store i32 %and209.i.i, i32* %head208.i.i, align 4, !tbaa !3 + %or210.i.i = or i32 %qsize.0.i.i, 1 + %add.ptr17.sum.i.i = add i32 %add.ptr4.sum.i49.i, 4 + %head211.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum.i.i + %280 = bitcast i8* %head211.i.i to i32* + store i32 %or210.i.i, i32* %280, align 4, !tbaa !3 + %add.ptr17.sum8.i.i = add i32 %qsize.0.i.i, %add.ptr4.sum.i49.i + %add.ptr212.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum8.i.i + %prev_foot213.i.i = bitcast i8* %add.ptr212.i.i to i32* + store i32 %qsize.0.i.i, i32* %prev_foot213.i.i, align 4, !tbaa !3 + %shr214.i.i = lshr i32 %qsize.0.i.i, 3 + %cmp215.i.i = icmp ult i32 %qsize.0.i.i, 256 + br i1 %cmp215.i.i, label %if.then217.i.i, label %if.else249.i.i + +if.then217.i.i: ; preds = %if.end207.i.i + %shl221.i.i = shl nuw nsw i32 %shr214.i.i, 1 + %arrayidx223.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl221.i.i + %281 = bitcast %struct.malloc_chunk** %arrayidx223.i.i to %struct.malloc_chunk* + %282 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shl226.i.i = shl i32 1, %shr214.i.i + %and227.i.i = and i32 %282, %shl226.i.i + %tobool228.i.i = icmp eq i32 %and227.i.i, 0 + br i1 %tobool228.i.i, label %if.then229.i.i, label %if.else233.i.i + +if.then229.i.i: ; preds = %if.then217.i.i + %or232.i.i = or i32 %282, %shl226.i.i + store i32 %or232.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %arrayidx223.sum.pre.i.i = add i32 %shl221.i.i, 2 + %.pre.i66.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx223.sum.pre.i.i + br label %if.end244.i.i + +if.else233.i.i: ; preds = %if.then217.i.i + %arrayidx223.sum24.i.i = add i32 %shl221.i.i, 2 + %283 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx223.sum24.i.i + %284 = load %struct.malloc_chunk** %283, align 4, !tbaa !0 + %285 = bitcast %struct.malloc_chunk* %284 to i8* + %286 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp236.i.i = icmp ult i8* %285, %286 + br i1 %cmp236.i.i, label %if.else242.i.i, label %if.end244.i.i, !prof !6 + +if.else242.i.i: ; preds = %if.else233.i.i + tail call void @abort() #6 + unreachable + +if.end244.i.i: ; preds = %if.else233.i.i, %if.then229.i.i + %.pre-phi.i67.i = phi %struct.malloc_chunk** [ %283, %if.else233.i.i ], [ %.pre.i66.i, %if.then229.i.i ] + %F224.0.i.i = phi %struct.malloc_chunk* [ %284, %if.else233.i.i ], [ %281, %if.then229.i.i ] + store %struct.malloc_chunk* %222, %struct.malloc_chunk** %.pre-phi.i67.i, align 4, !tbaa !0 + %bk246.i.i = getelementptr inbounds %struct.malloc_chunk* %F224.0.i.i, i32 0, i32 3 + store %struct.malloc_chunk* %222, %struct.malloc_chunk** %bk246.i.i, align 4, !tbaa !0 + %add.ptr17.sum22.i.i = add i32 %add.ptr4.sum.i49.i, 8 + %fd247.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum22.i.i + %287 = bitcast i8* %fd247.i.i to %struct.malloc_chunk** + store %struct.malloc_chunk* %F224.0.i.i, %struct.malloc_chunk** %287, align 4, !tbaa !0 + %add.ptr17.sum23.i.i = add i32 %add.ptr4.sum.i49.i, 12 + %bk248.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum23.i.i + %288 = bitcast i8* %bk248.i.i to %struct.malloc_chunk** + store %struct.malloc_chunk* %281, %struct.malloc_chunk** %288, align 4, !tbaa !0 + br label %prepend_alloc.exit.i + +if.else249.i.i: ; preds = %if.end207.i.i + %289 = bitcast i8* %add.ptr17.i.i to %struct.malloc_tree_chunk* + %shr253.i.i = lshr i32 %qsize.0.i.i, 8 + %cmp254.i.i = icmp eq i32 %shr253.i.i, 0 + br i1 %cmp254.i.i, label %if.end285.i.i, label %if.else257.i.i + +if.else257.i.i: ; preds = %if.else249.i.i + %cmp258.i.i = icmp ugt i32 %qsize.0.i.i, 16777215 + br i1 %cmp258.i.i, label %if.end285.i.i, label %if.else261.i.i + +if.else261.i.i: ; preds = %if.else257.i.i + %sub262.i.i = add i32 %shr253.i.i, 1048320 + %shr263.i.i = lshr i32 %sub262.i.i, 16 + %and264.i.i = and i32 %shr263.i.i, 8 + %shl265.i.i = shl i32 %shr253.i.i, %and264.i.i + %sub266.i.i = add i32 %shl265.i.i, 520192 + %shr267.i.i = lshr i32 %sub266.i.i, 16 + %and268.i.i = and i32 %shr267.i.i, 4 + %add269.i.i = or i32 %and268.i.i, %and264.i.i + %shl270.i.i = shl i32 %shl265.i.i, %and268.i.i + %sub271.i.i = add i32 %shl270.i.i, 245760 + %shr272.i.i = lshr i32 %sub271.i.i, 16 + %and273.i.i = and i32 %shr272.i.i, 2 + %add274.i.i = or i32 %add269.i.i, %and273.i.i + %sub275.i.i = sub i32 14, %add274.i.i + %shl276.i.i = shl i32 %shl270.i.i, %and273.i.i + %shr277.i.i = lshr i32 %shl276.i.i, 15 + %add278.i.i = add i32 %sub275.i.i, %shr277.i.i + %shl279.i.i = shl nsw i32 %add278.i.i, 1 + %add280.i.i = add i32 %add278.i.i, 7 + %shr281.i.i = lshr i32 %qsize.0.i.i, %add280.i.i + %and282.i.i = and i32 %shr281.i.i, 1 + %add283.i.i = or i32 %and282.i.i, %shl279.i.i + br label %if.end285.i.i + +if.end285.i.i: ; preds = %if.else261.i.i, %if.else257.i.i, %if.else249.i.i + %I252.0.i.i = phi i32 [ %add283.i.i, %if.else261.i.i ], [ 0, %if.else249.i.i ], [ 31, %if.else257.i.i ] + %arrayidx287.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I252.0.i.i + %add.ptr17.sum9.i.i = add i32 %add.ptr4.sum.i49.i, 28 + %index288.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum9.i.i + %290 = bitcast i8* %index288.i.i to i32* + store i32 %I252.0.i.i, i32* %290, align 4, !tbaa !3 + %add.ptr17.sum10.i.i = add i32 %add.ptr4.sum.i49.i, 16 + %child289.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum10.i.i + %child289.sum.i.i = add i32 %add.ptr4.sum.i49.i, 20 + %arrayidx290.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %child289.sum.i.i + %291 = bitcast i8* %arrayidx290.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %291, align 4, !tbaa !0 + %arrayidx292.i.i = bitcast i8* %child289.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %arrayidx292.i.i, align 4, !tbaa !0 + %292 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %shl294.i.i = shl i32 1, %I252.0.i.i + %and295.i.i = and i32 %292, %shl294.i.i + %tobool296.i.i = icmp eq i32 %and295.i.i, 0 + br i1 %tobool296.i.i, label %if.then297.i.i, label %if.else304.i.i + +if.then297.i.i: ; preds = %if.end285.i.i + %or300.i.i = or i32 %292, %shl294.i.i + store i32 %or300.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %arrayidx287.i.i, align 4, !tbaa !0 + %293 = bitcast %struct.malloc_tree_chunk** %arrayidx287.i.i to %struct.malloc_tree_chunk* + %add.ptr17.sum11.i.i = add i32 %add.ptr4.sum.i49.i, 24 + %parent301.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum11.i.i + %294 = bitcast i8* %parent301.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %293, %struct.malloc_tree_chunk** %294, align 4, !tbaa !0 + %add.ptr17.sum12.i.i = add i32 %add.ptr4.sum.i49.i, 12 + %bk302.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum12.i.i + %295 = bitcast i8* %bk302.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %295, align 4, !tbaa !0 + %add.ptr17.sum13.i.i = add i32 %add.ptr4.sum.i49.i, 8 + %fd303.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum13.i.i + %296 = bitcast i8* %fd303.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %296, align 4, !tbaa !0 + br label %prepend_alloc.exit.i + +if.else304.i.i: ; preds = %if.end285.i.i + %297 = load %struct.malloc_tree_chunk** %arrayidx287.i.i, align 4, !tbaa !0 + %cmp306.i.i = icmp eq i32 %I252.0.i.i, 31 + br i1 %cmp306.i.i, label %cond.end314.i.i, label %cond.false309.i.i + +cond.false309.i.i: ; preds = %if.else304.i.i + %shr310.i.i = lshr i32 %I252.0.i.i, 1 + %sub313.i.i = sub i32 25, %shr310.i.i + br label %cond.end314.i.i + +cond.end314.i.i: ; preds = %cond.false309.i.i, %if.else304.i.i + %cond315.i.i = phi i32 [ %sub313.i.i, %cond.false309.i.i ], [ 0, %if.else304.i.i ] + %head31739.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %297, i32 0, i32 1 + %298 = load i32* %head31739.i.i, align 4, !tbaa !3 + %and31840.i.i = and i32 %298, -8 + %cmp31941.i.i = icmp eq i32 %and31840.i.i, %qsize.0.i.i + br i1 %cmp31941.i.i, label %if.else342.i.i, label %if.then321.lr.ph.i.i + +if.then321.lr.ph.i.i: ; preds = %cond.end314.i.i + %shl316.i.i = shl i32 %qsize.0.i.i, %cond315.i.i + br label %if.then321.i.i + +for.cond.i68.i: ; preds = %if.then321.i.i + %shl326.i.i = shl i32 %K305.043.i.i, 1 + %head317.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %300, i32 0, i32 1 + %299 = load i32* %head317.i.i, align 4, !tbaa !3 + %and318.i.i = and i32 %299, -8 + %cmp319.i.i = icmp eq i32 %and318.i.i, %qsize.0.i.i + br i1 %cmp319.i.i, label %if.else342.i.i, label %if.then321.i.i + +if.then321.i.i: ; preds = %for.cond.i68.i, %if.then321.lr.ph.i.i + %K305.043.i.i = phi i32 [ %shl316.i.i, %if.then321.lr.ph.i.i ], [ %shl326.i.i, %for.cond.i68.i ] + %T.042.i.i = phi %struct.malloc_tree_chunk* [ %297, %if.then321.lr.ph.i.i ], [ %300, %for.cond.i68.i ] + %shr322.i.i = lshr i32 %K305.043.i.i, 31 + %arrayidx325.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.042.i.i, i32 0, i32 4, i32 %shr322.i.i + %300 = load %struct.malloc_tree_chunk** %arrayidx325.i.i, align 4, !tbaa !0 + %cmp327.i.i = icmp eq %struct.malloc_tree_chunk* %300, null + br i1 %cmp327.i.i, label %if.else330.i.i, label %for.cond.i68.i + +if.else330.i.i: ; preds = %if.then321.i.i + %301 = bitcast %struct.malloc_tree_chunk** %arrayidx325.i.i to i8* + %302 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp332.i.i = icmp ult i8* %301, %302 + br i1 %cmp332.i.i, label %if.else340.i.i, label %if.then336.i.i, !prof !6 + +if.then336.i.i: ; preds = %if.else330.i.i + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %arrayidx325.i.i, align 4, !tbaa !0 + %add.ptr17.sum19.i.i = add i32 %add.ptr4.sum.i49.i, 24 + %parent337.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum19.i.i + %303 = bitcast i8* %parent337.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %T.042.i.i, %struct.malloc_tree_chunk** %303, align 4, !tbaa !0 + %add.ptr17.sum20.i.i = add i32 %add.ptr4.sum.i49.i, 12 + %bk338.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum20.i.i + %304 = bitcast i8* %bk338.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %304, align 4, !tbaa !0 + %add.ptr17.sum21.i.i = add i32 %add.ptr4.sum.i49.i, 8 + %fd339.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum21.i.i + %305 = bitcast i8* %fd339.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %305, align 4, !tbaa !0 + br label %prepend_alloc.exit.i + +if.else340.i.i: ; preds = %if.else330.i.i + tail call void @abort() #6 + unreachable + +if.else342.i.i: ; preds = %for.cond.i68.i, %cond.end314.i.i + %T.0.lcssa.i69.i = phi %struct.malloc_tree_chunk* [ %297, %cond.end314.i.i ], [ %300, %for.cond.i68.i ] + %fd344.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa.i69.i, i32 0, i32 2 + %306 = load %struct.malloc_tree_chunk** %fd344.i.i, align 4, !tbaa !0 + %307 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i69.i to i8* + %308 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp346.i.i = icmp ult i8* %307, %308 + br i1 %cmp346.i.i, label %if.else362.i.i, label %land.rhs348.i.i + +land.rhs348.i.i: ; preds = %if.else342.i.i + %309 = bitcast %struct.malloc_tree_chunk* %306 to i8* + %cmp350.i.i = icmp ult i8* %309, %308 + br i1 %cmp350.i.i, label %if.else362.i.i, label %if.then356.i.i, !prof !6 + +if.then356.i.i: ; preds = %land.rhs348.i.i + %bk357.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %306, i32 0, i32 3 + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %bk357.i.i, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %289, %struct.malloc_tree_chunk** %fd344.i.i, align 4, !tbaa !0 + %add.ptr17.sum16.i.i = add i32 %add.ptr4.sum.i49.i, 8 + %fd359.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum16.i.i + %310 = bitcast i8* %fd359.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %306, %struct.malloc_tree_chunk** %310, align 4, !tbaa !0 + %add.ptr17.sum17.i.i = add i32 %add.ptr4.sum.i49.i, 12 + %bk360.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum17.i.i + %311 = bitcast i8* %bk360.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* %T.0.lcssa.i69.i, %struct.malloc_tree_chunk** %311, align 4, !tbaa !0 + %add.ptr17.sum18.i.i = add i32 %add.ptr4.sum.i49.i, 24 + %parent361.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr17.sum18.i.i + %312 = bitcast i8* %parent361.i.i to %struct.malloc_tree_chunk** + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %312, align 4, !tbaa !0 + br label %prepend_alloc.exit.i + +if.else362.i.i: ; preds = %land.rhs348.i.i, %if.else342.i.i + tail call void @abort() #6 + unreachable + +prepend_alloc.exit.i: ; preds = %if.then356.i.i, %if.then336.i.i, %if.then297.i.i, %if.end244.i.i, %if.then25.i.i, %if.then.i51.i + %add.ptr4.sum1415.i.i = or i32 %cond.i42.i, 8 + %add.ptr368.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum1415.i.i + br label %postaction + +if.else245.i: ; preds = %land.lhs.true231.i, %while.body227.i + %313 = bitcast %struct.malloc_chunk* %188 to i8* + br label %for.cond.i.i.i + +for.cond.i.i.i: ; preds = %if.end.i.i.i, %if.else245.i + %sp.0.i.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.else245.i ], [ %316, %if.end.i.i.i ] + %base.i.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 0 + %314 = load i8** %base.i.i.i, align 4, !tbaa !0 + %cmp.i.i.i = icmp ugt i8* %314, %313 + br i1 %cmp.i.i.i, label %if.end.i.i.i, label %land.lhs.true.i.i.i + +land.lhs.true.i.i.i: ; preds = %for.cond.i.i.i + %size.i.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 1 + %315 = load i32* %size.i.i.i, align 4, !tbaa !3 + %add.ptr.i.i.i = getelementptr inbounds i8* %314, i32 %315 + %cmp2.i.i.i = icmp ugt i8* %add.ptr.i.i.i, %313 + br i1 %cmp2.i.i.i, label %segment_holding.exit.i.i, label %if.end.i.i.i + +if.end.i.i.i: ; preds = %land.lhs.true.i.i.i, %for.cond.i.i.i + %next.i.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i.i, i32 0, i32 2 + %316 = load %struct.malloc_segment** %next.i.i.i, align 4, !tbaa !0 + br label %for.cond.i.i.i + +segment_holding.exit.i.i: ; preds = %land.lhs.true.i.i.i + %add.ptr.sum.i.i = add i32 %315, -47 + %add.ptr2.sum.i.i = add i32 %315, -39 + %add.ptr3.i.i = getelementptr inbounds i8* %314, i32 %add.ptr2.sum.i.i + %317 = ptrtoint i8* %add.ptr3.i.i to i32 + %and.i14.i = and i32 %317, 7 + %cmp.i15.i = icmp eq i32 %and.i14.i, 0 + br i1 %cmp.i15.i, label %cond.end.i.i, label %cond.false.i16.i + +cond.false.i16.i: ; preds = %segment_holding.exit.i.i + %318 = sub i32 0, %317 + %and6.i.i = and i32 %318, 7 + br label %cond.end.i.i + +cond.end.i.i: ; preds = %cond.false.i16.i, %segment_holding.exit.i.i + %cond.i17.i = phi i32 [ %and6.i.i, %cond.false.i16.i ], [ 0, %segment_holding.exit.i.i ] + %add.ptr2.sum1.i.i = add i32 %add.ptr.sum.i.i, %cond.i17.i + %add.ptr7.i.i = getelementptr inbounds i8* %314, i32 %add.ptr2.sum1.i.i + %add.ptr82.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1 + %add.ptr8.i.i = bitcast %struct.malloc_chunk* %add.ptr82.i.i to i8* + %cmp9.i.i = icmp ult i8* %add.ptr7.i.i, %add.ptr8.i.i + %cond13.i.i = select i1 %cmp9.i.i, i8* %313, i8* %add.ptr7.i.i + %add.ptr14.i.i = getelementptr inbounds i8* %cond13.i.i, i32 8 + %319 = bitcast i8* %add.ptr14.i.i to %struct.malloc_segment* + %sub16.i.i = add i32 %tsize.290.i, -40 + %add.ptr.i10.i.i = getelementptr inbounds i8* %tbase.291.i, i32 8 + %320 = ptrtoint i8* %add.ptr.i10.i.i to i32 + %and.i.i.i = and i32 %320, 7 + %cmp.i11.i.i = icmp eq i32 %and.i.i.i, 0 + br i1 %cmp.i11.i.i, label %init_top.exit.i.i, label %cond.false.i.i.i + +cond.false.i.i.i: ; preds = %cond.end.i.i + %321 = sub i32 0, %320 + %and3.i.i.i = and i32 %321, 7 + br label %init_top.exit.i.i + +init_top.exit.i.i: ; preds = %cond.false.i.i.i, %cond.end.i.i + %cond.i.i.i = phi i32 [ %and3.i.i.i, %cond.false.i.i.i ], [ 0, %cond.end.i.i ] + %add.ptr4.i.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %cond.i.i.i + %322 = bitcast i8* %add.ptr4.i.i.i to %struct.malloc_chunk* + %sub5.i.i.i = sub i32 %sub16.i.i, %cond.i.i.i + store %struct.malloc_chunk* %322, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + store i32 %sub5.i.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %or.i.i.i = or i32 %sub5.i.i.i, 1 + %add.ptr4.sum.i.i.i = add i32 %cond.i.i.i, 4 + %head.i.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr4.sum.i.i.i + %323 = bitcast i8* %head.i.i.i to i32* + store i32 %or.i.i.i, i32* %323, align 4, !tbaa !3 + %add.ptr6.sum.i.i.i = add i32 %tsize.290.i, -36 + %head7.i.i.i = getelementptr inbounds i8* %tbase.291.i, i32 %add.ptr6.sum.i.i.i + %324 = bitcast i8* %head7.i.i.i to i32* + store i32 40, i32* %324, align 4, !tbaa !3 + %325 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 %325, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3 + %head.i18.i = getelementptr inbounds i8* %cond13.i.i, i32 4 + %326 = bitcast i8* %head.i18.i to i32* + store i32 27, i32* %326, align 4, !tbaa !3 + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %add.ptr14.i.i, i8* bitcast (%struct.malloc_segment* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16) to i8*), i32 16, i32 4, i1 false) #1, !tbaa.struct !7 + store i8* %tbase.291.i, i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 0), align 4, !tbaa !0 + store i32 %tsize.290.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 1), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 3), align 4, !tbaa !3 + store %struct.malloc_segment* %319, %struct.malloc_segment** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 2), align 4, !tbaa !0 + %add.ptr2418.i.i = getelementptr inbounds i8* %cond13.i.i, i32 28 + %327 = bitcast i8* %add.ptr2418.i.i to i32* + store i32 7, i32* %327, align 4, !tbaa !3 + %328 = getelementptr inbounds i8* %cond13.i.i, i32 32 + %cmp2719.i.i = icmp ult i8* %328, %add.ptr.i.i.i + br i1 %cmp2719.i.i, label %if.then.i19.i, label %for.end.i.i + +if.then.i19.i: ; preds = %if.then.i19.i, %init_top.exit.i.i + %add.ptr2420.i.i = phi i32* [ %329, %if.then.i19.i ], [ %327, %init_top.exit.i.i ] + %329 = getelementptr inbounds i32* %add.ptr2420.i.i, i32 1 + store i32 7, i32* %329, align 4, !tbaa !3 + %330 = getelementptr inbounds i32* %add.ptr2420.i.i, i32 2 + %331 = bitcast i32* %330 to i8* + %cmp27.i.i = icmp ult i8* %331, %add.ptr.i.i.i + br i1 %cmp27.i.i, label %if.then.i19.i, label %for.end.i.i + +for.end.i.i: ; preds = %if.then.i19.i, %init_top.exit.i.i + %cmp28.i.i = icmp eq i8* %cond13.i.i, %313 + br i1 %cmp28.i.i, label %if.end248.i, label %if.then29.i.i + +if.then29.i.i: ; preds = %for.end.i.i + %sub.ptr.lhs.cast.i.i = ptrtoint i8* %cond13.i.i to i32 + %sub.ptr.rhs.cast.i.i = ptrtoint %struct.malloc_chunk* %188 to i32 + %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i + %add.ptr30.i.i = getelementptr inbounds i8* %313, i32 %sub.ptr.sub.i.i + %add.ptr30.sum.i.i = add i32 %sub.ptr.sub.i.i, 4 + %head31.i.i = getelementptr inbounds i8* %313, i32 %add.ptr30.sum.i.i + %332 = bitcast i8* %head31.i.i to i32* + %333 = load i32* %332, align 4, !tbaa !3 + %and32.i.i = and i32 %333, -2 + store i32 %and32.i.i, i32* %332, align 4, !tbaa !3 + %or33.i.i = or i32 %sub.ptr.sub.i.i, 1 + %head34.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 1 + store i32 %or33.i.i, i32* %head34.i.i, align 4, !tbaa !3 + %prev_foot.i.i = bitcast i8* %add.ptr30.i.i to i32* + store i32 %sub.ptr.sub.i.i, i32* %prev_foot.i.i, align 4, !tbaa !3 + %shr.i.i = lshr i32 %sub.ptr.sub.i.i, 3 + %cmp36.i.i = icmp ult i32 %sub.ptr.sub.i.i, 256 + br i1 %cmp36.i.i, label %if.then37.i.i, label %if.else56.i.i + +if.then37.i.i: ; preds = %if.then29.i.i + %shl.i20.i = shl nuw nsw i32 %shr.i.i, 1 + %arrayidx.i21.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl.i20.i + %334 = bitcast %struct.malloc_chunk** %arrayidx.i21.i to %struct.malloc_chunk* + %335 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shl39.i.i = shl i32 1, %shr.i.i + %and40.i.i = and i32 %335, %shl39.i.i + %tobool.i.i = icmp eq i32 %and40.i.i, 0 + br i1 %tobool.i.i, label %if.then41.i.i, label %if.else45.i.i + +if.then41.i.i: ; preds = %if.then37.i.i + %or44.i.i = or i32 %335, %shl39.i.i + store i32 %or44.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %arrayidx.sum.pre.i.i = add i32 %shl.i20.i, 2 + %.pre.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum.pre.i.i + br label %if.end52.i.i + +if.else45.i.i: ; preds = %if.then37.i.i + %arrayidx.sum9.i.i = add i32 %shl.i20.i, 2 + %336 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx.sum9.i.i + %337 = load %struct.malloc_chunk** %336, align 4, !tbaa !0 + %338 = bitcast %struct.malloc_chunk* %337 to i8* + %339 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp46.i.i = icmp ult i8* %338, %339 + br i1 %cmp46.i.i, label %if.else50.i.i, label %if.end52.i.i, !prof !6 + +if.else50.i.i: ; preds = %if.else45.i.i + tail call void @abort() #6 + unreachable + +if.end52.i.i: ; preds = %if.else45.i.i, %if.then41.i.i + %.pre-phi.i.i = phi %struct.malloc_chunk** [ %336, %if.else45.i.i ], [ %.pre.i.i, %if.then41.i.i ] + %F.0.i.i = phi %struct.malloc_chunk* [ %337, %if.else45.i.i ], [ %334, %if.then41.i.i ] + store %struct.malloc_chunk* %188, %struct.malloc_chunk** %.pre-phi.i.i, align 4, !tbaa !0 + %bk.i.i = getelementptr inbounds %struct.malloc_chunk* %F.0.i.i, i32 0, i32 3 + store %struct.malloc_chunk* %188, %struct.malloc_chunk** %bk.i.i, align 4, !tbaa !0 + %fd54.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2 + store %struct.malloc_chunk* %F.0.i.i, %struct.malloc_chunk** %fd54.i.i, align 4, !tbaa !0 + %bk55.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3 + store %struct.malloc_chunk* %334, %struct.malloc_chunk** %bk55.i.i, align 4, !tbaa !0 + br label %if.end248.i + +if.else56.i.i: ; preds = %if.then29.i.i + %340 = bitcast %struct.malloc_chunk* %188 to %struct.malloc_tree_chunk* + %shr58.i.i = lshr i32 %sub.ptr.sub.i.i, 8 + %cmp59.i.i = icmp eq i32 %shr58.i.i, 0 + br i1 %cmp59.i.i, label %if.end90.i.i, label %if.else62.i.i + +if.else62.i.i: ; preds = %if.else56.i.i + %cmp63.i.i = icmp ugt i32 %sub.ptr.sub.i.i, 16777215 + br i1 %cmp63.i.i, label %if.end90.i.i, label %if.else66.i.i + +if.else66.i.i: ; preds = %if.else62.i.i + %sub67.i.i = add i32 %shr58.i.i, 1048320 + %shr68.i.i = lshr i32 %sub67.i.i, 16 + %and69.i.i = and i32 %shr68.i.i, 8 + %shl70.i.i = shl i32 %shr58.i.i, %and69.i.i + %sub71.i.i = add i32 %shl70.i.i, 520192 + %shr72.i.i = lshr i32 %sub71.i.i, 16 + %and73.i.i = and i32 %shr72.i.i, 4 + %add74.i.i = or i32 %and73.i.i, %and69.i.i + %shl75.i.i = shl i32 %shl70.i.i, %and73.i.i + %sub76.i.i = add i32 %shl75.i.i, 245760 + %shr77.i.i = lshr i32 %sub76.i.i, 16 + %and78.i.i = and i32 %shr77.i.i, 2 + %add79.i.i = or i32 %add74.i.i, %and78.i.i + %sub80.i.i = sub i32 14, %add79.i.i + %shl81.i.i = shl i32 %shl75.i.i, %and78.i.i + %shr82.i.i = lshr i32 %shl81.i.i, 15 + %add83.i.i = add i32 %sub80.i.i, %shr82.i.i + %shl84.i.i = shl nsw i32 %add83.i.i, 1 + %add85.i.i = add i32 %add83.i.i, 7 + %shr86.i.i = lshr i32 %sub.ptr.sub.i.i, %add85.i.i + %and87.i.i = and i32 %shr86.i.i, 1 + %add88.i.i = or i32 %and87.i.i, %shl84.i.i + br label %if.end90.i.i + +if.end90.i.i: ; preds = %if.else66.i.i, %if.else62.i.i, %if.else56.i.i + %I57.0.i.i = phi i32 [ %add88.i.i, %if.else66.i.i ], [ 0, %if.else56.i.i ], [ 31, %if.else62.i.i ] + %arrayidx91.i.i = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I57.0.i.i + %index.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 3 + %I57.0.c.i.i = inttoptr i32 %I57.0.i.i to %struct.malloc_chunk* + store %struct.malloc_chunk* %I57.0.c.i.i, %struct.malloc_chunk** %index.i.i, align 4, !tbaa !3 + %arrayidx92.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 1 + store i32 0, i32* %arrayidx92.i.i, align 4, !tbaa !0 + %341 = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 0 + store i32 0, i32* %341, align 4, !tbaa !0 + %342 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %shl95.i.i = shl i32 1, %I57.0.i.i + %and96.i.i = and i32 %342, %shl95.i.i + %tobool97.i.i = icmp eq i32 %and96.i.i, 0 + br i1 %tobool97.i.i, label %if.then98.i.i, label %if.else104.i.i + +if.then98.i.i: ; preds = %if.end90.i.i + %or101.i.i = or i32 %342, %shl95.i.i + store i32 %or101.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %arrayidx91.i.i, align 4, !tbaa !0 + %parent.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 2 + %.c.i.i = bitcast %struct.malloc_tree_chunk** %arrayidx91.i.i to %struct.malloc_chunk* + store %struct.malloc_chunk* %.c.i.i, %struct.malloc_chunk** %parent.i.i, align 4, !tbaa !0 + %bk102.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3 + store %struct.malloc_chunk* %188, %struct.malloc_chunk** %bk102.i.i, align 4, !tbaa !0 + %fd103.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2 + store %struct.malloc_chunk* %188, %struct.malloc_chunk** %fd103.i.i, align 4, !tbaa !0 + br label %if.end248.i + +if.else104.i.i: ; preds = %if.end90.i.i + %343 = load %struct.malloc_tree_chunk** %arrayidx91.i.i, align 4, !tbaa !0 + %cmp106.i.i = icmp eq i32 %I57.0.i.i, 31 + br i1 %cmp106.i.i, label %cond.end114.i.i, label %cond.false109.i.i + +cond.false109.i.i: ; preds = %if.else104.i.i + %shr110.i.i = lshr i32 %I57.0.i.i, 1 + %sub113.i.i = sub i32 25, %shr110.i.i + br label %cond.end114.i.i + +cond.end114.i.i: ; preds = %cond.false109.i.i, %if.else104.i.i + %cond115.i.i = phi i32 [ %sub113.i.i, %cond.false109.i.i ], [ 0, %if.else104.i.i ] + %head11813.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %343, i32 0, i32 1 + %344 = load i32* %head11813.i.i, align 4, !tbaa !3 + %and11914.i.i = and i32 %344, -8 + %cmp12015.i.i = icmp eq i32 %and11914.i.i, %sub.ptr.sub.i.i + br i1 %cmp12015.i.i, label %if.else143.i.i, label %if.then122.lr.ph.i.i + +if.then122.lr.ph.i.i: ; preds = %cond.end114.i.i + %shl116.i.i = shl i32 %sub.ptr.sub.i.i, %cond115.i.i + br label %if.then122.i.i + +for.cond117.i.i: ; preds = %if.then122.i.i + %shl127.i.i = shl i32 %K105.017.i.i, 1 + %head118.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %346, i32 0, i32 1 + %345 = load i32* %head118.i.i, align 4, !tbaa !3 + %and119.i.i = and i32 %345, -8 + %cmp120.i.i = icmp eq i32 %and119.i.i, %sub.ptr.sub.i.i + br i1 %cmp120.i.i, label %if.else143.i.i, label %if.then122.i.i + +if.then122.i.i: ; preds = %for.cond117.i.i, %if.then122.lr.ph.i.i + %K105.017.i.i = phi i32 [ %shl116.i.i, %if.then122.lr.ph.i.i ], [ %shl127.i.i, %for.cond117.i.i ] + %T.016.i.i = phi %struct.malloc_tree_chunk* [ %343, %if.then122.lr.ph.i.i ], [ %346, %for.cond117.i.i ] + %shr123.i.i = lshr i32 %K105.017.i.i, 31 + %arrayidx126.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.016.i.i, i32 0, i32 4, i32 %shr123.i.i + %346 = load %struct.malloc_tree_chunk** %arrayidx126.i.i, align 4, !tbaa !0 + %cmp128.i.i = icmp eq %struct.malloc_tree_chunk* %346, null + br i1 %cmp128.i.i, label %if.else131.i.i, label %for.cond117.i.i + +if.else131.i.i: ; preds = %if.then122.i.i + %347 = bitcast %struct.malloc_tree_chunk** %arrayidx126.i.i to i8* + %348 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp133.i.i = icmp ult i8* %347, %348 + br i1 %cmp133.i.i, label %if.else141.i.i, label %if.then137.i.i, !prof !6 + +if.then137.i.i: ; preds = %if.else131.i.i + store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %arrayidx126.i.i, align 4, !tbaa !0 + %parent138.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 2 + %T.0.c6.i.i = bitcast %struct.malloc_tree_chunk* %T.016.i.i to %struct.malloc_chunk* + store %struct.malloc_chunk* %T.0.c6.i.i, %struct.malloc_chunk** %parent138.i.i, align 4, !tbaa !0 + %bk139.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3 + store %struct.malloc_chunk* %188, %struct.malloc_chunk** %bk139.i.i, align 4, !tbaa !0 + %fd140.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2 + store %struct.malloc_chunk* %188, %struct.malloc_chunk** %fd140.i.i, align 4, !tbaa !0 + br label %if.end248.i + +if.else141.i.i: ; preds = %if.else131.i.i + tail call void @abort() #6 + unreachable + +if.else143.i.i: ; preds = %for.cond117.i.i, %cond.end114.i.i + %T.0.lcssa.i.i = phi %struct.malloc_tree_chunk* [ %343, %cond.end114.i.i ], [ %346, %for.cond117.i.i ] + %fd145.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa.i.i, i32 0, i32 2 + %349 = load %struct.malloc_tree_chunk** %fd145.i.i, align 4, !tbaa !0 + %350 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i.i to i8* + %351 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp147.i.i = icmp ult i8* %350, %351 + br i1 %cmp147.i.i, label %if.else160.i.i, label %land.rhs.i.i + +land.rhs.i.i: ; preds = %if.else143.i.i + %352 = bitcast %struct.malloc_tree_chunk* %349 to i8* + %cmp150.i.i = icmp ult i8* %352, %351 + br i1 %cmp150.i.i, label %if.else160.i.i, label %if.then154.i.i, !prof !6 + +if.then154.i.i: ; preds = %land.rhs.i.i + %bk155.i.i = getelementptr inbounds %struct.malloc_tree_chunk* %349, i32 0, i32 3 + store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %bk155.i.i, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %340, %struct.malloc_tree_chunk** %fd145.i.i, align 4, !tbaa !0 + %fd157.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 2 + %.c5.i.i = bitcast %struct.malloc_tree_chunk* %349 to %struct.malloc_chunk* + store %struct.malloc_chunk* %.c5.i.i, %struct.malloc_chunk** %fd157.i.i, align 4, !tbaa !0 + %bk158.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 0, i32 3 + %T.0.c.i.i = bitcast %struct.malloc_tree_chunk* %T.0.lcssa.i.i to %struct.malloc_chunk* + store %struct.malloc_chunk* %T.0.c.i.i, %struct.malloc_chunk** %bk158.i.i, align 4, !tbaa !0 + %parent159.i.i = getelementptr inbounds %struct.malloc_chunk* %188, i32 1, i32 2 + store %struct.malloc_chunk* null, %struct.malloc_chunk** %parent159.i.i, align 4, !tbaa !0 + br label %if.end248.i + +if.else160.i.i: ; preds = %land.rhs.i.i, %if.else143.i.i + tail call void @abort() #6 + unreachable + +if.end248.i: ; preds = %if.then154.i.i, %if.then137.i.i, %if.then98.i.i, %if.end52.i.i, %for.end.i.i, %init_top.exit36.i, %init_top.exit.i + %353 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %cmp250.i = icmp ugt i32 %353, %nb.0 + br i1 %cmp250.i, label %if.then251.i, label %if.end264.i + +if.then251.i: ; preds = %if.end248.i + %sub253.i = sub i32 %353, %nb.0 + store i32 %sub253.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %354 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %355 = bitcast %struct.malloc_chunk* %354 to i8* + %add.ptr255.i = getelementptr inbounds i8* %355, i32 %nb.0 + %356 = bitcast i8* %add.ptr255.i to %struct.malloc_chunk* + store %struct.malloc_chunk* %356, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %or257.i = or i32 %sub253.i, 1 + %add.ptr255.sum.i = add i32 %nb.0, 4 + %head258.i = getelementptr inbounds i8* %355, i32 %add.ptr255.sum.i + %357 = bitcast i8* %head258.i to i32* + store i32 %or257.i, i32* %357, align 4, !tbaa !3 + %or260.i = or i32 %nb.0, 3 + %head261.i = getelementptr inbounds %struct.malloc_chunk* %354, i32 0, i32 1 + store i32 %or260.i, i32* %head261.i, align 4, !tbaa !3 + %add.ptr262.i = getelementptr inbounds %struct.malloc_chunk* %354, i32 0, i32 2 + %358 = bitcast %struct.malloc_chunk** %add.ptr262.i to i8* + br label %postaction + +if.end264.i: ; preds = %if.end248.i, %if.end143.i, %if.then125.i, %if.end121.i + %call265.i = tail call i32* @__errno_location() #7 + store i32 12, i32* %call265.i, align 4, !tbaa !3 + br label %postaction + +postaction: ; preds = %if.end264.i, %if.then251.i, %prepend_alloc.exit.i, %if.then16.i, %if.end8.i, %if.then185, %if.end180, %tmalloc_large.exit, %tmalloc_small.exit, %if.end125, %if.end21 + %mem.0 = phi i8* [ %11, %if.end21 ], [ %31, %if.end125 ], [ %77, %tmalloc_small.exit ], [ %160, %if.end180 ], [ %166, %if.then185 ], [ %151, %tmalloc_large.exit ], [ %358, %if.then251.i ], [ null, %if.end264.i ], [ %add.ptr368.i.i, %prepend_alloc.exit.i ], [ null, %if.end8.i ], [ null, %if.then16.i ] + ret i8* %mem.0 +} + +; Function Attrs: noreturn +declare void @abort() #4 + +; Function Attrs: nounwind +define weak void @free(i8* %mem) #0 { +entry: + %cmp = icmp eq i8* %mem, null + br i1 %cmp, label %if.end635, label %if.then + +if.then: ; preds = %entry + %add.ptr = getelementptr inbounds i8* %mem, i32 -8 + %0 = bitcast i8* %add.ptr to %struct.malloc_chunk* + %1 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp1 = icmp ult i8* %add.ptr, %1 + br i1 %cmp1, label %erroraction, label %land.rhs + +land.rhs: ; preds = %if.then + %head = getelementptr inbounds i8* %mem, i32 -4 + %2 = bitcast i8* %head to i32* + %3 = load i32* %2, align 4, !tbaa !3 + %and = and i32 %3, 3 + %cmp2 = icmp eq i32 %and, 1 + br i1 %cmp2, label %erroraction, label %if.then3, !prof !6 + +if.then3: ; preds = %land.rhs + %and5 = and i32 %3, -8 + %add.ptr.sum = add i32 %and5, -8 + %add.ptr6 = getelementptr inbounds i8* %mem, i32 %add.ptr.sum + %4 = bitcast i8* %add.ptr6 to %struct.malloc_chunk* + %and8 = and i32 %3, 1 + %tobool9 = icmp eq i32 %and8, 0 + br i1 %tobool9, label %if.then10, label %if.end224 + +if.then10: ; preds = %if.then3 + %prev_foot = bitcast i8* %add.ptr to i32* + %5 = load i32* %prev_foot, align 4, !tbaa !3 + %cmp13 = icmp eq i32 %and, 0 + br i1 %cmp13, label %if.end635, label %if.else + +if.else: ; preds = %if.then10 + %add.ptr.sum230 = sub i32 -8, %5 + %add.ptr16 = getelementptr inbounds i8* %mem, i32 %add.ptr.sum230 + %6 = bitcast i8* %add.ptr16 to %struct.malloc_chunk* + %add17 = add i32 %5, %and5 + %cmp18 = icmp ult i8* %add.ptr16, %1 + br i1 %cmp18, label %erroraction, label %if.then21, !prof !6 + +if.then21: ; preds = %if.else + %7 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp22 = icmp eq %struct.malloc_chunk* %6, %7 + br i1 %cmp22, label %if.else208, label %if.then24 + +if.then24: ; preds = %if.then21 + %shr = lshr i32 %5, 3 + %cmp25 = icmp ult i32 %5, 256 + br i1 %cmp25, label %if.then27, label %if.else72 + +if.then27: ; preds = %if.then24 + %add.ptr16.sum257 = add i32 %add.ptr.sum230, 8 + %fd = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum257 + %8 = bitcast i8* %fd to %struct.malloc_chunk** + %9 = load %struct.malloc_chunk** %8, align 4, !tbaa !0 + %add.ptr16.sum258 = add i32 %add.ptr.sum230, 12 + %bk = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum258 + %10 = bitcast i8* %bk to %struct.malloc_chunk** + %11 = load %struct.malloc_chunk** %10, align 4, !tbaa !0 + %shl = shl nuw nsw i32 %shr, 1 + %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl + %12 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk* + %cmp29 = icmp eq %struct.malloc_chunk* %9, %12 + br i1 %cmp29, label %if.then41, label %lor.rhs + +lor.rhs: ; preds = %if.then27 + %13 = bitcast %struct.malloc_chunk* %9 to i8* + %cmp31 = icmp ult i8* %13, %1 + br i1 %cmp31, label %if.else70, label %land.rhs33 + +land.rhs33: ; preds = %lor.rhs + %bk34 = getelementptr inbounds %struct.malloc_chunk* %9, i32 0, i32 3 + %14 = load %struct.malloc_chunk** %bk34, align 4, !tbaa !0 + %cmp35 = icmp eq %struct.malloc_chunk* %14, %6 + br i1 %cmp35, label %if.then41, label %if.else70, !prof !5 + +if.then41: ; preds = %land.rhs33, %if.then27 + %cmp42 = icmp eq %struct.malloc_chunk* %11, %9 + br i1 %cmp42, label %if.then44, label %if.else47 + +if.then44: ; preds = %if.then41 + %shl45 = shl i32 1, %shr + %neg = xor i32 %shl45, -1 + %15 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %and46 = and i32 %15, %neg + store i32 %and46, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end224 + +if.else47: ; preds = %if.then41 + %cmp50 = icmp eq %struct.malloc_chunk* %11, %12 + br i1 %cmp50, label %if.else47.if.then65_crit_edge, label %lor.rhs52 + +if.else47.if.then65_crit_edge: ; preds = %if.else47 + %fd67.pre = getelementptr inbounds %struct.malloc_chunk* %11, i32 0, i32 2 + br label %if.then65 + +lor.rhs52: ; preds = %if.else47 + %16 = bitcast %struct.malloc_chunk* %11 to i8* + %cmp53 = icmp ult i8* %16, %1 + br i1 %cmp53, label %if.else68, label %land.rhs55 + +land.rhs55: ; preds = %lor.rhs52 + %fd56 = getelementptr inbounds %struct.malloc_chunk* %11, i32 0, i32 2 + %17 = load %struct.malloc_chunk** %fd56, align 4, !tbaa !0 + %cmp57 = icmp eq %struct.malloc_chunk* %17, %6 + br i1 %cmp57, label %if.then65, label %if.else68, !prof !5 + +if.then65: ; preds = %land.rhs55, %if.else47.if.then65_crit_edge + %fd67.pre-phi = phi %struct.malloc_chunk** [ %fd67.pre, %if.else47.if.then65_crit_edge ], [ %fd56, %land.rhs55 ] + %bk66 = getelementptr inbounds %struct.malloc_chunk* %9, i32 0, i32 3 + store %struct.malloc_chunk* %11, %struct.malloc_chunk** %bk66, align 4, !tbaa !0 + store %struct.malloc_chunk* %9, %struct.malloc_chunk** %fd67.pre-phi, align 4, !tbaa !0 + br label %if.end224 + +if.else68: ; preds = %land.rhs55, %lor.rhs52 + tail call void @abort() #6 + unreachable + +if.else70: ; preds = %land.rhs33, %lor.rhs + tail call void @abort() #6 + unreachable + +if.else72: ; preds = %if.then24 + %18 = bitcast i8* %add.ptr16 to %struct.malloc_tree_chunk* + %add.ptr16.sum251 = add i32 %add.ptr.sum230, 24 + %parent = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum251 + %19 = bitcast i8* %parent to %struct.malloc_tree_chunk** + %20 = load %struct.malloc_tree_chunk** %19, align 4, !tbaa !0 + %add.ptr16.sum252 = add i32 %add.ptr.sum230, 12 + %bk73 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum252 + %21 = bitcast i8* %bk73 to %struct.malloc_tree_chunk** + %22 = load %struct.malloc_tree_chunk** %21, align 4, !tbaa !0 + %cmp74 = icmp eq %struct.malloc_tree_chunk* %22, %18 + br i1 %cmp74, label %if.else98, label %if.then76 + +if.then76: ; preds = %if.else72 + %add.ptr16.sum256 = add i32 %add.ptr.sum230, 8 + %fd78 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum256 + %23 = bitcast i8* %fd78 to %struct.malloc_tree_chunk** + %24 = load %struct.malloc_tree_chunk** %23, align 4, !tbaa !0 + %25 = bitcast %struct.malloc_tree_chunk* %24 to i8* + %cmp80 = icmp ult i8* %25, %1 + br i1 %cmp80, label %if.else96, label %land.lhs.true + +land.lhs.true: ; preds = %if.then76 + %bk82 = getelementptr inbounds %struct.malloc_tree_chunk* %24, i32 0, i32 3 + %26 = load %struct.malloc_tree_chunk** %bk82, align 4, !tbaa !0 + %cmp83 = icmp eq %struct.malloc_tree_chunk* %26, %18 + br i1 %cmp83, label %land.rhs85, label %if.else96 + +land.rhs85: ; preds = %land.lhs.true + %fd86 = getelementptr inbounds %struct.malloc_tree_chunk* %22, i32 0, i32 2 + %27 = load %struct.malloc_tree_chunk** %fd86, align 4, !tbaa !0 + %cmp87 = icmp eq %struct.malloc_tree_chunk* %27, %18 + br i1 %cmp87, label %if.then93, label %if.else96, !prof !5 + +if.then93: ; preds = %land.rhs85 + store %struct.malloc_tree_chunk* %22, %struct.malloc_tree_chunk** %bk82, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %24, %struct.malloc_tree_chunk** %fd86, align 4, !tbaa !0 + br label %if.end126 + +if.else96: ; preds = %land.rhs85, %land.lhs.true, %if.then76 + tail call void @abort() #6 + unreachable + +if.else98: ; preds = %if.else72 + %child.sum = add i32 %add.ptr.sum230, 20 + %arrayidx99 = getelementptr inbounds i8* %mem, i32 %child.sum + %28 = bitcast i8* %arrayidx99 to %struct.malloc_tree_chunk** + %29 = load %struct.malloc_tree_chunk** %28, align 4, !tbaa !0 + %cmp100 = icmp eq %struct.malloc_tree_chunk* %29, null + br i1 %cmp100, label %lor.lhs.false, label %while.cond + +lor.lhs.false: ; preds = %if.else98 + %add.ptr16.sum253 = add i32 %add.ptr.sum230, 16 + %child = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum253 + %arrayidx103 = bitcast i8* %child to %struct.malloc_tree_chunk** + %30 = load %struct.malloc_tree_chunk** %arrayidx103, align 4, !tbaa !0 + %cmp104 = icmp eq %struct.malloc_tree_chunk* %30, null + br i1 %cmp104, label %if.end126, label %while.cond + +while.cond: ; preds = %lor.rhs111, %while.cond, %lor.lhs.false, %if.else98 + %RP.0 = phi %struct.malloc_tree_chunk** [ %arrayidx103, %lor.lhs.false ], [ %28, %if.else98 ], [ %arrayidx108, %while.cond ], [ %arrayidx113, %lor.rhs111 ] + %R.0 = phi %struct.malloc_tree_chunk* [ %30, %lor.lhs.false ], [ %29, %if.else98 ], [ %31, %while.cond ], [ %32, %lor.rhs111 ] + %arrayidx108 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 1 + %31 = load %struct.malloc_tree_chunk** %arrayidx108, align 4, !tbaa !0 + %cmp109 = icmp eq %struct.malloc_tree_chunk* %31, null + br i1 %cmp109, label %lor.rhs111, label %while.cond + +lor.rhs111: ; preds = %while.cond + %arrayidx113 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 0 + %32 = load %struct.malloc_tree_chunk** %arrayidx113, align 4, !tbaa !0 + %cmp114 = icmp eq %struct.malloc_tree_chunk* %32, null + br i1 %cmp114, label %while.end, label %while.cond + +while.end: ; preds = %lor.rhs111 + %33 = bitcast %struct.malloc_tree_chunk** %RP.0 to i8* + %cmp118 = icmp ult i8* %33, %1 + br i1 %cmp118, label %if.else123, label %if.then122, !prof !6 + +if.then122: ; preds = %while.end + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0, align 4, !tbaa !0 + br label %if.end126 + +if.else123: ; preds = %while.end + tail call void @abort() #6 + unreachable + +if.end126: ; preds = %if.then122, %lor.lhs.false, %if.then93 + %R.1 = phi %struct.malloc_tree_chunk* [ %22, %if.then93 ], [ %R.0, %if.then122 ], [ null, %lor.lhs.false ] + %cmp127 = icmp eq %struct.malloc_tree_chunk* %20, null + br i1 %cmp127, label %if.end224, label %if.then129 + +if.then129: ; preds = %if.end126 + %add.ptr16.sum254 = add i32 %add.ptr.sum230, 28 + %index = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum254 + %34 = bitcast i8* %index to i32* + %35 = load i32* %34, align 4, !tbaa !3 + %arrayidx130 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %35 + %36 = load %struct.malloc_tree_chunk** %arrayidx130, align 4, !tbaa !0 + %cmp131 = icmp eq %struct.malloc_tree_chunk* %18, %36 + br i1 %cmp131, label %if.then133, label %if.else142 + +if.then133: ; preds = %if.then129 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx130, align 4, !tbaa !0 + %cond263 = icmp eq %struct.malloc_tree_chunk* %R.1, null + br i1 %cond263, label %if.end161.thread, label %if.then164 + +if.end161.thread: ; preds = %if.then133 + %shl138 = shl i32 1, %35 + %neg139 = xor i32 %shl138, -1 + %37 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and140 = and i32 %37, %neg139 + store i32 %and140, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end224 + +if.else142: ; preds = %if.then129 + %38 = bitcast %struct.malloc_tree_chunk* %20 to i8* + %39 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp143 = icmp ult i8* %38, %39 + br i1 %cmp143, label %if.else159, label %if.then147, !prof !6 + +if.then147: ; preds = %if.else142 + %arrayidx149 = getelementptr inbounds %struct.malloc_tree_chunk* %20, i32 0, i32 4, i32 0 + %40 = load %struct.malloc_tree_chunk** %arrayidx149, align 4, !tbaa !0 + %cmp150 = icmp eq %struct.malloc_tree_chunk* %40, %18 + br i1 %cmp150, label %if.then152, label %if.else155 + +if.then152: ; preds = %if.then147 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx149, align 4, !tbaa !0 + br label %if.end161 + +if.else155: ; preds = %if.then147 + %arrayidx157 = getelementptr inbounds %struct.malloc_tree_chunk* %20, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx157, align 4, !tbaa !0 + br label %if.end161 + +if.else159: ; preds = %if.else142 + tail call void @abort() #6 + unreachable + +if.end161: ; preds = %if.else155, %if.then152 + %cmp162 = icmp eq %struct.malloc_tree_chunk* %R.1, null + br i1 %cmp162, label %if.end224, label %if.then164 + +if.then164: ; preds = %if.end161, %if.then133 + %41 = bitcast %struct.malloc_tree_chunk* %R.1 to i8* + %42 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp165 = icmp ult i8* %41, %42 + br i1 %cmp165, label %if.else203, label %if.then169, !prof !6 + +if.then169: ; preds = %if.then164 + %parent170 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 5 + store %struct.malloc_tree_chunk* %20, %struct.malloc_tree_chunk** %parent170, align 4, !tbaa !0 + %add.ptr16.sum255 = add i32 %add.ptr.sum230, 16 + %child171 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum255 + %arrayidx172 = bitcast i8* %child171 to %struct.malloc_tree_chunk** + %43 = load %struct.malloc_tree_chunk** %arrayidx172, align 4, !tbaa !0 + %cmp173 = icmp eq %struct.malloc_tree_chunk* %43, null + br i1 %cmp173, label %if.end186, label %if.then175 + +if.then175: ; preds = %if.then169 + %44 = bitcast %struct.malloc_tree_chunk* %43 to i8* + %45 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp176 = icmp ult i8* %44, %45 + br i1 %cmp176, label %if.else184, label %if.then180, !prof !6 + +if.then180: ; preds = %if.then175 + %arrayidx182 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %43, %struct.malloc_tree_chunk** %arrayidx182, align 4, !tbaa !0 + %parent183 = getelementptr inbounds %struct.malloc_tree_chunk* %43, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent183, align 4, !tbaa !0 + br label %if.end186 + +if.else184: ; preds = %if.then175 + tail call void @abort() #6 + unreachable + +if.end186: ; preds = %if.then180, %if.then169 + %child171.sum = add i32 %add.ptr.sum230, 20 + %arrayidx188 = getelementptr inbounds i8* %mem, i32 %child171.sum + %46 = bitcast i8* %arrayidx188 to %struct.malloc_tree_chunk** + %47 = load %struct.malloc_tree_chunk** %46, align 4, !tbaa !0 + %cmp189 = icmp eq %struct.malloc_tree_chunk* %47, null + br i1 %cmp189, label %if.end224, label %if.then191 + +if.then191: ; preds = %if.end186 + %48 = bitcast %struct.malloc_tree_chunk* %47 to i8* + %49 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp192 = icmp ult i8* %48, %49 + br i1 %cmp192, label %if.else200, label %if.then196, !prof !6 + +if.then196: ; preds = %if.then191 + %arrayidx198 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %47, %struct.malloc_tree_chunk** %arrayidx198, align 4, !tbaa !0 + %parent199 = getelementptr inbounds %struct.malloc_tree_chunk* %47, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent199, align 4, !tbaa !0 + br label %if.end224 + +if.else200: ; preds = %if.then191 + tail call void @abort() #6 + unreachable + +if.else203: ; preds = %if.then164 + tail call void @abort() #6 + unreachable + +if.else208: ; preds = %if.then21 + %add.ptr6.sum = add i32 %and5, -4 + %head209 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum + %50 = bitcast i8* %head209 to i32* + %51 = load i32* %50, align 4, !tbaa !3 + %and210 = and i32 %51, 3 + %cmp211 = icmp eq i32 %and210, 3 + br i1 %cmp211, label %if.then213, label %if.end224 + +if.then213: ; preds = %if.else208 + store i32 %add17, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %52 = load i32* %50, align 4, !tbaa !3 + %and215 = and i32 %52, -2 + store i32 %and215, i32* %50, align 4, !tbaa !3 + %or = or i32 %add17, 1 + %add.ptr16.sum = add i32 %add.ptr.sum230, 4 + %head216 = getelementptr inbounds i8* %mem, i32 %add.ptr16.sum + %53 = bitcast i8* %head216 to i32* + store i32 %or, i32* %53, align 4, !tbaa !3 + %prev_foot218 = bitcast i8* %add.ptr6 to i32* + store i32 %add17, i32* %prev_foot218, align 4, !tbaa !3 + br label %if.end635 + +if.end224: ; preds = %if.else208, %if.then196, %if.end186, %if.end161, %if.end161.thread, %if.end126, %if.then65, %if.then44, %if.then3 + %psize.0 = phi i32 [ %and5, %if.then3 ], [ %add17, %if.then44 ], [ %add17, %if.then65 ], [ %add17, %if.then196 ], [ %add17, %if.end186 ], [ %add17, %if.end161 ], [ %add17, %if.end126 ], [ %add17, %if.else208 ], [ %add17, %if.end161.thread ] + %p.0 = phi %struct.malloc_chunk* [ %0, %if.then3 ], [ %6, %if.then44 ], [ %6, %if.then65 ], [ %6, %if.then196 ], [ %6, %if.end186 ], [ %6, %if.end161 ], [ %6, %if.end126 ], [ %6, %if.else208 ], [ %6, %if.end161.thread ] + %54 = bitcast %struct.malloc_chunk* %p.0 to i8* + %cmp225 = icmp ult i8* %54, %add.ptr6 + br i1 %cmp225, label %land.rhs227, label %erroraction + +land.rhs227: ; preds = %if.end224 + %add.ptr6.sum249 = add i32 %and5, -4 + %head228 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum249 + %55 = bitcast i8* %head228 to i32* + %56 = load i32* %55, align 4, !tbaa !3 + %and229 = and i32 %56, 1 + %tobool230 = icmp eq i32 %and229, 0 + br i1 %tobool230, label %erroraction, label %if.then235, !prof !6 + +if.then235: ; preds = %land.rhs227 + %and237 = and i32 %56, 2 + %tobool238 = icmp eq i32 %and237, 0 + br i1 %tobool238, label %if.then239, label %if.else485 + +if.then239: ; preds = %if.then235 + %57 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp240 = icmp eq %struct.malloc_chunk* %4, %57 + br i1 %cmp240, label %if.then242, label %if.else250 + +if.then242: ; preds = %if.then239 + %58 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add243 = add i32 %58, %psize.0 + store i32 %add243, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %or244 = or i32 %add243, 1 + %head245 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1 + store i32 %or244, i32* %head245, align 4, !tbaa !3 + %59 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp246 = icmp eq %struct.malloc_chunk* %p.0, %59 + br i1 %cmp246, label %if.then248, label %if.end635 + +if.then248: ; preds = %if.then242 + store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + br label %if.end635 + +if.else250: ; preds = %if.then239 + %60 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp251 = icmp eq %struct.malloc_chunk* %4, %60 + br i1 %cmp251, label %if.then253, label %if.else259 + +if.then253: ; preds = %if.else250 + %61 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %add254 = add i32 %61, %psize.0 + store i32 %add254, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %or255 = or i32 %add254, 1 + %head256 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1 + store i32 %or255, i32* %head256, align 4, !tbaa !3 + %add.ptr257 = getelementptr inbounds i8* %54, i32 %add254 + %prev_foot258 = bitcast i8* %add.ptr257 to i32* + store i32 %add254, i32* %prev_foot258, align 4, !tbaa !3 + br label %if.end635 + +if.else259: ; preds = %if.else250 + %and261 = and i32 %56, -8 + %add262 = add i32 %and261, %psize.0 + %shr263 = lshr i32 %56, 3 + %cmp264 = icmp ult i32 %56, 256 + br i1 %cmp264, label %if.then266, label %if.else323 + +if.then266: ; preds = %if.else259 + %fd268 = getelementptr inbounds i8* %mem, i32 %and5 + %62 = bitcast i8* %fd268 to %struct.malloc_chunk** + %63 = load %struct.malloc_chunk** %62, align 4, !tbaa !0 + %add.ptr6.sum247248 = or i32 %and5, 4 + %bk270 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum247248 + %64 = bitcast i8* %bk270 to %struct.malloc_chunk** + %65 = load %struct.malloc_chunk** %64, align 4, !tbaa !0 + %shl273 = shl nuw nsw i32 %shr263, 1 + %arrayidx274 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl273 + %66 = bitcast %struct.malloc_chunk** %arrayidx274 to %struct.malloc_chunk* + %cmp275 = icmp eq %struct.malloc_chunk* %63, %66 + br i1 %cmp275, label %if.then290, label %lor.rhs277 + +lor.rhs277: ; preds = %if.then266 + %67 = bitcast %struct.malloc_chunk* %63 to i8* + %68 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp278 = icmp ult i8* %67, %68 + br i1 %cmp278, label %if.else321, label %land.rhs280 + +land.rhs280: ; preds = %lor.rhs277 + %bk281 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3 + %69 = load %struct.malloc_chunk** %bk281, align 4, !tbaa !0 + %cmp282 = icmp eq %struct.malloc_chunk* %69, %4 + br i1 %cmp282, label %if.then290, label %if.else321, !prof !5 + +if.then290: ; preds = %land.rhs280, %if.then266 + %cmp291 = icmp eq %struct.malloc_chunk* %65, %63 + br i1 %cmp291, label %if.then293, label %if.else297 + +if.then293: ; preds = %if.then290 + %shl294 = shl i32 1, %shr263 + %neg295 = xor i32 %shl294, -1 + %70 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %and296 = and i32 %70, %neg295 + store i32 %and296, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end474 + +if.else297: ; preds = %if.then290 + %cmp300 = icmp eq %struct.malloc_chunk* %65, %66 + br i1 %cmp300, label %if.else297.if.then315_crit_edge, label %lor.rhs302 + +if.else297.if.then315_crit_edge: ; preds = %if.else297 + %fd317.pre = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2 + br label %if.then315 + +lor.rhs302: ; preds = %if.else297 + %71 = bitcast %struct.malloc_chunk* %65 to i8* + %72 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp303 = icmp ult i8* %71, %72 + br i1 %cmp303, label %if.else318, label %land.rhs305 + +land.rhs305: ; preds = %lor.rhs302 + %fd306 = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2 + %73 = load %struct.malloc_chunk** %fd306, align 4, !tbaa !0 + %cmp307 = icmp eq %struct.malloc_chunk* %73, %4 + br i1 %cmp307, label %if.then315, label %if.else318, !prof !5 + +if.then315: ; preds = %land.rhs305, %if.else297.if.then315_crit_edge + %fd317.pre-phi = phi %struct.malloc_chunk** [ %fd317.pre, %if.else297.if.then315_crit_edge ], [ %fd306, %land.rhs305 ] + %bk316 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3 + store %struct.malloc_chunk* %65, %struct.malloc_chunk** %bk316, align 4, !tbaa !0 + store %struct.malloc_chunk* %63, %struct.malloc_chunk** %fd317.pre-phi, align 4, !tbaa !0 + br label %if.end474 + +if.else318: ; preds = %land.rhs305, %lor.rhs302 + tail call void @abort() #6 + unreachable + +if.else321: ; preds = %land.rhs280, %lor.rhs277 + tail call void @abort() #6 + unreachable + +if.else323: ; preds = %if.else259 + %74 = bitcast i8* %add.ptr6 to %struct.malloc_tree_chunk* + %add.ptr6.sum232 = add i32 %and5, 16 + %parent326 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum232 + %75 = bitcast i8* %parent326 to %struct.malloc_tree_chunk** + %76 = load %struct.malloc_tree_chunk** %75, align 4, !tbaa !0 + %add.ptr6.sum233234 = or i32 %and5, 4 + %bk328 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum233234 + %77 = bitcast i8* %bk328 to %struct.malloc_tree_chunk** + %78 = load %struct.malloc_tree_chunk** %77, align 4, !tbaa !0 + %cmp329 = icmp eq %struct.malloc_tree_chunk* %78, %74 + br i1 %cmp329, label %if.else354, label %if.then331 + +if.then331: ; preds = %if.else323 + %fd333 = getelementptr inbounds i8* %mem, i32 %and5 + %79 = bitcast i8* %fd333 to %struct.malloc_tree_chunk** + %80 = load %struct.malloc_tree_chunk** %79, align 4, !tbaa !0 + %81 = bitcast %struct.malloc_tree_chunk* %80 to i8* + %82 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp335 = icmp ult i8* %81, %82 + br i1 %cmp335, label %if.else352, label %land.lhs.true337 + +land.lhs.true337: ; preds = %if.then331 + %bk338 = getelementptr inbounds %struct.malloc_tree_chunk* %80, i32 0, i32 3 + %83 = load %struct.malloc_tree_chunk** %bk338, align 4, !tbaa !0 + %cmp339 = icmp eq %struct.malloc_tree_chunk* %83, %74 + br i1 %cmp339, label %land.rhs341, label %if.else352 + +land.rhs341: ; preds = %land.lhs.true337 + %fd342 = getelementptr inbounds %struct.malloc_tree_chunk* %78, i32 0, i32 2 + %84 = load %struct.malloc_tree_chunk** %fd342, align 4, !tbaa !0 + %cmp343 = icmp eq %struct.malloc_tree_chunk* %84, %74 + br i1 %cmp343, label %if.then349, label %if.else352, !prof !5 + +if.then349: ; preds = %land.rhs341 + store %struct.malloc_tree_chunk* %78, %struct.malloc_tree_chunk** %bk338, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %80, %struct.malloc_tree_chunk** %fd342, align 4, !tbaa !0 + br label %if.end389 + +if.else352: ; preds = %land.rhs341, %land.lhs.true337, %if.then331 + tail call void @abort() #6 + unreachable + +if.else354: ; preds = %if.else323 + %child356.sum = add i32 %and5, 12 + %arrayidx357 = getelementptr inbounds i8* %mem, i32 %child356.sum + %85 = bitcast i8* %arrayidx357 to %struct.malloc_tree_chunk** + %86 = load %struct.malloc_tree_chunk** %85, align 4, !tbaa !0 + %cmp358 = icmp eq %struct.malloc_tree_chunk* %86, null + br i1 %cmp358, label %lor.lhs.false360, label %while.cond367 + +lor.lhs.false360: ; preds = %if.else354 + %add.ptr6.sum235 = add i32 %and5, 8 + %child356 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum235 + %arrayidx362 = bitcast i8* %child356 to %struct.malloc_tree_chunk** + %87 = load %struct.malloc_tree_chunk** %arrayidx362, align 4, !tbaa !0 + %cmp363 = icmp eq %struct.malloc_tree_chunk* %87, null + br i1 %cmp363, label %if.end389, label %while.cond367 + +while.cond367: ; preds = %lor.rhs372, %while.cond367, %lor.lhs.false360, %if.else354 + %RP355.0 = phi %struct.malloc_tree_chunk** [ %arrayidx362, %lor.lhs.false360 ], [ %85, %if.else354 ], [ %arrayidx369, %while.cond367 ], [ %arrayidx374, %lor.rhs372 ] + %R327.0 = phi %struct.malloc_tree_chunk* [ %87, %lor.lhs.false360 ], [ %86, %if.else354 ], [ %88, %while.cond367 ], [ %89, %lor.rhs372 ] + %arrayidx369 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.0, i32 0, i32 4, i32 1 + %88 = load %struct.malloc_tree_chunk** %arrayidx369, align 4, !tbaa !0 + %cmp370 = icmp eq %struct.malloc_tree_chunk* %88, null + br i1 %cmp370, label %lor.rhs372, label %while.cond367 + +lor.rhs372: ; preds = %while.cond367 + %arrayidx374 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.0, i32 0, i32 4, i32 0 + %89 = load %struct.malloc_tree_chunk** %arrayidx374, align 4, !tbaa !0 + %cmp375 = icmp eq %struct.malloc_tree_chunk* %89, null + br i1 %cmp375, label %while.end380, label %while.cond367 + +while.end380: ; preds = %lor.rhs372 + %90 = bitcast %struct.malloc_tree_chunk** %RP355.0 to i8* + %91 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp381 = icmp ult i8* %90, %91 + br i1 %cmp381, label %if.else386, label %if.then385, !prof !6 + +if.then385: ; preds = %while.end380 + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP355.0, align 4, !tbaa !0 + br label %if.end389 + +if.else386: ; preds = %while.end380 + tail call void @abort() #6 + unreachable + +if.end389: ; preds = %if.then385, %lor.lhs.false360, %if.then349 + %R327.1 = phi %struct.malloc_tree_chunk* [ %78, %if.then349 ], [ %R327.0, %if.then385 ], [ null, %lor.lhs.false360 ] + %cmp390 = icmp eq %struct.malloc_tree_chunk* %76, null + br i1 %cmp390, label %if.end474, label %if.then392 + +if.then392: ; preds = %if.end389 + %add.ptr6.sum243 = add i32 %and5, 20 + %index394 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum243 + %92 = bitcast i8* %index394 to i32* + %93 = load i32* %92, align 4, !tbaa !3 + %arrayidx395 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %93 + %94 = load %struct.malloc_tree_chunk** %arrayidx395, align 4, !tbaa !0 + %cmp396 = icmp eq %struct.malloc_tree_chunk* %74, %94 + br i1 %cmp396, label %if.then398, label %if.else407 + +if.then398: ; preds = %if.then392 + store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %arrayidx395, align 4, !tbaa !0 + %cond264 = icmp eq %struct.malloc_tree_chunk* %R327.1, null + br i1 %cond264, label %if.end426.thread, label %if.then429 + +if.end426.thread: ; preds = %if.then398 + %shl403 = shl i32 1, %93 + %neg404 = xor i32 %shl403, -1 + %95 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and405 = and i32 %95, %neg404 + store i32 %and405, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end474 + +if.else407: ; preds = %if.then392 + %96 = bitcast %struct.malloc_tree_chunk* %76 to i8* + %97 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp408 = icmp ult i8* %96, %97 + br i1 %cmp408, label %if.else424, label %if.then412, !prof !6 + +if.then412: ; preds = %if.else407 + %arrayidx414 = getelementptr inbounds %struct.malloc_tree_chunk* %76, i32 0, i32 4, i32 0 + %98 = load %struct.malloc_tree_chunk** %arrayidx414, align 4, !tbaa !0 + %cmp415 = icmp eq %struct.malloc_tree_chunk* %98, %74 + br i1 %cmp415, label %if.then417, label %if.else420 + +if.then417: ; preds = %if.then412 + store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %arrayidx414, align 4, !tbaa !0 + br label %if.end426 + +if.else420: ; preds = %if.then412 + %arrayidx422 = getelementptr inbounds %struct.malloc_tree_chunk* %76, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %arrayidx422, align 4, !tbaa !0 + br label %if.end426 + +if.else424: ; preds = %if.else407 + tail call void @abort() #6 + unreachable + +if.end426: ; preds = %if.else420, %if.then417 + %cmp427 = icmp eq %struct.malloc_tree_chunk* %R327.1, null + br i1 %cmp427, label %if.end474, label %if.then429 + +if.then429: ; preds = %if.end426, %if.then398 + %99 = bitcast %struct.malloc_tree_chunk* %R327.1 to i8* + %100 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp430 = icmp ult i8* %99, %100 + br i1 %cmp430, label %if.else470, label %if.then434, !prof !6 + +if.then434: ; preds = %if.then429 + %parent437 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.1, i32 0, i32 5 + store %struct.malloc_tree_chunk* %76, %struct.malloc_tree_chunk** %parent437, align 4, !tbaa !0 + %add.ptr6.sum244 = add i32 %and5, 8 + %child438 = getelementptr inbounds i8* %mem, i32 %add.ptr6.sum244 + %arrayidx439 = bitcast i8* %child438 to %struct.malloc_tree_chunk** + %101 = load %struct.malloc_tree_chunk** %arrayidx439, align 4, !tbaa !0 + %cmp440 = icmp eq %struct.malloc_tree_chunk* %101, null + br i1 %cmp440, label %if.end453, label %if.then442 + +if.then442: ; preds = %if.then434 + %102 = bitcast %struct.malloc_tree_chunk* %101 to i8* + %103 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp443 = icmp ult i8* %102, %103 + br i1 %cmp443, label %if.else451, label %if.then447, !prof !6 + +if.then447: ; preds = %if.then442 + %arrayidx449 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.1, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %101, %struct.malloc_tree_chunk** %arrayidx449, align 4, !tbaa !0 + %parent450 = getelementptr inbounds %struct.malloc_tree_chunk* %101, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %parent450, align 4, !tbaa !0 + br label %if.end453 + +if.else451: ; preds = %if.then442 + tail call void @abort() #6 + unreachable + +if.end453: ; preds = %if.then447, %if.then434 + %child438.sum = add i32 %and5, 12 + %arrayidx455 = getelementptr inbounds i8* %mem, i32 %child438.sum + %104 = bitcast i8* %arrayidx455 to %struct.malloc_tree_chunk** + %105 = load %struct.malloc_tree_chunk** %104, align 4, !tbaa !0 + %cmp456 = icmp eq %struct.malloc_tree_chunk* %105, null + br i1 %cmp456, label %if.end474, label %if.then458 + +if.then458: ; preds = %if.end453 + %106 = bitcast %struct.malloc_tree_chunk* %105 to i8* + %107 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp459 = icmp ult i8* %106, %107 + br i1 %cmp459, label %if.else467, label %if.then463, !prof !6 + +if.then463: ; preds = %if.then458 + %arrayidx465 = getelementptr inbounds %struct.malloc_tree_chunk* %R327.1, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %105, %struct.malloc_tree_chunk** %arrayidx465, align 4, !tbaa !0 + %parent466 = getelementptr inbounds %struct.malloc_tree_chunk* %105, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R327.1, %struct.malloc_tree_chunk** %parent466, align 4, !tbaa !0 + br label %if.end474 + +if.else467: ; preds = %if.then458 + tail call void @abort() #6 + unreachable + +if.else470: ; preds = %if.then429 + tail call void @abort() #6 + unreachable + +if.end474: ; preds = %if.then463, %if.end453, %if.end426, %if.end426.thread, %if.end389, %if.then315, %if.then293 + %or475 = or i32 %add262, 1 + %head476 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1 + store i32 %or475, i32* %head476, align 4, !tbaa !3 + %add.ptr477 = getelementptr inbounds i8* %54, i32 %add262 + %prev_foot478 = bitcast i8* %add.ptr477 to i32* + store i32 %add262, i32* %prev_foot478, align 4, !tbaa !3 + %108 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp479 = icmp eq %struct.malloc_chunk* %p.0, %108 + br i1 %cmp479, label %if.then481, label %if.end492 + +if.then481: ; preds = %if.end474 + store i32 %add262, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + br label %if.end635 + +if.else485: ; preds = %if.then235 + %and487 = and i32 %56, -2 + store i32 %and487, i32* %55, align 4, !tbaa !3 + %or488 = or i32 %psize.0, 1 + %head489 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1 + store i32 %or488, i32* %head489, align 4, !tbaa !3 + %add.ptr490 = getelementptr inbounds i8* %54, i32 %psize.0 + %prev_foot491 = bitcast i8* %add.ptr490 to i32* + store i32 %psize.0, i32* %prev_foot491, align 4, !tbaa !3 + br label %if.end492 + +if.end492: ; preds = %if.else485, %if.end474 + %psize.1 = phi i32 [ %psize.0, %if.else485 ], [ %add262, %if.end474 ] + %shr493 = lshr i32 %psize.1, 3 + %cmp494 = icmp ult i32 %psize.1, 256 + br i1 %cmp494, label %if.then496, label %if.else524 + +if.then496: ; preds = %if.end492 + %shl500 = shl nuw nsw i32 %shr493, 1 + %arrayidx501 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl500 + %109 = bitcast %struct.malloc_chunk** %arrayidx501 to %struct.malloc_chunk* + %110 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shl503 = shl i32 1, %shr493 + %and504 = and i32 %110, %shl503 + %tobool505 = icmp eq i32 %and504, 0 + br i1 %tobool505, label %if.then506, label %if.else509 + +if.then506: ; preds = %if.then496 + %or508 = or i32 %110, %shl503 + store i32 %or508, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %arrayidx501.sum.pre = add i32 %shl500, 2 + %.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx501.sum.pre + br label %if.end519 + +if.else509: ; preds = %if.then496 + %arrayidx501.sum242 = add i32 %shl500, 2 + %111 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx501.sum242 + %112 = load %struct.malloc_chunk** %111, align 4, !tbaa !0 + %113 = bitcast %struct.malloc_chunk* %112 to i8* + %114 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp511 = icmp ult i8* %113, %114 + br i1 %cmp511, label %if.else517, label %if.end519, !prof !6 + +if.else517: ; preds = %if.else509 + tail call void @abort() #6 + unreachable + +if.end519: ; preds = %if.else509, %if.then506 + %.pre-phi = phi %struct.malloc_chunk** [ %111, %if.else509 ], [ %.pre, %if.then506 ] + %F502.0 = phi %struct.malloc_chunk* [ %112, %if.else509 ], [ %109, %if.then506 ] + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %.pre-phi, align 4, !tbaa !0 + %bk521 = getelementptr inbounds %struct.malloc_chunk* %F502.0, i32 0, i32 3 + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %bk521, align 4, !tbaa !0 + %fd522 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2 + store %struct.malloc_chunk* %F502.0, %struct.malloc_chunk** %fd522, align 4, !tbaa !0 + %bk523 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3 + store %struct.malloc_chunk* %109, %struct.malloc_chunk** %bk523, align 4, !tbaa !0 + br label %if.end635 + +if.else524: ; preds = %if.end492 + %115 = bitcast %struct.malloc_chunk* %p.0 to %struct.malloc_tree_chunk* + %shr527 = lshr i32 %psize.1, 8 + %cmp528 = icmp eq i32 %shr527, 0 + br i1 %cmp528, label %if.end558, label %if.else531 + +if.else531: ; preds = %if.else524 + %cmp532 = icmp ugt i32 %psize.1, 16777215 + br i1 %cmp532, label %if.end558, label %if.else535 + +if.else535: ; preds = %if.else531 + %sub = add i32 %shr527, 1048320 + %shr536 = lshr i32 %sub, 16 + %and537 = and i32 %shr536, 8 + %shl538 = shl i32 %shr527, %and537 + %sub539 = add i32 %shl538, 520192 + %shr540 = lshr i32 %sub539, 16 + %and541 = and i32 %shr540, 4 + %add542 = or i32 %and541, %and537 + %shl543 = shl i32 %shl538, %and541 + %sub544 = add i32 %shl543, 245760 + %shr545 = lshr i32 %sub544, 16 + %and546 = and i32 %shr545, 2 + %add547 = or i32 %add542, %and546 + %sub548 = sub i32 14, %add547 + %shl549 = shl i32 %shl543, %and546 + %shr550 = lshr i32 %shl549, 15 + %add551 = add i32 %sub548, %shr550 + %shl552 = shl nsw i32 %add551, 1 + %add553 = add i32 %add551, 7 + %shr554 = lshr i32 %psize.1, %add553 + %and555 = and i32 %shr554, 1 + %add556 = or i32 %and555, %shl552 + br label %if.end558 + +if.end558: ; preds = %if.else535, %if.else531, %if.else524 + %I526.0 = phi i32 [ %add556, %if.else535 ], [ 0, %if.else524 ], [ 31, %if.else531 ] + %arrayidx559 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I526.0 + %index560 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 3 + %I526.0.c = inttoptr i32 %I526.0 to %struct.malloc_chunk* + store %struct.malloc_chunk* %I526.0.c, %struct.malloc_chunk** %index560, align 4, !tbaa !3 + %arrayidx562 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 1 + store i32 0, i32* %arrayidx562, align 4, !tbaa !0 + %116 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 0 + store i32 0, i32* %116, align 4, !tbaa !0 + %117 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %shl565 = shl i32 1, %I526.0 + %and566 = and i32 %117, %shl565 + %tobool567 = icmp eq i32 %and566, 0 + br i1 %tobool567, label %if.then568, label %if.else574 + +if.then568: ; preds = %if.end558 + %or570 = or i32 %117, %shl565 + store i32 %or570, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %arrayidx559, align 4, !tbaa !0 + %parent571 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2 + %.c = bitcast %struct.malloc_tree_chunk** %arrayidx559 to %struct.malloc_chunk* + store %struct.malloc_chunk* %.c, %struct.malloc_chunk** %parent571, align 4, !tbaa !0 + %bk572 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3 + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %bk572, align 4, !tbaa !0 + %fd573 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2 + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %fd573, align 4, !tbaa !0 + br label %if.end627 + +if.else574: ; preds = %if.end558 + %118 = load %struct.malloc_tree_chunk** %arrayidx559, align 4, !tbaa !0 + %cmp576 = icmp eq i32 %I526.0, 31 + br i1 %cmp576, label %cond.end, label %cond.false + +cond.false: ; preds = %if.else574 + %shr578 = lshr i32 %I526.0, 1 + %sub581 = sub i32 25, %shr578 + br label %cond.end + +cond.end: ; preds = %cond.false, %if.else574 + %cond = phi i32 [ %sub581, %cond.false ], [ 0, %if.else574 ] + %head583266 = getelementptr inbounds %struct.malloc_tree_chunk* %118, i32 0, i32 1 + %119 = load i32* %head583266, align 4, !tbaa !3 + %and584267 = and i32 %119, -8 + %cmp585268 = icmp eq i32 %and584267, %psize.1 + br i1 %cmp585268, label %if.else607, label %if.then587.lr.ph + +if.then587.lr.ph: ; preds = %cond.end + %shl582 = shl i32 %psize.1, %cond + br label %if.then587 + +for.cond: ; preds = %if.then587 + %shl592 = shl i32 %K575.0270, 1 + %head583 = getelementptr inbounds %struct.malloc_tree_chunk* %121, i32 0, i32 1 + %120 = load i32* %head583, align 4, !tbaa !3 + %and584 = and i32 %120, -8 + %cmp585 = icmp eq i32 %and584, %psize.1 + br i1 %cmp585, label %if.else607, label %if.then587 + +if.then587: ; preds = %for.cond, %if.then587.lr.ph + %K575.0270 = phi i32 [ %shl582, %if.then587.lr.ph ], [ %shl592, %for.cond ] + %T.0269 = phi %struct.malloc_tree_chunk* [ %118, %if.then587.lr.ph ], [ %121, %for.cond ] + %shr588 = lshr i32 %K575.0270, 31 + %arrayidx591 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0269, i32 0, i32 4, i32 %shr588 + %121 = load %struct.malloc_tree_chunk** %arrayidx591, align 4, !tbaa !0 + %cmp593 = icmp eq %struct.malloc_tree_chunk* %121, null + br i1 %cmp593, label %if.else596, label %for.cond + +if.else596: ; preds = %if.then587 + %122 = bitcast %struct.malloc_tree_chunk** %arrayidx591 to i8* + %123 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp597 = icmp ult i8* %122, %123 + br i1 %cmp597, label %if.else605, label %if.then601, !prof !6 + +if.then601: ; preds = %if.else596 + store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %arrayidx591, align 4, !tbaa !0 + %parent602 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2 + %T.0.c239 = bitcast %struct.malloc_tree_chunk* %T.0269 to %struct.malloc_chunk* + store %struct.malloc_chunk* %T.0.c239, %struct.malloc_chunk** %parent602, align 4, !tbaa !0 + %bk603 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3 + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %bk603, align 4, !tbaa !0 + %fd604 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2 + store %struct.malloc_chunk* %p.0, %struct.malloc_chunk** %fd604, align 4, !tbaa !0 + br label %if.end627 + +if.else605: ; preds = %if.else596 + tail call void @abort() #6 + unreachable + +if.else607: ; preds = %for.cond, %cond.end + %T.0.lcssa = phi %struct.malloc_tree_chunk* [ %118, %cond.end ], [ %121, %for.cond ] + %fd609 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa, i32 0, i32 2 + %124 = load %struct.malloc_tree_chunk** %fd609, align 4, !tbaa !0 + %125 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to i8* + %126 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp610 = icmp ult i8* %125, %126 + br i1 %cmp610, label %if.else625, label %land.rhs612 + +land.rhs612: ; preds = %if.else607 + %127 = bitcast %struct.malloc_tree_chunk* %124 to i8* + %cmp613 = icmp ult i8* %127, %126 + br i1 %cmp613, label %if.else625, label %if.then619, !prof !6 + +if.then619: ; preds = %land.rhs612 + %bk620 = getelementptr inbounds %struct.malloc_tree_chunk* %124, i32 0, i32 3 + store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %bk620, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %115, %struct.malloc_tree_chunk** %fd609, align 4, !tbaa !0 + %fd622 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2 + %.c238 = bitcast %struct.malloc_tree_chunk* %124 to %struct.malloc_chunk* + store %struct.malloc_chunk* %.c238, %struct.malloc_chunk** %fd622, align 4, !tbaa !0 + %bk623 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 3 + %T.0.c = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to %struct.malloc_chunk* + store %struct.malloc_chunk* %T.0.c, %struct.malloc_chunk** %bk623, align 4, !tbaa !0 + %parent624 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 1, i32 2 + store %struct.malloc_chunk* null, %struct.malloc_chunk** %parent624, align 4, !tbaa !0 + br label %if.end627 + +if.else625: ; preds = %land.rhs612, %if.else607 + tail call void @abort() #6 + unreachable + +if.end627: ; preds = %if.then619, %if.then601, %if.then568 + %128 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3 + %dec = add i32 %128, -1 + store i32 %dec, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3 + %cmp628 = icmp eq i32 %dec, 0 + br i1 %cmp628, label %while.cond.i, label %if.end635 + +while.cond.i: ; preds = %while.cond.i, %if.end627 + %sp.0.in.i = phi %struct.malloc_segment** [ %next4.i, %while.cond.i ], [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16, i32 2), %if.end627 ] + %sp.0.i = load %struct.malloc_segment** %sp.0.in.i, align 4 + %cmp.i = icmp eq %struct.malloc_segment* %sp.0.i, null + %next4.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i, i32 0, i32 2 + br i1 %cmp.i, label %release_unused_segments.exit, label %while.cond.i + +release_unused_segments.exit: ; preds = %while.cond.i + store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 8), align 4, !tbaa !3 + br label %if.end635 + +erroraction: ; preds = %land.rhs227, %if.end224, %if.else, %land.rhs, %if.then + tail call void @abort() #6 + unreachable + +if.end635: ; preds = %release_unused_segments.exit, %if.end627, %if.end519, %if.then481, %if.then253, %if.then248, %if.then242, %if.then213, %if.then10, %entry + ret void +} + +; Function Attrs: nounwind +define weak i8* @calloc(i32 %n_elements, i32 %elem_size) #0 { +entry: + %cmp = icmp eq i32 %n_elements, 0 + br i1 %cmp, label %if.end3, label %if.then + +if.then: ; preds = %entry + %mul = mul i32 %elem_size, %n_elements + %or = or i32 %elem_size, %n_elements + %tobool = icmp ugt i32 %or, 65535 + br i1 %tobool, label %land.lhs.true, label %if.end3 + +land.lhs.true: ; preds = %if.then + %div = udiv i32 %mul, %n_elements + %cmp1 = icmp eq i32 %div, %elem_size + %mul. = select i1 %cmp1, i32 %mul, i32 -1 + br label %if.end3 + +if.end3: ; preds = %land.lhs.true, %if.then, %entry + %req.0 = phi i32 [ %mul, %if.then ], [ 0, %entry ], [ %mul., %land.lhs.true ] + %call = tail call i8* @malloc(i32 %req.0) + %cmp4 = icmp eq i8* %call, null + br i1 %cmp4, label %if.end9, label %land.lhs.true5 + +land.lhs.true5: ; preds = %if.end3 + %head = getelementptr inbounds i8* %call, i32 -4 + %0 = bitcast i8* %head to i32* + %1 = load i32* %0, align 4, !tbaa !3 + %and6 = and i32 %1, 3 + %cmp7 = icmp eq i32 %and6, 0 + br i1 %cmp7, label %if.end9, label %if.then8 + +if.then8: ; preds = %land.lhs.true5 + tail call void @llvm.memset.p0i8.i32(i8* %call, i8 0, i32 %req.0, i32 1, i1 false) + br label %if.end9 + +if.end9: ; preds = %if.then8, %land.lhs.true5, %if.end3 + ret i8* %call +} + +; Function Attrs: nounwind +declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) #1 + +; Function Attrs: nounwind +define weak i8* @realloc(i8* %oldmem, i32 %bytes) #0 { +entry: + %cmp = icmp eq i8* %oldmem, null + br i1 %cmp, label %if.then, label %if.else + +if.then: ; preds = %entry + %call = tail call i8* @malloc(i32 %bytes) + br label %if.end27 + +if.else: ; preds = %entry + %cmp1 = icmp ugt i32 %bytes, -65 + br i1 %cmp1, label %if.then2, label %if.else4 + +if.then2: ; preds = %if.else + %call3 = tail call i32* @__errno_location() #7 + store i32 12, i32* %call3, align 4, !tbaa !3 + br label %if.end27 + +if.else4: ; preds = %if.else + %cmp5 = icmp ult i32 %bytes, 11 + br i1 %cmp5, label %cond.end, label %cond.false + +cond.false: ; preds = %if.else4 + %add6 = add i32 %bytes, 11 + %and = and i32 %add6, -8 + br label %cond.end + +cond.end: ; preds = %cond.false, %if.else4 + %cond = phi i32 [ %and, %cond.false ], [ 16, %if.else4 ] + %add.ptr = getelementptr inbounds i8* %oldmem, i32 -8 + %0 = bitcast i8* %add.ptr to %struct.malloc_chunk* + %call7 = tail call fastcc %struct.malloc_chunk* @try_realloc_chunk(%struct.malloc_chunk* %0, i32 %cond) + %cmp8 = icmp eq %struct.malloc_chunk* %call7, null + br i1 %cmp8, label %if.else11, label %if.then9 + +if.then9: ; preds = %cond.end + %add.ptr10 = getelementptr inbounds %struct.malloc_chunk* %call7, i32 0, i32 2 + %1 = bitcast %struct.malloc_chunk** %add.ptr10 to i8* + br label %if.end27 + +if.else11: ; preds = %cond.end + %call12 = tail call i8* @malloc(i32 %bytes) + %cmp13 = icmp eq i8* %call12, null + br i1 %cmp13, label %if.end27, label %if.then14 + +if.then14: ; preds = %if.else11 + %head = getelementptr inbounds i8* %oldmem, i32 -4 + %2 = bitcast i8* %head to i32* + %3 = load i32* %2, align 4, !tbaa !3 + %and15 = and i32 %3, -8 + %and17 = and i32 %3, 3 + %cmp18 = icmp eq i32 %and17, 0 + %cond19 = select i1 %cmp18, i32 8, i32 4 + %sub = sub i32 %and15, %cond19 + %cmp20 = icmp ult i32 %sub, %bytes + %cond24 = select i1 %cmp20, i32 %sub, i32 %bytes + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %call12, i8* %oldmem, i32 %cond24, i32 1, i1 false) + tail call void @free(i8* %oldmem) + br label %if.end27 + +if.end27: ; preds = %if.then14, %if.else11, %if.then9, %if.then2, %if.then + %mem.0 = phi i8* [ %call, %if.then ], [ null, %if.then2 ], [ %1, %if.then9 ], [ %call12, %if.then14 ], [ null, %if.else11 ] + ret i8* %mem.0 +} + +; Function Attrs: nounwind readnone +declare i32* @__errno_location() #3 + +; Function Attrs: nounwind +define internal fastcc %struct.malloc_chunk* @try_realloc_chunk(%struct.malloc_chunk* %p, i32 %nb) #0 { +entry: + %head = getelementptr inbounds %struct.malloc_chunk* %p, i32 0, i32 1 + %0 = load i32* %head, align 4, !tbaa !3 + %and = and i32 %0, -8 + %1 = bitcast %struct.malloc_chunk* %p to i8* + %add.ptr = getelementptr inbounds i8* %1, i32 %and + %2 = bitcast i8* %add.ptr to %struct.malloc_chunk* + %3 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp = icmp ult i8* %1, %3 + br i1 %cmp, label %if.else327, label %land.lhs.true + +land.lhs.true: ; preds = %entry + %and2 = and i32 %0, 3 + %cmp3 = icmp ne i32 %and2, 1 + %cmp5 = icmp ult i8* %1, %add.ptr + %or.cond = and i1 %cmp3, %cmp5 + br i1 %or.cond, label %land.rhs, label %if.else327 + +land.rhs: ; preds = %land.lhs.true + %add.ptr.sum1516 = or i32 %and, 4 + %head6 = getelementptr inbounds i8* %1, i32 %add.ptr.sum1516 + %4 = bitcast i8* %head6 to i32* + %5 = load i32* %4, align 4, !tbaa !3 + %and7 = and i32 %5, 1 + %tobool = icmp eq i32 %and7, 0 + br i1 %tobool, label %if.else327, label %if.then, !prof !6 + +if.then: ; preds = %land.rhs + %cmp11 = icmp eq i32 %and2, 0 + br i1 %cmp11, label %if.then12, label %if.else + +if.then12: ; preds = %if.then + %cmp.i = icmp ult i32 %nb, 256 + br i1 %cmp.i, label %if.end328, label %if.end.i + +if.end.i: ; preds = %if.then12 + %add.i = add i32 %nb, 4 + %cmp1.i = icmp ult i32 %and, %add.i + br i1 %cmp1.i, label %if.end34.i, label %land.lhs.true.i + +land.lhs.true.i: ; preds = %if.end.i + %sub.i = sub i32 %and, %nb + %6 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + %shl.i = shl i32 %6, 1 + %cmp2.i = icmp ugt i32 %sub.i, %shl.i + br i1 %cmp2.i, label %if.end34.i, label %if.end328 + +if.end34.i: ; preds = %land.lhs.true.i, %if.end.i + br label %if.end328 + +if.else: ; preds = %if.then + %cmp13 = icmp ult i32 %and, %nb + br i1 %cmp13, label %if.else33, label %if.then14 + +if.then14: ; preds = %if.else + %sub = sub i32 %and, %nb + %cmp15 = icmp ugt i32 %sub, 15 + br i1 %cmp15, label %if.then16, label %if.end328 + +if.then16: ; preds = %if.then14 + %add.ptr17 = getelementptr inbounds i8* %1, i32 %nb + %7 = bitcast i8* %add.ptr17 to %struct.malloc_chunk* + %and19 = and i32 %0, 1 + %or = or i32 %and19, %nb + %or20 = or i32 %or, 2 + store i32 %or20, i32* %head, align 4, !tbaa !3 + %add.ptr17.sum = add i32 %nb, 4 + %head23 = getelementptr inbounds i8* %1, i32 %add.ptr17.sum + %8 = bitcast i8* %head23 to i32* + %or28 = or i32 %sub, 3 + store i32 %or28, i32* %8, align 4, !tbaa !3 + %9 = load i32* %4, align 4, !tbaa !3 + %or32 = or i32 %9, 1 + store i32 %or32, i32* %4, align 4, !tbaa !3 + tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %7, i32 %sub) + br label %if.end328 + +if.else33: ; preds = %if.else + %10 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp34 = icmp eq %struct.malloc_chunk* %2, %10 + br i1 %cmp34, label %if.then35, label %if.else55 + +if.then35: ; preds = %if.else33 + %11 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add = add i32 %11, %and + %cmp36 = icmp ugt i32 %add, %nb + br i1 %cmp36, label %if.then37, label %if.end328 + +if.then37: ; preds = %if.then35 + %sub40 = sub i32 %add, %nb + %add.ptr41 = getelementptr inbounds i8* %1, i32 %nb + %12 = bitcast i8* %add.ptr41 to %struct.malloc_chunk* + %and43 = and i32 %0, 1 + %or44 = or i32 %and43, %nb + %or45 = or i32 %or44, 2 + store i32 %or45, i32* %head, align 4, !tbaa !3 + %add.ptr41.sum = add i32 %nb, 4 + %head48 = getelementptr inbounds i8* %1, i32 %add.ptr41.sum + %13 = bitcast i8* %head48 to i32* + %or50 = or i32 %sub40, 1 + store i32 %or50, i32* %13, align 4, !tbaa !3 + store %struct.malloc_chunk* %12, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + store i32 %sub40, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + br label %if.end328 + +if.else55: ; preds = %if.else33 + %14 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp56 = icmp eq %struct.malloc_chunk* %2, %14 + br i1 %cmp56, label %if.then57, label %if.else98 + +if.then57: ; preds = %if.else55 + %15 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %add58 = add i32 %15, %and + %cmp59 = icmp ult i32 %add58, %nb + br i1 %cmp59, label %if.end328, label %if.then60 + +if.then60: ; preds = %if.then57 + %sub62 = sub i32 %add58, %nb + %cmp63 = icmp ugt i32 %sub62, 15 + br i1 %cmp63, label %if.then64, label %if.else83 + +if.then64: ; preds = %if.then60 + %add.ptr66 = getelementptr inbounds i8* %1, i32 %nb + %16 = bitcast i8* %add.ptr66 to %struct.malloc_chunk* + %add.ptr67 = getelementptr inbounds i8* %1, i32 %add58 + %and69 = and i32 %0, 1 + %or70 = or i32 %and69, %nb + %or71 = or i32 %or70, 2 + store i32 %or71, i32* %head, align 4, !tbaa !3 + %add.ptr66.sum = add i32 %nb, 4 + %head74 = getelementptr inbounds i8* %1, i32 %add.ptr66.sum + %17 = bitcast i8* %head74 to i32* + %or76 = or i32 %sub62, 1 + store i32 %or76, i32* %17, align 4, !tbaa !3 + %prev_foot = bitcast i8* %add.ptr67 to i32* + store i32 %sub62, i32* %prev_foot, align 4, !tbaa !3 + %add.ptr67.sum = add i32 %add58, 4 + %head79 = getelementptr inbounds i8* %1, i32 %add.ptr67.sum + %18 = bitcast i8* %head79 to i32* + %19 = load i32* %18, align 4, !tbaa !3 + %and80 = and i32 %19, -2 + store i32 %and80, i32* %18, align 4, !tbaa !3 + br label %if.end96 + +if.else83: ; preds = %if.then60 + %and87 = and i32 %0, 1 + %or88 = or i32 %and87, %add58 + %or89 = or i32 %or88, 2 + store i32 %or89, i32* %head, align 4, !tbaa !3 + %add.ptr91.sum = add i32 %add58, 4 + %head92 = getelementptr inbounds i8* %1, i32 %add.ptr91.sum + %20 = bitcast i8* %head92 to i32* + %21 = load i32* %20, align 4, !tbaa !3 + %or93 = or i32 %21, 1 + store i32 %or93, i32* %20, align 4, !tbaa !3 + br label %if.end96 + +if.end96: ; preds = %if.else83, %if.then64 + %storemerge12 = phi i32 [ %sub62, %if.then64 ], [ 0, %if.else83 ] + %storemerge = phi %struct.malloc_chunk* [ %16, %if.then64 ], [ null, %if.else83 ] + store i32 %storemerge12, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + store %struct.malloc_chunk* %storemerge, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + br label %if.end328 + +if.else98: ; preds = %if.else55 + %and100 = and i32 %5, 2 + %tobool101 = icmp eq i32 %and100, 0 + br i1 %tobool101, label %if.then102, label %if.end328 + +if.then102: ; preds = %if.else98 + %and104 = and i32 %5, -8 + %add105 = add i32 %and104, %and + %cmp106 = icmp ult i32 %add105, %nb + br i1 %cmp106, label %if.end328, label %if.then107 + +if.then107: ; preds = %if.then102 + %sub110 = sub i32 %add105, %nb + %shr = lshr i32 %5, 3 + %cmp111 = icmp ult i32 %5, 256 + br i1 %cmp111, label %if.then112, label %if.else154 + +if.then112: ; preds = %if.then107 + %add.ptr.sum10 = add i32 %and, 8 + %fd = getelementptr inbounds i8* %1, i32 %add.ptr.sum10 + %22 = bitcast i8* %fd to %struct.malloc_chunk** + %23 = load %struct.malloc_chunk** %22, align 4, !tbaa !0 + %add.ptr.sum11 = add i32 %and, 12 + %bk = getelementptr inbounds i8* %1, i32 %add.ptr.sum11 + %24 = bitcast i8* %bk to %struct.malloc_chunk** + %25 = load %struct.malloc_chunk** %24, align 4, !tbaa !0 + %shl = shl nuw nsw i32 %shr, 1 + %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl + %26 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk* + %cmp114 = icmp eq %struct.malloc_chunk* %23, %26 + br i1 %cmp114, label %if.then124, label %lor.rhs + +lor.rhs: ; preds = %if.then112 + %27 = bitcast %struct.malloc_chunk* %23 to i8* + %cmp116 = icmp ult i8* %27, %3 + br i1 %cmp116, label %if.else152, label %land.rhs117 + +land.rhs117: ; preds = %lor.rhs + %bk118 = getelementptr inbounds %struct.malloc_chunk* %23, i32 0, i32 3 + %28 = load %struct.malloc_chunk** %bk118, align 4, !tbaa !0 + %cmp119 = icmp eq %struct.malloc_chunk* %28, %2 + br i1 %cmp119, label %if.then124, label %if.else152, !prof !5 + +if.then124: ; preds = %land.rhs117, %if.then112 + %cmp125 = icmp eq %struct.malloc_chunk* %25, %23 + br i1 %cmp125, label %if.then126, label %if.else129 + +if.then126: ; preds = %if.then124 + %shl127 = shl i32 1, %shr + %neg = xor i32 %shl127, -1 + %29 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %and128 = and i32 %29, %neg + store i32 %and128, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end287 + +if.else129: ; preds = %if.then124 + %cmp133 = icmp eq %struct.malloc_chunk* %25, %26 + br i1 %cmp133, label %if.else129.if.then146_crit_edge, label %lor.rhs134 + +if.else129.if.then146_crit_edge: ; preds = %if.else129 + %fd148.pre = getelementptr inbounds %struct.malloc_chunk* %25, i32 0, i32 2 + br label %if.then146 + +lor.rhs134: ; preds = %if.else129 + %30 = bitcast %struct.malloc_chunk* %25 to i8* + %cmp136 = icmp ult i8* %30, %3 + br i1 %cmp136, label %if.else149, label %land.rhs137 + +land.rhs137: ; preds = %lor.rhs134 + %fd138 = getelementptr inbounds %struct.malloc_chunk* %25, i32 0, i32 2 + %31 = load %struct.malloc_chunk** %fd138, align 4, !tbaa !0 + %cmp139 = icmp eq %struct.malloc_chunk* %31, %2 + br i1 %cmp139, label %if.then146, label %if.else149, !prof !5 + +if.then146: ; preds = %land.rhs137, %if.else129.if.then146_crit_edge + %fd148.pre-phi = phi %struct.malloc_chunk** [ %fd148.pre, %if.else129.if.then146_crit_edge ], [ %fd138, %land.rhs137 ] + %bk147 = getelementptr inbounds %struct.malloc_chunk* %23, i32 0, i32 3 + store %struct.malloc_chunk* %25, %struct.malloc_chunk** %bk147, align 4, !tbaa !0 + store %struct.malloc_chunk* %23, %struct.malloc_chunk** %fd148.pre-phi, align 4, !tbaa !0 + br label %if.end287 + +if.else149: ; preds = %land.rhs137, %lor.rhs134 + tail call void @abort() #6 + unreachable + +if.else152: ; preds = %land.rhs117, %lor.rhs + tail call void @abort() #6 + unreachable + +if.else154: ; preds = %if.then107 + %32 = bitcast i8* %add.ptr to %struct.malloc_tree_chunk* + %add.ptr.sum = add i32 %and, 24 + %parent = getelementptr inbounds i8* %1, i32 %add.ptr.sum + %33 = bitcast i8* %parent to %struct.malloc_tree_chunk** + %34 = load %struct.malloc_tree_chunk** %33, align 4, !tbaa !0 + %add.ptr.sum2 = add i32 %and, 12 + %bk155 = getelementptr inbounds i8* %1, i32 %add.ptr.sum2 + %35 = bitcast i8* %bk155 to %struct.malloc_tree_chunk** + %36 = load %struct.malloc_tree_chunk** %35, align 4, !tbaa !0 + %cmp156 = icmp eq %struct.malloc_tree_chunk* %36, %32 + br i1 %cmp156, label %if.else178, label %if.then157 + +if.then157: ; preds = %if.else154 + %add.ptr.sum9 = add i32 %and, 8 + %fd159 = getelementptr inbounds i8* %1, i32 %add.ptr.sum9 + %37 = bitcast i8* %fd159 to %struct.malloc_tree_chunk** + %38 = load %struct.malloc_tree_chunk** %37, align 4, !tbaa !0 + %39 = bitcast %struct.malloc_tree_chunk* %38 to i8* + %cmp162 = icmp ult i8* %39, %3 + br i1 %cmp162, label %if.else176, label %land.lhs.true163 + +land.lhs.true163: ; preds = %if.then157 + %bk164 = getelementptr inbounds %struct.malloc_tree_chunk* %38, i32 0, i32 3 + %40 = load %struct.malloc_tree_chunk** %bk164, align 4, !tbaa !0 + %cmp165 = icmp eq %struct.malloc_tree_chunk* %40, %32 + br i1 %cmp165, label %land.rhs166, label %if.else176 + +land.rhs166: ; preds = %land.lhs.true163 + %fd167 = getelementptr inbounds %struct.malloc_tree_chunk* %36, i32 0, i32 2 + %41 = load %struct.malloc_tree_chunk** %fd167, align 4, !tbaa !0 + %cmp168 = icmp eq %struct.malloc_tree_chunk* %41, %32 + br i1 %cmp168, label %if.then173, label %if.else176, !prof !5 + +if.then173: ; preds = %land.rhs166 + store %struct.malloc_tree_chunk* %36, %struct.malloc_tree_chunk** %bk164, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %38, %struct.malloc_tree_chunk** %fd167, align 4, !tbaa !0 + br label %if.end202 + +if.else176: ; preds = %land.rhs166, %land.lhs.true163, %if.then157 + tail call void @abort() #6 + unreachable + +if.else178: ; preds = %if.else154 + %child.sum = add i32 %and, 20 + %arrayidx179 = getelementptr inbounds i8* %1, i32 %child.sum + %42 = bitcast i8* %arrayidx179 to %struct.malloc_tree_chunk** + %43 = load %struct.malloc_tree_chunk** %42, align 4, !tbaa !0 + %cmp180 = icmp eq %struct.malloc_tree_chunk* %43, null + br i1 %cmp180, label %lor.lhs.false, label %while.cond + +lor.lhs.false: ; preds = %if.else178 + %add.ptr.sum3 = add i32 %and, 16 + %child = getelementptr inbounds i8* %1, i32 %add.ptr.sum3 + %arrayidx182 = bitcast i8* %child to %struct.malloc_tree_chunk** + %44 = load %struct.malloc_tree_chunk** %arrayidx182, align 4, !tbaa !0 + %cmp183 = icmp eq %struct.malloc_tree_chunk* %44, null + br i1 %cmp183, label %if.end202, label %while.cond + +while.cond: ; preds = %lor.rhs188, %while.cond, %lor.lhs.false, %if.else178 + %RP.0 = phi %struct.malloc_tree_chunk** [ %arrayidx182, %lor.lhs.false ], [ %42, %if.else178 ], [ %arrayidx186, %while.cond ], [ %arrayidx190, %lor.rhs188 ] + %R.0 = phi %struct.malloc_tree_chunk* [ %44, %lor.lhs.false ], [ %43, %if.else178 ], [ %45, %while.cond ], [ %46, %lor.rhs188 ] + %arrayidx186 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 1 + %45 = load %struct.malloc_tree_chunk** %arrayidx186, align 4, !tbaa !0 + %cmp187 = icmp eq %struct.malloc_tree_chunk* %45, null + br i1 %cmp187, label %lor.rhs188, label %while.cond + +lor.rhs188: ; preds = %while.cond + %arrayidx190 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 0 + %46 = load %struct.malloc_tree_chunk** %arrayidx190, align 4, !tbaa !0 + %cmp191 = icmp eq %struct.malloc_tree_chunk* %46, null + br i1 %cmp191, label %while.end, label %while.cond + +while.end: ; preds = %lor.rhs188 + %47 = bitcast %struct.malloc_tree_chunk** %RP.0 to i8* + %cmp195 = icmp ult i8* %47, %3 + br i1 %cmp195, label %if.else199, label %if.then198, !prof !6 + +if.then198: ; preds = %while.end + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0, align 4, !tbaa !0 + br label %if.end202 + +if.else199: ; preds = %while.end + tail call void @abort() #6 + unreachable + +if.end202: ; preds = %if.then198, %lor.lhs.false, %if.then173 + %R.1 = phi %struct.malloc_tree_chunk* [ %36, %if.then173 ], [ %R.0, %if.then198 ], [ null, %lor.lhs.false ] + %cmp203 = icmp eq %struct.malloc_tree_chunk* %34, null + br i1 %cmp203, label %if.end287, label %if.then205 + +if.then205: ; preds = %if.end202 + %add.ptr.sum7 = add i32 %and, 28 + %index = getelementptr inbounds i8* %1, i32 %add.ptr.sum7 + %48 = bitcast i8* %index to i32* + %49 = load i32* %48, align 4, !tbaa !3 + %arrayidx206 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %49 + %50 = load %struct.malloc_tree_chunk** %arrayidx206, align 4, !tbaa !0 + %cmp207 = icmp eq %struct.malloc_tree_chunk* %32, %50 + br i1 %cmp207, label %if.then209, label %if.else218 + +if.then209: ; preds = %if.then205 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx206, align 4, !tbaa !0 + %cond = icmp eq %struct.malloc_tree_chunk* %R.1, null + br i1 %cond, label %if.end238.thread, label %if.then241 + +if.end238.thread: ; preds = %if.then209 + %shl214 = shl i32 1, %49 + %neg215 = xor i32 %shl214, -1 + %51 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and216 = and i32 %51, %neg215 + store i32 %and216, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end287 + +if.else218: ; preds = %if.then205 + %52 = bitcast %struct.malloc_tree_chunk* %34 to i8* + %53 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp220 = icmp ult i8* %52, %53 + br i1 %cmp220, label %if.else236, label %if.then224, !prof !6 + +if.then224: ; preds = %if.else218 + %arrayidx226 = getelementptr inbounds %struct.malloc_tree_chunk* %34, i32 0, i32 4, i32 0 + %54 = load %struct.malloc_tree_chunk** %arrayidx226, align 4, !tbaa !0 + %cmp227 = icmp eq %struct.malloc_tree_chunk* %54, %32 + br i1 %cmp227, label %if.then229, label %if.else232 + +if.then229: ; preds = %if.then224 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx226, align 4, !tbaa !0 + br label %if.end238 + +if.else232: ; preds = %if.then224 + %arrayidx234 = getelementptr inbounds %struct.malloc_tree_chunk* %34, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx234, align 4, !tbaa !0 + br label %if.end238 + +if.else236: ; preds = %if.else218 + tail call void @abort() #6 + unreachable + +if.end238: ; preds = %if.else232, %if.then229 + %cmp239 = icmp eq %struct.malloc_tree_chunk* %R.1, null + br i1 %cmp239, label %if.end287, label %if.then241 + +if.then241: ; preds = %if.end238, %if.then209 + %55 = bitcast %struct.malloc_tree_chunk* %R.1 to i8* + %56 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp243 = icmp ult i8* %55, %56 + br i1 %cmp243, label %if.else283, label %if.then247, !prof !6 + +if.then247: ; preds = %if.then241 + %parent248 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 5 + store %struct.malloc_tree_chunk* %34, %struct.malloc_tree_chunk** %parent248, align 4, !tbaa !0 + %add.ptr.sum8 = add i32 %and, 16 + %child249 = getelementptr inbounds i8* %1, i32 %add.ptr.sum8 + %arrayidx250 = bitcast i8* %child249 to %struct.malloc_tree_chunk** + %57 = load %struct.malloc_tree_chunk** %arrayidx250, align 4, !tbaa !0 + %cmp251 = icmp eq %struct.malloc_tree_chunk* %57, null + br i1 %cmp251, label %if.end265, label %if.then253 + +if.then253: ; preds = %if.then247 + %58 = bitcast %struct.malloc_tree_chunk* %57 to i8* + %59 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp255 = icmp ult i8* %58, %59 + br i1 %cmp255, label %if.else263, label %if.then259, !prof !6 + +if.then259: ; preds = %if.then253 + %arrayidx261 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %57, %struct.malloc_tree_chunk** %arrayidx261, align 4, !tbaa !0 + %parent262 = getelementptr inbounds %struct.malloc_tree_chunk* %57, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent262, align 4, !tbaa !0 + br label %if.end265 + +if.else263: ; preds = %if.then253 + tail call void @abort() #6 + unreachable + +if.end265: ; preds = %if.then259, %if.then247 + %child249.sum = add i32 %and, 20 + %arrayidx267 = getelementptr inbounds i8* %1, i32 %child249.sum + %60 = bitcast i8* %arrayidx267 to %struct.malloc_tree_chunk** + %61 = load %struct.malloc_tree_chunk** %60, align 4, !tbaa !0 + %cmp268 = icmp eq %struct.malloc_tree_chunk* %61, null + br i1 %cmp268, label %if.end287, label %if.then270 + +if.then270: ; preds = %if.end265 + %62 = bitcast %struct.malloc_tree_chunk* %61 to i8* + %63 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp272 = icmp ult i8* %62, %63 + br i1 %cmp272, label %if.else280, label %if.then276, !prof !6 + +if.then276: ; preds = %if.then270 + %arrayidx278 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %61, %struct.malloc_tree_chunk** %arrayidx278, align 4, !tbaa !0 + %parent279 = getelementptr inbounds %struct.malloc_tree_chunk* %61, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent279, align 4, !tbaa !0 + br label %if.end287 + +if.else280: ; preds = %if.then270 + tail call void @abort() #6 + unreachable + +if.else283: ; preds = %if.then241 + tail call void @abort() #6 + unreachable + +if.end287: ; preds = %if.then276, %if.end265, %if.end238, %if.end238.thread, %if.end202, %if.then146, %if.then126 + %cmp288 = icmp ult i32 %sub110, 16 + br i1 %cmp288, label %if.then290, label %if.else301 + +if.then290: ; preds = %if.end287 + %64 = load i32* %head, align 4, !tbaa !3 + %and294 = and i32 %64, 1 + %or295 = or i32 %add105, %and294 + %or296 = or i32 %or295, 2 + store i32 %or296, i32* %head, align 4, !tbaa !3 + %add.ptr298.sum6 = or i32 %add105, 4 + %head299 = getelementptr inbounds i8* %1, i32 %add.ptr298.sum6 + %65 = bitcast i8* %head299 to i32* + %66 = load i32* %65, align 4, !tbaa !3 + %or300 = or i32 %66, 1 + store i32 %or300, i32* %65, align 4, !tbaa !3 + br label %if.end328 + +if.else301: ; preds = %if.end287 + %add.ptr303 = getelementptr inbounds i8* %1, i32 %nb + %67 = bitcast i8* %add.ptr303 to %struct.malloc_chunk* + %68 = load i32* %head, align 4, !tbaa !3 + %and305 = and i32 %68, 1 + %or306 = or i32 %and305, %nb + %or307 = or i32 %or306, 2 + store i32 %or307, i32* %head, align 4, !tbaa !3 + %add.ptr303.sum = add i32 %nb, 4 + %head310 = getelementptr inbounds i8* %1, i32 %add.ptr303.sum + %69 = bitcast i8* %head310 to i32* + %or315 = or i32 %sub110, 3 + store i32 %or315, i32* %69, align 4, !tbaa !3 + %add.ptr317.sum5 = or i32 %add105, 4 + %head318 = getelementptr inbounds i8* %1, i32 %add.ptr317.sum5 + %70 = bitcast i8* %head318 to i32* + %71 = load i32* %70, align 4, !tbaa !3 + %or319 = or i32 %71, 1 + store i32 %or319, i32* %70, align 4, !tbaa !3 + tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %67, i32 %sub110) + br label %if.end328 + +if.else327: ; preds = %land.rhs, %land.lhs.true, %entry + tail call void @abort() #6 + unreachable + +if.end328: ; preds = %if.else301, %if.then290, %if.then102, %if.else98, %if.end96, %if.then57, %if.then37, %if.then35, %if.then16, %if.then14, %if.end34.i, %land.lhs.true.i, %if.then12 + %newp.0 = phi %struct.malloc_chunk* [ %p, %if.then37 ], [ null, %if.then35 ], [ %p, %if.end96 ], [ null, %if.then57 ], [ null, %if.else98 ], [ null, %if.then102 ], [ %p, %if.then16 ], [ %p, %if.then14 ], [ %p, %if.else301 ], [ %p, %if.then290 ], [ null, %if.end34.i ], [ null, %if.then12 ], [ %p, %land.lhs.true.i ] + ret %struct.malloc_chunk* %newp.0 +} + +; Function Attrs: nounwind +define weak i8* @realloc_in_place(i8* %oldmem, i32 %bytes) #0 { +entry: + %cmp = icmp eq i8* %oldmem, null + br i1 %cmp, label %if.end9, label %if.then + +if.then: ; preds = %entry + %cmp1 = icmp ugt i32 %bytes, -65 + br i1 %cmp1, label %if.then2, label %if.else + +if.then2: ; preds = %if.then + %call = tail call i32* @__errno_location() #7 + store i32 12, i32* %call, align 4, !tbaa !3 + br label %if.end9 + +if.else: ; preds = %if.then + %cmp3 = icmp ult i32 %bytes, 11 + br i1 %cmp3, label %cond.end, label %cond.false + +cond.false: ; preds = %if.else + %add4 = add i32 %bytes, 11 + %and = and i32 %add4, -8 + br label %cond.end + +cond.end: ; preds = %cond.false, %if.else + %cond = phi i32 [ %and, %cond.false ], [ 16, %if.else ] + %add.ptr = getelementptr inbounds i8* %oldmem, i32 -8 + %0 = bitcast i8* %add.ptr to %struct.malloc_chunk* + %call5 = tail call fastcc %struct.malloc_chunk* @try_realloc_chunk(%struct.malloc_chunk* %0, i32 %cond) + %cmp6 = icmp eq %struct.malloc_chunk* %call5, %0 + %oldmem. = select i1 %cmp6, i8* %oldmem, i8* null + ret i8* %oldmem. + +if.end9: ; preds = %if.then2, %entry + ret i8* null +} + +; Function Attrs: nounwind +define weak i8* @memalign(i32 %alignment, i32 %bytes) #0 { +entry: + %cmp = icmp ult i32 %alignment, 9 + br i1 %cmp, label %if.then, label %if.end + +if.then: ; preds = %entry + %call = tail call i8* @malloc(i32 %bytes) + br label %return + +if.end: ; preds = %entry + %call1 = tail call fastcc i8* @internal_memalign(i32 %alignment, i32 %bytes) + br label %return + +return: ; preds = %if.end, %if.then + %retval.0 = phi i8* [ %call, %if.then ], [ %call1, %if.end ] + ret i8* %retval.0 +} + +; Function Attrs: nounwind +define internal fastcc i8* @internal_memalign(i32 %alignment, i32 %bytes) #0 { +entry: + %cmp = icmp ult i32 %alignment, 16 + %.alignment = select i1 %cmp, i32 16, i32 %alignment + %sub = add i32 %.alignment, -1 + %and = and i32 %sub, %.alignment + %cmp1 = icmp eq i32 %and, 0 + br i1 %cmp1, label %if.end4, label %while.cond + +while.cond: ; preds = %while.cond, %entry + %a.0 = phi i32 [ %shl, %while.cond ], [ 16, %entry ] + %cmp3 = icmp ult i32 %a.0, %.alignment + %shl = shl i32 %a.0, 1 + br i1 %cmp3, label %while.cond, label %if.end4 + +if.end4: ; preds = %while.cond, %entry + %alignment.addr.1 = phi i32 [ %.alignment, %entry ], [ %a.0, %while.cond ] + %sub5 = sub i32 -64, %alignment.addr.1 + %cmp6 = icmp ugt i32 %sub5, %bytes + br i1 %cmp6, label %if.else, label %if.then9 + +if.then9: ; preds = %if.end4 + %call = tail call i32* @__errno_location() #7 + store i32 12, i32* %call, align 4, !tbaa !3 + br label %if.end96 + +if.else: ; preds = %if.end4 + %cmp11 = icmp ult i32 %bytes, 11 + br i1 %cmp11, label %cond.end, label %cond.false + +cond.false: ; preds = %if.else + %add12 = add i32 %bytes, 11 + %and13 = and i32 %add12, -8 + br label %cond.end + +cond.end: ; preds = %cond.false, %if.else + %cond = phi i32 [ %and13, %cond.false ], [ 16, %if.else ] + %add14 = add i32 %alignment.addr.1, 12 + %sub16 = add i32 %add14, %cond + %call17 = tail call i8* @malloc(i32 %sub16) + %cmp18 = icmp eq i8* %call17, null + br i1 %cmp18, label %if.end96, label %if.then19 + +if.then19: ; preds = %cond.end + %add.ptr = getelementptr inbounds i8* %call17, i32 -8 + %0 = bitcast i8* %add.ptr to %struct.malloc_chunk* + %1 = ptrtoint i8* %call17 to i32 + %sub20 = add i32 %alignment.addr.1, -1 + %and21 = and i32 %1, %sub20 + %cmp22 = icmp eq i32 %and21, 0 + br i1 %cmp22, label %if.end64, label %if.then23 + +if.then23: ; preds = %if.then19 + %add.ptr25 = getelementptr inbounds i8* %call17, i32 %sub20 + %2 = ptrtoint i8* %add.ptr25 to i32 + %sub26 = sub i32 0, %alignment.addr.1 + %and27 = and i32 %2, %sub26 + %3 = inttoptr i32 %and27 to i8* + %add.ptr28 = getelementptr inbounds i8* %3, i32 -8 + %sub.ptr.lhs.cast = ptrtoint i8* %add.ptr28 to i32 + %sub.ptr.rhs.cast = ptrtoint i8* %add.ptr to i32 + %sub.ptr.sub = sub i32 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast + %cmp29 = icmp ugt i32 %sub.ptr.sub, 15 + br i1 %cmp29, label %cond.end33, label %cond.false31 + +cond.false31: ; preds = %if.then23 + %add.ptr28.sum = add i32 %alignment.addr.1, -8 + %add.ptr32 = getelementptr inbounds i8* %3, i32 %add.ptr28.sum + br label %cond.end33 + +cond.end33: ; preds = %cond.false31, %if.then23 + %cond34 = phi i8* [ %add.ptr32, %cond.false31 ], [ %add.ptr28, %if.then23 ] + %4 = bitcast i8* %cond34 to %struct.malloc_chunk* + %sub.ptr.lhs.cast35 = ptrtoint i8* %cond34 to i32 + %sub.ptr.sub37 = sub i32 %sub.ptr.lhs.cast35, %sub.ptr.rhs.cast + %head = getelementptr inbounds i8* %call17, i32 -4 + %5 = bitcast i8* %head to i32* + %6 = load i32* %5, align 4, !tbaa !3 + %and38 = and i32 %6, -8 + %sub39 = sub i32 %and38, %sub.ptr.sub37 + %and41 = and i32 %6, 3 + %cmp42 = icmp eq i32 %and41, 0 + br i1 %cmp42, label %if.then43, label %if.else47 + +if.then43: ; preds = %cond.end33 + %prev_foot = bitcast i8* %add.ptr to i32* + %7 = load i32* %prev_foot, align 4, !tbaa !3 + %add44 = add i32 %7, %sub.ptr.sub37 + %prev_foot45 = bitcast i8* %cond34 to i32* + store i32 %add44, i32* %prev_foot45, align 4, !tbaa !3 + %head46 = getelementptr inbounds i8* %cond34, i32 4 + %8 = bitcast i8* %head46 to i32* + store i32 %sub39, i32* %8, align 4, !tbaa !3 + br label %if.end64 + +if.else47: ; preds = %cond.end33 + %head48 = getelementptr inbounds i8* %cond34, i32 4 + %9 = bitcast i8* %head48 to i32* + %10 = load i32* %9, align 4, !tbaa !3 + %and49 = and i32 %10, 1 + %or = or i32 %sub39, %and49 + %or50 = or i32 %or, 2 + store i32 %or50, i32* %9, align 4, !tbaa !3 + %add.ptr52.sum = add i32 %sub39, 4 + %head53 = getelementptr inbounds i8* %cond34, i32 %add.ptr52.sum + %11 = bitcast i8* %head53 to i32* + %12 = load i32* %11, align 4, !tbaa !3 + %or54 = or i32 %12, 1 + store i32 %or54, i32* %11, align 4, !tbaa !3 + %13 = load i32* %5, align 4, !tbaa !3 + %and56 = and i32 %13, 1 + %or57 = or i32 %sub.ptr.sub37, %and56 + %or58 = or i32 %or57, 2 + store i32 %or58, i32* %5, align 4, !tbaa !3 + %add.ptr60.sum = add i32 %sub.ptr.sub37, -4 + %head61 = getelementptr inbounds i8* %call17, i32 %add.ptr60.sum + %14 = bitcast i8* %head61 to i32* + %15 = load i32* %14, align 4, !tbaa !3 + %or62 = or i32 %15, 1 + store i32 %or62, i32* %14, align 4, !tbaa !3 + tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %0, i32 %sub.ptr.sub37) + br label %if.end64 + +if.end64: ; preds = %if.else47, %if.then43, %if.then19 + %p.0 = phi %struct.malloc_chunk* [ %0, %if.then19 ], [ %4, %if.else47 ], [ %4, %if.then43 ] + %head65 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 1 + %16 = load i32* %head65, align 4, !tbaa !3 + %and66 = and i32 %16, 3 + %cmp67 = icmp eq i32 %and66, 0 + br i1 %cmp67, label %if.end93, label %if.then68 + +if.then68: ; preds = %if.end64 + %and70 = and i32 %16, -8 + %add71 = add i32 %cond, 16 + %cmp72 = icmp ugt i32 %and70, %add71 + br i1 %cmp72, label %if.then73, label %if.end93 + +if.then73: ; preds = %if.then68 + %sub74 = sub i32 %and70, %cond + %17 = bitcast %struct.malloc_chunk* %p.0 to i8* + %add.ptr75 = getelementptr inbounds i8* %17, i32 %cond + %18 = bitcast i8* %add.ptr75 to %struct.malloc_chunk* + %and77 = and i32 %16, 1 + %or78 = or i32 %cond, %and77 + %or79 = or i32 %or78, 2 + store i32 %or79, i32* %head65, align 4, !tbaa !3 + %add.ptr75.sum1 = or i32 %cond, 4 + %head82 = getelementptr inbounds i8* %17, i32 %add.ptr75.sum1 + %19 = bitcast i8* %head82 to i32* + %or87 = or i32 %sub74, 3 + store i32 %or87, i32* %19, align 4, !tbaa !3 + %add.ptr89.sum2 = or i32 %and70, 4 + %head90 = getelementptr inbounds i8* %17, i32 %add.ptr89.sum2 + %20 = bitcast i8* %head90 to i32* + %21 = load i32* %20, align 4, !tbaa !3 + %or91 = or i32 %21, 1 + store i32 %or91, i32* %20, align 4, !tbaa !3 + tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %18, i32 %sub74) + br label %if.end93 + +if.end93: ; preds = %if.then73, %if.then68, %if.end64 + %add.ptr94 = getelementptr inbounds %struct.malloc_chunk* %p.0, i32 0, i32 2 + %22 = bitcast %struct.malloc_chunk** %add.ptr94 to i8* + br label %if.end96 + +if.end96: ; preds = %if.end93, %cond.end, %if.then9 + %mem.0 = phi i8* [ null, %if.then9 ], [ %22, %if.end93 ], [ null, %cond.end ] + ret i8* %mem.0 +} + +; Function Attrs: nounwind +define weak i32 @posix_memalign(i8** %pp, i32 %alignment, i32 %bytes) #0 { +entry: + %cmp = icmp eq i32 %alignment, 8 + br i1 %cmp, label %if.then, label %if.else + +if.then: ; preds = %entry + %call = tail call i8* @malloc(i32 %bytes) + br label %if.end15 + +if.else: ; preds = %entry + %div = lshr i32 %alignment, 2 + %rem = and i32 %alignment, 3 + %cmp1 = icmp ne i32 %rem, 0 + %cmp2 = icmp eq i32 %div, 0 + %or.cond = or i1 %cmp1, %cmp2 + br i1 %or.cond, label %return, label %lor.lhs.false3 + +lor.lhs.false3: ; preds = %if.else + %sub = add i32 %div, 1073741823 + %and = and i32 %sub, %div + %cmp4 = icmp eq i32 %and, 0 + br i1 %cmp4, label %if.else6, label %return + +if.else6: ; preds = %lor.lhs.false3 + %sub7 = sub i32 -64, %alignment + %cmp8 = icmp ult i32 %sub7, %bytes + br i1 %cmp8, label %return, label %if.then9 + +if.then9: ; preds = %if.else6 + %cmp10 = icmp ult i32 %alignment, 16 + %.alignment = select i1 %cmp10, i32 16, i32 %alignment + %call12 = tail call fastcc i8* @internal_memalign(i32 %.alignment, i32 %bytes) + br label %if.end15 + +if.end15: ; preds = %if.then9, %if.then + %mem.0 = phi i8* [ %call, %if.then ], [ %call12, %if.then9 ] + %cmp16 = icmp eq i8* %mem.0, null + br i1 %cmp16, label %return, label %if.else18 + +if.else18: ; preds = %if.end15 + store i8* %mem.0, i8** %pp, align 4, !tbaa !0 + br label %return + +return: ; preds = %if.else18, %if.end15, %if.else6, %lor.lhs.false3, %if.else + %retval.0 = phi i32 [ 0, %if.else18 ], [ 22, %if.else ], [ 22, %lor.lhs.false3 ], [ 12, %if.end15 ], [ 12, %if.else6 ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind +define weak i8* @valloc(i32 %bytes) #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp = icmp eq i32 %0, 0 + br i1 %cmp, label %if.then.i, label %lor.end + +if.then.i: ; preds = %entry + %call.i = tail call i32 @sysconf(i32 30) #1 + %sub.i = add i32 %call.i, -1 + %and.i = and i32 %sub.i, %call.i + %cmp1.i = icmp eq i32 %and.i, 0 + br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i + +if.then5.i: ; preds = %if.then.i + tail call void @abort() #6 + unreachable + +init_mparams.exit: ; preds = %if.then.i + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i = tail call i32 @time(i32* null) #1 + %xor.i = and i32 %call6.i, -16 + %and7.i = xor i32 %xor.i, 1431655768 + store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %lor.end + +lor.end: ; preds = %init_mparams.exit, %entry + %1 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + %call1 = tail call i8* @memalign(i32 %1, i32 %bytes) + ret i8* %call1 +} + +; Function Attrs: nounwind +define weak i8* @pvalloc(i32 %bytes) #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp = icmp eq i32 %0, 0 + br i1 %cmp, label %if.then.i, label %lor.end + +if.then.i: ; preds = %entry + %call.i = tail call i32 @sysconf(i32 30) #1 + %sub.i = add i32 %call.i, -1 + %and.i = and i32 %sub.i, %call.i + %cmp1.i = icmp eq i32 %and.i, 0 + br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i + +if.then5.i: ; preds = %if.then.i + tail call void @abort() #6 + unreachable + +init_mparams.exit: ; preds = %if.then.i + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i = tail call i32 @time(i32* null) #1 + %xor.i = and i32 %call6.i, -16 + %and7.i = xor i32 %xor.i, 1431655768 + store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %lor.end + +lor.end: ; preds = %init_mparams.exit, %entry + %1 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + %add = add i32 %bytes, -1 + %sub = add i32 %add, %1 + %neg = sub i32 0, %1 + %and = and i32 %sub, %neg + %call2 = tail call i8* @memalign(i32 %1, i32 %and) + ret i8* %call2 +} + +; Function Attrs: nounwind +define weak i8** @independent_calloc(i32 %n_elements, i32 %elem_size, i8** %chunks) #0 { +entry: + %sz = alloca i32, align 4 + store i32 %elem_size, i32* %sz, align 4, !tbaa !3 + %call = call fastcc i8** @ialloc(i32 %n_elements, i32* %sz, i32 3, i8** %chunks) + ret i8** %call +} + +; Function Attrs: nounwind +define internal fastcc i8** @ialloc(i32 %n_elements, i32* nocapture %sizes, i32 %opts, i8** %chunks) #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp = icmp eq i32 %0, 0 + br i1 %cmp, label %if.then.i, label %lor.end + +if.then.i: ; preds = %entry + %call.i = tail call i32 @sysconf(i32 30) #1 + %sub.i = add i32 %call.i, -1 + %and.i = and i32 %sub.i, %call.i + %cmp1.i = icmp eq i32 %and.i, 0 + br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i + +if.then5.i: ; preds = %if.then.i + tail call void @abort() #6 + unreachable + +init_mparams.exit: ; preds = %if.then.i + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i = tail call i32 @time(i32* null) #1 + %xor.i = and i32 %call6.i, -16 + %and7.i = xor i32 %xor.i, 1431655768 + store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %lor.end + +lor.end: ; preds = %init_mparams.exit, %entry + %cmp1 = icmp eq i8** %chunks, null + %cmp2 = icmp eq i32 %n_elements, 0 + br i1 %cmp1, label %if.else, label %if.then + +if.then: ; preds = %lor.end + br i1 %cmp2, label %return, label %if.end11 + +if.else: ; preds = %lor.end + br i1 %cmp2, label %if.then5, label %if.end7 + +if.then5: ; preds = %if.else + %call6 = tail call i8* @malloc(i32 0) + %1 = bitcast i8* %call6 to i8** + br label %return + +if.end7: ; preds = %if.else + %mul = shl i32 %n_elements, 2 + %cmp8 = icmp ult i32 %mul, 11 + br i1 %cmp8, label %if.end11, label %cond.false + +cond.false: ; preds = %if.end7 + %add10 = add i32 %mul, 11 + %and = and i32 %add10, -8 + br label %if.end11 + +if.end11: ; preds = %cond.false, %if.end7, %if.then + %array_size.0 = phi i32 [ 0, %if.then ], [ %and, %cond.false ], [ 16, %if.end7 ] + %marray.0 = phi i8** [ %chunks, %if.then ], [ null, %cond.false ], [ null, %if.end7 ] + %and12 = and i32 %opts, 1 + %tobool13 = icmp eq i32 %and12, 0 + br i1 %tobool13, label %for.cond.preheader, label %if.then14 + +for.cond.preheader: ; preds = %if.end11 + br i1 %cmp2, label %if.end36, label %for.body + +if.then14: ; preds = %if.end11 + %2 = load i32* %sizes, align 4, !tbaa !3 + %cmp15 = icmp ult i32 %2, 11 + br i1 %cmp15, label %cond.end21, label %cond.false17 + +cond.false17: ; preds = %if.then14 + %add19 = add i32 %2, 11 + %and20 = and i32 %add19, -8 + br label %cond.end21 + +cond.end21: ; preds = %cond.false17, %if.then14 + %cond22 = phi i32 [ %and20, %cond.false17 ], [ 16, %if.then14 ] + %mul23 = mul i32 %cond22, %n_elements + br label %if.end36 + +for.body: ; preds = %cond.end33, %for.cond.preheader + %i.09 = phi i32 [ %inc, %cond.end33 ], [ 0, %for.cond.preheader ] + %contents_size.08 = phi i32 [ %add35, %cond.end33 ], [ 0, %for.cond.preheader ] + %arrayidx = getelementptr inbounds i32* %sizes, i32 %i.09 + %3 = load i32* %arrayidx, align 4, !tbaa !3 + %cmp26 = icmp ult i32 %3, 11 + br i1 %cmp26, label %cond.end33, label %cond.false28 + +cond.false28: ; preds = %for.body + %add31 = add i32 %3, 11 + %and32 = and i32 %add31, -8 + br label %cond.end33 + +cond.end33: ; preds = %cond.false28, %for.body + %cond34 = phi i32 [ %and32, %cond.false28 ], [ 16, %for.body ] + %add35 = add i32 %cond34, %contents_size.08 + %inc = add i32 %i.09, 1 + %cmp25 = icmp eq i32 %inc, %n_elements + br i1 %cmp25, label %if.end36, label %for.body + +if.end36: ; preds = %cond.end33, %cond.end21, %for.cond.preheader + %contents_size.1 = phi i32 [ %mul23, %cond.end21 ], [ 0, %for.cond.preheader ], [ %add35, %cond.end33 ] + %element_size.0 = phi i32 [ %cond22, %cond.end21 ], [ 0, %for.cond.preheader ], [ 0, %cond.end33 ] + %add37 = add i32 %array_size.0, -4 + %sub = add i32 %add37, %contents_size.1 + %call39 = tail call i8* @malloc(i32 %sub) + %cmp44 = icmp eq i8* %call39, null + br i1 %cmp44, label %return, label %if.end46 + +if.end46: ; preds = %if.end36 + %add.ptr = getelementptr inbounds i8* %call39, i32 -8 + %head = getelementptr inbounds i8* %call39, i32 -4 + %4 = bitcast i8* %head to i32* + %5 = load i32* %4, align 4, !tbaa !3 + %and47 = and i32 %5, -8 + %and48 = and i32 %opts, 2 + %tobool49 = icmp eq i32 %and48, 0 + br i1 %tobool49, label %if.end53, label %if.then50 + +if.then50: ; preds = %if.end46 + %sub51 = sub i32 -4, %array_size.0 + %sub52 = add i32 %sub51, %and47 + tail call void @llvm.memset.p0i8.i32(i8* %call39, i8 0, i32 %sub52, i32 4, i1 false) + br label %if.end53 + +if.end53: ; preds = %if.then50, %if.end46 + %cmp54 = icmp eq i8** %marray.0, null + br i1 %cmp54, label %if.then55, label %if.end61 + +if.then55: ; preds = %if.end53 + %sub57 = sub i32 %and47, %contents_size.1 + %add.ptr58 = getelementptr inbounds i8* %call39, i32 %contents_size.1 + %6 = bitcast i8* %add.ptr58 to i8** + %or59 = or i32 %sub57, 3 + %add.ptr56.sum = add i32 %contents_size.1, -4 + %head60 = getelementptr inbounds i8* %call39, i32 %add.ptr56.sum + %7 = bitcast i8* %head60 to i32* + store i32 %or59, i32* %7, align 4, !tbaa !3 + br label %if.end61 + +if.end61: ; preds = %if.then55, %if.end53 + %remainder_size.0 = phi i32 [ %contents_size.1, %if.then55 ], [ %and47, %if.end53 ] + %marray.1 = phi i8** [ %6, %if.then55 ], [ %marray.0, %if.end53 ] + store i8* %call39, i8** %marray.1, align 4, !tbaa !0 + %sub65 = add i32 %n_elements, -1 + %cmp662 = icmp eq i32 %sub65, 0 + br i1 %cmp662, label %if.else87, label %if.then67.lr.ph + +if.then67.lr.ph: ; preds = %if.end61 + %cmp68 = icmp eq i32 %element_size.0, 0 + br i1 %cmp68, label %if.else70.us, label %if.end81 + +if.else70.us: ; preds = %if.end81.us, %if.then67.lr.ph + %i.15.us = phi i32 [ %inc93.us, %if.end81.us ], [ 0, %if.then67.lr.ph ] + %remainder_size.14.us = phi i32 [ %sub82.us, %if.end81.us ], [ %remainder_size.0, %if.then67.lr.ph ] + %p.0.in3.us = phi i8* [ %add.ptr86.us, %if.end81.us ], [ %add.ptr, %if.then67.lr.ph ] + %arrayidx71.us = getelementptr inbounds i32* %sizes, i32 %i.15.us + %8 = load i32* %arrayidx71.us, align 4, !tbaa !3 + %cmp72.us = icmp ult i32 %8, 11 + br i1 %cmp72.us, label %if.end81.us, label %cond.false74.us + +cond.false74.us: ; preds = %if.else70.us + %add77.us = add i32 %8, 11 + %and78.us = and i32 %add77.us, -8 + br label %if.end81.us + +if.end81.us: ; preds = %cond.false74.us, %if.else70.us + %size.0.us = phi i32 [ %and78.us, %cond.false74.us ], [ 16, %if.else70.us ] + %sub82.us = sub i32 %remainder_size.14.us, %size.0.us + %or84.us = or i32 %size.0.us, 3 + %head85.us = getelementptr inbounds i8* %p.0.in3.us, i32 4 + %9 = bitcast i8* %head85.us to i32* + store i32 %or84.us, i32* %9, align 4, !tbaa !3 + %add.ptr86.us = getelementptr inbounds i8* %p.0.in3.us, i32 %size.0.us + %inc93.us = add i32 %i.15.us, 1 + %add.ptr86.us.sum = add i32 %size.0.us, 8 + %add.ptr63.us = getelementptr inbounds i8* %p.0.in3.us, i32 %add.ptr86.us.sum + %arrayidx64.us = getelementptr inbounds i8** %marray.1, i32 %inc93.us + store i8* %add.ptr63.us, i8** %arrayidx64.us, align 4, !tbaa !0 + %cmp66.us = icmp eq i32 %inc93.us, %sub65 + br i1 %cmp66.us, label %if.else87, label %if.else70.us + +if.end81: ; preds = %if.end81, %if.then67.lr.ph + %i.15 = phi i32 [ %inc93, %if.end81 ], [ 0, %if.then67.lr.ph ] + %remainder_size.14 = phi i32 [ %sub82, %if.end81 ], [ %remainder_size.0, %if.then67.lr.ph ] + %p.0.in3 = phi i8* [ %add.ptr86, %if.end81 ], [ %add.ptr, %if.then67.lr.ph ] + %sub82 = sub i32 %remainder_size.14, %element_size.0 + %or84 = or i32 %element_size.0, 3 + %head85 = getelementptr inbounds i8* %p.0.in3, i32 4 + %10 = bitcast i8* %head85 to i32* + store i32 %or84, i32* %10, align 4, !tbaa !3 + %add.ptr86 = getelementptr inbounds i8* %p.0.in3, i32 %element_size.0 + %inc93 = add i32 %i.15, 1 + %add.ptr86.sum = add i32 %element_size.0, 8 + %add.ptr63 = getelementptr inbounds i8* %p.0.in3, i32 %add.ptr86.sum + %arrayidx64 = getelementptr inbounds i8** %marray.1, i32 %inc93 + store i8* %add.ptr63, i8** %arrayidx64, align 4, !tbaa !0 + %cmp66 = icmp eq i32 %inc93, %sub65 + br i1 %cmp66, label %if.else87, label %if.end81 + +if.else87: ; preds = %if.end81, %if.end81.us, %if.end61 + %remainder_size.1.lcssa = phi i32 [ %remainder_size.0, %if.end61 ], [ %sub82.us, %if.end81.us ], [ %sub82, %if.end81 ] + %p.0.in.lcssa = phi i8* [ %add.ptr, %if.end61 ], [ %add.ptr86.us, %if.end81.us ], [ %add.ptr86, %if.end81 ] + %or89 = or i32 %remainder_size.1.lcssa, 3 + %head90 = getelementptr inbounds i8* %p.0.in.lcssa, i32 4 + %11 = bitcast i8* %head90 to i32* + store i32 %or89, i32* %11, align 4, !tbaa !3 + br label %return + +return: ; preds = %if.else87, %if.end36, %if.then5, %if.then + %retval.0 = phi i8** [ %marray.1, %if.else87 ], [ %1, %if.then5 ], [ %chunks, %if.then ], [ null, %if.end36 ] + ret i8** %retval.0 +} + +; Function Attrs: nounwind +define weak i8** @independent_comalloc(i32 %n_elements, i32* %sizes, i8** %chunks) #0 { +entry: + %call = tail call fastcc i8** @ialloc(i32 %n_elements, i32* %sizes, i32 0, i8** %chunks) + ret i8** %call +} + +; Function Attrs: nounwind +define weak i32 @bulk_free(i8** %array, i32 %nelem) #0 { +entry: + %arrayidx.i = getelementptr inbounds i8** %array, i32 %nelem + %cmp6.i = icmp eq i32 %nelem, 0 + br i1 %cmp6.i, label %internal_bulk_free.exit, label %for.body.i + +for.body.i: ; preds = %for.inc.i, %entry + %a.07.i = phi i8** [ %array, %entry ], [ %incdec.ptr.pre-phi.i, %for.inc.i ] + %0 = load i8** %a.07.i, align 4, !tbaa !0 + %cmp1.i = icmp eq i8* %0, null + br i1 %cmp1.i, label %for.body.for.inc_crit_edge.i, label %if.then.i + +for.body.for.inc_crit_edge.i: ; preds = %for.body.i + %incdec.ptr.pre.i = getelementptr inbounds i8** %a.07.i, i32 1 + br label %for.inc.i + +if.then.i: ; preds = %for.body.i + %add.ptr.i = getelementptr inbounds i8* %0, i32 -8 + %1 = bitcast i8* %add.ptr.i to %struct.malloc_chunk* + %head.i = getelementptr inbounds i8* %0, i32 -4 + %2 = bitcast i8* %head.i to i32* + %3 = load i32* %2, align 4, !tbaa !3 + %and.i = and i32 %3, -8 + store i8* null, i8** %a.07.i, align 4, !tbaa !0 + %4 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp2.i = icmp ult i8* %add.ptr.i, %4 + br i1 %cmp2.i, label %if.else25.i, label %land.rhs.i + +land.rhs.i: ; preds = %if.then.i + %and4.i = and i32 %3, 3 + %cmp5.i = icmp eq i32 %and4.i, 1 + br i1 %cmp5.i, label %if.else25.i, label %if.then6.i, !prof !6 + +if.then6.i: ; preds = %land.rhs.i + %add.ptr7.i = getelementptr inbounds i8** %a.07.i, i32 1 + %and91.i = add i32 %3, -8 + %add.ptr.sum.i = and i32 %and91.i, -8 + %cmp11.i = icmp eq i8** %add.ptr7.i, %arrayidx.i + br i1 %cmp11.i, label %if.else.i, label %land.lhs.true.i + +land.lhs.true.i: ; preds = %if.then6.i + %5 = load i8** %add.ptr7.i, align 4, !tbaa !0 + %add.ptr10.sum.i = add i32 %add.ptr.sum.i, 8 + %add.ptr12.i = getelementptr inbounds i8* %0, i32 %add.ptr10.sum.i + %cmp13.i = icmp eq i8* %5, %add.ptr12.i + br i1 %cmp13.i, label %if.then14.i, label %if.else.i + +if.then14.i: ; preds = %land.lhs.true.i + %add.ptr10.sum23.i = or i32 %add.ptr.sum.i, 4 + %head15.i = getelementptr inbounds i8* %0, i32 %add.ptr10.sum23.i + %6 = bitcast i8* %head15.i to i32* + %7 = load i32* %6, align 4, !tbaa !3 + %and16.i = and i32 %7, -8 + %add.i = add i32 %and16.i, %and.i + %and18.i = and i32 %3, 1 + %or.i = or i32 %and18.i, %add.i + %or19.i = or i32 %or.i, 2 + store i32 %or19.i, i32* %2, align 4, !tbaa !3 + %add.ptr21.sum.i = add i32 %add.i, -4 + %head22.i = getelementptr inbounds i8* %0, i32 %add.ptr21.sum.i + %8 = bitcast i8* %head22.i to i32* + %9 = load i32* %8, align 4, !tbaa !3 + %or23.i = or i32 %9, 1 + store i32 %or23.i, i32* %8, align 4, !tbaa !3 + store i8* %0, i8** %add.ptr7.i, align 4, !tbaa !0 + br label %for.inc.i + +if.else.i: ; preds = %land.lhs.true.i, %if.then6.i + tail call fastcc void @dispose_chunk(%struct.malloc_chunk* %1, i32 %and.i) #1 + br label %for.inc.i + +if.else25.i: ; preds = %land.rhs.i, %if.then.i + tail call void @abort() #6 + unreachable + +for.inc.i: ; preds = %if.else.i, %if.then14.i, %for.body.for.inc_crit_edge.i + %incdec.ptr.pre-phi.i = phi i8** [ %incdec.ptr.pre.i, %for.body.for.inc_crit_edge.i ], [ %add.ptr7.i, %if.then14.i ], [ %add.ptr7.i, %if.else.i ] + %cmp.i = icmp eq i8** %incdec.ptr.pre-phi.i, %arrayidx.i + br i1 %cmp.i, label %internal_bulk_free.exit, label %for.body.i + +internal_bulk_free.exit: ; preds = %for.inc.i, %entry + ret i32 0 +} + +; Function Attrs: nounwind +define weak i32 @malloc_trim(i32 %pad) #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp = icmp eq i32 %0, 0 + br i1 %cmp, label %if.then.i, label %lor.end.i + +if.then.i: ; preds = %entry + %call.i = tail call i32 @sysconf(i32 30) #1 + %sub.i = add i32 %call.i, -1 + %and.i = and i32 %sub.i, %call.i + %cmp1.i = icmp eq i32 %and.i, 0 + br i1 %cmp1.i, label %init_mparams.exit, label %if.then5.i + +if.then5.i: ; preds = %if.then.i + tail call void @abort() #6 + unreachable + +init_mparams.exit: ; preds = %if.then.i + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i = tail call i32 @time(i32* null) #1 + %xor.i = and i32 %call6.i, -16 + %and7.i = xor i32 %xor.i, 1431655768 + store volatile i32 %and7.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %lor.end.i + +lor.end.i: ; preds = %init_mparams.exit, %entry + %cmp1.i2 = icmp ult i32 %pad, -64 + br i1 %cmp1.i2, label %land.lhs.true.i, label %sys_trim.exit + +land.lhs.true.i: ; preds = %lor.end.i + %1 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp2.i = icmp eq %struct.malloc_chunk* %1, null + br i1 %cmp2.i, label %sys_trim.exit, label %if.then.i3 + +if.then.i3: ; preds = %land.lhs.true.i + %add.i = add i32 %pad, 40 + %2 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %cmp3.i = icmp ugt i32 %2, %add.i + br i1 %cmp3.i, label %if.then4.i, label %land.lhs.true45.i + +if.then4.i: ; preds = %if.then.i3 + %3 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + %sub6.i = sub i32 -41, %pad + %sub.i4 = add i32 %sub6.i, %2 + %add7.i = add i32 %sub.i4, %3 + %div.i = udiv i32 %add7.i, %3 + %4 = bitcast %struct.malloc_chunk* %1 to i8* + br label %for.cond.i.i + +for.cond.i.i: ; preds = %if.end.i2.i, %if.then4.i + %sp.0.i.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.then4.i ], [ %7, %if.end.i2.i ] + %base.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 0 + %5 = load i8** %base.i.i, align 4, !tbaa !0 + %cmp.i1.i = icmp ugt i8* %5, %4 + br i1 %cmp.i1.i, label %if.end.i2.i, label %land.lhs.true.i.i + +land.lhs.true.i.i: ; preds = %for.cond.i.i + %size.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 1 + %6 = load i32* %size.i.i, align 4, !tbaa !3 + %add.ptr.i.i = getelementptr inbounds i8* %5, i32 %6 + %cmp2.i.i = icmp ugt i8* %add.ptr.i.i, %4 + br i1 %cmp2.i.i, label %segment_holding.exit.i, label %if.end.i2.i + +if.end.i2.i: ; preds = %land.lhs.true.i.i, %for.cond.i.i + %next.i.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 2 + %7 = load %struct.malloc_segment** %next.i.i, align 4, !tbaa !0 + br label %for.cond.i.i + +segment_holding.exit.i: ; preds = %land.lhs.true.i.i + %sub8.i = add i32 %div.i, -1 + %mul.i = mul i32 %sub8.i, %3 + %sflags.i = getelementptr inbounds %struct.malloc_segment* %sp.0.i.i, i32 0, i32 3 + %8 = load i32* %sflags.i, align 4, !tbaa !3 + %and.i5 = and i32 %8, 8 + %tobool11.i = icmp eq i32 %and.i5, 0 + br i1 %tobool11.i, label %if.else.i, label %land.lhs.true45.i + +if.else.i: ; preds = %segment_holding.exit.i + %call20.i = tail call i8* @sbrk(i32 0) #1 + %9 = load i8** %base.i.i, align 4, !tbaa !0 + %10 = load i32* %size.i.i, align 4, !tbaa !3 + %add.ptr.i = getelementptr inbounds i8* %9, i32 %10 + %cmp21.i = icmp eq i8* %call20.i, %add.ptr.i + br i1 %cmp21.i, label %if.then22.i, label %land.lhs.true45.i + +if.then22.i: ; preds = %if.else.i + %sub19.i = sub i32 -2147483648, %3 + %cmp17.i = icmp ugt i32 %mul.i, 2147483646 + %sub19.mul.i = select i1 %cmp17.i, i32 %sub19.i, i32 %mul.i + %sub23.i = sub i32 0, %sub19.mul.i + %call24.i = tail call i8* @sbrk(i32 %sub23.i) #1 + %call25.i = tail call i8* @sbrk(i32 0) #1 + %cmp26.i = icmp ne i8* %call24.i, inttoptr (i32 -1 to i8*) + %cmp28.i = icmp ult i8* %call25.i, %call20.i + %or.cond.i = and i1 %cmp26.i, %cmp28.i + br i1 %or.cond.i, label %if.end33.i, label %land.lhs.true45.i + +if.end33.i: ; preds = %if.then22.i + %sub.ptr.lhs.cast.i = ptrtoint i8* %call20.i to i32 + %sub.ptr.rhs.cast.i = ptrtoint i8* %call25.i to i32 + %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i + %cmp34.i = icmp eq i8* %call20.i, %call25.i + br i1 %cmp34.i, label %land.lhs.true45.i, label %if.then35.i + +if.then35.i: ; preds = %if.end33.i + %11 = load i32* %size.i.i, align 4, !tbaa !3 + %sub37.i = sub i32 %11, %sub.ptr.sub.i + store i32 %sub37.i, i32* %size.i.i, align 4, !tbaa !3 + %12 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %sub38.i = sub i32 %12, %sub.ptr.sub.i + store i32 %sub38.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %13 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %14 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %sub41.i = sub i32 %14, %sub.ptr.sub.i + %15 = bitcast %struct.malloc_chunk* %13 to i8* + %add.ptr.i3.i = getelementptr inbounds %struct.malloc_chunk* %13, i32 0, i32 2 + %16 = ptrtoint %struct.malloc_chunk** %add.ptr.i3.i to i32 + %and.i4.i = and i32 %16, 7 + %cmp.i5.i = icmp eq i32 %and.i4.i, 0 + br i1 %cmp.i5.i, label %if.end43.i, label %cond.false.i.i + +cond.false.i.i: ; preds = %if.then35.i + %17 = sub i32 0, %16 + %and3.i.i = and i32 %17, 7 + br label %if.end43.i + +if.end43.i: ; preds = %cond.false.i.i, %if.then35.i + %cond.i.i = phi i32 [ %and3.i.i, %cond.false.i.i ], [ 0, %if.then35.i ] + %add.ptr4.i.i = getelementptr inbounds i8* %15, i32 %cond.i.i + %18 = bitcast i8* %add.ptr4.i.i to %struct.malloc_chunk* + %sub5.i.i = sub i32 %sub41.i, %cond.i.i + store %struct.malloc_chunk* %18, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + store i32 %sub5.i.i, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %or.i.i = or i32 %sub5.i.i, 1 + %add.ptr4.sum.i.i = add i32 %cond.i.i, 4 + %head.i.i = getelementptr inbounds i8* %15, i32 %add.ptr4.sum.i.i + %19 = bitcast i8* %head.i.i to i32* + store i32 %or.i.i, i32* %19, align 4, !tbaa !3 + %add.ptr6.sum.i.i = add i32 %sub41.i, 4 + %head7.i.i = getelementptr inbounds i8* %15, i32 %add.ptr6.sum.i.i + %20 = bitcast i8* %head7.i.i to i32* + store i32 40, i32* %20, align 4, !tbaa !3 + %21 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 %21, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3 + br label %sys_trim.exit + +land.lhs.true45.i: ; preds = %if.end33.i, %if.then22.i, %if.else.i, %segment_holding.exit.i, %if.then.i3 + %22 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %23 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3 + %cmp47.i = icmp ugt i32 %22, %23 + br i1 %cmp47.i, label %if.then48.i, label %sys_trim.exit + +if.then48.i: ; preds = %land.lhs.true45.i + store i32 -1, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 7), align 4, !tbaa !3 + br label %sys_trim.exit + +sys_trim.exit: ; preds = %if.then48.i, %land.lhs.true45.i, %if.end43.i, %land.lhs.true.i, %lor.end.i + %released.2.i = phi i32 [ 0, %if.then48.i ], [ 0, %land.lhs.true45.i ], [ 1, %if.end43.i ], [ 0, %land.lhs.true.i ], [ 0, %lor.end.i ] + ret i32 %released.2.i +} + +; Function Attrs: nounwind +define weak i32 @malloc_footprint() #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + ret i32 %0 +} + +; Function Attrs: nounwind +define weak i32 @malloc_max_footprint() #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3 + ret i32 %0 +} + +; Function Attrs: nounwind +define weak i32 @malloc_footprint_limit() #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3 + %cmp = icmp eq i32 %0, 0 + %cond = select i1 %cmp, i32 -1, i32 %0 + ret i32 %cond +} + +; Function Attrs: nounwind +define weak i32 @malloc_set_footprint_limit(i32 %bytes) #0 { +entry: + %cmp2 = icmp eq i32 %bytes, -1 + br i1 %cmp2, label %if.end9, label %if.else + +if.else: ; preds = %entry + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + %sub4 = add i32 %bytes, -1 + %add5 = add i32 %sub4, %0 + %neg7 = sub i32 0, %0 + %and8 = and i32 %add5, %neg7 + br label %if.end9 + +if.end9: ; preds = %if.else, %entry + %result.0 = phi i32 [ %and8, %if.else ], [ 0, %entry ] + store i32 %result.0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 14), align 4, !tbaa !3 + ret i32 %result.0 +} + +; Function Attrs: nounwind +define weak void @mallinfo(%struct.mallinfo* noalias sret %agg.result) #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp.i = icmp eq i32 %0, 0 + br i1 %cmp.i, label %if.then.i.i, label %lor.end.i + +if.then.i.i: ; preds = %entry + %call.i.i = tail call i32 @sysconf(i32 30) #1 + %sub.i.i = add i32 %call.i.i, -1 + %and.i.i = and i32 %sub.i.i, %call.i.i + %cmp1.i.i = icmp eq i32 %and.i.i, 0 + br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i + +if.then5.i.i: ; preds = %if.then.i.i + tail call void @abort() #6 + unreachable + +init_mparams.exit.i: ; preds = %if.then.i.i + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i.i = tail call i32 @time(i32* null) #1 + %xor.i.i = and i32 %call6.i.i, -16 + %and7.i.i = xor i32 %xor.i.i, 1431655768 + store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %lor.end.i + +lor.end.i: ; preds = %init_mparams.exit.i, %entry + %1 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp1.i = icmp eq %struct.malloc_chunk* %1, null + br i1 %cmp1.i, label %internal_mallinfo.exit, label %if.then.i + +if.then.i: ; preds = %lor.end.i + %2 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add.i = add i32 %2, 40 + br label %while.body.i + +while.body.i: ; preds = %while.end.i, %if.then.i + %s.013.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.then.i ], [ %9, %while.end.i ] + %sum.012.i = phi i32 [ %add.i, %if.then.i ], [ %sum.1.lcssa.i, %while.end.i ] + %mfree.011.i = phi i32 [ %add.i, %if.then.i ], [ %mfree.1.lcssa.i, %while.end.i ] + %nfree.010.i = phi i32 [ 1, %if.then.i ], [ %nfree.1.lcssa.i, %while.end.i ] + %base.i = getelementptr inbounds %struct.malloc_segment* %s.013.i, i32 0, i32 0 + %3 = load i8** %base.i, align 4, !tbaa !0 + %add.ptr.i = getelementptr inbounds i8* %3, i32 8 + %4 = ptrtoint i8* %add.ptr.i to i32 + %and.i = and i32 %4, 7 + %cmp4.i = icmp eq i32 %and.i, 0 + br i1 %cmp4.i, label %land.lhs.true.lr.ph.i, label %cond.false.i + +cond.false.i: ; preds = %while.body.i + %5 = sub i32 0, %4 + %and8.i = and i32 %5, 7 + br label %land.lhs.true.lr.ph.i + +land.lhs.true.lr.ph.i: ; preds = %cond.false.i, %while.body.i + %cond.i = phi i32 [ %and8.i, %cond.false.i ], [ 0, %while.body.i ] + %add.ptr9.i = getelementptr inbounds i8* %3, i32 %cond.i + %size.i = getelementptr inbounds %struct.malloc_segment* %s.013.i, i32 0, i32 1 + %6 = load i32* %size.i, align 4, !tbaa !3 + %add.ptr14.i = getelementptr inbounds i8* %3, i32 %6 + br label %land.lhs.true.i + +land.lhs.true.i: ; preds = %if.end.i, %land.lhs.true.lr.ph.i + %q.0.in7.i = phi i8* [ %add.ptr9.i, %land.lhs.true.lr.ph.i ], [ %add.ptr31.i, %if.end.i ] + %sum.16.i = phi i32 [ %sum.012.i, %land.lhs.true.lr.ph.i ], [ %add23.i, %if.end.i ] + %mfree.15.i = phi i32 [ %mfree.011.i, %land.lhs.true.lr.ph.i ], [ %mfree.2.i, %if.end.i ] + %nfree.14.i = phi i32 [ %nfree.010.i, %land.lhs.true.lr.ph.i ], [ %nfree.2.i, %if.end.i ] + %q.0.i = bitcast i8* %q.0.in7.i to %struct.malloc_chunk* + %cmp15.i = icmp uge i8* %q.0.in7.i, %add.ptr14.i + %cmp18.i = icmp eq %struct.malloc_chunk* %q.0.i, %1 + %or.cond.i = or i1 %cmp15.i, %cmp18.i + br i1 %or.cond.i, label %while.end.i, label %land.rhs.i + +land.rhs.i: ; preds = %land.lhs.true.i + %head.i = getelementptr inbounds i8* %q.0.in7.i, i32 4 + %7 = bitcast i8* %head.i to i32* + %8 = load i32* %7, align 4, !tbaa !3 + %cmp19.i = icmp eq i32 %8, 7 + br i1 %cmp19.i, label %while.end.i, label %while.body20.i + +while.body20.i: ; preds = %land.rhs.i + %and22.i = and i32 %8, -8 + %add23.i = add i32 %and22.i, %sum.16.i + %and25.i = and i32 %8, 3 + %cmp26.i = icmp eq i32 %and25.i, 1 + br i1 %cmp26.i, label %if.then27.i, label %if.end.i + +if.then27.i: ; preds = %while.body20.i + %add28.i = add i32 %and22.i, %mfree.15.i + %inc.i = add i32 %nfree.14.i, 1 + br label %if.end.i + +if.end.i: ; preds = %if.then27.i, %while.body20.i + %nfree.2.i = phi i32 [ %nfree.14.i, %while.body20.i ], [ %inc.i, %if.then27.i ] + %mfree.2.i = phi i32 [ %mfree.15.i, %while.body20.i ], [ %add28.i, %if.then27.i ] + %add.ptr31.i = getelementptr inbounds i8* %q.0.in7.i, i32 %and22.i + %cmp12.i = icmp ult i8* %add.ptr31.i, %3 + br i1 %cmp12.i, label %while.end.i, label %land.lhs.true.i + +while.end.i: ; preds = %if.end.i, %land.rhs.i, %land.lhs.true.i + %sum.1.lcssa.i = phi i32 [ %sum.16.i, %land.rhs.i ], [ %sum.16.i, %land.lhs.true.i ], [ %add23.i, %if.end.i ] + %mfree.1.lcssa.i = phi i32 [ %mfree.15.i, %land.rhs.i ], [ %mfree.15.i, %land.lhs.true.i ], [ %mfree.2.i, %if.end.i ] + %nfree.1.lcssa.i = phi i32 [ %nfree.14.i, %land.rhs.i ], [ %nfree.14.i, %land.lhs.true.i ], [ %nfree.2.i, %if.end.i ] + %next.i = getelementptr inbounds %struct.malloc_segment* %s.013.i, i32 0, i32 2 + %9 = load %struct.malloc_segment** %next.i, align 4, !tbaa !0 + %cmp2.i = icmp eq %struct.malloc_segment* %9, null + br i1 %cmp2.i, label %while.end32.i, label %while.body.i + +while.end32.i: ; preds = %while.end.i + %10 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %sub33.i = sub i32 %10, %sum.1.lcssa.i + %11 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3 + %sub35.i = sub i32 %10, %mfree.1.lcssa.i + br label %internal_mallinfo.exit + +internal_mallinfo.exit: ; preds = %while.end32.i, %lor.end.i + %nm.sroa.6.0.i = phi i32 [ %sub35.i, %while.end32.i ], [ 0, %lor.end.i ] + %nm.sroa.4.0.i = phi i32 [ %11, %while.end32.i ], [ 0, %lor.end.i ] + %nm.sroa.3.0.i = phi i32 [ %sub33.i, %while.end32.i ], [ 0, %lor.end.i ] + %nm.sroa.1.0.i = phi i32 [ %nfree.1.lcssa.i, %while.end32.i ], [ 0, %lor.end.i ] + %nm.sroa.0.0.i = phi i32 [ %sum.1.lcssa.i, %while.end32.i ], [ 0, %lor.end.i ] + %nm.sroa.7.0.i = phi i32 [ %mfree.1.lcssa.i, %while.end32.i ], [ 0, %lor.end.i ] + %nm.sroa.8.0.i = phi i32 [ %2, %while.end32.i ], [ 0, %lor.end.i ] + %nm.sroa.0.0.idx.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 0 + store i32 %nm.sroa.0.0.i, i32* %nm.sroa.0.0.idx.i, align 4 + %nm.sroa.1.4.idx25.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 1 + store i32 %nm.sroa.1.0.i, i32* %nm.sroa.1.4.idx25.i, align 4 + %nm.sroa.2.8.idx.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 2 + %12 = bitcast i32* %nm.sroa.2.8.idx.i to i64* + store i64 0, i64* %12, align 4 + %nm.sroa.3.16.idx31.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 4 + store i32 %nm.sroa.3.0.i, i32* %nm.sroa.3.16.idx31.i, align 4 + %nm.sroa.4.20.idx33.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 5 + store i32 %nm.sroa.4.0.i, i32* %nm.sroa.4.20.idx33.i, align 4 + %nm.sroa.5.24.idx35.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 6 + store i32 0, i32* %nm.sroa.5.24.idx35.i, align 4 + %nm.sroa.6.28.idx37.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 7 + store i32 %nm.sroa.6.0.i, i32* %nm.sroa.6.28.idx37.i, align 4 + %nm.sroa.7.32.idx39.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 8 + store i32 %nm.sroa.7.0.i, i32* %nm.sroa.7.32.idx39.i, align 4 + %nm.sroa.8.36.idx41.i = getelementptr inbounds %struct.mallinfo* %agg.result, i32 0, i32 9 + store i32 %nm.sroa.8.0.i, i32* %nm.sroa.8.36.idx41.i, align 4 + ret void +} + +; Function Attrs: nounwind +define weak void @malloc_stats() #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp.i = icmp eq i32 %0, 0 + br i1 %cmp.i, label %if.then.i.i, label %lor.end.i + +if.then.i.i: ; preds = %entry + %call.i.i = tail call i32 @sysconf(i32 30) #1 + %sub.i.i = add i32 %call.i.i, -1 + %and.i.i = and i32 %sub.i.i, %call.i.i + %cmp1.i.i = icmp eq i32 %and.i.i, 0 + br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i + +if.then5.i.i: ; preds = %if.then.i.i + tail call void @abort() #6 + unreachable + +init_mparams.exit.i: ; preds = %if.then.i.i + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i.i = tail call i32 @time(i32* null) #1 + %xor.i.i = and i32 %call6.i.i, -16 + %and7.i.i = xor i32 %xor.i.i, 1431655768 + store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %lor.end.i + +lor.end.i: ; preds = %init_mparams.exit.i, %entry + %1 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp1.i = icmp eq %struct.malloc_chunk* %1, null + br i1 %cmp1.i, label %internal_malloc_stats.exit, label %if.then.i + +if.then.i: ; preds = %lor.end.i + %2 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 13), align 4, !tbaa !3 + %3 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 12), align 4, !tbaa !3 + %4 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add.neg.i = add i32 %3, -40 + %sub.i = sub i32 %add.neg.i, %4 + br label %while.body.i + +while.body.i: ; preds = %while.end.i, %if.then.i + %s.05.i = phi %struct.malloc_segment* [ getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 16), %if.then.i ], [ %11, %while.end.i ] + %used.04.i = phi i32 [ %sub.i, %if.then.i ], [ %used.1.lcssa.i, %while.end.i ] + %base.i = getelementptr inbounds %struct.malloc_segment* %s.05.i, i32 0, i32 0 + %5 = load i8** %base.i, align 4, !tbaa !0 + %add.ptr.i = getelementptr inbounds i8* %5, i32 8 + %6 = ptrtoint i8* %add.ptr.i to i32 + %and.i = and i32 %6, 7 + %cmp4.i = icmp eq i32 %and.i, 0 + br i1 %cmp4.i, label %land.lhs.true.lr.ph.i, label %cond.false.i + +cond.false.i: ; preds = %while.body.i + %7 = sub i32 0, %6 + %and9.i = and i32 %7, 7 + br label %land.lhs.true.lr.ph.i + +land.lhs.true.lr.ph.i: ; preds = %cond.false.i, %while.body.i + %cond.i = phi i32 [ %and9.i, %cond.false.i ], [ 0, %while.body.i ] + %add.ptr10.i = getelementptr inbounds i8* %5, i32 %cond.i + %size.i = getelementptr inbounds %struct.malloc_segment* %s.05.i, i32 0, i32 1 + %8 = load i32* %size.i, align 4, !tbaa !3 + %add.ptr15.i = getelementptr inbounds i8* %5, i32 %8 + br label %land.lhs.true.i + +land.lhs.true.i: ; preds = %while.body21.i, %land.lhs.true.lr.ph.i + %q.0.in3.i = phi i8* [ %add.ptr10.i, %land.lhs.true.lr.ph.i ], [ %add.ptr31.i, %while.body21.i ] + %used.12.i = phi i32 [ %used.04.i, %land.lhs.true.lr.ph.i ], [ %used.2.i, %while.body21.i ] + %q.0.i = bitcast i8* %q.0.in3.i to %struct.malloc_chunk* + %cmp16.i = icmp uge i8* %q.0.in3.i, %add.ptr15.i + %cmp19.i = icmp eq %struct.malloc_chunk* %q.0.i, %1 + %or.cond.i = or i1 %cmp16.i, %cmp19.i + br i1 %or.cond.i, label %while.end.i, label %land.rhs.i + +land.rhs.i: ; preds = %land.lhs.true.i + %head.i = getelementptr inbounds i8* %q.0.in3.i, i32 4 + %9 = bitcast i8* %head.i to i32* + %10 = load i32* %9, align 4, !tbaa !3 + %cmp20.i = icmp eq i32 %10, 7 + br i1 %cmp20.i, label %while.end.i, label %while.body21.i + +while.body21.i: ; preds = %land.rhs.i + %and23.i = and i32 %10, 3 + %cmp24.i = icmp eq i32 %and23.i, 1 + %and27.i = and i32 %10, -8 + %sub28.i = select i1 %cmp24.i, i32 %and27.i, i32 0 + %used.2.i = sub i32 %used.12.i, %sub28.i + %add.ptr31.i = getelementptr inbounds i8* %q.0.in3.i, i32 %and27.i + %cmp13.i = icmp ult i8* %add.ptr31.i, %5 + br i1 %cmp13.i, label %while.end.i, label %land.lhs.true.i + +while.end.i: ; preds = %while.body21.i, %land.rhs.i, %land.lhs.true.i + %used.1.lcssa.i = phi i32 [ %used.12.i, %land.rhs.i ], [ %used.12.i, %land.lhs.true.i ], [ %used.2.i, %while.body21.i ] + %next.i = getelementptr inbounds %struct.malloc_segment* %s.05.i, i32 0, i32 2 + %11 = load %struct.malloc_segment** %next.i, align 4, !tbaa !0 + %cmp2.i = icmp eq %struct.malloc_segment* %11, null + br i1 %cmp2.i, label %internal_malloc_stats.exit, label %while.body.i + +internal_malloc_stats.exit: ; preds = %while.end.i, %lor.end.i + %maxfp.0.i = phi i32 [ 0, %lor.end.i ], [ %2, %while.end.i ] + %fp.0.i = phi i32 [ 0, %lor.end.i ], [ %3, %while.end.i ] + %used.3.i = phi i32 [ 0, %lor.end.i ], [ %used.1.lcssa.i, %while.end.i ] + %12 = load %struct._IO_FILE** @stderr, align 4, !tbaa !0 + %call34.i = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %12, i8* getelementptr inbounds ([26 x i8]* @.str49, i32 0, i32 0), i32 %maxfp.0.i) #1 + %call35.i = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %12, i8* getelementptr inbounds ([26 x i8]* @.str150, i32 0, i32 0), i32 %fp.0.i) #1 + %call36.i = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %12, i8* getelementptr inbounds ([26 x i8]* @.str251, i32 0, i32 0), i32 %used.3.i) #1 + ret void +} + +; Function Attrs: nounwind +define weak i32 @mallopt(i32 %param_number, i32 %value) #0 { +entry: + %0 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + %cmp.i = icmp eq i32 %0, 0 + br i1 %cmp.i, label %if.then.i.i, label %lor.end.i + +if.then.i.i: ; preds = %entry + %call.i.i = tail call i32 @sysconf(i32 30) #1 + %sub.i.i = add i32 %call.i.i, -1 + %and.i.i = and i32 %sub.i.i, %call.i.i + %cmp1.i.i = icmp eq i32 %and.i.i, 0 + br i1 %cmp1.i.i, label %init_mparams.exit.i, label %if.then5.i.i + +if.then5.i.i: ; preds = %if.then.i.i + tail call void @abort() #6 + unreachable + +init_mparams.exit.i: ; preds = %if.then.i.i + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + store i32 %call.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + store i32 -1, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 5), align 4, !tbaa !3 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 15), align 4, !tbaa !3 + %call6.i.i = tail call i32 @time(i32* null) #1 + %xor.i.i = and i32 %call6.i.i, -16 + %and7.i.i = xor i32 %xor.i.i, 1431655768 + store volatile i32 %and7.i.i, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 0), align 4, !tbaa !3 + br label %lor.end.i + +lor.end.i: ; preds = %init_mparams.exit.i, %entry + switch i32 %param_number, label %change_mparam.exit [ + i32 -1, label %sw.bb.i + i32 -2, label %sw.bb2.i + i32 -3, label %sw.bb5.i + ] + +sw.bb.i: ; preds = %lor.end.i + store i32 %value, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 4), align 4, !tbaa !3 + br label %change_mparam.exit + +sw.bb2.i: ; preds = %lor.end.i + %1 = load i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 1), align 4, !tbaa !3 + %cmp3.i = icmp ugt i32 %1, %value + br i1 %cmp3.i, label %change_mparam.exit, label %land.lhs.true.i + +land.lhs.true.i: ; preds = %sw.bb2.i + %sub.i = add i32 %value, -1 + %and.i = and i32 %sub.i, %value + %cmp4.i = icmp eq i32 %and.i, 0 + br i1 %cmp4.i, label %if.then.i, label %change_mparam.exit + +if.then.i: ; preds = %land.lhs.true.i + store i32 %value, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 2), align 4, !tbaa !3 + br label %change_mparam.exit + +sw.bb5.i: ; preds = %lor.end.i + store i32 %value, i32* getelementptr inbounds (%struct.malloc_params* @mparams, i32 0, i32 3), align 4, !tbaa !3 + br label %change_mparam.exit + +change_mparam.exit: ; preds = %sw.bb5.i, %if.then.i, %land.lhs.true.i, %sw.bb2.i, %sw.bb.i, %lor.end.i + %retval.0.i = phi i32 [ 1, %sw.bb5.i ], [ 1, %if.then.i ], [ 1, %sw.bb.i ], [ 0, %sw.bb2.i ], [ 0, %land.lhs.true.i ], [ 0, %lor.end.i ] + ret i32 %retval.0.i +} + +; Function Attrs: nounwind +define weak i32 @malloc_usable_size(i8* %mem) #0 { +entry: + %cmp = icmp eq i8* %mem, null + br i1 %cmp, label %return, label %if.then + +if.then: ; preds = %entry + %head = getelementptr inbounds i8* %mem, i32 -4 + %0 = bitcast i8* %head to i32* + %1 = load i32* %0, align 4, !tbaa !3 + %and = and i32 %1, 3 + %cmp1 = icmp eq i32 %and, 1 + br i1 %cmp1, label %return, label %if.then2 + +if.then2: ; preds = %if.then + %and4 = and i32 %1, -8 + %cmp7 = icmp eq i32 %and, 0 + %cond = select i1 %cmp7, i32 8, i32 4 + %sub = sub i32 %and4, %cond + br label %return + +return: ; preds = %if.then2, %if.then, %entry + %retval.0 = phi i32 [ %sub, %if.then2 ], [ 0, %if.then ], [ 0, %entry ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind +declare i32 @fprintf(%struct._IO_FILE* nocapture, i8* nocapture, ...) #0 + +declare i8* @sbrk(i32) #5 + +; Function Attrs: nounwind +define internal fastcc void @dispose_chunk(%struct.malloc_chunk* %p, i32 %psize) #0 { +entry: + %0 = bitcast %struct.malloc_chunk* %p to i8* + %add.ptr = getelementptr inbounds i8* %0, i32 %psize + %1 = bitcast i8* %add.ptr to %struct.malloc_chunk* + %head = getelementptr inbounds %struct.malloc_chunk* %p, i32 0, i32 1 + %2 = load i32* %head, align 4, !tbaa !3 + %and = and i32 %2, 1 + %tobool = icmp eq i32 %and, 0 + br i1 %tobool, label %if.then, label %if.end215 + +if.then: ; preds = %entry + %prev_foot = getelementptr inbounds %struct.malloc_chunk* %p, i32 0, i32 0 + %3 = load i32* %prev_foot, align 4, !tbaa !3 + %and2 = and i32 %2, 3 + %cmp = icmp eq i32 %and2, 0 + br i1 %cmp, label %if.end649, label %if.end + +if.end: ; preds = %if.then + %idx.neg = sub i32 0, %3 + %add.ptr5 = getelementptr inbounds i8* %0, i32 %idx.neg + %4 = bitcast i8* %add.ptr5 to %struct.malloc_chunk* + %add6 = add i32 %3, %psize + %5 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp7 = icmp ult i8* %add.ptr5, %5 + br i1 %cmp7, label %if.else213, label %if.then9, !prof !6 + +if.then9: ; preds = %if.end + %6 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp10 = icmp eq %struct.malloc_chunk* %4, %6 + br i1 %cmp10, label %if.else200, label %if.then12 + +if.then12: ; preds = %if.then9 + %shr = lshr i32 %3, 3 + %cmp13 = icmp ult i32 %3, 256 + br i1 %cmp13, label %if.then15, label %if.else59 + +if.then15: ; preds = %if.then12 + %add.ptr5.sum24 = sub i32 8, %3 + %fd = getelementptr inbounds i8* %0, i32 %add.ptr5.sum24 + %7 = bitcast i8* %fd to %struct.malloc_chunk** + %8 = load %struct.malloc_chunk** %7, align 4, !tbaa !0 + %add.ptr5.sum25 = sub i32 12, %3 + %bk = getelementptr inbounds i8* %0, i32 %add.ptr5.sum25 + %9 = bitcast i8* %bk to %struct.malloc_chunk** + %10 = load %struct.malloc_chunk** %9, align 4, !tbaa !0 + %shl = shl nuw nsw i32 %shr, 1 + %arrayidx = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl + %11 = bitcast %struct.malloc_chunk** %arrayidx to %struct.malloc_chunk* + %cmp17 = icmp eq %struct.malloc_chunk* %8, %11 + br i1 %cmp17, label %if.then27, label %lor.rhs + +lor.rhs: ; preds = %if.then15 + %12 = bitcast %struct.malloc_chunk* %8 to i8* + %cmp20 = icmp ult i8* %12, %5 + br i1 %cmp20, label %if.else57, label %land.rhs + +land.rhs: ; preds = %lor.rhs + %bk22 = getelementptr inbounds %struct.malloc_chunk* %8, i32 0, i32 3 + %13 = load %struct.malloc_chunk** %bk22, align 4, !tbaa !0 + %cmp23 = icmp eq %struct.malloc_chunk* %13, %4 + br i1 %cmp23, label %if.then27, label %if.else57, !prof !5 + +if.then27: ; preds = %land.rhs, %if.then15 + %cmp28 = icmp eq %struct.malloc_chunk* %10, %8 + br i1 %cmp28, label %if.then30, label %if.else + +if.then30: ; preds = %if.then27 + %shl31 = shl i32 1, %shr + %neg = xor i32 %shl31, -1 + %14 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %and32 = and i32 %14, %neg + store i32 %and32, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end215 + +if.else: ; preds = %if.then27 + %cmp36 = icmp eq %struct.malloc_chunk* %10, %11 + br i1 %cmp36, label %if.else.if.then51_crit_edge, label %lor.rhs38 + +if.else.if.then51_crit_edge: ; preds = %if.else + %fd53.pre = getelementptr inbounds %struct.malloc_chunk* %10, i32 0, i32 2 + br label %if.then51 + +lor.rhs38: ; preds = %if.else + %15 = bitcast %struct.malloc_chunk* %10 to i8* + %cmp40 = icmp ult i8* %15, %5 + br i1 %cmp40, label %if.else54, label %land.rhs42 + +land.rhs42: ; preds = %lor.rhs38 + %fd43 = getelementptr inbounds %struct.malloc_chunk* %10, i32 0, i32 2 + %16 = load %struct.malloc_chunk** %fd43, align 4, !tbaa !0 + %cmp44 = icmp eq %struct.malloc_chunk* %16, %4 + br i1 %cmp44, label %if.then51, label %if.else54, !prof !5 + +if.then51: ; preds = %land.rhs42, %if.else.if.then51_crit_edge + %fd53.pre-phi = phi %struct.malloc_chunk** [ %fd53.pre, %if.else.if.then51_crit_edge ], [ %fd43, %land.rhs42 ] + %bk52 = getelementptr inbounds %struct.malloc_chunk* %8, i32 0, i32 3 + store %struct.malloc_chunk* %10, %struct.malloc_chunk** %bk52, align 4, !tbaa !0 + store %struct.malloc_chunk* %8, %struct.malloc_chunk** %fd53.pre-phi, align 4, !tbaa !0 + br label %if.end215 + +if.else54: ; preds = %land.rhs42, %lor.rhs38 + tail call void @abort() #6 + unreachable + +if.else57: ; preds = %land.rhs, %lor.rhs + tail call void @abort() #6 + unreachable + +if.else59: ; preds = %if.then12 + %17 = bitcast i8* %add.ptr5 to %struct.malloc_tree_chunk* + %add.ptr5.sum18 = sub i32 24, %3 + %parent = getelementptr inbounds i8* %0, i32 %add.ptr5.sum18 + %18 = bitcast i8* %parent to %struct.malloc_tree_chunk** + %19 = load %struct.malloc_tree_chunk** %18, align 4, !tbaa !0 + %add.ptr5.sum19 = sub i32 12, %3 + %bk60 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum19 + %20 = bitcast i8* %bk60 to %struct.malloc_tree_chunk** + %21 = load %struct.malloc_tree_chunk** %20, align 4, !tbaa !0 + %cmp61 = icmp eq %struct.malloc_tree_chunk* %21, %17 + br i1 %cmp61, label %if.else85, label %if.then63 + +if.then63: ; preds = %if.else59 + %add.ptr5.sum23 = sub i32 8, %3 + %fd65 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum23 + %22 = bitcast i8* %fd65 to %struct.malloc_tree_chunk** + %23 = load %struct.malloc_tree_chunk** %22, align 4, !tbaa !0 + %24 = bitcast %struct.malloc_tree_chunk* %23 to i8* + %cmp68 = icmp ult i8* %24, %5 + br i1 %cmp68, label %if.else83, label %land.lhs.true + +land.lhs.true: ; preds = %if.then63 + %bk70 = getelementptr inbounds %struct.malloc_tree_chunk* %23, i32 0, i32 3 + %25 = load %struct.malloc_tree_chunk** %bk70, align 4, !tbaa !0 + %cmp71 = icmp eq %struct.malloc_tree_chunk* %25, %17 + br i1 %cmp71, label %land.rhs73, label %if.else83 + +land.rhs73: ; preds = %land.lhs.true + %fd74 = getelementptr inbounds %struct.malloc_tree_chunk* %21, i32 0, i32 2 + %26 = load %struct.malloc_tree_chunk** %fd74, align 4, !tbaa !0 + %cmp75 = icmp eq %struct.malloc_tree_chunk* %26, %17 + br i1 %cmp75, label %if.then80, label %if.else83, !prof !5 + +if.then80: ; preds = %land.rhs73 + store %struct.malloc_tree_chunk* %21, %struct.malloc_tree_chunk** %bk70, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %23, %struct.malloc_tree_chunk** %fd74, align 4, !tbaa !0 + br label %if.end114 + +if.else83: ; preds = %land.rhs73, %land.lhs.true, %if.then63 + tail call void @abort() #6 + unreachable + +if.else85: ; preds = %if.else59 + %add.ptr5.sum20 = sub i32 16, %3 + %child.sum = add i32 %add.ptr5.sum20, 4 + %arrayidx86 = getelementptr inbounds i8* %0, i32 %child.sum + %27 = bitcast i8* %arrayidx86 to %struct.malloc_tree_chunk** + %28 = load %struct.malloc_tree_chunk** %27, align 4, !tbaa !0 + %cmp87 = icmp eq %struct.malloc_tree_chunk* %28, null + br i1 %cmp87, label %lor.lhs.false, label %while.cond + +lor.lhs.false: ; preds = %if.else85 + %child = getelementptr inbounds i8* %0, i32 %add.ptr5.sum20 + %arrayidx90 = bitcast i8* %child to %struct.malloc_tree_chunk** + %29 = load %struct.malloc_tree_chunk** %arrayidx90, align 4, !tbaa !0 + %cmp91 = icmp eq %struct.malloc_tree_chunk* %29, null + br i1 %cmp91, label %if.end114, label %while.cond + +while.cond: ; preds = %lor.rhs98, %while.cond, %lor.lhs.false, %if.else85 + %RP.0 = phi %struct.malloc_tree_chunk** [ %arrayidx90, %lor.lhs.false ], [ %27, %if.else85 ], [ %arrayidx95, %while.cond ], [ %arrayidx100, %lor.rhs98 ] + %R.0 = phi %struct.malloc_tree_chunk* [ %29, %lor.lhs.false ], [ %28, %if.else85 ], [ %30, %while.cond ], [ %31, %lor.rhs98 ] + %arrayidx95 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 1 + %30 = load %struct.malloc_tree_chunk** %arrayidx95, align 4, !tbaa !0 + %cmp96 = icmp eq %struct.malloc_tree_chunk* %30, null + br i1 %cmp96, label %lor.rhs98, label %while.cond + +lor.rhs98: ; preds = %while.cond + %arrayidx100 = getelementptr inbounds %struct.malloc_tree_chunk* %R.0, i32 0, i32 4, i32 0 + %31 = load %struct.malloc_tree_chunk** %arrayidx100, align 4, !tbaa !0 + %cmp101 = icmp eq %struct.malloc_tree_chunk* %31, null + br i1 %cmp101, label %while.end, label %while.cond + +while.end: ; preds = %lor.rhs98 + %32 = bitcast %struct.malloc_tree_chunk** %RP.0 to i8* + %cmp106 = icmp ult i8* %32, %5 + br i1 %cmp106, label %if.else111, label %if.then110, !prof !6 + +if.then110: ; preds = %while.end + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP.0, align 4, !tbaa !0 + br label %if.end114 + +if.else111: ; preds = %while.end + tail call void @abort() #6 + unreachable + +if.end114: ; preds = %if.then110, %lor.lhs.false, %if.then80 + %R.1 = phi %struct.malloc_tree_chunk* [ %21, %if.then80 ], [ %R.0, %if.then110 ], [ null, %lor.lhs.false ] + %cmp115 = icmp eq %struct.malloc_tree_chunk* %19, null + br i1 %cmp115, label %if.end215, label %if.then117 + +if.then117: ; preds = %if.end114 + %add.ptr5.sum21 = sub i32 28, %3 + %index = getelementptr inbounds i8* %0, i32 %add.ptr5.sum21 + %33 = bitcast i8* %index to i32* + %34 = load i32* %33, align 4, !tbaa !3 + %arrayidx118 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %34 + %35 = load %struct.malloc_tree_chunk** %arrayidx118, align 4, !tbaa !0 + %cmp119 = icmp eq %struct.malloc_tree_chunk* %17, %35 + br i1 %cmp119, label %if.then121, label %if.else130 + +if.then121: ; preds = %if.then117 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx118, align 4, !tbaa !0 + %cond29 = icmp eq %struct.malloc_tree_chunk* %R.1, null + br i1 %cond29, label %if.end150.thread, label %if.then153 + +if.end150.thread: ; preds = %if.then121 + %shl126 = shl i32 1, %34 + %neg127 = xor i32 %shl126, -1 + %36 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and128 = and i32 %36, %neg127 + store i32 %and128, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end215 + +if.else130: ; preds = %if.then117 + %37 = bitcast %struct.malloc_tree_chunk* %19 to i8* + %38 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp132 = icmp ult i8* %37, %38 + br i1 %cmp132, label %if.else148, label %if.then136, !prof !6 + +if.then136: ; preds = %if.else130 + %arrayidx138 = getelementptr inbounds %struct.malloc_tree_chunk* %19, i32 0, i32 4, i32 0 + %39 = load %struct.malloc_tree_chunk** %arrayidx138, align 4, !tbaa !0 + %cmp139 = icmp eq %struct.malloc_tree_chunk* %39, %17 + br i1 %cmp139, label %if.then141, label %if.else144 + +if.then141: ; preds = %if.then136 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx138, align 4, !tbaa !0 + br label %if.end150 + +if.else144: ; preds = %if.then136 + %arrayidx146 = getelementptr inbounds %struct.malloc_tree_chunk* %19, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %arrayidx146, align 4, !tbaa !0 + br label %if.end150 + +if.else148: ; preds = %if.else130 + tail call void @abort() #6 + unreachable + +if.end150: ; preds = %if.else144, %if.then141 + %cmp151 = icmp eq %struct.malloc_tree_chunk* %R.1, null + br i1 %cmp151, label %if.end215, label %if.then153 + +if.then153: ; preds = %if.end150, %if.then121 + %40 = bitcast %struct.malloc_tree_chunk* %R.1 to i8* + %41 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp155 = icmp ult i8* %40, %41 + br i1 %cmp155, label %if.else195, label %if.then159, !prof !6 + +if.then159: ; preds = %if.then153 + %parent160 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 5 + store %struct.malloc_tree_chunk* %19, %struct.malloc_tree_chunk** %parent160, align 4, !tbaa !0 + %add.ptr5.sum22 = sub i32 16, %3 + %child161 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum22 + %arrayidx162 = bitcast i8* %child161 to %struct.malloc_tree_chunk** + %42 = load %struct.malloc_tree_chunk** %arrayidx162, align 4, !tbaa !0 + %cmp163 = icmp eq %struct.malloc_tree_chunk* %42, null + br i1 %cmp163, label %if.end177, label %if.then165 + +if.then165: ; preds = %if.then159 + %43 = bitcast %struct.malloc_tree_chunk* %42 to i8* + %44 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp167 = icmp ult i8* %43, %44 + br i1 %cmp167, label %if.else175, label %if.then171, !prof !6 + +if.then171: ; preds = %if.then165 + %arrayidx173 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %42, %struct.malloc_tree_chunk** %arrayidx173, align 4, !tbaa !0 + %parent174 = getelementptr inbounds %struct.malloc_tree_chunk* %42, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent174, align 4, !tbaa !0 + br label %if.end177 + +if.else175: ; preds = %if.then165 + tail call void @abort() #6 + unreachable + +if.end177: ; preds = %if.then171, %if.then159 + %child161.sum = add i32 %add.ptr5.sum22, 4 + %arrayidx179 = getelementptr inbounds i8* %0, i32 %child161.sum + %45 = bitcast i8* %arrayidx179 to %struct.malloc_tree_chunk** + %46 = load %struct.malloc_tree_chunk** %45, align 4, !tbaa !0 + %cmp180 = icmp eq %struct.malloc_tree_chunk* %46, null + br i1 %cmp180, label %if.end215, label %if.then182 + +if.then182: ; preds = %if.end177 + %47 = bitcast %struct.malloc_tree_chunk* %46 to i8* + %48 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp184 = icmp ult i8* %47, %48 + br i1 %cmp184, label %if.else192, label %if.then188, !prof !6 + +if.then188: ; preds = %if.then182 + %arrayidx190 = getelementptr inbounds %struct.malloc_tree_chunk* %R.1, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %46, %struct.malloc_tree_chunk** %arrayidx190, align 4, !tbaa !0 + %parent191 = getelementptr inbounds %struct.malloc_tree_chunk* %46, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R.1, %struct.malloc_tree_chunk** %parent191, align 4, !tbaa !0 + br label %if.end215 + +if.else192: ; preds = %if.then182 + tail call void @abort() #6 + unreachable + +if.else195: ; preds = %if.then153 + tail call void @abort() #6 + unreachable + +if.else200: ; preds = %if.then9 + %add.ptr.sum = add i32 %psize, 4 + %head201 = getelementptr inbounds i8* %0, i32 %add.ptr.sum + %49 = bitcast i8* %head201 to i32* + %50 = load i32* %49, align 4, !tbaa !3 + %and202 = and i32 %50, 3 + %cmp203 = icmp eq i32 %and202, 3 + br i1 %cmp203, label %if.then205, label %if.end215 + +if.then205: ; preds = %if.else200 + store i32 %add6, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %51 = load i32* %49, align 4, !tbaa !3 + %and207 = and i32 %51, -2 + store i32 %and207, i32* %49, align 4, !tbaa !3 + %or = or i32 %add6, 1 + %add.ptr5.sum = sub i32 4, %3 + %head208 = getelementptr inbounds i8* %0, i32 %add.ptr5.sum + %52 = bitcast i8* %head208 to i32* + store i32 %or, i32* %52, align 4, !tbaa !3 + %prev_foot210 = bitcast i8* %add.ptr to i32* + store i32 %add6, i32* %prev_foot210, align 4, !tbaa !3 + br label %if.end649 + +if.else213: ; preds = %if.end + tail call void @abort() #6 + unreachable + +if.end215: ; preds = %if.else200, %if.then188, %if.end177, %if.end150, %if.end150.thread, %if.end114, %if.then51, %if.then30, %entry + %psize.addr.0 = phi i32 [ %add6, %if.then30 ], [ %add6, %if.then51 ], [ %add6, %if.then188 ], [ %add6, %if.else200 ], [ %psize, %entry ], [ %add6, %if.end114 ], [ %add6, %if.end150.thread ], [ %add6, %if.end150 ], [ %add6, %if.end177 ] + %p.addr.0 = phi %struct.malloc_chunk* [ %4, %if.then30 ], [ %4, %if.then51 ], [ %4, %if.then188 ], [ %4, %if.else200 ], [ %p, %entry ], [ %4, %if.end114 ], [ %4, %if.end150.thread ], [ %4, %if.end150 ], [ %4, %if.end177 ] + %53 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp217 = icmp ult i8* %add.ptr, %53 + br i1 %cmp217, label %if.else648, label %if.then221, !prof !6 + +if.then221: ; preds = %if.end215 + %add.ptr.sum1 = add i32 %psize, 4 + %head222 = getelementptr inbounds i8* %0, i32 %add.ptr.sum1 + %54 = bitcast i8* %head222 to i32* + %55 = load i32* %54, align 4, !tbaa !3 + %and223 = and i32 %55, 2 + %tobool224 = icmp eq i32 %and223, 0 + br i1 %tobool224, label %if.then225, label %if.else493 + +if.then225: ; preds = %if.then221 + %56 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %cmp226 = icmp eq %struct.malloc_chunk* %1, %56 + br i1 %cmp226, label %if.then228, label %if.else240 + +if.then228: ; preds = %if.then225 + %57 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + %add229 = add i32 %57, %psize.addr.0 + store i32 %add229, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 3), align 4, !tbaa !3 + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 6), align 4, !tbaa !0 + %or231 = or i32 %add229, 1 + %head232 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1 + store i32 %or231, i32* %head232, align 4, !tbaa !3 + %58 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp234 = icmp eq %struct.malloc_chunk* %p.addr.0, %58 + br i1 %cmp234, label %if.then236, label %if.end649 + +if.then236: ; preds = %if.then228 + store %struct.malloc_chunk* null, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + store i32 0, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + br label %if.end649 + +if.else240: ; preds = %if.then225 + %59 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp242 = icmp eq %struct.malloc_chunk* %1, %59 + br i1 %cmp242, label %if.then244, label %if.else252 + +if.then244: ; preds = %if.else240 + %60 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + %add246 = add i32 %60, %psize.addr.0 + store i32 %add246, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %or248 = or i32 %add246, 1 + %head249 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1 + store i32 %or248, i32* %head249, align 4, !tbaa !3 + %61 = bitcast %struct.malloc_chunk* %p.addr.0 to i8* + %add.ptr250 = getelementptr inbounds i8* %61, i32 %add246 + %prev_foot251 = bitcast i8* %add.ptr250 to i32* + store i32 %add246, i32* %prev_foot251, align 4, !tbaa !3 + br label %if.end649 + +if.else252: ; preds = %if.else240 + %and254 = and i32 %55, -8 + %add255 = add i32 %and254, %psize.addr.0 + %shr256 = lshr i32 %55, 3 + %cmp257 = icmp ult i32 %55, 256 + br i1 %cmp257, label %if.then259, label %if.else321 + +if.then259: ; preds = %if.else252 + %add.ptr.sum15 = add i32 %psize, 8 + %fd261 = getelementptr inbounds i8* %0, i32 %add.ptr.sum15 + %62 = bitcast i8* %fd261 to %struct.malloc_chunk** + %63 = load %struct.malloc_chunk** %62, align 4, !tbaa !0 + %add.ptr.sum16 = add i32 %psize, 12 + %bk263 = getelementptr inbounds i8* %0, i32 %add.ptr.sum16 + %64 = bitcast i8* %bk263 to %struct.malloc_chunk** + %65 = load %struct.malloc_chunk** %64, align 4, !tbaa !0 + %shl266 = shl nuw nsw i32 %shr256, 1 + %arrayidx268 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl266 + %66 = bitcast %struct.malloc_chunk** %arrayidx268 to %struct.malloc_chunk* + %cmp269 = icmp eq %struct.malloc_chunk* %63, %66 + br i1 %cmp269, label %if.then285, label %lor.rhs271 + +lor.rhs271: ; preds = %if.then259 + %67 = bitcast %struct.malloc_chunk* %63 to i8* + %cmp273 = icmp ult i8* %67, %53 + br i1 %cmp273, label %if.else319, label %land.rhs275 + +land.rhs275: ; preds = %lor.rhs271 + %bk276 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3 + %68 = load %struct.malloc_chunk** %bk276, align 4, !tbaa !0 + %cmp277 = icmp eq %struct.malloc_chunk* %68, %1 + br i1 %cmp277, label %if.then285, label %if.else319, !prof !5 + +if.then285: ; preds = %land.rhs275, %if.then259 + %cmp286 = icmp eq %struct.malloc_chunk* %65, %63 + br i1 %cmp286, label %if.then288, label %if.else293 + +if.then288: ; preds = %if.then285 + %shl289 = shl i32 1, %shr256 + %neg290 = xor i32 %shl289, -1 + %69 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %and292 = and i32 %69, %neg290 + store i32 %and292, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + br label %if.end480 + +if.else293: ; preds = %if.then285 + %cmp297 = icmp eq %struct.malloc_chunk* %65, %66 + br i1 %cmp297, label %if.else293.if.then313_crit_edge, label %lor.rhs299 + +if.else293.if.then313_crit_edge: ; preds = %if.else293 + %fd315.pre = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2 + br label %if.then313 + +lor.rhs299: ; preds = %if.else293 + %70 = bitcast %struct.malloc_chunk* %65 to i8* + %cmp301 = icmp ult i8* %70, %53 + br i1 %cmp301, label %if.else316, label %land.rhs303 + +land.rhs303: ; preds = %lor.rhs299 + %fd304 = getelementptr inbounds %struct.malloc_chunk* %65, i32 0, i32 2 + %71 = load %struct.malloc_chunk** %fd304, align 4, !tbaa !0 + %cmp305 = icmp eq %struct.malloc_chunk* %71, %1 + br i1 %cmp305, label %if.then313, label %if.else316, !prof !5 + +if.then313: ; preds = %land.rhs303, %if.else293.if.then313_crit_edge + %fd315.pre-phi = phi %struct.malloc_chunk** [ %fd315.pre, %if.else293.if.then313_crit_edge ], [ %fd304, %land.rhs303 ] + %bk314 = getelementptr inbounds %struct.malloc_chunk* %63, i32 0, i32 3 + store %struct.malloc_chunk* %65, %struct.malloc_chunk** %bk314, align 4, !tbaa !0 + store %struct.malloc_chunk* %63, %struct.malloc_chunk** %fd315.pre-phi, align 4, !tbaa !0 + br label %if.end480 + +if.else316: ; preds = %land.rhs303, %lor.rhs299 + tail call void @abort() #6 + unreachable + +if.else319: ; preds = %land.rhs275, %lor.rhs271 + tail call void @abort() #6 + unreachable + +if.else321: ; preds = %if.else252 + %72 = bitcast i8* %add.ptr to %struct.malloc_tree_chunk* + %add.ptr.sum2 = add i32 %psize, 24 + %parent324 = getelementptr inbounds i8* %0, i32 %add.ptr.sum2 + %73 = bitcast i8* %parent324 to %struct.malloc_tree_chunk** + %74 = load %struct.malloc_tree_chunk** %73, align 4, !tbaa !0 + %add.ptr.sum3 = add i32 %psize, 12 + %bk326 = getelementptr inbounds i8* %0, i32 %add.ptr.sum3 + %75 = bitcast i8* %bk326 to %struct.malloc_tree_chunk** + %76 = load %struct.malloc_tree_chunk** %75, align 4, !tbaa !0 + %cmp327 = icmp eq %struct.malloc_tree_chunk* %76, %72 + br i1 %cmp327, label %if.else353, label %if.then329 + +if.then329: ; preds = %if.else321 + %add.ptr.sum14 = add i32 %psize, 8 + %fd331 = getelementptr inbounds i8* %0, i32 %add.ptr.sum14 + %77 = bitcast i8* %fd331 to %struct.malloc_tree_chunk** + %78 = load %struct.malloc_tree_chunk** %77, align 4, !tbaa !0 + %79 = bitcast %struct.malloc_tree_chunk* %78 to i8* + %cmp334 = icmp ult i8* %79, %53 + br i1 %cmp334, label %if.else351, label %land.lhs.true336 + +land.lhs.true336: ; preds = %if.then329 + %bk337 = getelementptr inbounds %struct.malloc_tree_chunk* %78, i32 0, i32 3 + %80 = load %struct.malloc_tree_chunk** %bk337, align 4, !tbaa !0 + %cmp338 = icmp eq %struct.malloc_tree_chunk* %80, %72 + br i1 %cmp338, label %land.rhs340, label %if.else351 + +land.rhs340: ; preds = %land.lhs.true336 + %fd341 = getelementptr inbounds %struct.malloc_tree_chunk* %76, i32 0, i32 2 + %81 = load %struct.malloc_tree_chunk** %fd341, align 4, !tbaa !0 + %cmp342 = icmp eq %struct.malloc_tree_chunk* %81, %72 + br i1 %cmp342, label %if.then348, label %if.else351, !prof !5 + +if.then348: ; preds = %land.rhs340 + store %struct.malloc_tree_chunk* %76, %struct.malloc_tree_chunk** %bk337, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %78, %struct.malloc_tree_chunk** %fd341, align 4, !tbaa !0 + br label %if.end389 + +if.else351: ; preds = %land.rhs340, %land.lhs.true336, %if.then329 + tail call void @abort() #6 + unreachable + +if.else353: ; preds = %if.else321 + %child355.sum = add i32 %psize, 20 + %arrayidx356 = getelementptr inbounds i8* %0, i32 %child355.sum + %82 = bitcast i8* %arrayidx356 to %struct.malloc_tree_chunk** + %83 = load %struct.malloc_tree_chunk** %82, align 4, !tbaa !0 + %cmp357 = icmp eq %struct.malloc_tree_chunk* %83, null + br i1 %cmp357, label %lor.lhs.false359, label %while.cond366 + +lor.lhs.false359: ; preds = %if.else353 + %add.ptr.sum4 = add i32 %psize, 16 + %child355 = getelementptr inbounds i8* %0, i32 %add.ptr.sum4 + %arrayidx361 = bitcast i8* %child355 to %struct.malloc_tree_chunk** + %84 = load %struct.malloc_tree_chunk** %arrayidx361, align 4, !tbaa !0 + %cmp362 = icmp eq %struct.malloc_tree_chunk* %84, null + br i1 %cmp362, label %if.end389, label %while.cond366 + +while.cond366: ; preds = %lor.rhs371, %while.cond366, %lor.lhs.false359, %if.else353 + %RP354.0 = phi %struct.malloc_tree_chunk** [ %arrayidx361, %lor.lhs.false359 ], [ %82, %if.else353 ], [ %arrayidx368, %while.cond366 ], [ %arrayidx373, %lor.rhs371 ] + %R325.0 = phi %struct.malloc_tree_chunk* [ %84, %lor.lhs.false359 ], [ %83, %if.else353 ], [ %85, %while.cond366 ], [ %86, %lor.rhs371 ] + %arrayidx368 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.0, i32 0, i32 4, i32 1 + %85 = load %struct.malloc_tree_chunk** %arrayidx368, align 4, !tbaa !0 + %cmp369 = icmp eq %struct.malloc_tree_chunk* %85, null + br i1 %cmp369, label %lor.rhs371, label %while.cond366 + +lor.rhs371: ; preds = %while.cond366 + %arrayidx373 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.0, i32 0, i32 4, i32 0 + %86 = load %struct.malloc_tree_chunk** %arrayidx373, align 4, !tbaa !0 + %cmp374 = icmp eq %struct.malloc_tree_chunk* %86, null + br i1 %cmp374, label %while.end379, label %while.cond366 + +while.end379: ; preds = %lor.rhs371 + %87 = bitcast %struct.malloc_tree_chunk** %RP354.0 to i8* + %cmp381 = icmp ult i8* %87, %53 + br i1 %cmp381, label %if.else386, label %if.then385, !prof !6 + +if.then385: ; preds = %while.end379 + store %struct.malloc_tree_chunk* null, %struct.malloc_tree_chunk** %RP354.0, align 4, !tbaa !0 + br label %if.end389 + +if.else386: ; preds = %while.end379 + tail call void @abort() #6 + unreachable + +if.end389: ; preds = %if.then385, %lor.lhs.false359, %if.then348 + %R325.1 = phi %struct.malloc_tree_chunk* [ %76, %if.then348 ], [ %R325.0, %if.then385 ], [ null, %lor.lhs.false359 ] + %cmp390 = icmp eq %struct.malloc_tree_chunk* %74, null + br i1 %cmp390, label %if.end480, label %if.then392 + +if.then392: ; preds = %if.end389 + %add.ptr.sum12 = add i32 %psize, 28 + %index394 = getelementptr inbounds i8* %0, i32 %add.ptr.sum12 + %88 = bitcast i8* %index394 to i32* + %89 = load i32* %88, align 4, !tbaa !3 + %arrayidx396 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %89 + %90 = load %struct.malloc_tree_chunk** %arrayidx396, align 4, !tbaa !0 + %cmp397 = icmp eq %struct.malloc_tree_chunk* %72, %90 + br i1 %cmp397, label %if.then399, label %if.else409 + +if.then399: ; preds = %if.then392 + store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %arrayidx396, align 4, !tbaa !0 + %cond30 = icmp eq %struct.malloc_tree_chunk* %R325.1, null + br i1 %cond30, label %if.end429.thread, label %if.then432 + +if.end429.thread: ; preds = %if.then399 + %shl404 = shl i32 1, %89 + %neg405 = xor i32 %shl404, -1 + %91 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %and407 = and i32 %91, %neg405 + store i32 %and407, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + br label %if.end480 + +if.else409: ; preds = %if.then392 + %92 = bitcast %struct.malloc_tree_chunk* %74 to i8* + %93 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp411 = icmp ult i8* %92, %93 + br i1 %cmp411, label %if.else427, label %if.then415, !prof !6 + +if.then415: ; preds = %if.else409 + %arrayidx417 = getelementptr inbounds %struct.malloc_tree_chunk* %74, i32 0, i32 4, i32 0 + %94 = load %struct.malloc_tree_chunk** %arrayidx417, align 4, !tbaa !0 + %cmp418 = icmp eq %struct.malloc_tree_chunk* %94, %72 + br i1 %cmp418, label %if.then420, label %if.else423 + +if.then420: ; preds = %if.then415 + store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %arrayidx417, align 4, !tbaa !0 + br label %if.end429 + +if.else423: ; preds = %if.then415 + %arrayidx425 = getelementptr inbounds %struct.malloc_tree_chunk* %74, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %arrayidx425, align 4, !tbaa !0 + br label %if.end429 + +if.else427: ; preds = %if.else409 + tail call void @abort() #6 + unreachable + +if.end429: ; preds = %if.else423, %if.then420 + %cmp430 = icmp eq %struct.malloc_tree_chunk* %R325.1, null + br i1 %cmp430, label %if.end480, label %if.then432 + +if.then432: ; preds = %if.end429, %if.then399 + %95 = bitcast %struct.malloc_tree_chunk* %R325.1 to i8* + %96 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp434 = icmp ult i8* %95, %96 + br i1 %cmp434, label %if.else476, label %if.then438, !prof !6 + +if.then438: ; preds = %if.then432 + %parent441 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.1, i32 0, i32 5 + store %struct.malloc_tree_chunk* %74, %struct.malloc_tree_chunk** %parent441, align 4, !tbaa !0 + %add.ptr.sum13 = add i32 %psize, 16 + %child442 = getelementptr inbounds i8* %0, i32 %add.ptr.sum13 + %arrayidx443 = bitcast i8* %child442 to %struct.malloc_tree_chunk** + %97 = load %struct.malloc_tree_chunk** %arrayidx443, align 4, !tbaa !0 + %cmp444 = icmp eq %struct.malloc_tree_chunk* %97, null + br i1 %cmp444, label %if.end458, label %if.then446 + +if.then446: ; preds = %if.then438 + %98 = bitcast %struct.malloc_tree_chunk* %97 to i8* + %99 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp448 = icmp ult i8* %98, %99 + br i1 %cmp448, label %if.else456, label %if.then452, !prof !6 + +if.then452: ; preds = %if.then446 + %arrayidx454 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.1, i32 0, i32 4, i32 0 + store %struct.malloc_tree_chunk* %97, %struct.malloc_tree_chunk** %arrayidx454, align 4, !tbaa !0 + %parent455 = getelementptr inbounds %struct.malloc_tree_chunk* %97, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %parent455, align 4, !tbaa !0 + br label %if.end458 + +if.else456: ; preds = %if.then446 + tail call void @abort() #6 + unreachable + +if.end458: ; preds = %if.then452, %if.then438 + %child442.sum = add i32 %psize, 20 + %arrayidx460 = getelementptr inbounds i8* %0, i32 %child442.sum + %100 = bitcast i8* %arrayidx460 to %struct.malloc_tree_chunk** + %101 = load %struct.malloc_tree_chunk** %100, align 4, !tbaa !0 + %cmp461 = icmp eq %struct.malloc_tree_chunk* %101, null + br i1 %cmp461, label %if.end480, label %if.then463 + +if.then463: ; preds = %if.end458 + %102 = bitcast %struct.malloc_tree_chunk* %101 to i8* + %103 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp465 = icmp ult i8* %102, %103 + br i1 %cmp465, label %if.else473, label %if.then469, !prof !6 + +if.then469: ; preds = %if.then463 + %arrayidx471 = getelementptr inbounds %struct.malloc_tree_chunk* %R325.1, i32 0, i32 4, i32 1 + store %struct.malloc_tree_chunk* %101, %struct.malloc_tree_chunk** %arrayidx471, align 4, !tbaa !0 + %parent472 = getelementptr inbounds %struct.malloc_tree_chunk* %101, i32 0, i32 5 + store %struct.malloc_tree_chunk* %R325.1, %struct.malloc_tree_chunk** %parent472, align 4, !tbaa !0 + br label %if.end480 + +if.else473: ; preds = %if.then463 + tail call void @abort() #6 + unreachable + +if.else476: ; preds = %if.then432 + tail call void @abort() #6 + unreachable + +if.end480: ; preds = %if.then469, %if.end458, %if.end429, %if.end429.thread, %if.end389, %if.then313, %if.then288 + %or481 = or i32 %add255, 1 + %head482 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1 + store i32 %or481, i32* %head482, align 4, !tbaa !3 + %104 = bitcast %struct.malloc_chunk* %p.addr.0 to i8* + %add.ptr483 = getelementptr inbounds i8* %104, i32 %add255 + %prev_foot484 = bitcast i8* %add.ptr483 to i32* + store i32 %add255, i32* %prev_foot484, align 4, !tbaa !3 + %105 = load %struct.malloc_chunk** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 5), align 4, !tbaa !0 + %cmp486 = icmp eq %struct.malloc_chunk* %p.addr.0, %105 + br i1 %cmp486, label %if.then488, label %if.end500 + +if.then488: ; preds = %if.end480 + store i32 %add255, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 2), align 4, !tbaa !3 + br label %if.end649 + +if.else493: ; preds = %if.then221 + %and495 = and i32 %55, -2 + store i32 %and495, i32* %54, align 4, !tbaa !3 + %or496 = or i32 %psize.addr.0, 1 + %head497 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 1 + store i32 %or496, i32* %head497, align 4, !tbaa !3 + %106 = bitcast %struct.malloc_chunk* %p.addr.0 to i8* + %add.ptr498 = getelementptr inbounds i8* %106, i32 %psize.addr.0 + %prev_foot499 = bitcast i8* %add.ptr498 to i32* + store i32 %psize.addr.0, i32* %prev_foot499, align 4, !tbaa !3 + br label %if.end500 + +if.end500: ; preds = %if.else493, %if.end480 + %psize.addr.1 = phi i32 [ %psize.addr.0, %if.else493 ], [ %add255, %if.end480 ] + %shr501 = lshr i32 %psize.addr.1, 3 + %cmp502 = icmp ult i32 %psize.addr.1, 256 + br i1 %cmp502, label %if.then504, label %if.else536 + +if.then504: ; preds = %if.end500 + %shl508 = shl nuw nsw i32 %shr501, 1 + %arrayidx510 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %shl508 + %107 = bitcast %struct.malloc_chunk** %arrayidx510 to %struct.malloc_chunk* + %108 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %shl513 = shl i32 1, %shr501 + %and514 = and i32 %108, %shl513 + %tobool515 = icmp eq i32 %and514, 0 + br i1 %tobool515, label %if.then516, label %if.else520 + +if.then516: ; preds = %if.then504 + %or519 = or i32 %108, %shl513 + store i32 %or519, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 0), align 4, !tbaa !3 + %arrayidx510.sum.pre = add i32 %shl508, 2 + %.pre = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx510.sum.pre + br label %if.end531 + +if.else520: ; preds = %if.then504 + %arrayidx510.sum11 = add i32 %shl508, 2 + %109 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 10, i32 %arrayidx510.sum11 + %110 = load %struct.malloc_chunk** %109, align 4, !tbaa !0 + %111 = bitcast %struct.malloc_chunk* %110 to i8* + %112 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp523 = icmp ult i8* %111, %112 + br i1 %cmp523, label %if.else529, label %if.end531, !prof !6 + +if.else529: ; preds = %if.else520 + tail call void @abort() #6 + unreachable + +if.end531: ; preds = %if.else520, %if.then516 + %.pre-phi = phi %struct.malloc_chunk** [ %109, %if.else520 ], [ %.pre, %if.then516 ] + %F511.0 = phi %struct.malloc_chunk* [ %110, %if.else520 ], [ %107, %if.then516 ] + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %.pre-phi, align 4, !tbaa !0 + %bk533 = getelementptr inbounds %struct.malloc_chunk* %F511.0, i32 0, i32 3 + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %bk533, align 4, !tbaa !0 + %fd534 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2 + store %struct.malloc_chunk* %F511.0, %struct.malloc_chunk** %fd534, align 4, !tbaa !0 + %bk535 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3 + store %struct.malloc_chunk* %107, %struct.malloc_chunk** %bk535, align 4, !tbaa !0 + br label %if.end649 + +if.else536: ; preds = %if.end500 + %113 = bitcast %struct.malloc_chunk* %p.addr.0 to %struct.malloc_tree_chunk* + %shr540 = lshr i32 %psize.addr.1, 8 + %cmp541 = icmp eq i32 %shr540, 0 + br i1 %cmp541, label %if.end571, label %if.else544 + +if.else544: ; preds = %if.else536 + %cmp545 = icmp ugt i32 %psize.addr.1, 16777215 + br i1 %cmp545, label %if.end571, label %if.else548 + +if.else548: ; preds = %if.else544 + %sub = add i32 %shr540, 1048320 + %shr549 = lshr i32 %sub, 16 + %and550 = and i32 %shr549, 8 + %shl551 = shl i32 %shr540, %and550 + %sub552 = add i32 %shl551, 520192 + %shr553 = lshr i32 %sub552, 16 + %and554 = and i32 %shr553, 4 + %add555 = or i32 %and554, %and550 + %shl556 = shl i32 %shl551, %and554 + %sub557 = add i32 %shl556, 245760 + %shr558 = lshr i32 %sub557, 16 + %and559 = and i32 %shr558, 2 + %add560 = or i32 %add555, %and559 + %sub561 = sub i32 14, %add560 + %shl562 = shl i32 %shl556, %and559 + %shr563 = lshr i32 %shl562, 15 + %add564 = add i32 %sub561, %shr563 + %shl565 = shl nsw i32 %add564, 1 + %add566 = add i32 %add564, 7 + %shr567 = lshr i32 %psize.addr.1, %add566 + %and568 = and i32 %shr567, 1 + %add569 = or i32 %and568, %shl565 + br label %if.end571 + +if.end571: ; preds = %if.else548, %if.else544, %if.else536 + %I539.0 = phi i32 [ %add569, %if.else548 ], [ 0, %if.else536 ], [ 31, %if.else544 ] + %arrayidx573 = getelementptr inbounds %struct.malloc_state* @_gm_, i32 0, i32 11, i32 %I539.0 + %index574 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 3 + %I539.0.c = inttoptr i32 %I539.0 to %struct.malloc_chunk* + store %struct.malloc_chunk* %I539.0.c, %struct.malloc_chunk** %index574, align 4, !tbaa !3 + %arrayidx576 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 1 + store i32 0, i32* %arrayidx576, align 4, !tbaa !0 + %114 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 0 + store i32 0, i32* %114, align 4, !tbaa !0 + %115 = load i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + %shl580 = shl i32 1, %I539.0 + %and581 = and i32 %115, %shl580 + %tobool582 = icmp eq i32 %and581, 0 + br i1 %tobool582, label %if.then583, label %if.else590 + +if.then583: ; preds = %if.end571 + %or586 = or i32 %115, %shl580 + store i32 %or586, i32* getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 1), align 4, !tbaa !3 + store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %arrayidx573, align 4, !tbaa !0 + %parent587 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 2 + %.c = bitcast %struct.malloc_tree_chunk** %arrayidx573 to %struct.malloc_chunk* + store %struct.malloc_chunk* %.c, %struct.malloc_chunk** %parent587, align 4, !tbaa !0 + %bk588 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3 + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %bk588, align 4, !tbaa !0 + %fd589 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2 + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %fd589, align 4, !tbaa !0 + br label %if.end649 + +if.else590: ; preds = %if.end571 + %116 = load %struct.malloc_tree_chunk** %arrayidx573, align 4, !tbaa !0 + %cmp592 = icmp eq i32 %I539.0, 31 + br i1 %cmp592, label %cond.end, label %cond.false + +cond.false: ; preds = %if.else590 + %shr594 = lshr i32 %I539.0, 1 + %sub597 = sub i32 25, %shr594 + br label %cond.end + +cond.end: ; preds = %cond.false, %if.else590 + %cond = phi i32 [ %sub597, %cond.false ], [ 0, %if.else590 ] + %head59932 = getelementptr inbounds %struct.malloc_tree_chunk* %116, i32 0, i32 1 + %117 = load i32* %head59932, align 4, !tbaa !3 + %and60033 = and i32 %117, -8 + %cmp60134 = icmp eq i32 %and60033, %psize.addr.1 + br i1 %cmp60134, label %if.else624, label %if.then603.lr.ph + +if.then603.lr.ph: ; preds = %cond.end + %shl598 = shl i32 %psize.addr.1, %cond + br label %if.then603 + +for.cond: ; preds = %if.then603 + %shl608 = shl i32 %K591.036, 1 + %head599 = getelementptr inbounds %struct.malloc_tree_chunk* %119, i32 0, i32 1 + %118 = load i32* %head599, align 4, !tbaa !3 + %and600 = and i32 %118, -8 + %cmp601 = icmp eq i32 %and600, %psize.addr.1 + br i1 %cmp601, label %if.else624, label %if.then603 + +if.then603: ; preds = %for.cond, %if.then603.lr.ph + %K591.036 = phi i32 [ %shl598, %if.then603.lr.ph ], [ %shl608, %for.cond ] + %T.035 = phi %struct.malloc_tree_chunk* [ %116, %if.then603.lr.ph ], [ %119, %for.cond ] + %shr604 = lshr i32 %K591.036, 31 + %arrayidx607 = getelementptr inbounds %struct.malloc_tree_chunk* %T.035, i32 0, i32 4, i32 %shr604 + %119 = load %struct.malloc_tree_chunk** %arrayidx607, align 4, !tbaa !0 + %cmp609 = icmp eq %struct.malloc_tree_chunk* %119, null + br i1 %cmp609, label %if.else612, label %for.cond + +if.else612: ; preds = %if.then603 + %120 = bitcast %struct.malloc_tree_chunk** %arrayidx607 to i8* + %121 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp614 = icmp ult i8* %120, %121 + br i1 %cmp614, label %if.else622, label %if.then618, !prof !6 + +if.then618: ; preds = %if.else612 + store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %arrayidx607, align 4, !tbaa !0 + %parent619 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 2 + %T.0.c8 = bitcast %struct.malloc_tree_chunk* %T.035 to %struct.malloc_chunk* + store %struct.malloc_chunk* %T.0.c8, %struct.malloc_chunk** %parent619, align 4, !tbaa !0 + %bk620 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3 + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %bk620, align 4, !tbaa !0 + %fd621 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2 + store %struct.malloc_chunk* %p.addr.0, %struct.malloc_chunk** %fd621, align 4, !tbaa !0 + br label %if.end649 + +if.else622: ; preds = %if.else612 + tail call void @abort() #6 + unreachable + +if.else624: ; preds = %for.cond, %cond.end + %T.0.lcssa = phi %struct.malloc_tree_chunk* [ %116, %cond.end ], [ %119, %for.cond ] + %fd626 = getelementptr inbounds %struct.malloc_tree_chunk* %T.0.lcssa, i32 0, i32 2 + %122 = load %struct.malloc_tree_chunk** %fd626, align 4, !tbaa !0 + %123 = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to i8* + %124 = load i8** getelementptr inbounds (%struct.malloc_state* @_gm_, i32 0, i32 4), align 4, !tbaa !0 + %cmp628 = icmp ult i8* %123, %124 + br i1 %cmp628, label %if.else644, label %land.rhs630 + +land.rhs630: ; preds = %if.else624 + %125 = bitcast %struct.malloc_tree_chunk* %122 to i8* + %cmp632 = icmp ult i8* %125, %124 + br i1 %cmp632, label %if.else644, label %if.then638, !prof !6 + +if.then638: ; preds = %land.rhs630 + %bk639 = getelementptr inbounds %struct.malloc_tree_chunk* %122, i32 0, i32 3 + store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %bk639, align 4, !tbaa !0 + store %struct.malloc_tree_chunk* %113, %struct.malloc_tree_chunk** %fd626, align 4, !tbaa !0 + %fd641 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 2 + %.c7 = bitcast %struct.malloc_tree_chunk* %122 to %struct.malloc_chunk* + store %struct.malloc_chunk* %.c7, %struct.malloc_chunk** %fd641, align 4, !tbaa !0 + %bk642 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 0, i32 3 + %T.0.c = bitcast %struct.malloc_tree_chunk* %T.0.lcssa to %struct.malloc_chunk* + store %struct.malloc_chunk* %T.0.c, %struct.malloc_chunk** %bk642, align 4, !tbaa !0 + %parent643 = getelementptr inbounds %struct.malloc_chunk* %p.addr.0, i32 1, i32 2 + store %struct.malloc_chunk* null, %struct.malloc_chunk** %parent643, align 4, !tbaa !0 + br label %if.end649 + +if.else644: ; preds = %land.rhs630, %if.else624 + tail call void @abort() #6 + unreachable + +if.else648: ; preds = %if.end215 + tail call void @abort() #6 + unreachable + +if.end649: ; preds = %if.then638, %if.then618, %if.then583, %if.end531, %if.then488, %if.then244, %if.then236, %if.then228, %if.then205, %if.then + ret void +} + +declare i32 @sysconf(i32) #5 + +declare i32 @time(i32*) #5 + +define weak i8* @_Znwj(i32 %size) #5 { +entry: + %cmp = icmp eq i32 %size, 0 + %.size = select i1 %cmp, i32 1, i32 %size + br label %invoke.cont + +invoke.cont: ; preds = %if.then3, %entry + %call = tail call i8* @malloc(i32 %.size) + %cmp1 = icmp eq i8* %call, null + br i1 %cmp1, label %while.body, label %while.end + +while.body: ; preds = %invoke.cont + %0 = atomicrmw add i32* bitcast (void ()** @_ZL13__new_handler to i32*), i32 0 seq_cst + %tobool = icmp eq i32 %0, 0 + br i1 %tobool, label %if.else, label %if.then3 + +if.then3: ; preds = %while.body + %1 = inttoptr i32 %0 to void ()* + invoke void %1() + to label %invoke.cont unwind label %lpad.loopexit + +lpad.loopexit: ; preds = %if.then3 + %lpad.loopexit4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + filter [1 x i8*] [i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*)] + br label %lpad + +lpad.nonloopexit: ; preds = %if.else + %lpad.nonloopexit5 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + filter [1 x i8*] [i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*)] + br label %lpad + +lpad: ; preds = %lpad.nonloopexit, %lpad.loopexit + %lpad.phi = phi { i8*, i32 } [ %lpad.loopexit4, %lpad.loopexit ], [ %lpad.nonloopexit5, %lpad.nonloopexit ] + %2 = extractvalue { i8*, i32 } %lpad.phi, 1 + %ehspec.fails = icmp slt i32 %2, 0 + br i1 %ehspec.fails, label %ehspec.unexpected, label %eh.resume + +ehspec.unexpected: ; preds = %lpad + %3 = extractvalue { i8*, i32 } %lpad.phi, 0 + tail call void @__cxa_call_unexpected(i8* %3) #8 + unreachable + +if.else: ; preds = %while.body + %exception = tail call i8* @__cxa_allocate_exception(i32 4) #1 + %4 = bitcast i8* %exception to i32 (...)*** + store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt9bad_alloc, i32 0, i32 2) to i32 (...)**), i32 (...)*** %4, align 4, !tbaa !8 + invoke void @__cxa_throw(i8* %exception, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*)) #8 + to label %unreachable unwind label %lpad.nonloopexit + +while.end: ; preds = %invoke.cont + ret i8* %call + +eh.resume: ; preds = %lpad + resume { i8*, i32 } %lpad.phi + +unreachable: ; preds = %if.else + unreachable +} + +declare i32 @__gxx_personality_v0(...) + +; Function Attrs: nounwind +define void ()* @_ZSt15get_new_handlerv() #0 { +entry: + %0 = atomicrmw add i32* bitcast (void ()** @_ZL13__new_handler to i32*), i32 0 seq_cst + %1 = inttoptr i32 %0 to void ()* + ret void ()* %1 +} + +declare i8* @__cxa_allocate_exception(i32) + +declare void @__cxa_throw(i8*, i8*, i8*) + +declare void @__cxa_call_unexpected(i8*) + +; Function Attrs: nounwind +define weak noalias i8* @_ZnwjRKSt9nothrow_t(i32 %size, %"struct.std::nothrow_t"*) #0 { +entry: + %call = invoke noalias i8* @_Znwj(i32 %size) + to label %try.cont unwind label %lpad + +lpad: ; preds = %entry + %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + catch i8* null + %2 = extractvalue { i8*, i32 } %1, 0 + %3 = tail call i8* @__cxa_begin_catch(i8* %2) #1 + invoke void @__cxa_end_catch() + to label %try.cont unwind label %lpad1 + +try.cont: ; preds = %lpad, %entry + %p.0 = phi i8* [ null, %lpad ], [ %call, %entry ] + ret i8* %p.0 + +lpad1: ; preds = %lpad + %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + filter [0 x i8*] zeroinitializer + %5 = extractvalue { i8*, i32 } %4, 0 + tail call void @__cxa_call_unexpected(i8* %5) #6 + unreachable +} + +declare i8* @__cxa_begin_catch(i8*) + +declare void @__cxa_end_catch() + +define weak noalias i8* @_Znaj(i32 %size) #5 { +entry: + %call = invoke noalias i8* @_Znwj(i32 %size) + to label %invoke.cont unwind label %lpad + +invoke.cont: ; preds = %entry + ret i8* %call + +lpad: ; preds = %entry + %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + filter [1 x i8*] [i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*)] + %1 = extractvalue { i8*, i32 } %0, 1 + %ehspec.fails = icmp slt i32 %1, 0 + br i1 %ehspec.fails, label %ehspec.unexpected, label %eh.resume + +ehspec.unexpected: ; preds = %lpad + %2 = extractvalue { i8*, i32 } %0, 0 + tail call void @__cxa_call_unexpected(i8* %2) #8 + unreachable + +eh.resume: ; preds = %lpad + resume { i8*, i32 } %0 +} + +; Function Attrs: nounwind +define weak noalias i8* @_ZnajRKSt9nothrow_t(i32 %size, %"struct.std::nothrow_t"*) #0 { +entry: + %call = invoke noalias i8* @_Znaj(i32 %size) + to label %try.cont unwind label %lpad + +lpad: ; preds = %entry + %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + catch i8* null + %2 = extractvalue { i8*, i32 } %1, 0 + %3 = tail call i8* @__cxa_begin_catch(i8* %2) #1 + invoke void @__cxa_end_catch() + to label %try.cont unwind label %lpad1 + +try.cont: ; preds = %lpad, %entry + %p.0 = phi i8* [ null, %lpad ], [ %call, %entry ] + ret i8* %p.0 + +lpad1: ; preds = %lpad + %4 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + filter [0 x i8*] zeroinitializer + %5 = extractvalue { i8*, i32 } %4, 0 + tail call void @__cxa_call_unexpected(i8* %5) #6 + unreachable +} + +; Function Attrs: nounwind +define weak void @_ZdlPv(i8* %ptr) #0 { +entry: + %tobool = icmp eq i8* %ptr, null + br i1 %tobool, label %if.end, label %if.then + +if.then: ; preds = %entry + tail call void @free(i8* %ptr) + br label %if.end + +if.end: ; preds = %if.then, %entry + ret void +} + +; Function Attrs: nounwind +define weak void @_ZdlPvRKSt9nothrow_t(i8* %ptr, %"struct.std::nothrow_t"*) #0 { +entry: + tail call void @_ZdlPv(i8* %ptr) #1 + ret void +} + +; Function Attrs: nounwind +define weak void @_ZdaPv(i8* %ptr) #0 { +entry: + tail call void @_ZdlPv(i8* %ptr) #1 + ret void +} + +; Function Attrs: nounwind +define weak void @_ZdaPvRKSt9nothrow_t(i8* %ptr, %"struct.std::nothrow_t"*) #0 { +entry: + tail call void @_ZdaPv(i8* %ptr) #1 + ret void +} + +; Function Attrs: nounwind +define void ()* @_ZSt15set_new_handlerPFvvE(void ()* %handler) #0 { +entry: + %0 = ptrtoint void ()* %handler to i32 + %1 = atomicrmw xchg i32* bitcast (void ()** @_ZL13__new_handler to i32*), i32 %0 seq_cst + %2 = inttoptr i32 %1 to void ()* + ret void ()* %2 +} + +; Function Attrs: nounwind +define void @_ZNSt9bad_allocC2Ev(%"class.std::bad_alloc"* nocapture %this) unnamed_addr #0 align 2 { +entry: + %0 = getelementptr inbounds %"class.std::bad_alloc"* %this, i32 0, i32 0, i32 0 + store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt9bad_alloc, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8 + ret void +} + +; Function Attrs: nounwind +define void @_ZNSt9bad_allocD0Ev(%"class.std::bad_alloc"* %this) unnamed_addr #0 align 2 { +entry: + %0 = getelementptr inbounds %"class.std::bad_alloc"* %this, i32 0, i32 0 + tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1 + %1 = bitcast %"class.std::bad_alloc"* %this to i8* + tail call void @_ZdlPv(i8* %1) #1 + ret void +} + +; Function Attrs: nounwind +define void @_ZNSt9bad_allocD2Ev(%"class.std::bad_alloc"* %this) unnamed_addr #0 align 2 { +entry: + %0 = getelementptr inbounds %"class.std::bad_alloc"* %this, i32 0, i32 0 + tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1 + ret void +} + +; Function Attrs: nounwind +declare void @_ZNSt9exceptionD2Ev(%"class.std::exception"*) #0 + +; Function Attrs: nounwind readnone +define i8* @_ZNKSt9bad_alloc4whatEv(%"class.std::bad_alloc"* nocapture %this) unnamed_addr #3 align 2 { +entry: + ret i8* getelementptr inbounds ([15 x i8]* @.str352, i32 0, i32 0) +} + +; Function Attrs: nounwind +define void @_ZNSt20bad_array_new_lengthC2Ev(%"class.std::bad_array_new_length"* nocapture %this) unnamed_addr #0 align 2 { +entry: + %0 = getelementptr inbounds %"class.std::bad_array_new_length"* %this, i32 0, i32 0, i32 0, i32 0 + store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt20bad_array_new_length, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8 + ret void +} + +; Function Attrs: nounwind +define void @_ZNSt20bad_array_new_lengthD0Ev(%"class.std::bad_array_new_length"* %this) unnamed_addr #0 align 2 { +entry: + %0 = getelementptr inbounds %"class.std::bad_array_new_length"* %this, i32 0, i32 0, i32 0 + tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1 + %1 = bitcast %"class.std::bad_array_new_length"* %this to i8* + tail call void @_ZdlPv(i8* %1) #1 + ret void +} + +; Function Attrs: nounwind readnone +define i8* @_ZNKSt16bad_array_length4whatEv(%"class.std::bad_array_length"* nocapture %this) unnamed_addr #3 align 2 { +entry: + ret i8* getelementptr inbounds ([17 x i8]* @.str1453, i32 0, i32 0) +} + +; Function Attrs: nounwind +define void @_ZNSt16bad_array_lengthC2Ev(%"class.std::bad_array_length"* nocapture %this) unnamed_addr #0 align 2 { +entry: + %0 = getelementptr inbounds %"class.std::bad_array_length"* %this, i32 0, i32 0, i32 0, i32 0 + store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt16bad_array_length, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8 + ret void +} + +; Function Attrs: nounwind +define void @_ZNSt16bad_array_lengthD0Ev(%"class.std::bad_array_length"* %this) unnamed_addr #0 align 2 { +entry: + %0 = getelementptr inbounds %"class.std::bad_array_length"* %this, i32 0, i32 0, i32 0 + tail call void @_ZNSt9exceptionD2Ev(%"class.std::exception"* %0) #1 + %1 = bitcast %"class.std::bad_array_length"* %this to i8* + tail call void @_ZdlPv(i8* %1) #1 + ret void +} + +; Function Attrs: nounwind readnone +define i8* @_ZNKSt20bad_array_new_length4whatEv(%"class.std::bad_array_new_length"* nocapture %this) unnamed_addr #3 align 2 { +entry: + ret i8* getelementptr inbounds ([21 x i8]* @.str2554, i32 0, i32 0) +} + +; Function Attrs: noreturn +define void @_ZSt17__throw_bad_allocv() #4 { +entry: + %exception = tail call i8* @__cxa_allocate_exception(i32 4) #1 + %0 = bitcast i8* %exception to i32 (...)*** + store i32 (...)** bitcast (i8** getelementptr inbounds ([5 x i8*]* @_ZTVSt9bad_alloc, i32 0, i32 2) to i32 (...)**), i32 (...)*** %0, align 4, !tbaa !8 + tail call void @__cxa_throw(i8* %exception, i8* bitcast ({ i8*, i8*, i8* }* @_ZTISt9bad_alloc to i8*), i8* bitcast (void (%"class.std::bad_alloc"*)* @_ZNSt9bad_allocD2Ev to i8*)) #8 + unreachable +} + +; Function Attrs: nounwind +define double @__floatscan(%struct._IO_FILE* %f, i32 %prec, i32 %pok) #0 { +entry: + %x.i = alloca [128 x i32], align 4 + switch i32 %prec, label %return [ + i32 0, label %while.cond.preheader + i32 1, label %sw.bb1 + i32 2, label %sw.bb3 + ] + +sw.bb1: ; preds = %entry + br label %while.cond.preheader + +sw.bb3: ; preds = %entry + br label %while.cond.preheader + +while.cond.preheader: ; preds = %sw.bb3, %sw.bb1, %entry + %bits.0.ph = phi i32 [ 24, %entry ], [ 53, %sw.bb1 ], [ 53, %sw.bb3 ] + %emin.0.ph = phi i32 [ -149, %entry ], [ -1074, %sw.bb1 ], [ -1074, %sw.bb3 ] + %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1 + %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27 + br label %while.cond + +while.cond: ; preds = %cond.end, %while.cond.preheader + %0 = load i8** %rpos, align 4, !tbaa !0 + %1 = load i8** %shend, align 4, !tbaa !0 + %cmp = icmp ult i8* %0, %1 + br i1 %cmp, label %cond.true, label %cond.false + +cond.true: ; preds = %while.cond + %incdec.ptr = getelementptr inbounds i8* %0, i32 1 + store i8* %incdec.ptr, i8** %rpos, align 4, !tbaa !0 + %2 = load i8* %0, align 1, !tbaa !1 + %conv = zext i8 %2 to i32 + br label %cond.end + +cond.false: ; preds = %while.cond + %call = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i32 [ %conv, %cond.true ], [ %call, %cond.false ] + %call6 = call i32 @isspace(i32 %cond) #1 + %tobool = icmp eq i32 %call6, 0 + br i1 %tobool, label %while.end, label %while.cond + +while.end: ; preds = %cond.end + %cmp9 = icmp eq i32 %cond, 45 + switch i32 %cond, label %if.end [ + i32 45, label %if.then + i32 43, label %if.then + ] + +if.then: ; preds = %while.end, %while.end + %conv12 = zext i1 %cmp9 to i32 + %mul = shl nuw nsw i32 %conv12, 1 + %sub13 = sub nsw i32 1, %mul + %3 = load i8** %rpos, align 4, !tbaa !0 + %4 = load i8** %shend, align 4, !tbaa !0 + %cmp16 = icmp ult i8* %3, %4 + br i1 %cmp16, label %cond.true18, label %cond.false22 + +cond.true18: ; preds = %if.then + %incdec.ptr20 = getelementptr inbounds i8* %3, i32 1 + store i8* %incdec.ptr20, i8** %rpos, align 4, !tbaa !0 + %5 = load i8* %3, align 1, !tbaa !1 + %conv21 = zext i8 %5 to i32 + br label %if.end + +cond.false22: ; preds = %if.then + %call23 = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %if.end + +if.end: ; preds = %cond.false22, %cond.true18, %while.end + %sign.0 = phi i32 [ 1, %while.end ], [ %sub13, %cond.false22 ], [ %sub13, %cond.true18 ] + %c.0 = phi i32 [ %cond, %while.end ], [ %call23, %cond.false22 ], [ %conv21, %cond.true18 ] + br label %land.rhs + +land.rhs: ; preds = %for.inc, %if.end + %c.1154 = phi i32 [ %c.0, %if.end ], [ %c.2, %for.inc ] + %i.0153 = phi i32 [ 0, %if.end ], [ %inc, %for.inc ] + %or = or i32 %c.1154, 32 + %arrayidx = getelementptr inbounds [9 x i8]* @.str655, i32 0, i32 %i.0153 + %6 = load i8* %arrayidx, align 1, !tbaa !1 + %conv28 = sext i8 %6 to i32 + %cmp29 = icmp eq i32 %or, %conv28 + br i1 %cmp29, label %for.body, label %for.end + +for.body: ; preds = %land.rhs + %cmp31 = icmp ult i32 %i.0153, 7 + br i1 %cmp31, label %if.then33, label %for.inc + +if.then33: ; preds = %for.body + %7 = load i8** %rpos, align 4, !tbaa !0 + %8 = load i8** %shend, align 4, !tbaa !0 + %cmp36 = icmp ult i8* %7, %8 + br i1 %cmp36, label %cond.true38, label %cond.false42 + +cond.true38: ; preds = %if.then33 + %incdec.ptr40 = getelementptr inbounds i8* %7, i32 1 + store i8* %incdec.ptr40, i8** %rpos, align 4, !tbaa !0 + %9 = load i8* %7, align 1, !tbaa !1 + %conv41 = zext i8 %9 to i32 + br label %for.inc + +cond.false42: ; preds = %if.then33 + %call43 = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.inc + +for.inc: ; preds = %cond.false42, %cond.true38, %for.body + %c.2 = phi i32 [ %c.1154, %for.body ], [ %conv41, %cond.true38 ], [ %call43, %cond.false42 ] + %inc = add i32 %i.0153, 1 + %cmp26 = icmp ult i32 %inc, 8 + br i1 %cmp26, label %land.rhs, label %for.end + +for.end: ; preds = %for.inc, %land.rhs + %c.1.lcssa = phi i32 [ %c.2, %for.inc ], [ %c.1154, %land.rhs ] + %i.0.lcssa = phi i32 [ %inc, %for.inc ], [ %i.0153, %land.rhs ] + switch i32 %i.0.lcssa, label %lor.lhs.false52 [ + i32 8, label %if.end83 + i32 3, label %if.then59 + ] + +lor.lhs.false52: ; preds = %for.end + %cmp53 = icmp ult i32 %i.0.lcssa, 4 + %tobool55 = icmp eq i32 %pok, 0 + %or.cond = or i1 %cmp53, %tobool55 + br i1 %or.cond, label %if.end87, label %if.then56 + +if.then56: ; preds = %lor.lhs.false52 + %cmp57 = icmp eq i32 %i.0.lcssa, 8 + br i1 %cmp57, label %if.end83, label %if.then59 + +if.then59: ; preds = %if.then56, %for.end + %10 = load i8** %shend, align 4, !tbaa !0 + %tobool61 = icmp eq i8* %10, null + br i1 %tobool61, label %cond.end66, label %cond.true62 + +cond.true62: ; preds = %if.then59 + %11 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr64 = getelementptr inbounds i8* %11, i32 -1 + store i8* %incdec.ptr64, i8** %rpos, align 4, !tbaa !0 + br label %cond.end66 + +cond.end66: ; preds = %cond.true62, %if.then59 + %notlhs = icmp eq i32 %pok, 0 + %notrhs = icmp ult i32 %i.0.lcssa, 4 + %or.cond175.not = or i1 %notrhs, %notlhs + %brmerge = or i1 %or.cond175.not, %tobool61 + br i1 %brmerge, label %if.end83, label %for.inc80 + +for.inc80: ; preds = %for.inc80, %cond.end66 + %i.1152 = phi i32 [ %dec, %for.inc80 ], [ %i.0.lcssa, %cond.end66 ] + %12 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr77 = getelementptr inbounds i8* %12, i32 -1 + store i8* %incdec.ptr77, i8** %rpos, align 4, !tbaa !0 + %dec = add i32 %i.1152, -1 + %cmp70 = icmp ugt i32 %dec, 3 + br i1 %cmp70, label %for.inc80, label %if.end83 + +if.end83: ; preds = %for.inc80, %cond.end66, %if.then56, %for.end + %conv84 = sitofp i32 %sign.0 to float + %mul85 = fmul float %conv84, 0x7FF0000000000000 + %conv86 = fpext float %mul85 to double + br label %return + +if.end87: ; preds = %lor.lhs.false52 + %tobool88 = icmp eq i32 %i.0.lcssa, 0 + br i1 %tobool88, label %land.rhs93, label %if.end120 + +land.rhs93: ; preds = %for.inc117, %if.end87 + %c.3150 = phi i32 [ %c.4, %for.inc117 ], [ %c.1.lcssa, %if.end87 ] + %i.2149 = phi i32 [ %inc118, %for.inc117 ], [ 0, %if.end87 ] + %or94 = or i32 %c.3150, 32 + %arrayidx95 = getelementptr inbounds [4 x i8]* @.str1756, i32 0, i32 %i.2149 + %13 = load i8* %arrayidx95, align 1, !tbaa !1 + %conv96 = sext i8 %13 to i32 + %cmp97 = icmp eq i32 %or94, %conv96 + br i1 %cmp97, label %for.body100, label %if.end120 + +for.body100: ; preds = %land.rhs93 + %cmp101 = icmp ult i32 %i.2149, 2 + br i1 %cmp101, label %if.then103, label %for.inc117 + +if.then103: ; preds = %for.body100 + %14 = load i8** %rpos, align 4, !tbaa !0 + %15 = load i8** %shend, align 4, !tbaa !0 + %cmp106 = icmp ult i8* %14, %15 + br i1 %cmp106, label %cond.true108, label %cond.false112 + +cond.true108: ; preds = %if.then103 + %incdec.ptr110 = getelementptr inbounds i8* %14, i32 1 + store i8* %incdec.ptr110, i8** %rpos, align 4, !tbaa !0 + %16 = load i8* %14, align 1, !tbaa !1 + %conv111 = zext i8 %16 to i32 + br label %for.inc117 + +cond.false112: ; preds = %if.then103 + %call113 = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.inc117 + +for.inc117: ; preds = %cond.false112, %cond.true108, %for.body100 + %c.4 = phi i32 [ %c.3150, %for.body100 ], [ %conv111, %cond.true108 ], [ %call113, %cond.false112 ] + %inc118 = add i32 %i.2149, 1 + %cmp91 = icmp ult i32 %inc118, 3 + br i1 %cmp91, label %land.rhs93, label %if.end120 + +if.end120: ; preds = %for.inc117, %land.rhs93, %if.end87 + %i.3 = phi i32 [ %i.0.lcssa, %if.end87 ], [ %inc118, %for.inc117 ], [ %i.2149, %land.rhs93 ] + %c.5 = phi i32 [ %c.1.lcssa, %if.end87 ], [ %c.4, %for.inc117 ], [ %c.3150, %land.rhs93 ] + switch i32 %i.3, label %if.then207 [ + i32 3, label %if.then123 + i32 0, label %if.end216 + ] + +if.then123: ; preds = %if.end120 + %17 = load i8** %rpos, align 4, !tbaa !0 + %18 = load i8** %shend, align 4, !tbaa !0 + %cmp126 = icmp ult i8* %17, %18 + br i1 %cmp126, label %cond.true128, label %cond.false132 + +cond.true128: ; preds = %if.then123 + %incdec.ptr130 = getelementptr inbounds i8* %17, i32 1 + store i8* %incdec.ptr130, i8** %rpos, align 4, !tbaa !0 + %19 = load i8* %17, align 1, !tbaa !1 + %conv131 = zext i8 %19 to i32 + br label %cond.end134 + +cond.false132: ; preds = %if.then123 + %call133 = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %cond.end134 + +cond.end134: ; preds = %cond.false132, %cond.true128 + %cond135 = phi i32 [ %conv131, %cond.true128 ], [ %call133, %cond.false132 ] + %cmp136 = icmp eq i32 %cond135, 40 + br i1 %cmp136, label %for.cond147, label %if.then138 + +if.then138: ; preds = %cond.end134 + %20 = load i8** %shend, align 4, !tbaa !0 + %tobool140 = icmp eq i8* %20, null + br i1 %tobool140, label %return, label %cond.true141 + +cond.true141: ; preds = %if.then138 + %21 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr143 = getelementptr inbounds i8* %21, i32 -1 + store i8* %incdec.ptr143, i8** %rpos, align 4, !tbaa !0 + br label %return + +for.cond147: ; preds = %for.inc203, %cond.end134 + %i.4 = phi i32 [ %inc204, %for.inc203 ], [ 1, %cond.end134 ] + %22 = load i8** %rpos, align 4, !tbaa !0 + %23 = load i8** %shend, align 4, !tbaa !0 + %cmp150 = icmp ult i8* %22, %23 + br i1 %cmp150, label %cond.true152, label %cond.false156 + +cond.true152: ; preds = %for.cond147 + %incdec.ptr154 = getelementptr inbounds i8* %22, i32 1 + store i8* %incdec.ptr154, i8** %rpos, align 4, !tbaa !0 + %24 = load i8* %22, align 1, !tbaa !1 + %conv155 = zext i8 %24 to i32 + br label %cond.end158 + +cond.false156: ; preds = %for.cond147 + %call157 = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %cond.end158 + +cond.end158: ; preds = %cond.false156, %cond.true152 + %cond159 = phi i32 [ %conv155, %cond.true152 ], [ %call157, %cond.false156 ] + %sub160 = add nsw i32 %cond159, -48 + %cmp161 = icmp ult i32 %sub160, 10 + %sub164 = add nsw i32 %cond159, -65 + %cmp165 = icmp ult i32 %sub164, 26 + %or.cond81 = or i1 %cmp161, %cmp165 + br i1 %or.cond81, label %for.inc203, label %lor.lhs.false167 + +lor.lhs.false167: ; preds = %cond.end158 + %sub168 = add nsw i32 %cond159, -97 + %cmp169 = icmp ult i32 %sub168, 26 + %cmp172 = icmp eq i32 %cond159, 95 + %or.cond2 = or i1 %cmp169, %cmp172 + br i1 %or.cond2, label %for.inc203, label %if.end175 + +if.end175: ; preds = %lor.lhs.false167 + %cmp176 = icmp eq i32 %cond159, 41 + br i1 %cmp176, label %return, label %if.end179 + +if.end179: ; preds = %if.end175 + %25 = load i8** %shend, align 4, !tbaa !0 + %tobool181 = icmp eq i8* %25, null + br i1 %tobool181, label %cond.end186, label %cond.true182 + +cond.true182: ; preds = %if.end179 + %26 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr184 = getelementptr inbounds i8* %26, i32 -1 + store i8* %incdec.ptr184, i8** %rpos, align 4, !tbaa !0 + br label %cond.end186 + +cond.end186: ; preds = %cond.true182, %if.end179 + br i1 %tobool55, label %if.then188, label %while.cond191.preheader + +while.cond191.preheader: ; preds = %cond.end186 + %tobool193123 = icmp eq i32 %i.4, 0 + %brmerge176 = or i1 %tobool193123, %tobool181 + br i1 %brmerge176, label %return, label %while.cond191.backedge + +if.then188: ; preds = %cond.end186 + %call189 = call i32* @__errno_location() #7 + store i32 22, i32* %call189, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f, i32 0) #1 + br label %return + +while.cond191.backedge: ; preds = %while.cond191.backedge, %while.cond191.preheader + %dec192124.in = phi i32 [ %dec192124, %while.cond191.backedge ], [ %i.4, %while.cond191.preheader ] + %dec192124 = add i32 %dec192124.in, -1 + %27 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr199 = getelementptr inbounds i8* %27, i32 -1 + store i8* %incdec.ptr199, i8** %rpos, align 4, !tbaa !0 + %tobool193 = icmp eq i32 %dec192124, 0 + br i1 %tobool193, label %return, label %while.cond191.backedge + +for.inc203: ; preds = %lor.lhs.false167, %cond.end158 + %inc204 = add i32 %i.4, 1 + br label %for.cond147 + +if.then207: ; preds = %if.end120 + %28 = load i8** %shend, align 4, !tbaa !0 + %tobool209 = icmp eq i8* %28, null + br i1 %tobool209, label %cond.end214, label %cond.true210 + +cond.true210: ; preds = %if.then207 + %29 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr212 = getelementptr inbounds i8* %29, i32 -1 + store i8* %incdec.ptr212, i8** %rpos, align 4, !tbaa !0 + br label %cond.end214 + +cond.end214: ; preds = %cond.true210, %if.then207 + %call215 = call i32* @__errno_location() #7 + store i32 22, i32* %call215, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f, i32 0) #1 + br label %return + +if.end216: ; preds = %if.end120 + %cmp217 = icmp eq i32 %c.5, 48 + br i1 %cmp217, label %if.then219, label %if.end245 + +if.then219: ; preds = %if.end216 + %30 = load i8** %rpos, align 4, !tbaa !0 + %31 = load i8** %shend, align 4, !tbaa !0 + %cmp222 = icmp ult i8* %30, %31 + br i1 %cmp222, label %cond.true224, label %cond.false228 + +cond.true224: ; preds = %if.then219 + %incdec.ptr226 = getelementptr inbounds i8* %30, i32 1 + store i8* %incdec.ptr226, i8** %rpos, align 4, !tbaa !0 + %32 = load i8* %30, align 1, !tbaa !1 + %conv227 = zext i8 %32 to i32 + br label %cond.end230 + +cond.false228: ; preds = %if.then219 + %call229 = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %cond.end230 + +cond.end230: ; preds = %cond.false228, %cond.true224 + %cond231 = phi i32 [ %conv227, %cond.true224 ], [ %call229, %cond.false228 ] + %or232 = or i32 %cond231, 32 + %cmp233 = icmp eq i32 %or232, 120 + br i1 %cmp233, label %if.then235, label %if.end237 + +if.then235: ; preds = %cond.end230 + %33 = load i8** %rpos, align 4, !tbaa !0 + %34 = load i8** %shend, align 4, !tbaa !0 + %cmp.i = icmp ult i8* %33, %34 + br i1 %cmp.i, label %cond.true.i, label %cond.false.i + +cond.true.i: ; preds = %if.then235 + %incdec.ptr.i = getelementptr inbounds i8* %33, i32 1 + store i8* %incdec.ptr.i, i8** %rpos, align 4, !tbaa !0 + %35 = load i8* %33, align 1, !tbaa !1 + %conv.i = zext i8 %35 to i32 + br label %for.cond.i + +cond.false.i: ; preds = %if.then235 + %call.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond.i + +for.cond.i: ; preds = %cond.false12.i, %cond.true8.i, %cond.false.i, %cond.true.i + %gotdig.0.i = phi i32 [ 0, %cond.true.i ], [ 0, %cond.false.i ], [ 1, %cond.true8.i ], [ 1, %cond.false12.i ] + %c.0.i = phi i32 [ %conv.i, %cond.true.i ], [ %call.i, %cond.false.i ], [ %conv11.i, %cond.true8.i ], [ %call13.i, %cond.false12.i ] + switch i32 %c.0.i, label %for.cond48.i [ + i32 48, label %for.body.i + i32 46, label %if.then.i + ] + +for.body.i: ; preds = %for.cond.i + %36 = load i8** %rpos, align 4, !tbaa !0 + %37 = load i8** %shend, align 4, !tbaa !0 + %cmp6.i = icmp ult i8* %36, %37 + br i1 %cmp6.i, label %cond.true8.i, label %cond.false12.i + +cond.true8.i: ; preds = %for.body.i + %incdec.ptr10.i = getelementptr inbounds i8* %36, i32 1 + store i8* %incdec.ptr10.i, i8** %rpos, align 4, !tbaa !0 + %38 = load i8* %36, align 1, !tbaa !1 + %conv11.i = zext i8 %38 to i32 + br label %for.cond.i + +cond.false12.i: ; preds = %for.body.i + %call13.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond.i + +if.then.i: ; preds = %for.cond.i + %39 = load i8** %rpos, align 4, !tbaa !0 + %40 = load i8** %shend, align 4, !tbaa !0 + %cmp20.i = icmp ult i8* %39, %40 + br i1 %cmp20.i, label %cond.true22.i, label %cond.false26.i + +cond.true22.i: ; preds = %if.then.i + %incdec.ptr24.i = getelementptr inbounds i8* %39, i32 1 + store i8* %incdec.ptr24.i, i8** %rpos, align 4, !tbaa !0 + %41 = load i8* %39, align 1, !tbaa !1 + %conv25.i = zext i8 %41 to i32 + br label %for.cond30.preheader.i + +cond.false26.i: ; preds = %if.then.i + %call27.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond30.preheader.i + +for.cond30.preheader.i: ; preds = %cond.false26.i, %cond.true22.i + %c.1.ph.i = phi i32 [ %conv25.i, %cond.true22.i ], [ %call27.i, %cond.false26.i ] + %cmp31107.i = icmp eq i32 %c.1.ph.i, 48 + br i1 %cmp31107.i, label %for.body33.i, label %for.cond48.i + +for.body33.i: ; preds = %cond.end45.i.for.body33.i_crit_edge, %for.cond30.preheader.i + %rp.0108.i = phi i64 [ %phitmp.i, %cond.end45.i.for.body33.i_crit_edge ], [ -1, %for.cond30.preheader.i ] + %42 = load i8** %rpos, align 4, !tbaa !0 + %43 = load i8** %shend, align 4, !tbaa !0 + %cmp37.i = icmp ult i8* %42, %43 + br i1 %cmp37.i, label %cond.true39.i, label %cond.false43.i + +cond.true39.i: ; preds = %for.body33.i + %incdec.ptr41.i = getelementptr inbounds i8* %42, i32 1 + store i8* %incdec.ptr41.i, i8** %rpos, align 4, !tbaa !0 + %44 = load i8* %42, align 1, !tbaa !1 + %conv42.i = zext i8 %44 to i32 + br label %cond.end45.i + +cond.false43.i: ; preds = %for.body33.i + %call44.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %cond.end45.i + +cond.end45.i: ; preds = %cond.false43.i, %cond.true39.i + %cond46.i = phi i32 [ %conv42.i, %cond.true39.i ], [ %call44.i, %cond.false43.i ] + %cmp31.i = icmp eq i32 %cond46.i, 48 + br i1 %cmp31.i, label %cond.end45.i.for.body33.i_crit_edge, label %for.cond48.i + +cond.end45.i.for.body33.i_crit_edge: ; preds = %cond.end45.i + %phitmp.i = add i64 %rp.0108.i, -1 + br label %for.body33.i + +for.cond48.i: ; preds = %cond.false100.i, %cond.true96.i, %cond.end45.i, %for.cond30.preheader.i, %for.cond.i + %x.0.i = phi i32 [ 0, %for.cond.i ], [ 0, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %x.2.i, %cond.true96.i ], [ %x.2.i, %cond.false100.i ] + %y.0.i = phi double [ 0.000000e+00, %for.cond.i ], [ 0.000000e+00, %cond.end45.i ], [ 0.000000e+00, %for.cond30.preheader.i ], [ %y.2.i, %cond.true96.i ], [ %y.2.i, %cond.false100.i ] + %scale.0.i = phi double [ 1.000000e+00, %for.cond.i ], [ 1.000000e+00, %cond.end45.i ], [ 1.000000e+00, %for.cond30.preheader.i ], [ %scale.2.i, %cond.true96.i ], [ %scale.2.i, %cond.false100.i ] + %gottail.0.i = phi i32 [ 0, %for.cond.i ], [ 0, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %gottail.2.i, %cond.true96.i ], [ %gottail.2.i, %cond.false100.i ] + %gotrad.0.i = phi i32 [ 0, %for.cond.i ], [ 1, %cond.end45.i ], [ 1, %for.cond30.preheader.i ], [ %gotrad.1.i, %cond.true96.i ], [ %gotrad.1.i, %cond.false100.i ] + %gotdig.2.i = phi i32 [ %gotdig.0.i, %for.cond.i ], [ 1, %cond.end45.i ], [ %gotdig.0.i, %for.cond30.preheader.i ], [ %gotdig.3.i, %cond.true96.i ], [ %gotdig.3.i, %cond.false100.i ] + %rp.1.i = phi i64 [ 0, %for.cond.i ], [ %rp.0108.i, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %rp.2.i, %cond.true96.i ], [ %rp.2.i, %cond.false100.i ] + %dc.0.i = phi i64 [ 0, %for.cond.i ], [ 0, %cond.end45.i ], [ 0, %for.cond30.preheader.i ], [ %dc.1.i, %cond.true96.i ], [ %dc.1.i, %cond.false100.i ] + %c.2.i = phi i32 [ %c.0.i, %for.cond.i ], [ %cond46.i, %cond.end45.i ], [ %c.1.ph.i, %for.cond30.preheader.i ], [ %conv99.i, %cond.true96.i ], [ %call101.i, %cond.false100.i ] + %sub.i = add nsw i32 %c.2.i, -48 + %cmp49.i = icmp ult i32 %sub.i, 10 + br i1 %cmp49.i, label %if.end69.i, label %lor.lhs.false.i + +lor.lhs.false.i: ; preds = %for.cond48.i + %or.i = or i32 %c.2.i, 32 + %sub51.i = add nsw i32 %or.i, -97 + %cmp52.i = icmp ult i32 %sub51.i, 6 + %cmp54.i = icmp eq i32 %c.2.i, 46 + %or.cond.i = or i1 %cmp52.i, %cmp54.i + br i1 %or.cond.i, label %for.body56.i, label %for.end104.i + +for.body56.i: ; preds = %lor.lhs.false.i + br i1 %cmp54.i, label %if.then59.i, label %if.else.i + +if.then59.i: ; preds = %for.body56.i + %tobool.i = icmp eq i32 %gotrad.0.i, 0 + br i1 %tobool.i, label %for.inc91.i, label %for.end104.i + +if.else.i: ; preds = %for.body56.i + %cmp62.i = icmp sgt i32 %c.2.i, 57 + %sub66.i = add nsw i32 %or.i, -87 + %sub66.sub.i = select i1 %cmp62.i, i32 %sub66.i, i32 %sub.i + br label %if.end69.i + +if.end69.i: ; preds = %if.else.i, %for.cond48.i + %d.0.i = phi i32 [ %sub.i, %for.cond48.i ], [ %sub66.sub.i, %if.else.i ] + %cmp70.i = icmp slt i64 %dc.0.i, 8 + br i1 %cmp70.i, label %if.then72.i, label %if.else74.i + +if.then72.i: ; preds = %if.end69.i + %mul.i = shl i32 %x.0.i, 4 + %add73.i = add i32 %d.0.i, %mul.i + br label %if.end89.i + +if.else74.i: ; preds = %if.end69.i + %cmp75.i = icmp slt i64 %dc.0.i, 14 + br i1 %cmp75.i, label %if.then77.i, label %if.else81.i + +if.then77.i: ; preds = %if.else74.i + %conv78.i = sitofp i32 %d.0.i to double + %div.i = fmul double %scale.0.i, 6.250000e-02 + %mul79.i = fmul double %div.i, %conv78.i + %add80.i = fadd double %y.0.i, %mul79.i + br label %if.end89.i + +if.else81.i: ; preds = %if.else74.i + %tobool82.i = icmp ne i32 %d.0.i, 0 + %tobool83.i = icmp eq i32 %gottail.0.i, 0 + %or.cond89.i = and i1 %tobool82.i, %tobool83.i + br i1 %or.cond89.i, label %if.then84.i, label %if.end89.i + +if.then84.i: ; preds = %if.else81.i + %mul85.i = fmul double %scale.0.i, 5.000000e-01 + %add86.i = fadd double %y.0.i, %mul85.i + br label %if.end89.i + +if.end89.i: ; preds = %if.then84.i, %if.else81.i, %if.then77.i, %if.then72.i + %x.1.i = phi i32 [ %add73.i, %if.then72.i ], [ %x.0.i, %if.then77.i ], [ %x.0.i, %if.then84.i ], [ %x.0.i, %if.else81.i ] + %y.1.i = phi double [ %y.0.i, %if.then72.i ], [ %add80.i, %if.then77.i ], [ %add86.i, %if.then84.i ], [ %y.0.i, %if.else81.i ] + %scale.1.i = phi double [ %scale.0.i, %if.then72.i ], [ %div.i, %if.then77.i ], [ %scale.0.i, %if.then84.i ], [ %scale.0.i, %if.else81.i ] + %gottail.1.i = phi i32 [ %gottail.0.i, %if.then72.i ], [ %gottail.0.i, %if.then77.i ], [ 1, %if.then84.i ], [ %gottail.0.i, %if.else81.i ] + %inc.i = add nsw i64 %dc.0.i, 1 + br label %for.inc91.i + +for.inc91.i: ; preds = %if.end89.i, %if.then59.i + %x.2.i = phi i32 [ %x.1.i, %if.end89.i ], [ %x.0.i, %if.then59.i ] + %y.2.i = phi double [ %y.1.i, %if.end89.i ], [ %y.0.i, %if.then59.i ] + %scale.2.i = phi double [ %scale.1.i, %if.end89.i ], [ %scale.0.i, %if.then59.i ] + %gottail.2.i = phi i32 [ %gottail.1.i, %if.end89.i ], [ %gottail.0.i, %if.then59.i ] + %gotrad.1.i = phi i32 [ %gotrad.0.i, %if.end89.i ], [ 1, %if.then59.i ] + %gotdig.3.i = phi i32 [ 1, %if.end89.i ], [ %gotdig.2.i, %if.then59.i ] + %rp.2.i = phi i64 [ %rp.1.i, %if.end89.i ], [ %dc.0.i, %if.then59.i ] + %dc.1.i = phi i64 [ %inc.i, %if.end89.i ], [ %dc.0.i, %if.then59.i ] + %45 = load i8** %rpos, align 4, !tbaa !0 + %46 = load i8** %shend, align 4, !tbaa !0 + %cmp94.i = icmp ult i8* %45, %46 + br i1 %cmp94.i, label %cond.true96.i, label %cond.false100.i + +cond.true96.i: ; preds = %for.inc91.i + %incdec.ptr98.i = getelementptr inbounds i8* %45, i32 1 + store i8* %incdec.ptr98.i, i8** %rpos, align 4, !tbaa !0 + %47 = load i8* %45, align 1, !tbaa !1 + %conv99.i = zext i8 %47 to i32 + br label %for.cond48.i + +cond.false100.i: ; preds = %for.inc91.i + %call101.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond48.i + +for.end104.i: ; preds = %if.then59.i, %lor.lhs.false.i + %c.2.lcssa.i = phi i32 [ %c.2.i, %lor.lhs.false.i ], [ 46, %if.then59.i ] + %tobool105.i = icmp eq i32 %gotdig.2.i, 0 + br i1 %tobool105.i, label %if.then106.i, label %if.end137.i + +if.then106.i: ; preds = %for.end104.i + %48 = load i8** %shend, align 4, !tbaa !0 + %tobool108.i = icmp eq i8* %48, null + br i1 %tobool108.i, label %cond.end113.i, label %cond.true109.i + +cond.true109.i: ; preds = %if.then106.i + %49 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr111.i = getelementptr inbounds i8* %49, i32 -1 + store i8* %incdec.ptr111.i, i8** %rpos, align 4, !tbaa !0 + br label %cond.end113.i + +cond.end113.i: ; preds = %cond.true109.i, %if.then106.i + br i1 %tobool55, label %if.else133.i, label %if.then115.i + +if.then115.i: ; preds = %cond.end113.i + br i1 %tobool108.i, label %if.end134.i, label %cond.end122.i + +cond.end122.i: ; preds = %if.then115.i + %50 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr120.i = getelementptr inbounds i8* %50, i32 -1 + store i8* %incdec.ptr120.i, i8** %rpos, align 4, !tbaa !0 + %tobool123.i = icmp eq i32 %gotrad.0.i, 0 + br i1 %tobool123.i, label %if.end134.i, label %cond.true127.i + +cond.true127.i: ; preds = %cond.end122.i + %incdec.ptr129.i = getelementptr inbounds i8* %50, i32 -2 + store i8* %incdec.ptr129.i, i8** %rpos, align 4, !tbaa !0 + br label %if.end134.i + +if.else133.i: ; preds = %cond.end113.i + call void @__shlim(%struct._IO_FILE* %f, i32 0) #1 + br label %if.end134.i + +if.end134.i: ; preds = %if.else133.i, %cond.true127.i, %cond.end122.i, %if.then115.i + %conv135.i = sitofp i32 %sign.0 to double + %mul136.i = fmul double %conv135.i, 0.000000e+00 + br label %return + +if.end137.i: ; preds = %for.end104.i + %tobool138.i = icmp eq i32 %gotrad.0.i, 0 + %dc.0.rp.1.i = select i1 %tobool138.i, i64 %dc.0.i, i64 %rp.1.i + %cmp141103.i = icmp slt i64 %dc.0.i, 8 + br i1 %cmp141103.i, label %while.body.i, label %while.end.i + +while.body.i: ; preds = %while.body.i, %if.end137.i + %dc.2105.i = phi i64 [ %inc144.i, %while.body.i ], [ %dc.0.i, %if.end137.i ] + %x.3104.i = phi i32 [ %mul143.i, %while.body.i ], [ %x.0.i, %if.end137.i ] + %mul143.i = shl i32 %x.3104.i, 4 + %inc144.i = add nsw i64 %dc.2105.i, 1 + %cmp141.i = icmp slt i64 %inc144.i, 8 + br i1 %cmp141.i, label %while.body.i, label %while.end.i + +while.end.i: ; preds = %while.body.i, %if.end137.i + %x.3.lcssa.i = phi i32 [ %x.0.i, %if.end137.i ], [ %mul143.i, %while.body.i ] + %or145.i = or i32 %c.2.lcssa.i, 32 + %cmp146.i = icmp eq i32 %or145.i, 112 + br i1 %cmp146.i, label %if.then148.i, label %if.else165.i + +if.then148.i: ; preds = %while.end.i + %call149.i = call fastcc i64 @scanexp(%struct._IO_FILE* %f, i32 %pok) #1 + %cmp150.i = icmp eq i64 %call149.i, -9223372036854775808 + br i1 %cmp150.i, label %if.then152.i, label %if.end173.i + +if.then152.i: ; preds = %if.then148.i + br i1 %tobool55, label %if.else162.i, label %if.then154.i + +if.then154.i: ; preds = %if.then152.i + %51 = load i8** %shend, align 4, !tbaa !0 + %tobool156.i = icmp eq i8* %51, null + br i1 %tobool156.i, label %if.end173.i, label %cond.true157.i + +cond.true157.i: ; preds = %if.then154.i + %52 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr159.i = getelementptr inbounds i8* %52, i32 -1 + store i8* %incdec.ptr159.i, i8** %rpos, align 4, !tbaa !0 + br label %if.end173.i + +if.else162.i: ; preds = %if.then152.i + call void @__shlim(%struct._IO_FILE* %f, i32 0) #1 + br label %return + +if.else165.i: ; preds = %while.end.i + %53 = load i8** %shend, align 4, !tbaa !0 + %tobool167.i = icmp eq i8* %53, null + br i1 %tobool167.i, label %if.end173.i, label %cond.true168.i + +cond.true168.i: ; preds = %if.else165.i + %54 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr170.i = getelementptr inbounds i8* %54, i32 -1 + store i8* %incdec.ptr170.i, i8** %rpos, align 4, !tbaa !0 + br label %if.end173.i + +if.end173.i: ; preds = %cond.true168.i, %if.else165.i, %cond.true157.i, %if.then154.i, %if.then148.i + %e2.0.i = phi i64 [ %call149.i, %if.then148.i ], [ 0, %cond.true168.i ], [ 0, %if.else165.i ], [ 0, %if.then154.i ], [ 0, %cond.true157.i ] + %mul174.i = shl i64 %dc.0.rp.1.i, 2 + %sub175.i = add nsw i64 %mul174.i, -32 + %add176.i = add nsw i64 %sub175.i, %e2.0.i + %tobool177.i = icmp eq i32 %x.3.lcssa.i, 0 + br i1 %tobool177.i, label %if.then178.i, label %if.end181.i + +if.then178.i: ; preds = %if.end173.i + %conv179.i = sitofp i32 %sign.0 to double + %mul180.i = fmul double %conv179.i, 0.000000e+00 + br label %return + +if.end181.i: ; preds = %if.end173.i + %sub182.i = sub nsw i32 0, %emin.0.ph + %conv183.i120 = zext i32 %sub182.i to i64 + %cmp184.i = icmp sgt i64 %add176.i, %conv183.i120 + br i1 %cmp184.i, label %if.then186.i, label %if.end191.i + +if.then186.i: ; preds = %if.end181.i + %call187.i = call i32* @__errno_location() #7 + store i32 34, i32* %call187.i, align 4, !tbaa !3 + %conv188.i = sitofp i32 %sign.0 to double + %mul189.i = fmul double %conv188.i, 0x7FEFFFFFFFFFFFFF + %mul190.i = fmul double %mul189.i, 0x7FEFFFFFFFFFFFFF + br label %return + +if.end191.i: ; preds = %if.end181.i + %sub192.i = add nsw i32 %emin.0.ph, -106 + %conv193.i = sext i32 %sub192.i to i64 + %cmp194.i = icmp slt i64 %add176.i, %conv193.i + br i1 %cmp194.i, label %if.then196.i, label %while.cond202.preheader.i + +while.cond202.preheader.i: ; preds = %if.end191.i + %cmp20397.i = icmp sgt i32 %x.3.lcssa.i, -1 + br i1 %cmp20397.i, label %while.body205.i, label %while.end218.i + +if.then196.i: ; preds = %if.end191.i + %call197.i = call i32* @__errno_location() #7 + store i32 34, i32* %call197.i, align 4, !tbaa !3 + %conv198.i = sitofp i32 %sign.0 to double + %mul199.i = fmul double %conv198.i, 0x10000000000000 + %mul200.i = fmul double %mul199.i, 0x10000000000000 + br label %return + +while.body205.i: ; preds = %if.end216.i, %while.cond202.preheader.i + %e2.1100.i = phi i64 [ %dec217.i, %if.end216.i ], [ %add176.i, %while.cond202.preheader.i ] + %y.399.i = phi double [ %y.4.i, %if.end216.i ], [ %y.0.i, %while.cond202.preheader.i ] + %x.498.i = phi i32 [ %x.5.i, %if.end216.i ], [ %x.3.lcssa.i, %while.cond202.preheader.i ] + %cmp206.i = fcmp ult double %y.399.i, 5.000000e-01 + %add214.i = shl i32 %x.498.i, 1 + br i1 %cmp206.i, label %if.end216.i, label %if.then208.i + +if.then208.i: ; preds = %while.body205.i + %add210115.i = or i32 %add214.i, 1 + %sub211.i = fadd double %y.399.i, -1.000000e+00 + br label %if.end216.i + +if.end216.i: ; preds = %if.then208.i, %while.body205.i + %x.5.i = phi i32 [ %add210115.i, %if.then208.i ], [ %add214.i, %while.body205.i ] + %sub211.pn.i = phi double [ %sub211.i, %if.then208.i ], [ %y.399.i, %while.body205.i ] + %y.4.i = fadd double %y.399.i, %sub211.pn.i + %dec217.i = add nsw i64 %e2.1100.i, -1 + %cmp203.i = icmp sgt i32 %x.5.i, -1 + br i1 %cmp203.i, label %while.body205.i, label %while.end218.i + +while.end218.i: ; preds = %if.end216.i, %while.cond202.preheader.i + %e2.1.lcssa.i = phi i64 [ %add176.i, %while.cond202.preheader.i ], [ %dec217.i, %if.end216.i ] + %y.3.lcssa.i = phi double [ %y.0.i, %while.cond202.preheader.i ], [ %y.4.i, %if.end216.i ] + %x.4.lcssa.i = phi i32 [ %x.3.lcssa.i, %while.cond202.preheader.i ], [ %x.5.i, %if.end216.i ] + %conv219.i121 = zext i32 %bits.0.ph to i64 + %conv221.i = sext i32 %emin.0.ph to i64 + %add220.i = sub i64 32, %conv221.i + %sub222.i = add i64 %e2.1.lcssa.i, %add220.i + %cmp223.i = icmp sgt i64 %conv219.i121, %sub222.i + br i1 %cmp223.i, label %if.then225.i, label %if.end234.i + +if.then225.i: ; preds = %while.end218.i + %conv229.i = trunc i64 %sub222.i to i32 + %cmp230.i = icmp slt i32 %conv229.i, 0 + %.conv229.i = select i1 %cmp230.i, i32 0, i32 %conv229.i + br label %if.end234.i + +if.end234.i: ; preds = %if.then225.i, %while.end218.i + %bits.addr.0.i = phi i32 [ %.conv229.i, %if.then225.i ], [ %bits.0.ph, %while.end218.i ] + %cmp235.i = icmp slt i32 %bits.addr.0.i, 53 + br i1 %cmp235.i, label %if.end243.i, label %if.end234.if.end252_crit_edge.i + +if.end234.if.end252_crit_edge.i: ; preds = %if.end234.i + %conv253.pre.i = sitofp i32 %sign.0 to double + br label %if.end252.i + +if.end243.i: ; preds = %if.end234.i + %sub239.i = sub i32 84, %bits.addr.0.i + %call240.i = call double @scalbn(double 1.000000e+00, i32 %sub239.i) #1 + %conv241.i = sitofp i32 %sign.0 to double + %call242.i = call double @copysignl(double %call240.i, double %conv241.i) #7 + %cmp244.i = icmp slt i32 %bits.addr.0.i, 32 + %tobool247.i = fcmp une double %y.3.lcssa.i, 0.000000e+00 + %or.cond90.i = and i1 %cmp244.i, %tobool247.i + br i1 %or.cond90.i, label %land.lhs.true248.i, label %if.end252.i + +land.lhs.true248.i: ; preds = %if.end243.i + %and.i = and i32 %x.4.lcssa.i, 1 + %tobool249.i = icmp eq i32 %and.i, 0 + %55 = xor i32 %and.i, 1 + %inc251.x.4.i = add i32 %55, %x.4.lcssa.i + %.y.3.i = select i1 %tobool249.i, double 0.000000e+00, double %y.3.lcssa.i + br label %if.end252.i + +if.end252.i: ; preds = %land.lhs.true248.i, %if.end243.i, %if.end234.if.end252_crit_edge.i + %conv253.pre-phi.i = phi double [ %conv253.pre.i, %if.end234.if.end252_crit_edge.i ], [ %conv241.i, %land.lhs.true248.i ], [ %conv241.i, %if.end243.i ] + %bias.096.i = phi double [ 0.000000e+00, %if.end234.if.end252_crit_edge.i ], [ %call242.i, %land.lhs.true248.i ], [ %call242.i, %if.end243.i ] + %x.6.i = phi i32 [ %x.4.lcssa.i, %if.end234.if.end252_crit_edge.i ], [ %inc251.x.4.i, %land.lhs.true248.i ], [ %x.4.lcssa.i, %if.end243.i ] + %y.5.i = phi double [ %y.3.lcssa.i, %if.end234.if.end252_crit_edge.i ], [ %.y.3.i, %land.lhs.true248.i ], [ %y.3.lcssa.i, %if.end243.i ] + %conv254.i = uitofp i32 %x.6.i to double + %mul255.i = fmul double %conv253.pre-phi.i, %conv254.i + %add256.i = fadd double %bias.096.i, %mul255.i + %mul258.i = fmul double %conv253.pre-phi.i, %y.5.i + %add259.i = fadd double %mul258.i, %add256.i + %sub260.i = fsub double %add259.i, %bias.096.i + %tobool261.i = fcmp une double %sub260.i, 0.000000e+00 + br i1 %tobool261.i, label %if.end264.i, label %if.then262.i + +if.then262.i: ; preds = %if.end252.i + %call263.i = call i32* @__errno_location() #7 + store i32 34, i32* %call263.i, align 4, !tbaa !3 + br label %if.end264.i + +if.end264.i: ; preds = %if.then262.i, %if.end252.i + %conv265.i = trunc i64 %e2.1.lcssa.i to i32 + %call266.i = call double @scalbnl(double %sub260.i, i32 %conv265.i) #1 + br label %return + +if.end237: ; preds = %cond.end230 + %56 = load i8** %shend, align 4, !tbaa !0 + %tobool239 = icmp eq i8* %56, null + br i1 %tobool239, label %if.end245, label %cond.true240 + +cond.true240: ; preds = %if.end237 + %57 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr242 = getelementptr inbounds i8* %57, i32 -1 + store i8* %incdec.ptr242, i8** %rpos, align 4, !tbaa !0 + br label %if.end245 + +if.end245: ; preds = %cond.true240, %if.end237, %if.end216 + %c.6 = phi i32 [ %c.5, %if.end216 ], [ 48, %if.end237 ], [ 48, %cond.true240 ] + %58 = bitcast [128 x i32]* %x.i to i8* + call void @llvm.lifetime.start(i64 512, i8* %58) #1 + %sum.i = add i32 %emin.0.ph, %bits.0.ph + %sub1.i = sub i32 0, %sum.i + br label %for.cond.i85 + +for.cond.i85: ; preds = %cond.false.i91, %cond.true.i89, %if.end245 + %gotdig.0.i84 = phi i32 [ 0, %if.end245 ], [ 1, %cond.true.i89 ], [ 1, %cond.false.i91 ] + %c.addr.0.i = phi i32 [ %c.6, %if.end245 ], [ %conv.i88, %cond.true.i89 ], [ %call.i90, %cond.false.i91 ] + switch i32 %c.addr.0.i, label %if.end.i [ + i32 48, label %for.body.i86 + i32 46, label %if.then.i92 + ] + +for.body.i86: ; preds = %for.cond.i85 + %59 = load i8** %rpos, align 4, !tbaa !0 + %60 = load i8** %shend, align 4, !tbaa !0 + %cmp2.i = icmp ult i8* %59, %60 + br i1 %cmp2.i, label %cond.true.i89, label %cond.false.i91 + +cond.true.i89: ; preds = %for.body.i86 + %incdec.ptr.i87 = getelementptr inbounds i8* %59, i32 1 + store i8* %incdec.ptr.i87, i8** %rpos, align 4, !tbaa !0 + %61 = load i8* %59, align 1, !tbaa !1 + %conv.i88 = zext i8 %61 to i32 + br label %for.cond.i85 + +cond.false.i91: ; preds = %for.body.i86 + %call.i90 = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond.i85 + +if.then.i92: ; preds = %for.cond.i85 + %62 = load i8** %rpos, align 4, !tbaa !0 + %63 = load i8** %shend, align 4, !tbaa !0 + %cmp8.i = icmp ult i8* %62, %63 + br i1 %cmp8.i, label %cond.true10.i, label %cond.false14.i + +cond.true10.i: ; preds = %if.then.i92 + %incdec.ptr12.i = getelementptr inbounds i8* %62, i32 1 + store i8* %incdec.ptr12.i, i8** %rpos, align 4, !tbaa !0 + %64 = load i8* %62, align 1, !tbaa !1 + %conv13.i = zext i8 %64 to i32 + br label %for.cond18.preheader.i + +cond.false14.i: ; preds = %if.then.i92 + %call15.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond18.preheader.i + +for.cond18.preheader.i: ; preds = %cond.false14.i, %cond.true10.i + %c.addr.1.ph.i = phi i32 [ %conv13.i, %cond.true10.i ], [ %call15.i, %cond.false14.i ] + %cmp19343.i = icmp eq i32 %c.addr.1.ph.i, 48 + br i1 %cmp19343.i, label %for.body21.i, label %if.end.i + +for.body21.i: ; preds = %for.cond18.backedge.i.for.body21.i_crit_edge, %for.cond18.preheader.i + %lrp.0344.i = phi i64 [ %phitmp.i93, %for.cond18.backedge.i.for.body21.i_crit_edge ], [ -1, %for.cond18.preheader.i ] + %65 = load i8** %rpos, align 4, !tbaa !0 + %66 = load i8** %shend, align 4, !tbaa !0 + %cmp25.i = icmp ult i8* %65, %66 + br i1 %cmp25.i, label %cond.true27.i, label %cond.false31.i + +cond.true27.i: ; preds = %for.body21.i + %incdec.ptr29.i = getelementptr inbounds i8* %65, i32 1 + store i8* %incdec.ptr29.i, i8** %rpos, align 4, !tbaa !0 + %67 = load i8* %65, align 1, !tbaa !1 + %conv30.i = zext i8 %67 to i32 + br label %for.cond18.backedge.i + +cond.false31.i: ; preds = %for.body21.i + %call32.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond18.backedge.i + +for.cond18.backedge.i: ; preds = %cond.false31.i, %cond.true27.i + %c.addr.1.be.i = phi i32 [ %call32.i, %cond.false31.i ], [ %conv30.i, %cond.true27.i ] + %cmp19.i = icmp eq i32 %c.addr.1.be.i, 48 + br i1 %cmp19.i, label %for.cond18.backedge.i.for.body21.i_crit_edge, label %if.end.i + +for.cond18.backedge.i.for.body21.i_crit_edge: ; preds = %for.cond18.backedge.i + %phitmp.i93 = add i64 %lrp.0344.i, -1 + br label %for.body21.i + +if.end.i: ; preds = %for.cond18.backedge.i, %for.cond18.preheader.i, %for.cond.i85 + %lrp.1.i = phi i64 [ 0, %for.cond18.preheader.i ], [ %lrp.0344.i, %for.cond18.backedge.i ], [ 0, %for.cond.i85 ] + %gotdig.2.i94 = phi i32 [ %gotdig.0.i84, %for.cond18.preheader.i ], [ 1, %for.cond18.backedge.i ], [ %gotdig.0.i84, %for.cond.i85 ] + %gotrad.0.i95 = phi i32 [ 1, %for.cond18.preheader.i ], [ 1, %for.cond18.backedge.i ], [ 0, %for.cond.i85 ] + %c.addr.2.i = phi i32 [ %c.addr.1.ph.i, %for.cond18.preheader.i ], [ %c.addr.1.be.i, %for.cond18.backedge.i ], [ %c.addr.0.i, %for.cond.i85 ] + %arrayidx.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 0 + store i32 0, i32* %arrayidx.i, align 4, !tbaa !3 + %sub37321.i = add nsw i32 %c.addr.2.i, -48 + %cmp38322.i = icmp ult i32 %sub37321.i, 10 + %cmp40323.i = icmp eq i32 %c.addr.2.i, 46 + %or.cond2324.i = or i1 %cmp38322.i, %cmp40323.i + br i1 %or.cond2324.i, label %for.body42.lr.ph.i, label %for.end94.i + +for.body42.lr.ph.i: ; preds = %if.end.i + %arrayidx77.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 124 + br label %for.body42.i + +for.body42.i: ; preds = %for.cond36.backedge.i, %for.body42.lr.ph.i + %cmp40334.i = phi i1 [ %cmp40323.i, %for.body42.lr.ph.i ], [ %cmp40.i, %for.cond36.backedge.i ] + %sub37333.i = phi i32 [ %sub37321.i, %for.body42.lr.ph.i ], [ %sub37.i, %for.cond36.backedge.i ] + %c.addr.3332.i = phi i32 [ %c.addr.2.i, %for.body42.lr.ph.i ], [ %c.addr.3.be.i, %for.cond36.backedge.i ] + %j.0331.i = phi i32 [ 0, %for.body42.lr.ph.i ], [ %j.2.i, %for.cond36.backedge.i ] + %k.0330.i = phi i32 [ 0, %for.body42.lr.ph.i ], [ %k.2.i, %for.cond36.backedge.i ] + %gotrad.1329.i = phi i32 [ %gotrad.0.i95, %for.body42.lr.ph.i ], [ %gotrad.2.i, %for.cond36.backedge.i ] + %gotdig.3328.i = phi i32 [ %gotdig.2.i94, %for.body42.lr.ph.i ], [ %gotdig.4.i, %for.cond36.backedge.i ] + %lnz.0327.i = phi i32 [ 0, %for.body42.lr.ph.i ], [ %lnz.2.i, %for.cond36.backedge.i ] + %dc.0326.i = phi i64 [ 0, %for.body42.lr.ph.i ], [ %dc.1.i100, %for.cond36.backedge.i ] + %lrp.2325.i = phi i64 [ %lrp.1.i, %for.body42.lr.ph.i ], [ %lrp.3.i, %for.cond36.backedge.i ] + br i1 %cmp40334.i, label %if.then45.i, label %if.else.i97 + +if.then45.i: ; preds = %for.body42.i + %cond.i = icmp eq i32 %gotrad.1329.i, 0 + br i1 %cond.i, label %for.inc81.i, label %if.end97.i + +if.else.i97: ; preds = %for.body42.i + %cmp48.i = icmp slt i32 %k.0330.i, 125 + %inc.i96 = add nsw i64 %dc.0326.i, 1 + %cmp51.i = icmp ne i32 %c.addr.3332.i, 48 + br i1 %cmp48.i, label %if.then50.i, label %if.else72.i + +if.then50.i: ; preds = %if.else.i97 + %conv54.i = trunc i64 %inc.i96 to i32 + %conv54.lnz.0.i = select i1 %cmp51.i, i32 %conv54.i, i32 %lnz.0327.i + %tobool56.i = icmp eq i32 %j.0331.i, 0 + %arrayidx64.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.0330.i + br i1 %tobool56.i, label %if.end65.i, label %if.then57.i + +if.then57.i: ; preds = %if.then50.i + %68 = load i32* %arrayidx64.i, align 4, !tbaa !3 + %mul.i98 = mul i32 %68, 10 + %add59.i = add i32 %c.addr.3332.i, -48 + %sub60.i = add i32 %add59.i, %mul.i98 + br label %if.end65.i + +if.end65.i: ; preds = %if.then57.i, %if.then50.i + %storemerge.i = phi i32 [ %sub60.i, %if.then57.i ], [ %sub37333.i, %if.then50.i ] + store i32 %storemerge.i, i32* %arrayidx64.i, align 4, !tbaa !3 + %inc66.i = add nsw i32 %j.0331.i, 1 + %cmp67.i = icmp eq i32 %inc66.i, 9 + %inc70.i = zext i1 %cmp67.i to i32 + %inc70.k.0.i = add nsw i32 %inc70.i, %k.0330.i + %.inc66.i = select i1 %cmp67.i, i32 0, i32 %inc66.i + br label %for.inc81.i + +if.else72.i: ; preds = %if.else.i97 + br i1 %cmp51.i, label %if.then76.i, label %for.inc81.i + +if.then76.i: ; preds = %if.else72.i + %69 = load i32* %arrayidx77.i, align 4, !tbaa !3 + %or.i99 = or i32 %69, 1 + store i32 %or.i99, i32* %arrayidx77.i, align 4, !tbaa !3 + br label %for.inc81.i + +for.inc81.i: ; preds = %if.then76.i, %if.else72.i, %if.end65.i, %if.then45.i + %lrp.3.i = phi i64 [ %lrp.2325.i, %if.end65.i ], [ %lrp.2325.i, %if.then76.i ], [ %dc.0326.i, %if.then45.i ], [ %lrp.2325.i, %if.else72.i ] + %dc.1.i100 = phi i64 [ %inc.i96, %if.end65.i ], [ %inc.i96, %if.then76.i ], [ %dc.0326.i, %if.then45.i ], [ %inc.i96, %if.else72.i ] + %lnz.2.i = phi i32 [ %conv54.lnz.0.i, %if.end65.i ], [ %lnz.0327.i, %if.then76.i ], [ %lnz.0327.i, %if.then45.i ], [ %lnz.0327.i, %if.else72.i ] + %gotdig.4.i = phi i32 [ 1, %if.end65.i ], [ %gotdig.3328.i, %if.then76.i ], [ %gotdig.3328.i, %if.then45.i ], [ %gotdig.3328.i, %if.else72.i ] + %gotrad.2.i = phi i32 [ %gotrad.1329.i, %if.end65.i ], [ %gotrad.1329.i, %if.then76.i ], [ 1, %if.then45.i ], [ %gotrad.1329.i, %if.else72.i ] + %k.2.i = phi i32 [ %inc70.k.0.i, %if.end65.i ], [ %k.0330.i, %if.then76.i ], [ %k.0330.i, %if.then45.i ], [ %k.0330.i, %if.else72.i ] + %j.2.i = phi i32 [ %.inc66.i, %if.end65.i ], [ %j.0331.i, %if.then76.i ], [ %j.0331.i, %if.then45.i ], [ %j.0331.i, %if.else72.i ] + %70 = load i8** %rpos, align 4, !tbaa !0 + %71 = load i8** %shend, align 4, !tbaa !0 + %cmp84.i = icmp ult i8* %70, %71 + br i1 %cmp84.i, label %cond.true86.i, label %cond.false90.i + +cond.true86.i: ; preds = %for.inc81.i + %incdec.ptr88.i = getelementptr inbounds i8* %70, i32 1 + store i8* %incdec.ptr88.i, i8** %rpos, align 4, !tbaa !0 + %72 = load i8* %70, align 1, !tbaa !1 + %conv89.i = zext i8 %72 to i32 + br label %for.cond36.backedge.i + +cond.false90.i: ; preds = %for.inc81.i + %call91.i = call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond36.backedge.i + +for.cond36.backedge.i: ; preds = %cond.false90.i, %cond.true86.i + %c.addr.3.be.i = phi i32 [ %call91.i, %cond.false90.i ], [ %conv89.i, %cond.true86.i ] + %sub37.i = add nsw i32 %c.addr.3.be.i, -48 + %cmp38.i = icmp ult i32 %sub37.i, 10 + %cmp40.i = icmp eq i32 %c.addr.3.be.i, 46 + %or.cond2.i = or i1 %cmp38.i, %cmp40.i + br i1 %or.cond2.i, label %for.body42.i, label %for.end94.i + +for.end94.i: ; preds = %for.cond36.backedge.i, %if.end.i + %c.addr.3.lcssa.i = phi i32 [ %c.addr.2.i, %if.end.i ], [ %c.addr.3.be.i, %for.cond36.backedge.i ] + %j.0.lcssa.i = phi i32 [ 0, %if.end.i ], [ %j.2.i, %for.cond36.backedge.i ] + %k.0.lcssa.i = phi i32 [ 0, %if.end.i ], [ %k.2.i, %for.cond36.backedge.i ] + %gotrad.1.lcssa.i = phi i32 [ %gotrad.0.i95, %if.end.i ], [ %gotrad.2.i, %for.cond36.backedge.i ] + %gotdig.3.lcssa.i = phi i32 [ %gotdig.2.i94, %if.end.i ], [ %gotdig.4.i, %for.cond36.backedge.i ] + %lnz.0.lcssa.i = phi i32 [ 0, %if.end.i ], [ %lnz.2.i, %for.cond36.backedge.i ] + %dc.0.lcssa.i = phi i64 [ 0, %if.end.i ], [ %dc.1.i100, %for.cond36.backedge.i ] + %lrp.2.lcssa.i = phi i64 [ %lrp.1.i, %if.end.i ], [ %lrp.3.i, %for.cond36.backedge.i ] + %tobool95.i = icmp eq i32 %gotrad.1.lcssa.i, 0 + %dc.0.lrp.2.i = select i1 %tobool95.i, i64 %dc.0.lcssa.i, i64 %lrp.2.lcssa.i + br label %if.end97.i + +if.end97.i: ; preds = %for.end94.i, %if.then45.i + %c.addr.3320.i = phi i32 [ %c.addr.3.lcssa.i, %for.end94.i ], [ %c.addr.3332.i, %if.then45.i ] + %j.0318.i = phi i32 [ %j.0.lcssa.i, %for.end94.i ], [ %j.0331.i, %if.then45.i ] + %k.0316.i = phi i32 [ %k.0.lcssa.i, %for.end94.i ], [ %k.0330.i, %if.then45.i ] + %gotdig.3313.i = phi i32 [ %gotdig.3.lcssa.i, %for.end94.i ], [ %gotdig.3328.i, %if.then45.i ] + %lnz.0311.i = phi i32 [ %lnz.0.lcssa.i, %for.end94.i ], [ %lnz.0327.i, %if.then45.i ] + %dc.0309.i = phi i64 [ %dc.0.lcssa.i, %for.end94.i ], [ %dc.0326.i, %if.then45.i ] + %lrp.4.i = phi i64 [ %dc.0.lrp.2.i, %for.end94.i ], [ %lrp.2325.i, %if.then45.i ] + %tobool98.i = icmp ne i32 %gotdig.3313.i, 0 + br i1 %tobool98.i, label %land.lhs.true.i, label %if.else120.i + +land.lhs.true.i: ; preds = %if.end97.i + %or99.i = or i32 %c.addr.3320.i, 32 + %cmp100.i = icmp eq i32 %or99.i, 101 + br i1 %cmp100.i, label %if.then102.i, label %if.else120.i + +if.then102.i: ; preds = %land.lhs.true.i + %call103.i = call fastcc i64 @scanexp(%struct._IO_FILE* %f, i32 %pok) #1 + %cmp104.i = icmp eq i64 %call103.i, -9223372036854775808 + br i1 %cmp104.i, label %if.then106.i101, label %if.end118.i + +if.then106.i101: ; preds = %if.then102.i + br i1 %tobool55, label %if.else116.i, label %if.then108.i + +if.then108.i: ; preds = %if.then106.i101 + %73 = load i8** %shend, align 4, !tbaa !0 + %tobool110.i = icmp eq i8* %73, null + br i1 %tobool110.i, label %if.end118.i, label %cond.true111.i + +cond.true111.i: ; preds = %if.then108.i + %74 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr113.i = getelementptr inbounds i8* %74, i32 -1 + store i8* %incdec.ptr113.i, i8** %rpos, align 4, !tbaa !0 + br label %if.end118.i + +if.else116.i: ; preds = %if.then106.i101 + call void @__shlim(%struct._IO_FILE* %f, i32 0) #1 + br label %return + +if.end118.i: ; preds = %cond.true111.i, %if.then108.i, %if.then102.i + %e10.0.i = phi i64 [ %call103.i, %if.then102.i ], [ 0, %if.then108.i ], [ 0, %cond.true111.i ] + %add119.i = add nsw i64 %e10.0.i, %lrp.4.i + br label %if.end132.i + +if.else120.i: ; preds = %land.lhs.true.i, %if.end97.i + %cmp121.i = icmp sgt i32 %c.addr.3320.i, -1 + br i1 %cmp121.i, label %if.then123.i, label %if.end132.i + +if.then123.i: ; preds = %if.else120.i + %75 = load i8** %shend, align 4, !tbaa !0 + %tobool125.i = icmp eq i8* %75, null + br i1 %tobool125.i, label %if.end132.i, label %cond.true126.i + +cond.true126.i: ; preds = %if.then123.i + %76 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr128.i = getelementptr inbounds i8* %76, i32 -1 + store i8* %incdec.ptr128.i, i8** %rpos, align 4, !tbaa !0 + br label %if.end132.i + +if.end132.i: ; preds = %cond.true126.i, %if.then123.i, %if.else120.i, %if.end118.i + %lrp.5.i = phi i64 [ %add119.i, %if.end118.i ], [ %lrp.4.i, %cond.true126.i ], [ %lrp.4.i, %if.then123.i ], [ %lrp.4.i, %if.else120.i ] + br i1 %tobool98.i, label %if.end136.i, label %if.then134.i + +if.then134.i: ; preds = %if.end132.i + %call135.i = call i32* @__errno_location() #7 + store i32 22, i32* %call135.i, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f, i32 0) #1 + br label %return + +if.end136.i: ; preds = %if.end132.i + %77 = load i32* %arrayidx.i, align 4, !tbaa !3 + %tobool138.i102 = icmp eq i32 %77, 0 + br i1 %tobool138.i102, label %if.then139.i, label %if.end142.i + +if.then139.i: ; preds = %if.end136.i + %conv140.i = sitofp i32 %sign.0 to double + %mul141.i = fmul double %conv140.i, 0.000000e+00 + br label %return + +if.end142.i: ; preds = %if.end136.i + %cmp143.i = icmp eq i64 %lrp.5.i, %dc.0309.i + %cmp146.i103 = icmp slt i64 %dc.0309.i, 10 + %or.cond.i104 = and i1 %cmp143.i, %cmp146.i103 + br i1 %or.cond.i104, label %land.lhs.true148.i, label %if.end159.i + +land.lhs.true148.i: ; preds = %if.end142.i + %cmp149.i = icmp ugt i32 %bits.0.ph, 30 + br i1 %cmp149.i, label %if.then154.i106, label %lor.lhs.false.i105 + +lor.lhs.false.i105: ; preds = %land.lhs.true148.i + %shr.i = lshr i32 %77, %bits.0.ph + %cmp152.i = icmp eq i32 %shr.i, 0 + br i1 %cmp152.i, label %if.then154.i106, label %if.end159.i + +if.then154.i106: ; preds = %lor.lhs.false.i105, %land.lhs.true148.i + %conv155.i = sitofp i32 %sign.0 to double + %conv157.i = uitofp i32 %77 to double + %mul158.i = fmul double %conv155.i, %conv157.i + br label %return + +if.end159.i: ; preds = %lor.lhs.false.i105, %if.end142.i + %div.i107 = sdiv i32 %emin.0.ph, -2 + %conv161.i = sext i32 %div.i107 to i64 + %cmp162.i = icmp sgt i64 %lrp.5.i, %conv161.i + br i1 %cmp162.i, label %if.then164.i, label %if.end169.i + +if.then164.i: ; preds = %if.end159.i + %call165.i = call i32* @__errno_location() #7 + store i32 34, i32* %call165.i, align 4, !tbaa !3 + %conv166.i = sitofp i32 %sign.0 to double + %mul167.i = fmul double %conv166.i, 0x7FEFFFFFFFFFFFFF + %mul168.i = fmul double %mul167.i, 0x7FEFFFFFFFFFFFFF + br label %return + +if.end169.i: ; preds = %if.end159.i + %sub170.i = add nsw i32 %emin.0.ph, -106 + %conv171.i = sext i32 %sub170.i to i64 + %cmp172.i = icmp slt i64 %lrp.5.i, %conv171.i + br i1 %cmp172.i, label %if.then174.i, label %if.end179.i + +if.then174.i: ; preds = %if.end169.i + %call175.i = call i32* @__errno_location() #7 + store i32 34, i32* %call175.i, align 4, !tbaa !3 + %conv176.i = sitofp i32 %sign.0 to double + %mul177.i = fmul double %conv176.i, 0x10000000000000 + %mul178.i = fmul double %mul177.i, 0x10000000000000 + br label %return + +if.end179.i: ; preds = %if.end169.i + %tobool180.i = icmp eq i32 %j.0318.i, 0 + br i1 %tobool180.i, label %if.end192.i, label %for.cond182.preheader.i + +for.cond182.preheader.i: ; preds = %if.end179.i + %cmp183304.i = icmp slt i32 %j.0318.i, 9 + br i1 %cmp183304.i, label %for.body185.lr.ph.i, label %for.end190.i + +for.body185.lr.ph.i: ; preds = %for.cond182.preheader.i + %arrayidx186.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.0316.i + %arrayidx186.promoted.i = load i32* %arrayidx186.i, align 4, !tbaa !3 + br label %for.body185.i + +for.body185.i: ; preds = %for.body185.i, %for.body185.lr.ph.i + %mul187306.i = phi i32 [ %arrayidx186.promoted.i, %for.body185.lr.ph.i ], [ %mul187.i, %for.body185.i ] + %j.3305.i = phi i32 [ %j.0318.i, %for.body185.lr.ph.i ], [ %inc189.i, %for.body185.i ] + %mul187.i = mul i32 %mul187306.i, 10 + %inc189.i = add nsw i32 %j.3305.i, 1 + %exitcond.i = icmp eq i32 %inc189.i, 9 + br i1 %exitcond.i, label %for.cond182.for.end190_crit_edge.i, label %for.body185.i + +for.cond182.for.end190_crit_edge.i: ; preds = %for.body185.i + store i32 %mul187.i, i32* %arrayidx186.i, align 4, !tbaa !3 + br label %for.end190.i + +for.end190.i: ; preds = %for.cond182.for.end190_crit_edge.i, %for.cond182.preheader.i + %inc191.i = add nsw i32 %k.0316.i, 1 + br label %if.end192.i + +if.end192.i: ; preds = %for.end190.i, %if.end179.i + %k.3.i = phi i32 [ %inc191.i, %for.end190.i ], [ %k.0316.i, %if.end179.i ] + %conv193.i108 = trunc i64 %lrp.5.i to i32 + %cmp194.i109 = icmp slt i32 %lnz.0311.i, 9 + br i1 %cmp194.i109, label %land.lhs.true196.i, label %if.end243.i111 + +land.lhs.true196.i: ; preds = %if.end192.i + %cmp197.i = icmp sle i32 %lnz.0311.i, %conv193.i108 + %cmp200.i = icmp slt i32 %conv193.i108, 18 + %or.cond1.i = and i1 %cmp197.i, %cmp200.i + br i1 %or.cond1.i, label %if.then202.i, label %if.end243.i111 + +if.then202.i: ; preds = %land.lhs.true196.i + %cmp203.i110 = icmp eq i32 %conv193.i108, 9 + br i1 %cmp203.i110, label %if.then205.i, label %if.end210.i + +if.then205.i: ; preds = %if.then202.i + %conv206.i = sitofp i32 %sign.0 to double + %78 = load i32* %arrayidx.i, align 4, !tbaa !3 + %conv208.i = uitofp i32 %78 to double + %mul209.i = fmul double %conv206.i, %conv208.i + br label %return + +if.end210.i: ; preds = %if.then202.i + %cmp211.i = icmp slt i32 %conv193.i108, 9 + br i1 %cmp211.i, label %if.then213.i, label %if.end222.i + +if.then213.i: ; preds = %if.end210.i + %conv214.i = sitofp i32 %sign.0 to double + %79 = load i32* %arrayidx.i, align 4, !tbaa !3 + %conv216.i = uitofp i32 %79 to double + %mul217.i = fmul double %conv214.i, %conv216.i + %sub218.i = sub nsw i32 8, %conv193.i108 + %arrayidx219.i = getelementptr inbounds [8 x i32]* @decfloat.p10s, i32 0, i32 %sub218.i + %80 = load i32* %arrayidx219.i, align 4, !tbaa !3 + %conv220.i = sitofp i32 %80 to double + %div221.i = fdiv double %mul217.i, %conv220.i + br label %return + +if.end222.i: ; preds = %if.end210.i + %81 = mul i32 %conv193.i108, -3 + %mul224.neg.i = add i32 %bits.0.ph, 27 + %sub225.i = add i32 %mul224.neg.i, %81 + %cmp226.i = icmp sgt i32 %sub225.i, 30 + %.pre.i = load i32* %arrayidx.i, align 4, !tbaa !3 + br i1 %cmp226.i, label %if.then233.i, label %lor.lhs.false228.i + +lor.lhs.false228.i: ; preds = %if.end222.i + %shr230.i = lshr i32 %.pre.i, %sub225.i + %cmp231.i = icmp eq i32 %shr230.i, 0 + br i1 %cmp231.i, label %if.then233.i, label %if.end243.i111 + +if.then233.i: ; preds = %lor.lhs.false228.i, %if.end222.i + %conv234.i = sitofp i32 %sign.0 to double + %conv236.i = uitofp i32 %.pre.i to double + %mul237.i = fmul double %conv234.i, %conv236.i + %sub238.i = add nsw i32 %conv193.i108, -10 + %arrayidx239.i = getelementptr inbounds [8 x i32]* @decfloat.p10s, i32 0, i32 %sub238.i + %82 = load i32* %arrayidx239.i, align 4, !tbaa !3 + %conv240.i = sitofp i32 %82 to double + %mul241.i = fmul double %mul237.i, %conv240.i + br label %return + +if.end243.i111: ; preds = %lor.lhs.false228.i, %land.lhs.true196.i, %if.end192.i + %rem.i = srem i32 %conv193.i108, 9 + %tobool244.i = icmp eq i32 %rem.i, 0 + br i1 %tobool244.i, label %while.cond.outer.i, label %if.then245.i + +if.then245.i: ; preds = %if.end243.i111 + %cmp246.i = icmp sgt i32 %conv193.i108, -1 + %add252.i = add nsw i32 %rem.i, 9 + %cond254.i = select i1 %cmp246.i, i32 %rem.i, i32 %add252.i + %sub255.i = sub nsw i32 8, %cond254.i + %arrayidx256.i = getelementptr inbounds [8 x i32]* @decfloat.p10s, i32 0, i32 %sub255.i + %83 = load i32* %arrayidx256.i, align 4, !tbaa !3 + %cmp258296.i = icmp eq i32 %k.3.i, 0 + br i1 %cmp258296.i, label %if.end285.i, label %for.body260.lr.ph.i + +for.body260.lr.ph.i: ; preds = %if.then245.i + %div267.i = sdiv i32 1000000000, %83 + br label %for.body260.i + +for.body260.i: ; preds = %for.inc278.i, %for.body260.lr.ph.i + %carry.0300.i = phi i32 [ 0, %for.body260.lr.ph.i ], [ %mul268.i, %for.inc278.i ] + %k.4299.i = phi i32 [ 0, %for.body260.lr.ph.i ], [ %add275.i, %for.inc278.i ] + %a.0298.i = phi i32 [ 0, %for.body260.lr.ph.i ], [ %a.1.i, %for.inc278.i ] + %rp.0297.i = phi i32 [ %conv193.i108, %for.body260.lr.ph.i ], [ %rp.1.i113, %for.inc278.i ] + %arrayidx261.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.4299.i + %84 = load i32* %arrayidx261.i, align 4, !tbaa !3 + %rem262.i = urem i32 %84, %83 + %div264.i = udiv i32 %84, %83 + %add265.i = add i32 %div264.i, %carry.0300.i + store i32 %add265.i, i32* %arrayidx261.i, align 4, !tbaa !3 + %mul268.i = mul i32 %rem262.i, %div267.i + %cmp269.i = icmp eq i32 %k.4299.i, %a.0298.i + %tobool273.i = icmp eq i32 %add265.i, 0 + %or.cond223.i = and i1 %cmp269.i, %tobool273.i + %add275.i = add nsw i32 %k.4299.i, 1 + br i1 %or.cond223.i, label %if.then274.i, label %for.inc278.i + +if.then274.i: ; preds = %for.body260.i + %and.i112 = and i32 %add275.i, 127 + %sub276.i = add nsw i32 %rp.0297.i, -9 + br label %for.inc278.i + +for.inc278.i: ; preds = %if.then274.i, %for.body260.i + %rp.1.i113 = phi i32 [ %sub276.i, %if.then274.i ], [ %rp.0297.i, %for.body260.i ] + %a.1.i = phi i32 [ %and.i112, %if.then274.i ], [ %a.0298.i, %for.body260.i ] + %cmp258.i = icmp eq i32 %add275.i, %k.3.i + br i1 %cmp258.i, label %for.end280.i, label %for.body260.i + +for.end280.i: ; preds = %for.inc278.i + %tobool281.i = icmp eq i32 %mul268.i, 0 + br i1 %tobool281.i, label %if.end285.i, label %if.then282.i + +if.then282.i: ; preds = %for.end280.i + %inc283.i = add nsw i32 %k.3.i, 1 + %arrayidx284.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.3.i + store i32 %mul268.i, i32* %arrayidx284.i, align 4, !tbaa !3 + br label %if.end285.i + +if.end285.i: ; preds = %if.then282.i, %for.end280.i, %if.then245.i + %rp.0.lcssa377.i = phi i32 [ %rp.1.i113, %if.then282.i ], [ %rp.1.i113, %for.end280.i ], [ %conv193.i108, %if.then245.i ] + %a.0.lcssa376.i = phi i32 [ %a.1.i, %if.then282.i ], [ %a.1.i, %for.end280.i ], [ 0, %if.then245.i ] + %z.0.i = phi i32 [ %inc283.i, %if.then282.i ], [ %k.3.i, %for.end280.i ], [ 0, %if.then245.i ] + %sub286.i = sub i32 9, %cond254.i + %add287.i = add nsw i32 %sub286.i, %rp.0.lcssa377.i + br label %while.cond.outer.i + +while.cond.outer.i: ; preds = %if.end357.i, %if.end285.i, %if.end243.i111 + %rp.2.ph247.i = phi i32 [ %add344.i, %if.end357.i ], [ %add287.i, %if.end285.i ], [ %conv193.i108, %if.end243.i111 ] + %e2.0.ph.i = phi i32 [ %sub300.lcssa.i, %if.end357.i ], [ 0, %if.end285.i ], [ 0, %if.end243.i111 ] + %z.1.ph248.i = phi i32 [ %z.4.i, %if.end357.i ], [ %z.0.i, %if.end285.i ], [ %k.3.i, %if.end243.i111 ] + %a.2.ph249.i = phi i32 [ %and346.i, %if.end357.i ], [ %a.0.lcssa376.i, %if.end285.i ], [ 0, %if.end243.i111 ] + %cmp289.i = icmp slt i32 %rp.2.ph247.i, 18 + %arrayidx294.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %a.2.ph249.i + br i1 %cmp289.i, label %while.body.us.i, label %while.cond.outer.while.cond.outer.split_crit_edge.i + +while.cond.outer.while.cond.outer.split_crit_edge.i: ; preds = %while.cond.outer.i + %cmp292.i = icmp eq i32 %rp.2.ph247.i, 18 + br i1 %cmp292.i, label %land.rhs.us256.i, label %for.cond360.outer.i + +while.body.us.i: ; preds = %for.end341.us.i, %while.cond.outer.i + %e2.0.us.i = phi i32 [ %sub300.us.i, %for.end341.us.i ], [ %e2.0.ph.i, %while.cond.outer.i ] + %z.1.us.i = phi i32 [ %z.3.us.i, %for.end341.us.i ], [ %z.1.ph248.i, %while.cond.outer.i ] + %sub301.us.i = add nsw i32 %z.1.us.i, 127 + br label %for.cond303.us.i + +for.cond303.us.i: ; preds = %if.end333.us.i, %while.body.us.i + %z.2.us.i = phi i32 [ %z.1.us.i, %while.body.us.i ], [ %z.3.us.i, %if.end333.us.i ] + %k.5.in.us.i = phi i32 [ %sub301.us.i, %while.body.us.i ], [ %sub339.us.i, %if.end333.us.i ] + %carry299.0.us.i = phi i32 [ 0, %while.body.us.i ], [ %carry299.1.us.i, %if.end333.us.i ] + %k.5.us.i = and i32 %k.5.in.us.i, 127 + %arrayidx306.us.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.5.us.i + %85 = load i32* %arrayidx306.us.i, align 4, !tbaa !3 + %conv307.us.i = zext i32 %85 to i64 + %shl.us.i = shl nuw nsw i64 %conv307.us.i, 29 + %conv308.us.i = zext i32 %carry299.0.us.i to i64 + %add309.us.i = add i64 %shl.us.i, %conv308.us.i + %cmp310.us.i = icmp ugt i64 %add309.us.i, 1000000000 + %extract.t231.us.i = trunc i64 %add309.us.i to i32 + br i1 %cmp310.us.i, label %if.then312.us.i, label %if.end321.us.i + +if.then312.us.i: ; preds = %for.cond303.us.i + %div313.us.i = udiv i64 %add309.us.i, 1000000000 + %conv314.us.i = trunc i64 %div313.us.i to i32 + %rem315.us.i = urem i64 %add309.us.i, 1000000000 + %extract.t.us.i = trunc i64 %rem315.us.i to i32 + br label %if.end321.us.i + +if.end321.us.i: ; preds = %if.then312.us.i, %for.cond303.us.i + %rem315.sink.off0.us.i = phi i32 [ %extract.t.us.i, %if.then312.us.i ], [ %extract.t231.us.i, %for.cond303.us.i ] + %carry299.1.us.i = phi i32 [ %conv314.us.i, %if.then312.us.i ], [ 0, %for.cond303.us.i ] + store i32 %rem315.sink.off0.us.i, i32* %arrayidx306.us.i, align 4, !tbaa !3 + %sub322.us.i = add nsw i32 %z.2.us.i, 127 + %and323.us.i = and i32 %sub322.us.i, 127 + %cmp324.us.i = icmp ne i32 %k.5.us.i, %and323.us.i + %cmp327.us.i = icmp eq i32 %k.5.us.i, %a.2.ph249.i + %or.cond224.us.i = or i1 %cmp324.us.i, %cmp327.us.i + br i1 %or.cond224.us.i, label %if.end333.us.i, label %land.lhs.true329.us.i + +land.lhs.true329.us.i: ; preds = %if.end321.us.i + %tobool331.us.i = icmp eq i32 %rem315.sink.off0.us.i, 0 + %k.5.z.2.us.i = select i1 %tobool331.us.i, i32 %k.5.us.i, i32 %z.2.us.i + br label %if.end333.us.i + +if.end333.us.i: ; preds = %land.lhs.true329.us.i, %if.end321.us.i + %z.3.us.i = phi i32 [ %z.2.us.i, %if.end321.us.i ], [ %k.5.z.2.us.i, %land.lhs.true329.us.i ] + %sub339.us.i = add nsw i32 %k.5.us.i, -1 + br i1 %cmp327.us.i, label %for.end341.us.i, label %for.cond303.us.i + +for.end341.us.i: ; preds = %if.end333.us.i + %sub300.us.i = add nsw i32 %e2.0.us.i, -29 + %tobool342.us.i = icmp eq i32 %carry299.1.us.i, 0 + br i1 %tobool342.us.i, label %while.body.us.i, label %if.then343.i + +land.rhs.us256.i: ; preds = %for.end341.us292.i, %while.cond.outer.while.cond.outer.split_crit_edge.i + %e2.0.us253.i = phi i32 [ %e2.0.ph.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ], [ %sub300.us259.i, %for.end341.us292.i ] + %z.1.us254.i = phi i32 [ %z.1.ph248.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ], [ %z.3.us290.i, %for.end341.us292.i ] + %86 = load i32* %arrayidx294.i, align 4, !tbaa !3 + %cmp295.us257.i = icmp ult i32 %86, 9007199 + br i1 %cmp295.us257.i, label %while.body.us258.i, label %for.cond360.outer.i + +while.body.us258.i: ; preds = %land.rhs.us256.i + %sub301.us260.i = add nsw i32 %z.1.us254.i, 127 + br label %for.cond303.us261.i + +for.cond303.us261.i: ; preds = %if.end333.us289.i, %while.body.us258.i + %z.2.us262.i = phi i32 [ %z.1.us254.i, %while.body.us258.i ], [ %z.3.us290.i, %if.end333.us289.i ] + %k.5.in.us263.i = phi i32 [ %sub301.us260.i, %while.body.us258.i ], [ %sub339.us291.i, %if.end333.us289.i ] + %carry299.0.us264.i = phi i32 [ 0, %while.body.us258.i ], [ %carry299.1.us280.i, %if.end333.us289.i ] + %k.5.us265.i = and i32 %k.5.in.us263.i, 127 + %arrayidx306.us266.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.5.us265.i + %87 = load i32* %arrayidx306.us266.i, align 4, !tbaa !3 + %conv307.us267.i = zext i32 %87 to i64 + %shl.us268.i = shl nuw nsw i64 %conv307.us267.i, 29 + %conv308.us269.i = zext i32 %carry299.0.us264.i to i64 + %add309.us270.i = add i64 %shl.us268.i, %conv308.us269.i + %cmp310.us271.i = icmp ugt i64 %add309.us270.i, 1000000000 + %extract.t231.us272.i = trunc i64 %add309.us270.i to i32 + br i1 %cmp310.us271.i, label %if.then312.us273.i, label %if.end321.us278.i + +if.then312.us273.i: ; preds = %for.cond303.us261.i + %div313.us274.i = udiv i64 %add309.us270.i, 1000000000 + %conv314.us275.i = trunc i64 %div313.us274.i to i32 + %rem315.us276.i = urem i64 %add309.us270.i, 1000000000 + %extract.t.us277.i = trunc i64 %rem315.us276.i to i32 + br label %if.end321.us278.i + +if.end321.us278.i: ; preds = %if.then312.us273.i, %for.cond303.us261.i + %rem315.sink.off0.us279.i = phi i32 [ %extract.t.us277.i, %if.then312.us273.i ], [ %extract.t231.us272.i, %for.cond303.us261.i ] + %carry299.1.us280.i = phi i32 [ %conv314.us275.i, %if.then312.us273.i ], [ 0, %for.cond303.us261.i ] + store i32 %rem315.sink.off0.us279.i, i32* %arrayidx306.us266.i, align 4, !tbaa !3 + %sub322.us281.i = add nsw i32 %z.2.us262.i, 127 + %and323.us282.i = and i32 %sub322.us281.i, 127 + %cmp324.us283.i = icmp ne i32 %k.5.us265.i, %and323.us282.i + %cmp327.us284.i = icmp eq i32 %k.5.us265.i, %a.2.ph249.i + %or.cond224.us285.i = or i1 %cmp324.us283.i, %cmp327.us284.i + br i1 %or.cond224.us285.i, label %if.end333.us289.i, label %land.lhs.true329.us286.i + +land.lhs.true329.us286.i: ; preds = %if.end321.us278.i + %tobool331.us287.i = icmp eq i32 %rem315.sink.off0.us279.i, 0 + %k.5.z.2.us288.i = select i1 %tobool331.us287.i, i32 %k.5.us265.i, i32 %z.2.us262.i + br label %if.end333.us289.i + +if.end333.us289.i: ; preds = %land.lhs.true329.us286.i, %if.end321.us278.i + %z.3.us290.i = phi i32 [ %z.2.us262.i, %if.end321.us278.i ], [ %k.5.z.2.us288.i, %land.lhs.true329.us286.i ] + %sub339.us291.i = add nsw i32 %k.5.us265.i, -1 + br i1 %cmp327.us284.i, label %for.end341.us292.i, label %for.cond303.us261.i + +for.end341.us292.i: ; preds = %if.end333.us289.i + %sub300.us259.i = add nsw i32 %e2.0.us253.i, -29 + %tobool342.us295.i = icmp eq i32 %carry299.1.us280.i, 0 + br i1 %tobool342.us295.i, label %land.rhs.us256.i, label %if.then343.i + +if.then343.i: ; preds = %for.end341.us292.i, %for.end341.us.i + %carry299.1.lcssa.lcssa.i = phi i32 [ %carry299.1.us280.i, %for.end341.us292.i ], [ %carry299.1.us.i, %for.end341.us.i ] + %z.3.lcssa.lcssa.i = phi i32 [ %z.3.us290.i, %for.end341.us292.i ], [ %z.3.us.i, %for.end341.us.i ] + %sub300.lcssa.i = phi i32 [ %sub300.us259.i, %for.end341.us292.i ], [ %sub300.us.i, %for.end341.us.i ] + %add344.i = add nsw i32 %rp.2.ph247.i, 9 + %sub345.i = add nsw i32 %a.2.ph249.i, 127 + %and346.i = and i32 %sub345.i, 127 + %cmp347.i = icmp eq i32 %and346.i, %z.3.lcssa.lcssa.i + br i1 %cmp347.i, label %if.then349.i, label %if.end357.i + +if.then349.i: ; preds = %if.then343.i + %sub350.i = add nsw i32 %z.3.lcssa.lcssa.i, 127 + %and351.i = and i32 %sub350.i, 127 + %arrayidx352.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and351.i + %88 = load i32* %arrayidx352.i, align 4, !tbaa !3 + %sub353.i = add nsw i32 %z.3.lcssa.lcssa.i, 126 + %and354.i = and i32 %sub353.i, 127 + %arrayidx355.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and354.i + %89 = load i32* %arrayidx355.i, align 4, !tbaa !3 + %or356.i = or i32 %89, %88 + store i32 %or356.i, i32* %arrayidx355.i, align 4, !tbaa !3 + br label %if.end357.i + +if.end357.i: ; preds = %if.then349.i, %if.then343.i + %z.4.i = phi i32 [ %and351.i, %if.then349.i ], [ %z.3.lcssa.lcssa.i, %if.then343.i ] + %arrayidx358.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and346.i + store i32 %carry299.1.lcssa.lcssa.i, i32* %arrayidx358.i, align 4, !tbaa !3 + br label %while.cond.outer.i + +for.cond360.i: ; preds = %for.cond360.i.outer, %if.end396.i + %e2.1.i = phi i32 [ %add401.i, %if.end396.i ], [ %e2.1.i.ph, %for.cond360.i.outer ] + %a.3.i = phi i32 [ %z.5.ph.i, %if.end396.i ], [ %a.3.i.ph, %for.cond360.i.outer ] + br label %for.body367.i + +for.cond364.i: ; preds = %if.end378.i + %cmp365.i = icmp slt i32 %inc388.i, 2 + br i1 %cmp365.i, label %for.body367.i, label %for.end389.i + +for.body367.i: ; preds = %for.cond364.i, %for.cond360.i + %i.0235.i = phi i32 [ 0, %for.cond360.i ], [ %inc388.i, %for.cond364.i ] + %add368.i = add nsw i32 %i.0235.i, %a.3.i + %and369.i = and i32 %add368.i, 127 + %cmp370.i = icmp eq i32 %and369.i, %z.5.ph.i + br i1 %cmp370.i, label %for.end389.i, label %lor.lhs.false372.i + +lor.lhs.false372.i: ; preds = %for.body367.i + %arrayidx373.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and369.i + %90 = load i32* %arrayidx373.i, align 4, !tbaa !3 + %arrayidx374.i = getelementptr inbounds [2 x i32]* @decfloat.th, i32 0, i32 %i.0235.i + %91 = load i32* %arrayidx374.i, align 4, !tbaa !3 + %cmp375.i = icmp ult i32 %90, %91 + br i1 %cmp375.i, label %for.end389.i, label %if.end378.i + +if.end378.i: ; preds = %lor.lhs.false372.i + %cmp383.i = icmp ugt i32 %90, %91 + %inc388.i = add nsw i32 %i.0235.i, 1 + br i1 %cmp383.i, label %for.end389.i, label %for.cond364.i + +for.end389.i: ; preds = %if.end378.i, %lor.lhs.false372.i, %for.body367.i, %for.cond364.i + %i.1.i = phi i32 [ %i.0235.i, %if.end378.i ], [ %inc388.i, %for.cond364.i ], [ 2, %lor.lhs.false372.i ], [ 2, %for.body367.i ] + %cmp390.i = icmp eq i32 %i.1.i, 2 + %or.cond225.i = and i1 %cmp390.i, %cmp393.i + br i1 %or.cond225.i, label %for.cond451.preheader.i, label %if.end396.i + +for.cond451.preheader.i: ; preds = %for.end389.i + %and456.i = and i32 %a.3.i, 127 + %cmp457.i = icmp eq i32 %and456.i, %z.5.ph.i + br i1 %cmp457.i, label %if.then459.i, label %if.end464.i + +if.end396.i: ; preds = %for.end389.i + %add401.i = add nsw i32 %..i, %e2.1.i + %cmp403236.i = icmp eq i32 %a.3.i, %z.5.ph.i + br i1 %cmp403236.i, label %for.cond360.i, label %for.body405.lr.ph.i + +for.body405.lr.ph.i: ; preds = %if.end396.i + %shl409.i = shl i32 1, %..i + %sub410.i = add nsw i32 %shl409.i, -1 + %shr416.i = lshr i32 1000000000, %..i + br label %for.body405.i + +for.body405.i: ; preds = %for.body405.i, %for.body405.lr.ph.i + %carry362.0241.i = phi i32 [ 0, %for.body405.lr.ph.i ], [ %mul417.i, %for.body405.i ] + %k.6239.i = phi i32 [ %a.3.i, %for.body405.lr.ph.i ], [ %and425.i, %for.body405.i ] + %a.4238.i = phi i32 [ %a.3.i, %for.body405.lr.ph.i ], [ %a.5.i, %for.body405.i ] + %rp.4237.i = phi i32 [ %rp.3.i.ph, %for.body405.lr.ph.i ], [ %rp.5.i, %for.body405.i ] + %arrayidx408.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %k.6239.i + %92 = load i32* %arrayidx408.i, align 4, !tbaa !3 + %and411.i = and i32 %92, %sub410.i + %shr413.i = lshr i32 %92, %..i + %add414.i = add i32 %shr413.i, %carry362.0241.i + store i32 %add414.i, i32* %arrayidx408.i, align 4, !tbaa !3 + %mul417.i = mul i32 %and411.i, %shr416.i + %cmp418.i = icmp eq i32 %k.6239.i, %a.4238.i + %tobool422.i = icmp eq i32 %add414.i, 0 + %or.cond226.i = and i1 %cmp418.i, %tobool422.i + %add424.i = add nsw i32 %k.6239.i, 1 + %and425.i = and i32 %add424.i, 127 + %sub427.i = add nsw i32 %rp.4237.i, -9 + %rp.5.i = select i1 %or.cond226.i, i32 %sub427.i, i32 %rp.4237.i + %a.5.i = select i1 %or.cond226.i, i32 %and425.i, i32 %a.4238.i + %cmp403.i = icmp eq i32 %and425.i, %z.5.ph.i + br i1 %cmp403.i, label %for.end432.i, label %for.body405.i + +for.end432.i: ; preds = %for.body405.i + %tobool433.i = icmp eq i32 %mul417.i, 0 + br i1 %tobool433.i, label %for.cond360.i.outer, label %if.then434.i + +if.then434.i: ; preds = %for.end432.i + %cmp437.i = icmp eq i32 %and436.i, %a.5.i + br i1 %cmp437.i, label %if.else443.i, label %if.then439.i + +if.then439.i: ; preds = %if.then434.i + %arrayidx440.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %z.5.ph.i + store i32 %mul417.i, i32* %arrayidx440.i, align 4, !tbaa !3 + br label %for.cond360.outer.i + +for.cond360.outer.i: ; preds = %if.then439.i, %land.rhs.us256.i, %while.cond.outer.while.cond.outer.split_crit_edge.i + %rp.3.ph244.i = phi i32 [ %rp.5.i, %if.then439.i ], [ 18, %land.rhs.us256.i ], [ %rp.2.ph247.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ] + %e2.1.ph.i = phi i32 [ %add401.i, %if.then439.i ], [ %e2.0.us253.i, %land.rhs.us256.i ], [ %e2.0.ph.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ] + %z.5.ph.i = phi i32 [ %and436.i, %if.then439.i ], [ %z.1.us254.i, %land.rhs.us256.i ], [ %z.1.ph248.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ] + %a.3.ph.i = phi i32 [ %a.5.i, %if.then439.i ], [ %a.2.ph249.i, %land.rhs.us256.i ], [ %a.2.ph249.i, %while.cond.outer.while.cond.outer.split_crit_edge.i ] + %add435.i = add nsw i32 %z.5.ph.i, 1 + %and436.i = and i32 %add435.i, 127 + %sub444.i = add nsw i32 %z.5.ph.i, 127 + %and445.i = and i32 %sub444.i, 127 + %arrayidx446.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and445.i + br label %for.cond360.i.outer + +for.cond360.i.outer: ; preds = %if.else443.i, %for.cond360.outer.i, %for.end432.i + %rp.3.i.ph = phi i32 [ %rp.3.ph244.i, %for.cond360.outer.i ], [ %rp.5.i, %if.else443.i ], [ %rp.5.i, %for.end432.i ] + %e2.1.i.ph = phi i32 [ %e2.1.ph.i, %for.cond360.outer.i ], [ %add401.i, %if.else443.i ], [ %add401.i, %for.end432.i ] + %a.3.i.ph = phi i32 [ %a.3.ph.i, %for.cond360.outer.i ], [ %a.5.i, %if.else443.i ], [ %a.5.i, %for.end432.i ] + %cmp393.i = icmp eq i32 %rp.3.i.ph, 18 + %cmp397.i = icmp sgt i32 %rp.3.i.ph, 27 + %..i = select i1 %cmp397.i, i32 9, i32 1 + br label %for.cond360.i + +if.else443.i: ; preds = %if.then434.i + %93 = load i32* %arrayidx446.i, align 4, !tbaa !3 + %or447.i = or i32 %93, 1 + store i32 %or447.i, i32* %arrayidx446.i, align 4, !tbaa !3 + br label %for.cond360.i.outer + +if.then459.i: ; preds = %for.cond451.preheader.i + %sub462.i = add nsw i32 %and436.i, -1 + %arrayidx463.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %sub462.i + store i32 0, i32* %arrayidx463.i, align 4, !tbaa !3 + br label %if.end464.i + +if.end464.i: ; preds = %if.then459.i, %for.cond451.preheader.i + %z.7.i = phi i32 [ %and436.i, %if.then459.i ], [ %z.5.ph.i, %for.cond451.preheader.i ] + %arrayidx468.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and456.i + %94 = load i32* %arrayidx468.i, align 4, !tbaa !3 + %conv469.i = uitofp i32 %94 to double + %add455.1.i = add nsw i32 %a.3.i, 1 + %and456.1.i = and i32 %add455.1.i, 127 + %cmp457.1.i = icmp eq i32 %and456.1.i, %z.7.i + br i1 %cmp457.1.i, label %if.then459.1.i, label %if.end464.1.i + +if.then480.i: ; preds = %if.end464.1.i + %cmp483.i = icmp slt i32 %sub477.i, 0 + %.sub482.i = select i1 %cmp483.i, i32 0, i32 %sub477.i + br label %if.end487.i + +if.end487.i: ; preds = %if.end464.1.i, %if.then480.i + %denormal.0.i = phi i32 [ 1, %if.then480.i ], [ 0, %if.end464.1.i ] + %bits.addr.0.i114 = phi i32 [ %.sub482.i, %if.then480.i ], [ %bits.0.ph, %if.end464.1.i ] + %cmp488.i = icmp slt i32 %bits.addr.0.i114, 53 + br i1 %cmp488.i, label %if.then490.i, label %if.end500.i + +if.then490.i: ; preds = %if.end487.i + %sub492.i = sub i32 105, %bits.addr.0.i114 + %call493.i = call double @scalbn(double 1.000000e+00, i32 %sub492.i) #1 + %call494.i = call double @copysignl(double %call493.i, double %mul475.i) #7 + %sub495.i = sub nsw i32 53, %bits.addr.0.i114 + %call496.i = call double @scalbn(double 1.000000e+00, i32 %sub495.i) #1 + %call497.i = call double @fmodl(double %mul475.i, double %call496.i) #1 + %sub498.i = fsub double %mul475.i, %call497.i + %add499.i = fadd double %call494.i, %sub498.i + br label %if.end500.i + +if.end500.i: ; preds = %if.then490.i, %if.end487.i + %y.1.i115 = phi double [ %add499.i, %if.then490.i ], [ %mul475.i, %if.end487.i ] + %frac.0.i = phi double [ %call497.i, %if.then490.i ], [ 0.000000e+00, %if.end487.i ] + %bias.0.i = phi double [ %call494.i, %if.then490.i ], [ 0.000000e+00, %if.end487.i ] + %add501.i = add nsw i32 %a.3.i, 2 + %and502.i = and i32 %add501.i, 127 + %cmp503.i = icmp eq i32 %and502.i, %z.7.1.i + br i1 %cmp503.i, label %if.end561.i, label %if.then505.i + +if.then505.i: ; preds = %if.end500.i + %arrayidx509.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and502.i + %95 = load i32* %arrayidx509.i, align 4, !tbaa !3 + %cmp510.i = icmp ult i32 %95, 500000000 + br i1 %cmp510.i, label %land.lhs.true512.i, label %if.else524.i + +land.lhs.true512.i: ; preds = %if.then505.i + %tobool513.i = icmp eq i32 %95, 0 + br i1 %tobool513.i, label %lor.lhs.false514.i, label %if.then520.i + +lor.lhs.false514.i: ; preds = %land.lhs.true512.i + %add516.i = add nsw i32 %a.3.i, 3 + %and517.i = and i32 %add516.i, 127 + %cmp518.i = icmp eq i32 %and517.i, %z.7.1.i + br i1 %cmp518.i, label %if.end551.i, label %if.then520.i + +if.then520.i: ; preds = %lor.lhs.false514.i, %land.lhs.true512.i + %mul522.i = fmul double %conv474.i, 2.500000e-01 + %add523.i = fadd double %mul522.i, %frac.0.i + br label %if.end551.i + +if.else524.i: ; preds = %if.then505.i + %cmp525.i = icmp ugt i32 %95, 500000000 + br i1 %cmp525.i, label %if.then527.i, label %if.then534.i + +if.then527.i: ; preds = %if.else524.i + %mul529.i = fmul double %conv474.i, 7.500000e-01 + %add530.i = fadd double %mul529.i, %frac.0.i + br label %if.end551.i + +if.then534.i: ; preds = %if.else524.i + %add536.i = add nsw i32 %a.3.i, 3 + %and537.i = and i32 %add536.i, 127 + %cmp538.i = icmp eq i32 %and537.i, %z.7.1.i + br i1 %cmp538.i, label %if.then540.i, label %if.else544.i + +if.then540.i: ; preds = %if.then534.i + %mul542.i = fmul double %conv474.i, 5.000000e-01 + %add543.i = fadd double %mul542.i, %frac.0.i + br label %if.end551.i + +if.else544.i: ; preds = %if.then534.i + %mul546.i = fmul double %conv474.i, 7.500000e-01 + %add547.i = fadd double %mul546.i, %frac.0.i + br label %if.end551.i + +if.end551.i: ; preds = %if.else544.i, %if.then540.i, %if.then527.i, %if.then520.i, %lor.lhs.false514.i + %frac.1.i = phi double [ %add523.i, %if.then520.i ], [ %add530.i, %if.then527.i ], [ %add543.i, %if.then540.i ], [ %add547.i, %if.else544.i ], [ %frac.0.i, %lor.lhs.false514.i ] + %sub552.i = sub nsw i32 53, %bits.addr.0.i114 + %cmp553.i = icmp sgt i32 %sub552.i, 1 + br i1 %cmp553.i, label %land.lhs.true555.i, label %if.end561.i + +land.lhs.true555.i: ; preds = %if.end551.i + %call556.i = call double @fmodl(double %frac.1.i, double 1.000000e+00) #1 + %tobool557.i = fcmp une double %call556.i, 0.000000e+00 + br i1 %tobool557.i, label %if.end561.i, label %if.then558.i + +if.then558.i: ; preds = %land.lhs.true555.i + %inc559.i = fadd double %frac.1.i, 1.000000e+00 + br label %if.end561.i + +if.end561.i: ; preds = %if.then558.i, %land.lhs.true555.i, %if.end551.i, %if.end500.i + %frac.2.i = phi double [ %frac.1.i, %land.lhs.true555.i ], [ %inc559.i, %if.then558.i ], [ %frac.1.i, %if.end551.i ], [ %frac.0.i, %if.end500.i ] + %add562.i = fadd double %y.1.i115, %frac.2.i + %sub563.i = fsub double %add562.i, %bias.0.i + %and565.i = and i32 %add476.i, 2147483647 + %sub566.i = sub i32 -2, %sum.i + %cmp567.i = icmp sgt i32 %and565.i, %sub566.i + br i1 %cmp567.i, label %if.then569.i, label %if.end595.i + +if.then569.i: ; preds = %if.end561.i + %call570.i = call double @fabs(double %sub563.i) #7 + %cmp571.i = fcmp ult double %call570.i, 0x4340000000000000 + br i1 %cmp571.i, label %if.end584.i, label %if.then573.i + +if.then573.i: ; preds = %if.then569.i + %tobool574.i = icmp ne i32 %denormal.0.i, 0 + %cmp578.i = icmp eq i32 %bits.addr.0.i114, %sub477.i + %or.cond227.i = and i1 %tobool574.i, %cmp578.i + %denormal.1.i = select i1 %or.cond227.i, i32 0, i32 %denormal.0.i + %mul582.i = fmul double %sub563.i, 5.000000e-01 + %inc583.i = add nsw i32 %e2.1.i, 1 + br label %if.end584.i + +if.end584.i: ; preds = %if.then573.i, %if.then569.i + %e2.2.i = phi i32 [ %inc583.i, %if.then573.i ], [ %e2.1.i, %if.then569.i ] + %denormal.2.i = phi i32 [ %denormal.1.i, %if.then573.i ], [ %denormal.0.i, %if.then569.i ] + %y.2.i116 = phi double [ %mul582.i, %if.then573.i ], [ %sub563.i, %if.then569.i ] + %96 = add nsw i32 %e2.2.i, 50 + %cmp586.i = icmp sgt i32 %96, %sub1.i + br i1 %cmp586.i, label %if.then592.i, label %lor.lhs.false588.i + +lor.lhs.false588.i: ; preds = %if.end584.i + %tobool589.i = icmp ne i32 %denormal.2.i, 0 + %tobool591.i = fcmp une double %frac.2.i, 0.000000e+00 + %or.cond228.i = and i1 %tobool589.i, %tobool591.i + br i1 %or.cond228.i, label %if.then592.i, label %if.end595.i + +if.then592.i: ; preds = %lor.lhs.false588.i, %if.end584.i + %call593.i = call i32* @__errno_location() #7 + store i32 34, i32* %call593.i, align 4, !tbaa !3 + br label %if.end595.i + +if.end595.i: ; preds = %if.then592.i, %lor.lhs.false588.i, %if.end561.i + %e2.3.i = phi i32 [ %e2.2.i, %if.then592.i ], [ %e2.2.i, %lor.lhs.false588.i ], [ %e2.1.i, %if.end561.i ] + %y.3.i = phi double [ %y.2.i116, %if.then592.i ], [ %y.2.i116, %lor.lhs.false588.i ], [ %sub563.i, %if.end561.i ] + %call596.i = call double @scalbnl(double %y.3.i, i32 %e2.3.i) #1 + br label %return + +if.then459.1.i: ; preds = %if.end464.i + %add460.1.i = add nsw i32 %z.7.i, 1 + %and461.1.i = and i32 %add460.1.i, 127 + %sub462.1.i = add nsw i32 %and461.1.i, -1 + %arrayidx463.1.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %sub462.1.i + store i32 0, i32* %arrayidx463.1.i, align 4, !tbaa !3 + br label %if.end464.1.i + +if.end464.1.i: ; preds = %if.then459.1.i, %if.end464.i + %z.7.1.i = phi i32 [ %and461.1.i, %if.then459.1.i ], [ %z.7.i, %if.end464.i ] + %mul465.1.i = fmul double %conv469.i, 1.000000e+09 + %arrayidx468.1.i = getelementptr inbounds [128 x i32]* %x.i, i32 0, i32 %and456.1.i + %97 = load i32* %arrayidx468.1.i, align 4, !tbaa !3 + %conv469.1.i = uitofp i32 %97 to double + %add470.1.i = fadd double %mul465.1.i, %conv469.1.i + %conv474.i = sitofp i32 %sign.0 to double + %mul475.i = fmul double %conv474.i, %add470.1.i + %add476.i = add nsw i32 %e2.1.i, 53 + %sub477.i = sub nsw i32 %add476.i, %emin.0.ph + %cmp478.i = icmp slt i32 %sub477.i, %bits.0.ph + br i1 %cmp478.i, label %if.then480.i, label %if.end487.i + +return: ; preds = %if.end595.i, %if.then233.i, %if.then213.i, %if.then205.i, %if.then174.i, %if.then164.i, %if.then154.i106, %if.then139.i, %if.then134.i, %if.else116.i, %if.end264.i, %if.then196.i, %if.then186.i, %if.then178.i, %if.else162.i, %if.end134.i, %cond.end214, %while.cond191.backedge, %if.then188, %while.cond191.preheader, %if.end175, %cond.true141, %if.then138, %if.end83, %entry + %retval.0 = phi double [ %conv86, %if.end83 ], [ 0.000000e+00, %if.then188 ], [ 0.000000e+00, %cond.end214 ], [ 0.000000e+00, %entry ], [ 0x7FF8000000000000, %if.then138 ], [ 0x7FF8000000000000, %cond.true141 ], [ 0x7FF8000000000000, %if.end175 ], [ %mul190.i, %if.then186.i ], [ %mul200.i, %if.then196.i ], [ %call266.i, %if.end264.i ], [ %mul180.i, %if.then178.i ], [ 0.000000e+00, %if.else162.i ], [ %mul136.i, %if.end134.i ], [ %mul158.i, %if.then154.i106 ], [ %mul168.i, %if.then164.i ], [ %mul178.i, %if.then174.i ], [ %mul209.i, %if.then205.i ], [ %div221.i, %if.then213.i ], [ %mul241.i, %if.then233.i ], [ %call596.i, %if.end595.i ], [ %mul141.i, %if.then139.i ], [ 0.000000e+00, %if.then134.i ], [ 0.000000e+00, %if.else116.i ], [ 0x7FF8000000000000, %while.cond191.backedge ], [ 0x7FF8000000000000, %while.cond191.preheader ] + ret double %retval.0 +} + +declare i32 @isspace(i32) #5 + +; Function Attrs: nounwind +declare void @llvm.lifetime.start(i64, i8* nocapture) #1 + +; Function Attrs: nounwind +define internal fastcc i64 @scanexp(%struct._IO_FILE* %f, i32 %pok) #0 { +entry: + %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1 + %0 = load i8** %rpos, align 4, !tbaa !0 + %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27 + %1 = load i8** %shend, align 4, !tbaa !0 + %cmp = icmp ult i8* %0, %1 + br i1 %cmp, label %cond.true, label %cond.false + +cond.true: ; preds = %entry + %incdec.ptr = getelementptr inbounds i8* %0, i32 1 + store i8* %incdec.ptr, i8** %rpos, align 4, !tbaa !0 + %2 = load i8* %0, align 1, !tbaa !1 + %conv = zext i8 %2 to i32 + br label %cond.end + +cond.false: ; preds = %entry + %call = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %cond.end + +cond.end: ; preds = %cond.false, %cond.true + %cond = phi i32 [ %conv, %cond.true ], [ %call, %cond.false ] + %cmp4 = icmp eq i32 %cond, 45 + switch i32 %cond, label %if.end30 [ + i32 45, label %if.then + i32 43, label %if.then + ] + +if.then: ; preds = %cond.end, %cond.end + %conv7 = zext i1 %cmp4 to i32 + %3 = load i8** %rpos, align 4, !tbaa !0 + %4 = load i8** %shend, align 4, !tbaa !0 + %cmp10 = icmp ult i8* %3, %4 + br i1 %cmp10, label %cond.true12, label %cond.false16 + +cond.true12: ; preds = %if.then + %incdec.ptr14 = getelementptr inbounds i8* %3, i32 1 + store i8* %incdec.ptr14, i8** %rpos, align 4, !tbaa !0 + %5 = load i8* %3, align 1, !tbaa !1 + %conv15 = zext i8 %5 to i32 + br label %cond.end18 + +cond.false16: ; preds = %if.then + %call17 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %cond.end18 + +cond.end18: ; preds = %cond.false16, %cond.true12 + %cond19 = phi i32 [ %conv15, %cond.true12 ], [ %call17, %cond.false16 ] + %sub = add nsw i32 %cond19, -48 + %cmp20 = icmp ult i32 %sub, 10 + %tobool = icmp eq i32 %pok, 0 + %or.cond = or i1 %cmp20, %tobool + br i1 %or.cond, label %if.end30, label %if.then22 + +if.then22: ; preds = %cond.end18 + %6 = load i8** %shend, align 4, !tbaa !0 + %tobool24 = icmp eq i8* %6, null + br i1 %tobool24, label %if.end30, label %cond.true25 + +cond.true25: ; preds = %if.then22 + %7 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr27 = getelementptr inbounds i8* %7, i32 -1 + store i8* %incdec.ptr27, i8** %rpos, align 4, !tbaa !0 + br label %if.end30 + +if.end30: ; preds = %cond.true25, %if.then22, %cond.end18, %cond.end + %c.0 = phi i32 [ %cond19, %cond.true25 ], [ %cond19, %if.then22 ], [ %cond19, %cond.end18 ], [ %cond, %cond.end ] + %neg.0 = phi i32 [ %conv7, %cond.true25 ], [ %conv7, %if.then22 ], [ %conv7, %cond.end18 ], [ 0, %cond.end ] + %sub31 = add nsw i32 %c.0, -48 + %cmp32 = icmp ugt i32 %sub31, 9 + br i1 %cmp32, label %if.then34, label %for.body + +if.then34: ; preds = %if.end30 + %8 = load i8** %shend, align 4, !tbaa !0 + %tobool36 = icmp eq i8* %8, null + br i1 %tobool36, label %return, label %cond.true37 + +cond.true37: ; preds = %if.then34 + %9 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr39 = getelementptr inbounds i8* %9, i32 -1 + store i8* %incdec.ptr39, i8** %rpos, align 4, !tbaa !0 + br label %return + +for.body: ; preds = %for.cond.backedge.for.body_crit_edge, %if.end30 + %x.043 = phi i32 [ %phitmp47, %for.cond.backedge.for.body_crit_edge ], [ 0, %if.end30 ] + %c.142 = phi i32 [ %c.1.be, %for.cond.backedge.for.body_crit_edge ], [ %c.0, %if.end30 ] + %add = add i32 %c.142, -48 + %sub48 = add i32 %add, %x.043 + %10 = load i8** %rpos, align 4, !tbaa !0 + %11 = load i8** %shend, align 4, !tbaa !0 + %cmp51 = icmp ult i8* %10, %11 + br i1 %cmp51, label %cond.true53, label %cond.false57 + +cond.true53: ; preds = %for.body + %incdec.ptr55 = getelementptr inbounds i8* %10, i32 1 + store i8* %incdec.ptr55, i8** %rpos, align 4, !tbaa !0 + %12 = load i8* %10, align 1, !tbaa !1 + %conv56 = zext i8 %12 to i32 + br label %for.cond.backedge + +cond.false57: ; preds = %for.body + %call58 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond.backedge + +for.cond.backedge: ; preds = %cond.false57, %cond.true53 + %c.1.be = phi i32 [ %conv56, %cond.true53 ], [ %call58, %cond.false57 ] + %sub43 = add nsw i32 %c.1.be, -48 + %cmp44 = icmp ult i32 %sub43, 10 + %cmp46 = icmp slt i32 %sub48, 214748364 + %cmp46. = and i1 %cmp44, %cmp46 + br i1 %cmp46., label %for.cond.backedge.for.body_crit_edge, label %for.end + +for.cond.backedge.for.body_crit_edge: ; preds = %for.cond.backedge + %phitmp47 = mul i32 %sub48, 10 + br label %for.body + +for.end: ; preds = %for.cond.backedge + %phitmp = sext i32 %sub48 to i64 + %sub6335 = add nsw i32 %c.1.be, -48 + %cmp6436 = icmp ult i32 %sub6335, 10 + br i1 %cmp6436, label %for.body70, label %for.cond89.preheader + +for.cond89.preheader: ; preds = %for.cond62.backedge, %for.end + %y.0.lcssa = phi i64 [ %phitmp, %for.end ], [ %sub74, %for.cond62.backedge ] + %c.2.lcssa = phi i32 [ %c.1.be, %for.end ], [ %c.2.be, %for.cond62.backedge ] + %sub9033 = add nsw i32 %c.2.lcssa, -48 + %cmp9134 = icmp ult i32 %sub9033, 10 + br i1 %cmp9134, label %for.inc94, label %for.end107 + +for.body70: ; preds = %for.cond62.backedge, %for.end + %y.038 = phi i64 [ %phitmp, %for.end ], [ %sub74, %for.cond62.backedge ] + %c.237 = phi i32 [ %c.1.be, %for.end ], [ %c.2.be, %for.cond62.backedge ] + %mul71 = mul nsw i64 %y.038, 10 + %conv72 = sext i32 %c.237 to i64 + %add73 = add i64 %conv72, -48 + %sub74 = add i64 %add73, %mul71 + %13 = load i8** %rpos, align 4, !tbaa !0 + %14 = load i8** %shend, align 4, !tbaa !0 + %cmp78 = icmp ult i8* %13, %14 + br i1 %cmp78, label %cond.true80, label %cond.false84 + +cond.true80: ; preds = %for.body70 + %incdec.ptr82 = getelementptr inbounds i8* %13, i32 1 + store i8* %incdec.ptr82, i8** %rpos, align 4, !tbaa !0 + %15 = load i8* %13, align 1, !tbaa !1 + %conv83 = zext i8 %15 to i32 + br label %for.cond62.backedge + +cond.false84: ; preds = %for.body70 + %call85 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond62.backedge + +for.cond62.backedge: ; preds = %cond.false84, %cond.true80 + %c.2.be = phi i32 [ %conv83, %cond.true80 ], [ %call85, %cond.false84 ] + %sub63 = add nsw i32 %c.2.be, -48 + %cmp64 = icmp ult i32 %sub63, 10 + %cmp67 = icmp slt i64 %sub74, 92233720368547758 + %or.cond32 = and i1 %cmp64, %cmp67 + br i1 %or.cond32, label %for.body70, label %for.cond89.preheader + +for.inc94: ; preds = %for.cond89.backedge, %for.cond89.preheader + %16 = load i8** %rpos, align 4, !tbaa !0 + %17 = load i8** %shend, align 4, !tbaa !0 + %cmp97 = icmp ult i8* %16, %17 + br i1 %cmp97, label %cond.true99, label %cond.false103 + +cond.true99: ; preds = %for.inc94 + %incdec.ptr101 = getelementptr inbounds i8* %16, i32 1 + store i8* %incdec.ptr101, i8** %rpos, align 4, !tbaa !0 + %18 = load i8* %16, align 1, !tbaa !1 + %conv102 = zext i8 %18 to i32 + br label %for.cond89.backedge + +cond.false103: ; preds = %for.inc94 + %call104 = tail call i32 @__shgetc(%struct._IO_FILE* %f) #1 + br label %for.cond89.backedge + +for.cond89.backedge: ; preds = %cond.false103, %cond.true99 + %c.3.be = phi i32 [ %conv102, %cond.true99 ], [ %call104, %cond.false103 ] + %sub90 = add nsw i32 %c.3.be, -48 + %cmp91 = icmp ult i32 %sub90, 10 + br i1 %cmp91, label %for.inc94, label %for.end107 + +for.end107: ; preds = %for.cond89.backedge, %for.cond89.preheader + %19 = load i8** %shend, align 4, !tbaa !0 + %tobool109 = icmp eq i8* %19, null + br i1 %tobool109, label %cond.end114, label %cond.true110 + +cond.true110: ; preds = %for.end107 + %20 = load i8** %rpos, align 4, !tbaa !0 + %incdec.ptr112 = getelementptr inbounds i8* %20, i32 -1 + store i8* %incdec.ptr112, i8** %rpos, align 4, !tbaa !0 + br label %cond.end114 + +cond.end114: ; preds = %cond.true110, %for.end107 + %tobool115 = icmp ne i32 %neg.0, 0 + %sub117 = sub nsw i64 0, %y.0.lcssa + %cond120 = select i1 %tobool115, i64 %sub117, i64 %y.0.lcssa + br label %return + +return: ; preds = %cond.end114, %cond.true37, %if.then34 + %retval.0 = phi i64 [ %cond120, %cond.end114 ], [ -9223372036854775808, %if.then34 ], [ -9223372036854775808, %cond.true37 ] + ret i64 %retval.0 +} + +; Function Attrs: nounwind readnone +declare double @copysignl(double, double) #3 + +declare double @fmodl(double, double) #5 + +; Function Attrs: nounwind readnone +declare double @fabs(double) #3 + +; Function Attrs: nounwind +define void @__shlim(%struct._IO_FILE* nocapture %f, i32 %lim) #0 { +entry: + %shlim = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 28 + store i32 %lim, i32* %shlim, align 4, !tbaa !3 + %rend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 2 + %0 = load i8** %rend, align 4, !tbaa !0 + %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1 + %1 = load i8** %rpos, align 4, !tbaa !0 + %sub.ptr.lhs.cast = ptrtoint i8* %0 to i32 + %sub.ptr.rhs.cast = ptrtoint i8* %1 to i32 + %sub.ptr.sub = sub i32 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast + %shcnt = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29 + store i32 %sub.ptr.sub, i32* %shcnt, align 4, !tbaa !3 + %tobool = icmp ne i32 %lim, 0 + %cmp = icmp sgt i32 %sub.ptr.sub, %lim + %or.cond = and i1 %tobool, %cmp + br i1 %or.cond, label %if.then, label %if.else + +if.then: ; preds = %entry + %add.ptr = getelementptr inbounds i8* %1, i32 %lim + %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27 + store i8* %add.ptr, i8** %shend, align 4, !tbaa !0 + br label %if.end + +if.else: ; preds = %entry + %shend4 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27 + store i8* %0, i8** %shend4, align 4, !tbaa !0 + br label %if.end + +if.end: ; preds = %if.else, %if.then + ret void +} + +; Function Attrs: nounwind +define i32 @__shgetc(%struct._IO_FILE* %f) #0 { +entry: + %shlim = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 28 + %0 = load i32* %shlim, align 4, !tbaa !3 + %tobool = icmp eq i32 %0, 0 + br i1 %tobool, label %lor.lhs.false, label %land.lhs.true + +land.lhs.true: ; preds = %entry + %shcnt = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29 + %1 = load i32* %shcnt, align 4, !tbaa !3 + %cmp = icmp slt i32 %1, %0 + br i1 %cmp, label %lor.lhs.false, label %if.then + +lor.lhs.false: ; preds = %land.lhs.true, %entry + %call = tail call i32 bitcast (i32 (%struct._IO_FILE.3*)* @__uflow to i32 (%struct._IO_FILE*)*)(%struct._IO_FILE* %f) #1 + %cmp2 = icmp slt i32 %call, 0 + br i1 %cmp2, label %if.then, label %if.end + +if.then: ; preds = %lor.lhs.false, %land.lhs.true + %shend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27 + store i8* null, i8** %shend, align 4, !tbaa !0 + br label %return + +if.end: ; preds = %lor.lhs.false + %2 = load i32* %shlim, align 4, !tbaa !3 + %tobool4 = icmp eq i32 %2, 0 + %rend17.phi.trans.insert = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 2 + %.pre = load i8** %rend17.phi.trans.insert, align 4, !tbaa !0 + br i1 %tobool4, label %if.else, label %land.lhs.true5 + +land.lhs.true5: ; preds = %if.end + %rpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1 + %3 = load i8** %rpos, align 4, !tbaa !0 + %sub.ptr.lhs.cast = ptrtoint i8* %.pre to i32 + %sub.ptr.rhs.cast = ptrtoint i8* %3 to i32 + %sub.ptr.sub = sub i32 %sub.ptr.lhs.cast, %sub.ptr.rhs.cast + %shcnt7 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29 + %4 = load i32* %shcnt7, align 4, !tbaa !3 + %sub = sub nsw i32 %2, %4 + %sub8 = add nsw i32 %sub, -1 + %cmp9 = icmp sgt i32 %sub.ptr.sub, %sub8 + br i1 %cmp9, label %if.then10, label %if.else + +if.then10: ; preds = %land.lhs.true5 + %add.ptr = getelementptr inbounds i8* %3, i32 %sub8 + %shend16 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27 + store i8* %add.ptr, i8** %shend16, align 4, !tbaa !0 + br label %if.end19 + +if.else: ; preds = %land.lhs.true5, %if.end + %shend18 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 27 + store i8* %.pre, i8** %shend18, align 4, !tbaa !0 + br label %if.end19 + +if.end19: ; preds = %if.else, %if.then10 + %tobool21 = icmp eq i8* %.pre, null + %rpos31.phi.trans.insert = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 1 + %.pre24 = load i8** %rpos31.phi.trans.insert, align 4, !tbaa !0 + br i1 %tobool21, label %if.end30, label %if.then22 + +if.then22: ; preds = %if.end19 + %sub.ptr.lhs.cast25 = ptrtoint i8* %.pre to i32 + %sub.ptr.rhs.cast26 = ptrtoint i8* %.pre24 to i32 + %shcnt28 = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 29 + %5 = load i32* %shcnt28, align 4, !tbaa !3 + %sub.ptr.sub27 = add i32 %sub.ptr.lhs.cast25, 1 + %add = sub i32 %sub.ptr.sub27, %sub.ptr.rhs.cast26 + %add29 = add i32 %add, %5 + store i32 %add29, i32* %shcnt28, align 4, !tbaa !3 + br label %if.end30 + +if.end30: ; preds = %if.then22, %if.end19 + %arrayidx = getelementptr inbounds i8* %.pre24, i32 -1 + %6 = load i8* %arrayidx, align 1, !tbaa !1 + %conv = zext i8 %6 to i32 + %cmp32 = icmp eq i32 %conv, %call + br i1 %cmp32, label %return, label %if.then34 + +if.then34: ; preds = %if.end30 + %conv35 = trunc i32 %call to i8 + store i8 %conv35, i8* %arrayidx, align 1, !tbaa !1 + br label %return + +return: ; preds = %if.then34, %if.end30, %if.then + %retval.0 = phi i32 [ -1, %if.then ], [ %call, %if.end30 ], [ %call, %if.then34 ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind readnone +define double @scalbn(double %x, i32 %n) #3 { +entry: + %cmp = icmp sgt i32 %n, 1023 + br i1 %cmp, label %if.then, label %if.else + +if.then: ; preds = %entry + %mul = fmul double %x, 0x7FE0000000000000 + %sub = add nsw i32 %n, -1023 + %cmp1 = icmp sgt i32 %sub, 1023 + br i1 %cmp1, label %if.then2, label %if.end20 + +if.then2: ; preds = %if.then + %mul3 = fmul double %mul, 0x7FE0000000000000 + %sub4 = add nsw i32 %n, -2046 + %cmp5 = icmp sgt i32 %sub4, 1023 + %.sub4 = select i1 %cmp5, i32 1023, i32 %sub4 + br label %if.end20 + +if.else: ; preds = %entry + %cmp8 = icmp slt i32 %n, -1022 + br i1 %cmp8, label %if.then9, label %if.end20 + +if.then9: ; preds = %if.else + %mul10 = fmul double %x, 0x10000000000000 + %add = add nsw i32 %n, 1022 + %cmp11 = icmp slt i32 %add, -1022 + br i1 %cmp11, label %if.then12, label %if.end20 + +if.then12: ; preds = %if.then9 + %mul13 = fmul double %mul10, 0x10000000000000 + %add14 = add nsw i32 %n, 2044 + %cmp15 = icmp slt i32 %add14, -1022 + %.add14 = select i1 %cmp15, i32 -1022, i32 %add14 + br label %if.end20 + +if.end20: ; preds = %if.then12, %if.then9, %if.else, %if.then2, %if.then + %n.addr.0 = phi i32 [ %.sub4, %if.then2 ], [ %sub, %if.then ], [ %.add14, %if.then12 ], [ %add, %if.then9 ], [ %n, %if.else ] + %y.0 = phi double [ %mul3, %if.then2 ], [ %mul, %if.then ], [ %mul13, %if.then12 ], [ %mul10, %if.then9 ], [ %x, %if.else ] + %add21 = add nsw i32 %n.addr.0, 1023 + %conv16 = zext i32 %add21 to i64 + %shl = shl i64 %conv16, 52 + %0 = bitcast i64 %shl to double + %mul22 = fmul double %y.0, %0 + ret double %mul22 +} + +; Function Attrs: nounwind +define double @scalbnl(double %x, i32 %n) #0 { +entry: + %call = tail call double @scalbn(double %x, i32 %n) #1 + ret double %call +} + +; Function Attrs: nounwind +define i32 @__overflow(%struct._IO_FILE* %f, i32 %_c) #0 { +entry: + %c = alloca i8, align 1 + %conv = trunc i32 %_c to i8 + store i8 %conv, i8* %c, align 1, !tbaa !1 + %wend = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 4 + %0 = load i8** %wend, align 4, !tbaa !0 + %tobool = icmp eq i8* %0, null + br i1 %tobool, label %land.lhs.true, label %if.end + +land.lhs.true: ; preds = %entry + %call = call i32 bitcast (i32 (%struct._IO_FILE.4*)* @__towrite to i32 (%struct._IO_FILE*)*)(%struct._IO_FILE* %f) #1 + %tobool1 = icmp eq i32 %call, 0 + br i1 %tobool1, label %land.lhs.true.if.end_crit_edge, label %return + +land.lhs.true.if.end_crit_edge: ; preds = %land.lhs.true + %.pre = load i8** %wend, align 4, !tbaa !0 + br label %if.end + +if.end: ; preds = %land.lhs.true.if.end_crit_edge, %entry + %1 = phi i8* [ %.pre, %land.lhs.true.if.end_crit_edge ], [ %0, %entry ] + %wpos = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 5 + %2 = load i8** %wpos, align 4, !tbaa !0 + %cmp = icmp ult i8* %2, %1 + br i1 %cmp, label %land.lhs.true4, label %if.end12 + +land.lhs.true4: ; preds = %if.end + %3 = load i8* %c, align 1, !tbaa !1 + %conv5 = zext i8 %3 to i32 + %lbf = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 20 + %4 = load i8* %lbf, align 1, !tbaa !1 + %conv6 = sext i8 %4 to i32 + %cmp7 = icmp eq i32 %conv5, %conv6 + br i1 %cmp7, label %if.end12, label %if.then9 + +if.then9: ; preds = %land.lhs.true4 + %incdec.ptr = getelementptr inbounds i8* %2, i32 1 + store i8* %incdec.ptr, i8** %wpos, align 4, !tbaa !0 + store i8 %3, i8* %2, align 1, !tbaa !1 + br label %return + +if.end12: ; preds = %land.lhs.true4, %if.end + %write = getelementptr inbounds %struct._IO_FILE* %f, i32 0, i32 9 + %5 = load i32 (%struct._IO_FILE*, i8*, i32)** %write, align 4, !tbaa !0 + %call13 = call i32 %5(%struct._IO_FILE* %f, i8* %c, i32 1) #1 + %cmp14 = icmp eq i32 %call13, 1 + br i1 %cmp14, label %if.end17, label %return + +if.end17: ; preds = %if.end12 + %6 = load i8* %c, align 1, !tbaa !1 + %conv18 = zext i8 %6 to i32 + br label %return + +return: ; preds = %if.end17, %if.end12, %if.then9, %land.lhs.true + %retval.0 = phi i32 [ %conv5, %if.then9 ], [ %conv18, %if.end17 ], [ -1, %land.lhs.true ], [ -1, %if.end12 ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind +define i32 @__toread(%struct._IO_FILE.3* %f) #0 { +entry: + %mode = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 19 + %0 = load i8* %mode, align 1, !tbaa !1 + %conv = sext i8 %0 to i32 + %sub = add nsw i32 %conv, 255 + %or = or i32 %sub, %conv + %conv3 = trunc i32 %or to i8 + store i8 %conv3, i8* %mode, align 1, !tbaa !1 + %wpos = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 5 + %1 = load i8** %wpos, align 4, !tbaa !0 + %buf = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 11 + %2 = load i8** %buf, align 4, !tbaa !0 + %cmp = icmp ugt i8* %1, %2 + br i1 %cmp, label %if.then, label %if.end + +if.then: ; preds = %entry + %write = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 9 + %3 = load i32 (%struct._IO_FILE.3*, i8*, i32)** %write, align 4, !tbaa !0 + %call = tail call i32 %3(%struct._IO_FILE.3* %f, i8* null, i32 0) #1 + br label %if.end + +if.end: ; preds = %if.then, %entry + %wend = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 4 + store i8* null, i8** %wend, align 4, !tbaa !0 + %wbase = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 7 + store i8* null, i8** %wbase, align 4, !tbaa !0 + store i8* null, i8** %wpos, align 4, !tbaa !0 + %flags = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 0 + %4 = load i32* %flags, align 4, !tbaa !3 + %and = and i32 %4, 20 + %tobool = icmp eq i32 %and, 0 + br i1 %tobool, label %if.end14, label %if.then6 + +if.then6: ; preds = %if.end + %and8 = and i32 %4, 4 + %tobool9 = icmp eq i32 %and8, 0 + br i1 %tobool9, label %return, label %if.then10 + +if.then10: ; preds = %if.then6 + %or12 = or i32 %4, 32 + store i32 %or12, i32* %flags, align 4, !tbaa !3 + br label %return + +if.end14: ; preds = %if.end + %5 = load i8** %buf, align 4, !tbaa !0 + %rend = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 2 + store i8* %5, i8** %rend, align 4, !tbaa !0 + %rpos = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 1 + store i8* %5, i8** %rpos, align 4, !tbaa !0 + br label %return + +return: ; preds = %if.end14, %if.then10, %if.then6 + %retval.0 = phi i32 [ 0, %if.end14 ], [ -1, %if.then6 ], [ -1, %if.then10 ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind +define i32 @__towrite(%struct._IO_FILE.4* nocapture %f) #0 { +entry: + %mode = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 19 + %0 = load i8* %mode, align 1, !tbaa !1 + %conv = sext i8 %0 to i32 + %sub = add nsw i32 %conv, 255 + %or = or i32 %sub, %conv + %conv3 = trunc i32 %or to i8 + store i8 %conv3, i8* %mode, align 1, !tbaa !1 + %flags = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 0 + %1 = load i32* %flags, align 4, !tbaa !3 + %and = and i32 %1, 8 + %tobool = icmp eq i32 %and, 0 + br i1 %tobool, label %if.end, label %if.then + +if.then: ; preds = %entry + %or5 = or i32 %1, 32 + store i32 %or5, i32* %flags, align 4, !tbaa !3 + br label %return + +if.end: ; preds = %entry + %rend = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 2 + store i8* null, i8** %rend, align 4, !tbaa !0 + %rpos = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 1 + store i8* null, i8** %rpos, align 4, !tbaa !0 + %buf = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 11 + %2 = load i8** %buf, align 4, !tbaa !0 + %wbase = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 7 + store i8* %2, i8** %wbase, align 4, !tbaa !0 + %wpos = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 5 + store i8* %2, i8** %wpos, align 4, !tbaa !0 + %buf_size = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 12 + %3 = load i32* %buf_size, align 4, !tbaa !3 + %add.ptr = getelementptr inbounds i8* %2, i32 %3 + %wend = getelementptr inbounds %struct._IO_FILE.4* %f, i32 0, i32 4 + store i8* %add.ptr, i8** %wend, align 4, !tbaa !0 + br label %return + +return: ; preds = %if.end, %if.then + %retval.0 = phi i32 [ -1, %if.then ], [ 0, %if.end ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind +define i32 @__uflow(%struct._IO_FILE.3* %f) #0 { +entry: + %c = alloca i8, align 1 + %rend = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 2 + %0 = load i8** %rend, align 4, !tbaa !0 + %tobool = icmp eq i8* %0, null + br i1 %tobool, label %lor.lhs.false, label %land.lhs.true + +lor.lhs.false: ; preds = %entry + %call = call i32 @__toread(%struct._IO_FILE.3* %f) #1 + %tobool1 = icmp eq i32 %call, 0 + br i1 %tobool1, label %land.lhs.true, label %return + +land.lhs.true: ; preds = %lor.lhs.false, %entry + %read = getelementptr inbounds %struct._IO_FILE.3* %f, i32 0, i32 8 + %1 = load i32 (%struct._IO_FILE.3*, i8*, i32)** %read, align 4, !tbaa !0 + %call2 = call i32 %1(%struct._IO_FILE.3* %f, i8* %c, i32 1) #1 + %cmp = icmp eq i32 %call2, 1 + br i1 %cmp, label %if.then, label %return + +if.then: ; preds = %land.lhs.true + %2 = load i8* %c, align 1, !tbaa !1 + %conv = zext i8 %2 to i32 + br label %return + +return: ; preds = %if.then, %land.lhs.true, %lor.lhs.false + %retval.0 = phi i32 [ %conv, %if.then ], [ -1, %lor.lhs.false ], [ -1, %land.lhs.true ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind +define double @atof(i8* %s) #0 { +entry: + %call = tail call double @strtod(i8* %s, i8** null) #1 + ret double %call +} + +; Function Attrs: nounwind +define float @strtof(i8* noalias %s, i8** noalias %p) #0 { +entry: + %f.i = alloca %struct._IO_FILE, align 4 + %0 = bitcast %struct._IO_FILE* %f.i to i8* + call void @llvm.lifetime.start(i64 112, i8* %0) #1 + call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1 + %rpos.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 1 + store i8* %s, i8** %rpos.i, align 4, !tbaa !0 + %rend.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 2 + store i8* inttoptr (i32 -1 to i8*), i8** %rend.i, align 4, !tbaa !0 + %buf.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 11 + store i8* %s, i8** %buf.i, align 4, !tbaa !0 + %lock.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 21 + store i32 -1, i32* %lock.i, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f.i, i32 0) #1 + %call.i = call double @__floatscan(%struct._IO_FILE* %f.i, i32 0, i32 1) #1 + %shcnt.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 29 + %1 = load i32* %shcnt.i, align 4, !tbaa !3 + %2 = load i8** %rpos.i, align 4, !tbaa !0 + %3 = load i8** %rend.i, align 4, !tbaa !0 + %sub.ptr.lhs.cast.i = ptrtoint i8* %2 to i32 + %sub.ptr.rhs.cast.i = ptrtoint i8* %3 to i32 + %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i + %add.i = add nsw i32 %sub.ptr.sub.i, %1 + %tobool.i = icmp eq i8** %p, null + br i1 %tobool.i, label %strtox.exit, label %if.then.i + +if.then.i: ; preds = %entry + %tobool3.i = icmp eq i32 %add.i, 0 + br i1 %tobool3.i, label %cond.end.i, label %cond.true.i + +cond.true.i: ; preds = %if.then.i + %add.ptr.i = getelementptr inbounds i8* %s, i32 %add.i + br label %cond.end.i + +cond.end.i: ; preds = %cond.true.i, %if.then.i + %cond.i = phi i8* [ %add.ptr.i, %cond.true.i ], [ %s, %if.then.i ] + store i8* %cond.i, i8** %p, align 4, !tbaa !0 + br label %strtox.exit + +strtox.exit: ; preds = %cond.end.i, %entry + call void @llvm.lifetime.end(i64 112, i8* %0) #1 + %conv = fptrunc double %call.i to float + ret float %conv +} + +; Function Attrs: nounwind +define double @strtod(i8* noalias %s, i8** noalias %p) #0 { +entry: + %f.i = alloca %struct._IO_FILE, align 4 + %0 = bitcast %struct._IO_FILE* %f.i to i8* + call void @llvm.lifetime.start(i64 112, i8* %0) #1 + call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1 + %rpos.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 1 + store i8* %s, i8** %rpos.i, align 4, !tbaa !0 + %rend.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 2 + store i8* inttoptr (i32 -1 to i8*), i8** %rend.i, align 4, !tbaa !0 + %buf.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 11 + store i8* %s, i8** %buf.i, align 4, !tbaa !0 + %lock.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 21 + store i32 -1, i32* %lock.i, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f.i, i32 0) #1 + %call.i = call double @__floatscan(%struct._IO_FILE* %f.i, i32 1, i32 1) #1 + %shcnt.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 29 + %1 = load i32* %shcnt.i, align 4, !tbaa !3 + %2 = load i8** %rpos.i, align 4, !tbaa !0 + %3 = load i8** %rend.i, align 4, !tbaa !0 + %sub.ptr.lhs.cast.i = ptrtoint i8* %2 to i32 + %sub.ptr.rhs.cast.i = ptrtoint i8* %3 to i32 + %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i + %add.i = add nsw i32 %sub.ptr.sub.i, %1 + %tobool.i = icmp eq i8** %p, null + br i1 %tobool.i, label %strtox.exit, label %if.then.i + +if.then.i: ; preds = %entry + %tobool3.i = icmp eq i32 %add.i, 0 + br i1 %tobool3.i, label %cond.end.i, label %cond.true.i + +cond.true.i: ; preds = %if.then.i + %add.ptr.i = getelementptr inbounds i8* %s, i32 %add.i + br label %cond.end.i + +cond.end.i: ; preds = %cond.true.i, %if.then.i + %cond.i = phi i8* [ %add.ptr.i, %cond.true.i ], [ %s, %if.then.i ] + store i8* %cond.i, i8** %p, align 4, !tbaa !0 + br label %strtox.exit + +strtox.exit: ; preds = %cond.end.i, %entry + call void @llvm.lifetime.end(i64 112, i8* %0) #1 + ret double %call.i +} + +; Function Attrs: nounwind +define double @strtold(i8* noalias %s, i8** noalias %p) #0 { +entry: + %f.i = alloca %struct._IO_FILE, align 4 + %0 = bitcast %struct._IO_FILE* %f.i to i8* + call void @llvm.lifetime.start(i64 112, i8* %0) #1 + call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1 + %rpos.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 1 + store i8* %s, i8** %rpos.i, align 4, !tbaa !0 + %rend.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 2 + store i8* inttoptr (i32 -1 to i8*), i8** %rend.i, align 4, !tbaa !0 + %buf.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 11 + store i8* %s, i8** %buf.i, align 4, !tbaa !0 + %lock.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 21 + store i32 -1, i32* %lock.i, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f.i, i32 0) #1 + %call.i = call double @__floatscan(%struct._IO_FILE* %f.i, i32 2, i32 1) #1 + %shcnt.i = getelementptr inbounds %struct._IO_FILE* %f.i, i32 0, i32 29 + %1 = load i32* %shcnt.i, align 4, !tbaa !3 + %2 = load i8** %rpos.i, align 4, !tbaa !0 + %3 = load i8** %rend.i, align 4, !tbaa !0 + %sub.ptr.lhs.cast.i = ptrtoint i8* %2 to i32 + %sub.ptr.rhs.cast.i = ptrtoint i8* %3 to i32 + %sub.ptr.sub.i = sub i32 %sub.ptr.lhs.cast.i, %sub.ptr.rhs.cast.i + %add.i = add nsw i32 %sub.ptr.sub.i, %1 + %tobool.i = icmp eq i8** %p, null + br i1 %tobool.i, label %strtox.exit, label %if.then.i + +if.then.i: ; preds = %entry + %tobool3.i = icmp eq i32 %add.i, 0 + br i1 %tobool3.i, label %cond.end.i, label %cond.true.i + +cond.true.i: ; preds = %if.then.i + %add.ptr.i = getelementptr inbounds i8* %s, i32 %add.i + br label %cond.end.i + +cond.end.i: ; preds = %cond.true.i, %if.then.i + %cond.i = phi i8* [ %add.ptr.i, %cond.true.i ], [ %s, %if.then.i ] + store i8* %cond.i, i8** %p, align 4, !tbaa !0 + br label %strtox.exit + +strtox.exit: ; preds = %cond.end.i, %entry + call void @llvm.lifetime.end(i64 112, i8* %0) #1 + ret double %call.i +} + +; Function Attrs: nounwind +define float @strtof_l(i8* noalias %s, i8** noalias %p, %struct.__locale_struct* nocapture %loc) #0 { +entry: + %f.i.i = alloca %struct._IO_FILE, align 4 + %0 = bitcast %struct._IO_FILE* %f.i.i to i8* + call void @llvm.lifetime.start(i64 112, i8* %0) #1 + call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1 + %rpos.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 1 + store i8* %s, i8** %rpos.i.i, align 4, !tbaa !0 + %rend.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 2 + store i8* inttoptr (i32 -1 to i8*), i8** %rend.i.i, align 4, !tbaa !0 + %buf.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 11 + store i8* %s, i8** %buf.i.i, align 4, !tbaa !0 + %lock.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 21 + store i32 -1, i32* %lock.i.i, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f.i.i, i32 0) #1 + %call.i.i = call double @__floatscan(%struct._IO_FILE* %f.i.i, i32 0, i32 1) #1 + %shcnt.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 29 + %1 = load i32* %shcnt.i.i, align 4, !tbaa !3 + %2 = load i8** %rpos.i.i, align 4, !tbaa !0 + %3 = load i8** %rend.i.i, align 4, !tbaa !0 + %sub.ptr.lhs.cast.i.i = ptrtoint i8* %2 to i32 + %sub.ptr.rhs.cast.i.i = ptrtoint i8* %3 to i32 + %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i + %add.i.i = add nsw i32 %sub.ptr.sub.i.i, %1 + %tobool.i.i = icmp eq i8** %p, null + br i1 %tobool.i.i, label %strtof.exit, label %if.then.i.i + +if.then.i.i: ; preds = %entry + %tobool3.i.i = icmp eq i32 %add.i.i, 0 + br i1 %tobool3.i.i, label %cond.end.i.i, label %cond.true.i.i + +cond.true.i.i: ; preds = %if.then.i.i + %add.ptr.i.i = getelementptr inbounds i8* %s, i32 %add.i.i + br label %cond.end.i.i + +cond.end.i.i: ; preds = %cond.true.i.i, %if.then.i.i + %cond.i.i = phi i8* [ %add.ptr.i.i, %cond.true.i.i ], [ %s, %if.then.i.i ] + store i8* %cond.i.i, i8** %p, align 4, !tbaa !0 + br label %strtof.exit + +strtof.exit: ; preds = %cond.end.i.i, %entry + call void @llvm.lifetime.end(i64 112, i8* %0) #1 + %conv.i = fptrunc double %call.i.i to float + ret float %conv.i +} + +; Function Attrs: nounwind +define double @strtod_l(i8* noalias %s, i8** noalias %p, %struct.__locale_struct.0* nocapture %loc) #0 { +entry: + %f.i.i = alloca %struct._IO_FILE, align 4 + %0 = bitcast %struct._IO_FILE* %f.i.i to i8* + call void @llvm.lifetime.start(i64 112, i8* %0) #1 + call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1 + %rpos.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 1 + store i8* %s, i8** %rpos.i.i, align 4, !tbaa !0 + %rend.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 2 + store i8* inttoptr (i32 -1 to i8*), i8** %rend.i.i, align 4, !tbaa !0 + %buf.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 11 + store i8* %s, i8** %buf.i.i, align 4, !tbaa !0 + %lock.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 21 + store i32 -1, i32* %lock.i.i, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f.i.i, i32 0) #1 + %call.i.i = call double @__floatscan(%struct._IO_FILE* %f.i.i, i32 1, i32 1) #1 + %shcnt.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 29 + %1 = load i32* %shcnt.i.i, align 4, !tbaa !3 + %2 = load i8** %rpos.i.i, align 4, !tbaa !0 + %3 = load i8** %rend.i.i, align 4, !tbaa !0 + %sub.ptr.lhs.cast.i.i = ptrtoint i8* %2 to i32 + %sub.ptr.rhs.cast.i.i = ptrtoint i8* %3 to i32 + %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i + %add.i.i = add nsw i32 %sub.ptr.sub.i.i, %1 + %tobool.i.i = icmp eq i8** %p, null + br i1 %tobool.i.i, label %strtod.exit, label %if.then.i.i + +if.then.i.i: ; preds = %entry + %tobool3.i.i = icmp eq i32 %add.i.i, 0 + br i1 %tobool3.i.i, label %cond.end.i.i, label %cond.true.i.i + +cond.true.i.i: ; preds = %if.then.i.i + %add.ptr.i.i = getelementptr inbounds i8* %s, i32 %add.i.i + br label %cond.end.i.i + +cond.end.i.i: ; preds = %cond.true.i.i, %if.then.i.i + %cond.i.i = phi i8* [ %add.ptr.i.i, %cond.true.i.i ], [ %s, %if.then.i.i ] + store i8* %cond.i.i, i8** %p, align 4, !tbaa !0 + br label %strtod.exit + +strtod.exit: ; preds = %cond.end.i.i, %entry + call void @llvm.lifetime.end(i64 112, i8* %0) #1 + ret double %call.i.i +} + +; Function Attrs: nounwind +define double @strtold_l(i8* noalias %s, i8** noalias %p, %struct.__locale_struct.1* nocapture %loc) #0 { +entry: + %f.i.i = alloca %struct._IO_FILE, align 4 + %0 = bitcast %struct._IO_FILE* %f.i.i to i8* + call void @llvm.lifetime.start(i64 112, i8* %0) #1 + call void @llvm.memset.p0i8.i64(i8* %0, i8 0, i64 112, i32 4, i1 false) #1 + %rpos.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 1 + store i8* %s, i8** %rpos.i.i, align 4, !tbaa !0 + %rend.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 2 + store i8* inttoptr (i32 -1 to i8*), i8** %rend.i.i, align 4, !tbaa !0 + %buf.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 11 + store i8* %s, i8** %buf.i.i, align 4, !tbaa !0 + %lock.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 21 + store i32 -1, i32* %lock.i.i, align 4, !tbaa !3 + call void @__shlim(%struct._IO_FILE* %f.i.i, i32 0) #1 + %call.i.i = call double @__floatscan(%struct._IO_FILE* %f.i.i, i32 2, i32 1) #1 + %shcnt.i.i = getelementptr inbounds %struct._IO_FILE* %f.i.i, i32 0, i32 29 + %1 = load i32* %shcnt.i.i, align 4, !tbaa !3 + %2 = load i8** %rpos.i.i, align 4, !tbaa !0 + %3 = load i8** %rend.i.i, align 4, !tbaa !0 + %sub.ptr.lhs.cast.i.i = ptrtoint i8* %2 to i32 + %sub.ptr.rhs.cast.i.i = ptrtoint i8* %3 to i32 + %sub.ptr.sub.i.i = sub i32 %sub.ptr.lhs.cast.i.i, %sub.ptr.rhs.cast.i.i + %add.i.i = add nsw i32 %sub.ptr.sub.i.i, %1 + %tobool.i.i = icmp eq i8** %p, null + br i1 %tobool.i.i, label %strtold.exit, label %if.then.i.i + +if.then.i.i: ; preds = %entry + %tobool3.i.i = icmp eq i32 %add.i.i, 0 + br i1 %tobool3.i.i, label %cond.end.i.i, label %cond.true.i.i + +cond.true.i.i: ; preds = %if.then.i.i + %add.ptr.i.i = getelementptr inbounds i8* %s, i32 %add.i.i + br label %cond.end.i.i + +cond.end.i.i: ; preds = %cond.true.i.i, %if.then.i.i + %cond.i.i = phi i8* [ %add.ptr.i.i, %cond.true.i.i ], [ %s, %if.then.i.i ] + store i8* %cond.i.i, i8** %p, align 4, !tbaa !0 + br label %strtold.exit + +strtold.exit: ; preds = %cond.end.i.i, %entry + call void @llvm.lifetime.end(i64 112, i8* %0) #1 + ret double %call.i.i +} + +; Function Attrs: nounwind +declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) #1 + +; Function Attrs: nounwind +declare void @llvm.lifetime.end(i64, i8* nocapture) #1 + +; Function Attrs: nounwind readonly +define i32 @memcmp(i8* nocapture %vl, i8* nocapture %vr, i32 %n) #2 { +entry: + %tobool8 = icmp eq i32 %n, 0 + br i1 %tobool8, label %cond.end, label %land.rhs + +land.rhs: ; preds = %for.inc, %entry + %r.011 = phi i8* [ %incdec.ptr3, %for.inc ], [ %vr, %entry ] + %l.010 = phi i8* [ %incdec.ptr, %for.inc ], [ %vl, %entry ] + %n.addr.09 = phi i32 [ %dec, %for.inc ], [ %n, %entry ] + %0 = load i8* %l.010, align 1, !tbaa !1 + %1 = load i8* %r.011, align 1, !tbaa !1 + %cmp = icmp eq i8 %0, %1 + br i1 %cmp, label %for.inc, label %cond.true + +for.inc: ; preds = %land.rhs + %dec = add i32 %n.addr.09, -1 + %incdec.ptr = getelementptr inbounds i8* %l.010, i32 1 + %incdec.ptr3 = getelementptr inbounds i8* %r.011, i32 1 + %tobool = icmp eq i32 %dec, 0 + br i1 %tobool, label %cond.end, label %land.rhs + +cond.true: ; preds = %land.rhs + %conv5 = zext i8 %0 to i32 + %conv6 = zext i8 %1 to i32 + %sub = sub nsw i32 %conv5, %conv6 + br label %cond.end + +cond.end: ; preds = %cond.true, %for.inc, %entry + %cond = phi i32 [ %sub, %cond.true ], [ 0, %for.inc ], [ 0, %entry ] + ret i32 %cond +} + +; Function Attrs: nounwind +define i32 @strcasecmp(i8* nocapture %_l, i8* nocapture %_r) #0 { +entry: + %0 = load i8* %_l, align 1, !tbaa !1 + %tobool11 = icmp eq i8 %0, 0 + br i1 %tobool11, label %for.end, label %land.lhs.true.lr.ph + +land.lhs.true.lr.ph: ; preds = %entry + %conv10 = zext i8 %0 to i32 + br label %land.lhs.true + +land.lhs.true: ; preds = %for.inc, %land.lhs.true.lr.ph + %conv15 = phi i32 [ %conv10, %land.lhs.true.lr.ph ], [ %conv, %for.inc ] + %1 = phi i8 [ %0, %land.lhs.true.lr.ph ], [ %4, %for.inc ] + %r.013 = phi i8* [ %_r, %land.lhs.true.lr.ph ], [ %incdec.ptr11, %for.inc ] + %l.012 = phi i8* [ %_l, %land.lhs.true.lr.ph ], [ %incdec.ptr, %for.inc ] + %2 = load i8* %r.013, align 1, !tbaa !1 + %tobool2 = icmp eq i8 %2, 0 + br i1 %tobool2, label %for.end, label %land.rhs + +land.rhs: ; preds = %land.lhs.true + %cmp = icmp eq i8 %1, %2 + br i1 %cmp, label %for.inc, label %lor.rhs + +lor.rhs: ; preds = %land.rhs + %call = tail call i32 @tolower(i32 %conv15) #1 + %3 = load i8* %r.013, align 1, !tbaa !1 + %conv7 = zext i8 %3 to i32 + %call8 = tail call i32 @tolower(i32 %conv7) #1 + %cmp9 = icmp eq i32 %call, %call8 + br i1 %cmp9, label %for.inc, label %lor.rhs.for.endsplit_crit_edge + +lor.rhs.for.endsplit_crit_edge: ; preds = %lor.rhs + %.pre.pre = load i8* %l.012, align 1, !tbaa !1 + br label %for.end + +for.inc: ; preds = %lor.rhs, %land.rhs + %incdec.ptr = getelementptr inbounds i8* %l.012, i32 1 + %incdec.ptr11 = getelementptr inbounds i8* %r.013, i32 1 + %4 = load i8* %incdec.ptr, align 1, !tbaa !1 + %conv = zext i8 %4 to i32 + %tobool = icmp eq i8 %4, 0 + br i1 %tobool, label %for.end, label %land.lhs.true + +for.end: ; preds = %for.inc, %lor.rhs.for.endsplit_crit_edge, %land.lhs.true, %entry + %5 = phi i8 [ 0, %entry ], [ %.pre.pre, %lor.rhs.for.endsplit_crit_edge ], [ %1, %land.lhs.true ], [ 0, %for.inc ] + %r.0.lcssa = phi i8* [ %_r, %entry ], [ %r.013, %lor.rhs.for.endsplit_crit_edge ], [ %r.013, %land.lhs.true ], [ %incdec.ptr11, %for.inc ] + %conv12 = zext i8 %5 to i32 + %call13 = tail call i32 @tolower(i32 %conv12) #1 + %6 = load i8* %r.0.lcssa, align 1, !tbaa !1 + %conv14 = zext i8 %6 to i32 + %call15 = tail call i32 @tolower(i32 %conv14) #1 + %sub = sub nsw i32 %call13, %call15 + ret i32 %sub +} + +declare i32 @tolower(i32) #5 + +; Function Attrs: nounwind readonly +define i32 @strcmp(i8* nocapture %l, i8* nocapture %r) #2 { +entry: + %0 = load i8* %l, align 1, !tbaa !1 + %1 = load i8* %r, align 1, !tbaa !1 + %cmp10 = icmp ne i8 %0, %1 + %tobool11 = icmp eq i8 %0, 0 + %or.cond12 = or i1 %cmp10, %tobool11 + %tobool513 = icmp eq i8 %1, 0 + %or.cond814 = or i1 %or.cond12, %tobool513 + br i1 %or.cond814, label %for.end, label %for.inc + +for.inc: ; preds = %for.inc, %entry + %r.addr.016 = phi i8* [ %incdec.ptr6, %for.inc ], [ %r, %entry ] + %l.addr.015 = phi i8* [ %incdec.ptr, %for.inc ], [ %l, %entry ] + %incdec.ptr = getelementptr inbounds i8* %l.addr.015, i32 1 + %incdec.ptr6 = getelementptr inbounds i8* %r.addr.016, i32 1 + %2 = load i8* %incdec.ptr, align 1, !tbaa !1 + %3 = load i8* %incdec.ptr6, align 1, !tbaa !1 + %cmp = icmp ne i8 %2, %3 + %tobool = icmp eq i8 %2, 0 + %or.cond = or i1 %cmp, %tobool + %tobool5 = icmp eq i8 %3, 0 + %or.cond8 = or i1 %or.cond, %tobool5 + br i1 %or.cond8, label %for.end, label %for.inc + +for.end: ; preds = %for.inc, %entry + %.lcssa9 = phi i8 [ %1, %entry ], [ %3, %for.inc ] + %.lcssa = phi i8 [ %0, %entry ], [ %2, %for.inc ] + %conv7 = zext i8 %.lcssa to i32 + %conv8 = zext i8 %.lcssa9 to i32 + %sub = sub nsw i32 %conv7, %conv8 + ret i32 %sub +} + +; Function Attrs: nounwind +define i32 @strncasecmp(i8* nocapture %_l, i8* nocapture %_r, i32 %n) #0 { +entry: + %tobool = icmp eq i32 %n, 0 + br i1 %tobool, label %return, label %for.cond.preheader + +for.cond.preheader: ; preds = %entry + %0 = load i8* %_l, align 1, !tbaa !1 + %tobool115 = icmp eq i8 %0, 0 + br i1 %tobool115, label %for.end, label %land.lhs.true.lr.ph + +land.lhs.true.lr.ph: ; preds = %for.cond.preheader + %conv14 = zext i8 %0 to i32 + br label %land.lhs.true + +land.lhs.true: ; preds = %for.inc, %land.lhs.true.lr.ph + %conv19 = phi i32 [ %conv14, %land.lhs.true.lr.ph ], [ %conv, %for.inc ] + %1 = phi i8 [ %0, %land.lhs.true.lr.ph ], [ %4, %for.inc ] + %n.addr.018.in = phi i32 [ %n, %land.lhs.true.lr.ph ], [ %n.addr.018, %for.inc ] + %r.017 = phi i8* [ %_r, %land.lhs.true.lr.ph ], [ %incdec.ptr14, %for.inc ] + %l.016 = phi i8* [ %_l, %land.lhs.true.lr.ph ], [ %incdec.ptr, %for.inc ] + %n.addr.018 = add i32 %n.addr.018.in, -1 + %2 = load i8* %r.017, align 1, !tbaa !1 + %tobool3 = icmp eq i8 %2, 0 + %tobool5 = icmp eq i32 %n.addr.018, 0 + %or.cond = or i1 %tobool3, %tobool5 + br i1 %or.cond, label %for.end, label %land.rhs + +land.rhs: ; preds = %land.lhs.true + %cmp = icmp eq i8 %1, %2 + br i1 %cmp, label %for.inc, label %lor.rhs + +lor.rhs: ; preds = %land.rhs + %call = tail call i32 @tolower(i32 %conv19) #1 + %3 = load i8* %r.017, align 1, !tbaa !1 + %conv10 = zext i8 %3 to i32 + %call11 = tail call i32 @tolower(i32 %conv10) #1 + %cmp12 = icmp eq i32 %call, %call11 + br i1 %cmp12, label %for.inc, label %lor.rhs.for.endsplit_crit_edge + +lor.rhs.for.endsplit_crit_edge: ; preds = %lor.rhs + %.pre.pre = load i8* %l.016, align 1, !tbaa !1 + br label %for.end + +for.inc: ; preds = %lor.rhs, %land.rhs + %incdec.ptr = getelementptr inbounds i8* %l.016, i32 1 + %incdec.ptr14 = getelementptr inbounds i8* %r.017, i32 1 + %4 = load i8* %incdec.ptr, align 1, !tbaa !1 + %conv = zext i8 %4 to i32 + %tobool1 = icmp eq i8 %4, 0 + br i1 %tobool1, label %for.end, label %land.lhs.true + +for.end: ; preds = %for.inc, %lor.rhs.for.endsplit_crit_edge, %land.lhs.true, %for.cond.preheader + %5 = phi i8 [ 0, %for.cond.preheader ], [ %.pre.pre, %lor.rhs.for.endsplit_crit_edge ], [ %1, %land.lhs.true ], [ 0, %for.inc ] + %r.0.lcssa = phi i8* [ %_r, %for.cond.preheader ], [ %r.017, %lor.rhs.for.endsplit_crit_edge ], [ %r.017, %land.lhs.true ], [ %incdec.ptr14, %for.inc ] + %conv16 = zext i8 %5 to i32 + %call17 = tail call i32 @tolower(i32 %conv16) #1 + %6 = load i8* %r.0.lcssa, align 1, !tbaa !1 + %conv18 = zext i8 %6 to i32 + %call19 = tail call i32 @tolower(i32 %conv18) #1 + %sub = sub nsw i32 %call17, %call19 + br label %return + +return: ; preds = %for.end, %entry + %retval.0 = phi i32 [ %sub, %for.end ], [ 0, %entry ] + ret i32 %retval.0 +} + +; Function Attrs: nounwind readonly +define i32 @strncmp(i8* nocapture %_l, i8* nocapture %_r, i32 %n) #2 { +entry: + %tobool = icmp eq i32 %n, 0 + br i1 %tobool, label %return, label %for.cond.preheader + +for.cond.preheader: ; preds = %entry + %0 = load i8* %_l, align 1, !tbaa !1 + %tobool113 = icmp eq i8 %0, 0 + br i1 %tobool113, label %for.end, label %land.lhs.true + +land.lhs.true: ; preds = %for.inc, %for.cond.preheader + %1 = phi i8 [ %3, %for.inc ], [ %0, %for.cond.preheader ] + %n.addr.016.in = phi i32 [ %n.addr.016, %for.inc ], [ %n, %for.cond.preheader ] + %r.015 = phi i8* [ %incdec.ptr9, %for.inc ], [ %_r, %for.cond.preheader ] + %l.014 = phi i8* [ %incdec.ptr, %for.inc ], [ %_l, %for.cond.preheader ] + %n.addr.016 = add i32 %n.addr.016.in, -1 + %2 = load i8* %r.015, align 1, !tbaa !1 + %notlhs = icmp ne i8 %2, 0 + %notrhs = icmp ne i32 %n.addr.016, 0 + %or.cond.not = and i1 %notrhs, %notlhs + %cmp = icmp eq i8 %1, %2 + %or.cond11 = and i1 %or.cond.not, %cmp + br i1 %or.cond11, label %for.inc, label %for.end + +for.inc: ; preds = %land.lhs.true + %incdec.ptr = getelementptr inbounds i8* %l.014, i32 1 + %incdec.ptr9 = getelementptr inbounds i8* %r.015, i32 1 + %3 = load i8* %incdec.ptr, align 1, !tbaa !1 + %tobool1 = icmp eq i8 %3, 0 + br i1 %tobool1, label %for.end, label %land.lhs.true + +for.end: ; preds = %for.inc, %land.lhs.true, %for.cond.preheader + %4 = phi i8 [ 0, %for.cond.preheader ], [ %1, %land.lhs.true ], [ 0, %for.inc ] + %r.0.lcssa = phi i8* [ %_r, %for.cond.preheader ], [ %r.015, %land.lhs.true ], [ %incdec.ptr9, %for.inc ] + %conv11 = zext i8 %4 to i32 + %5 = load i8* %r.0.lcssa, align 1, !tbaa !1 + %conv12 = zext i8 %5 to i32 + %sub = sub nsw i32 %conv11, %conv12 + br label %return + +return: ; preds = %for.end, %entry + %retval.0 = phi i32 [ %sub, %for.end ], [ 0, %entry ] + ret i32 %retval.0 +} + +attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #1 = { nounwind } +attributes #2 = { nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #3 = { nounwind readnone "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #4 = { noreturn "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #5 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } +attributes #6 = { noreturn nounwind } +attributes #7 = { nounwind readnone } +attributes #8 = { noreturn } + +!0 = metadata !{metadata !"any pointer", metadata !1} +!1 = metadata !{metadata !"omnipotent char", metadata !2} +!2 = metadata !{metadata !"Simple C/C++ TBAA"} +!3 = metadata !{metadata !"int", metadata !1} +!4 = metadata !{metadata !"short", metadata !1} +!5 = metadata !{metadata !"branch_weights", i32 64, i32 4} +!6 = metadata !{metadata !"branch_weights", i32 4, i32 64} +!7 = metadata !{i64 0, i64 4, metadata !0, i64 4, i64 4, metadata !3, i64 8, i64 4, metadata !0, i64 12, i64 4, metadata !3} +!8 = metadata !{metadata !"vtable pointer", metadata !2} diff --git a/tests/cases/i24_ce_fastcomp.txt b/tests/cases/i24_ce_fastcomp.txt new file mode 100644 index 00000000..12024aa3 --- /dev/null +++ b/tests/cases/i24_ce_fastcomp.txt @@ -0,0 +1 @@ +checksum = ADDDE3F6 diff --git a/tests/cases/i24_mem_ta2.ll b/tests/cases/i24_mem_ta2.ll index 550389fe..296c8c0b 100644 --- a/tests/cases/i24_mem_ta2.ll +++ b/tests/cases/i24_mem_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [6 x i8] c".%x.\0A\00", align 1 ; [#uses=1 type=[5 x i8]*] diff --git a/tests/cases/i96_ashr_ta2.ll b/tests/cases/i96_ashr_ta2.ll index 83966168..2800ad0d 100644 --- a/tests/cases/i96_ashr_ta2.ll +++ b/tests/cases/i96_ashr_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [23 x i8] c"hello..world!%x,%x,%x\0A\00", align 1 diff --git a/tests/cases/i96shiftnon32_ta2.ll b/tests/cases/i96shiftnon32_ta2.ll index 55e84575..3a3ba5fd 100644 --- a/tests/cases/i96shiftnon32_ta2.ll +++ b/tests/cases/i96shiftnon32_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpxFUbAg/test_emcc1.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.c_s = type { i8, float, i32 } diff --git a/tests/cases/icmp64.ll b/tests/cases/icmp64.ll new file mode 100644 index 00000000..440ff6f9 --- /dev/null +++ b/tests/cases/icmp64.ll @@ -0,0 +1,32 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +@.str = private unnamed_addr constant [17 x i8] c"hello, world %d\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +; [#uses=0] +define i32 @main() { +entry: + %retval = alloca i32, align 4 ; [#uses=1 type=i32*] + store i32 0, i32* %retval + %a0 = add i64 0, 0 + %a1 = icmp slt i64 %a0, 0 + %a2 = zext i1 %a1 to i32 + %calla = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %a2) + %b0 = add i64 0, 1 + %b1 = icmp slt i64 %b0, 0 + %b2 = zext i1 %b1 to i32 + %callb = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %b2) + %c0 = sub i64 1, 0 + %c1 = icmp slt i64 %c0, 0 + %c2 = zext i1 %c1 to i32 + %callc = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %c2) + %d0 = sub i64 0, 1 + %d1 = icmp slt i64 %d0, 0 + %d2 = zext i1 %d1 to i32 + %calld = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8]* @.str, i32 0, i32 0), i32 %d2) + ret i32 1 +} + +; [#uses=1] +declare i32 @printf(i8*, ...) diff --git a/tests/cases/icmp64.txt b/tests/cases/icmp64.txt new file mode 100644 index 00000000..5e75a06b --- /dev/null +++ b/tests/cases/icmp64.txt @@ -0,0 +1,4 @@ +hello, world 0 +hello, world 0 +hello, world 0 +hello, world 1 diff --git a/tests/cases/inttoptr.ll b/tests/cases/inttoptr.ll index c1b40a74..7682bed1 100644 --- a/tests/cases/inttoptr.ll +++ b/tests/cases/inttoptr.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/invokebitcast.ll b/tests/cases/invokebitcast.ll index ec090b0d..ecbce6dd 100644 --- a/tests/cases/invokebitcast.ll +++ b/tests/cases/invokebitcast.ll @@ -1,7 +1,7 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' ; Just test for compilation here -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.CPU_Regs = type { [8 x %union.GenReg32] } %union.GenReg32 = type { [1 x i32] } @@ -10,7 +10,7 @@ target triple = "le32-unknown-nacl" @.str = private unnamed_addr constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] ; [#uses=0] -define i32 @main() { +define i32 @main(i32 %p) { entry: %retval = alloca i32 ; [#uses=2] %0 = alloca i32 ; [#uses=2] @@ -24,13 +24,15 @@ entry: store i32 %3, i32* %retval, align 4 br label %return - invoke void bitcast (void (i32*, i32)* @_Z8toStringj to void (i64*, i32)*)(%struct.CPU_Regs* noalias @cpu_regs, i32 %99) + invoke void bitcast (void (i32*, i32)* @_Z8toStringj to void (i64*, i32)*)(i64* bitcast (%struct.CPU_Regs* @cpu_regs to i64*), i32 %p) to label %invcont33 unwind label %lpad106 invcont33: ret i32 %retval1 lpad106: + %Z = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) + cleanup ret i32 %retval1 return: ; preds = %entry @@ -40,3 +42,6 @@ return: ; preds = %entry ; [#uses=1] declare i32 @puts(i8*) + +declare void @_Z8toStringj(i32*, i32) +declare i32 @__gxx_personality_v0(...) diff --git a/tests/cases/invokeundef.ll b/tests/cases/invokeundef.ll index 2f13e7ab..e24763d9 100644 --- a/tests/cases/invokeundef.ll +++ b/tests/cases/invokeundef.ll @@ -1,7 +1,7 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' ; Just test for compilation here -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.CPU_Regs = type { [8 x %union.GenReg32] } %union.GenReg32 = type { [1 x i32] } diff --git a/tests/cases/legalizer_b_ta2.ll b/tests/cases/legalizer_b_ta2.ll index a6214100..78b5dc04 100644 --- a/tests/cases/legalizer_b_ta2.ll +++ b/tests/cases/legalizer_b_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @globaliz = global [300 x i8] zeroinitializer @@ -92,7 +92,7 @@ entry: store i128 %ored, i128* %bundled, align 4 call i32 (i8*)* @puts(i8* %buffer) - %ander = trunc i128 18402271027389267967 to i128 + %ander = bitcast i128 18402271027389267967 to i128 %anded = and i128 %loaded, %ander ; variable store i128 %anded, i128* %bundled, align 4 call i32 (i8*)* @puts(i8* %buffer) diff --git a/tests/cases/legalizer_ta2.ll b/tests/cases/legalizer_ta2.ll index 6f153ad2..1cd89220 100644 --- a/tests/cases/legalizer_ta2.ll +++ b/tests/cases/legalizer_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @globaliz = global [300 x i8] zeroinitializer diff --git a/tests/cases/loadbitcastgep.ll b/tests/cases/loadbitcastgep.ll index cfb88a0d..311329f3 100644 --- a/tests/cases/loadbitcastgep.ll +++ b/tests/cases/loadbitcastgep.ll @@ -1,6 +1,6 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.CPU_Regs = type { [8 x %union.GenReg32] } %union.GenReg32 = type { [1 x i32] } diff --git a/tests/cases/muli33_ta2.ll b/tests/cases/muli33_ta2.ll index b33b04f7..e6f092cd 100644 --- a/tests/cases/muli33_ta2.ll +++ b/tests/cases/muli33_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpt0JpDh/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [7 x i8] c"20\0A91\0A\00", align 1 @.str1 = private unnamed_addr constant [6 x i8] c"%u %u\00", align 1 diff --git a/tests/cases/oob_ta2.ll b/tests/cases/oob_ta2.ll index b95d28da..3c06573e 100644 --- a/tests/cases/oob_ta2.ll +++ b/tests/cases/oob_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %structy = type { [2 x [10 x i8]] } diff --git a/tests/cases/phi24_ta2.ll b/tests/cases/phi24_ta2.ll index 18577fee..0edb36be 100644 --- a/tests/cases/phi24_ta2.ll +++ b/tests/cases/phi24_ta2.ll @@ -1,6 +1,6 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %union.U4 = type { i32 } %union.U3 = type { i8* } diff --git a/tests/cases/phicubed.ll b/tests/cases/phicubed.ll index 5fc3208b..90f91e9c 100644 --- a/tests/cases/phicubed.ll +++ b/tests/cases/phicubed.ll @@ -1,6 +1,6 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.worker_args = type { i32, %struct.worker_args* } diff --git a/tests/cases/phientryimplicit.ll b/tests/cases/phientryimplicit.ll index c237457c..1dc5f2c7 100644 --- a/tests/cases/phientryimplicit.ll +++ b/tests/cases/phientryimplicit.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" ; Phi nodes can refer to the entry. And the entry might be unnamed, and doesn't even have a consistent implicit name! @@ -10,14 +10,14 @@ target triple = "le32-unknown-nacl" define i32 @main() { %retval = alloca i32, align 4 ; [#uses=1 type=i32*] %a16 = trunc i32 1 to i1 - br i1 %a16, label %L17, label %L26, !dbg !1269853 ; [debug line = 3920:5] + br i1 %a16, label %L17, label %L26 L17: %a25 = trunc i32 1 to i1 br label %L26 L26: - %a27 = phi i1 [ false, %1 ], [ %a25, %L17 ] ; [#uses=1 type=i1] + %a27 = phi i1 [ false, %0 ], [ %a25, %L17 ] ; [#uses=1 type=i1] store i32 0, i32* %retval %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32] %cal2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i1 %a27) ; make sure %27 is used @@ -27,7 +27,7 @@ L26: define i32 @main0() { %retval = alloca i32, align 4 ; [#uses=1 type=i32*] %a16 = trunc i32 1 to i1 - br i1 %a16, label %L17, label %L26, !dbg !1269853 ; [debug line = 3920:5] + br i1 %a16, label %L17, label %L26 L17: %a25 = trunc i32 1 to i1 diff --git a/tests/cases/phientryimplicitmix.ll b/tests/cases/phientryimplicitmix.ll index 527c761f..8903e783 100644 --- a/tests/cases/phientryimplicitmix.ll +++ b/tests/cases/phientryimplicitmix.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" ; Phi nodes can refer to the entry. And the entry might be unnamed, and doesn't even have a consistent implicit name! diff --git a/tests/cases/phientryimplicitmoar.ll b/tests/cases/phientryimplicitmoar.ll index 0f07cc44..ad1e701c 100644 --- a/tests/cases/phientryimplicitmoar.ll +++ b/tests/cases/phientryimplicitmoar.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] @.str2 = private unnamed_addr constant [15 x i8] c"hello!!world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/philoop_ta2.ll b/tests/cases/philoop_ta2.ll index 5036c7ba..b73aefc3 100644 --- a/tests/cases/philoop_ta2.ll +++ b/tests/cases/philoop_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/tmpVIBz29/a.out.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [13 x i8] c"99\0A70\0A26\0A97\0A\00", align 1 @.str1 = private unnamed_addr constant [12 x i8] c"%u %u %u %u\00", align 1 diff --git a/tests/cases/phinonexist.ll b/tests/cases/phinonexist.ll index 145d2221..75c1cef6 100644 --- a/tests/cases/phinonexist.ll +++ b/tests/cases/phinonexist.ll @@ -5,18 +5,19 @@ target triple = "i386-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] define i32 @main() { +entry: %retval = alloca i32, align 4 %a12 = zext i1 1 to i32 - br label %13 + br label %label13 -; <label>:13 ; preds = %13, %1 - %a14 = phi i32 [ %a12, %1 ], [ %a15, %135 ] +label13: ; preds = %13, %1 + %a14 = phi i32 [ %a12, %entry ], [ %a15, %135 ] %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) %a15 = add nsw i32 %a14, 2 %a16 = icmp eq i32 %a15, 9 - br label %17 + br label %label17 -; <label>:17 ; preds = %1 +label17: ; preds = %1 ret i32 1 } diff --git a/tests/cases/phinonreachable64.ll b/tests/cases/phinonreachable64.ll new file mode 100644 index 00000000..fe56fc09 --- /dev/null +++ b/tests/cases/phinonreachable64.ll @@ -0,0 +1,26 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] + +define i32 @main() { +_entry: + %retval = alloca i32, align 4 + %a12 = zext i1 1 to i64 + br label %_phinode + +_nonreachable: + %b = zext i32 -1 to i64 + br label %_phinode + +_phinode: + %a14 = phi i64 [ %a12, %_entry ], [ %b, %_nonreachable ] + %a14s = trunc i64 %a14 to i32 + %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) + ret i32 %a14s +} + +; [#uses=1] +declare i32 @printf(i8*, ...) + diff --git a/tests/cases/phiptrtoint.ll b/tests/cases/phiptrtoint.ll index d682dc06..2028f494 100644 --- a/tests/cases/phiptrtoint.ll +++ b/tests/cases/phiptrtoint.ll @@ -1,7 +1,7 @@ ; ModuleID = '/tmp/tmpJctwj0/bug.bc' ; just an asm validation check, no output -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %"class.test::Processor" = type { i32, %"class.test::StateMachine" } %"class.test::StateMachine" = type { { i32, i32 } } diff --git a/tests/cases/phiself.ll b/tests/cases/phiself.ll index 0a06fcca..72572859 100644 --- a/tests/cases/phiself.ll +++ b/tests/cases/phiself.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/emscripten_temp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [7 x i8] c"cheez\0A\00", align 1 @.str1 = private unnamed_addr constant [6 x i8] c"*%d*\0A\00", align 1 diff --git a/tests/cases/ptrtoi64.ll b/tests/cases/ptrtoi64.ll index 5898f529..e22b60dc 100644 --- a/tests/cases/ptrtoi64.ll +++ b/tests/cases/ptrtoi64.ll @@ -1,8 +1,8 @@ ; pointer to i64, then to i32 ; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str2 = private constant [9 x i8] c"*%d,%d*\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/ptrtoint_blockaddr.ll b/tests/cases/ptrtoint_blockaddr.ll index 6adc2c5b..f9f72449 100644 --- a/tests/cases/ptrtoint_blockaddr.ll +++ b/tests/cases/ptrtoint_blockaddr.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/quotedlabel.ll b/tests/cases/quotedlabel.ll index d32e380a..d4b8639c 100644 --- a/tests/cases/quotedlabel.ll +++ b/tests/cases/quotedlabel.ll @@ -13,7 +13,7 @@ entry: br label %"finish$$$" "finish$$$": ; preds = %entry - %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0] ret i32 0 } diff --git a/tests/cases/returnnan_fastcomp.ll b/tests/cases/returnnan_fastcomp.ll new file mode 100644 index 00000000..3a6a9f9e --- /dev/null +++ b/tests/cases/returnnan_fastcomp.ll @@ -0,0 +1,34 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +@.str = private unnamed_addr constant [18 x i8] c"hello, world %f!\0A\00", align 1 + +define i32 @main() { +entry: + %retval = alloca i32, align 4 + store i32 0, i32* %retval + %f = call double @nand() + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), double %f) + %g = call double @zerod() + %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), double %g) + %h = call float @zerof() + %hd = fpext float %h to double + %call3 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), double %hd) + ret i32 1 +} + +define double @nand() unnamed_addr align 2 { + ret double 0x7FF8000000000000 +} + +define double @zerod() unnamed_addr align 2 { + ret double 0x0000000000000000 +} + +define float @zerof() unnamed_addr align 2 { + ret float 0x0000000000000000 +} + +declare i32 @printf(i8*, ...) + diff --git a/tests/cases/returnnan_fastcomp.txt b/tests/cases/returnnan_fastcomp.txt new file mode 100644 index 00000000..f11733ba --- /dev/null +++ b/tests/cases/returnnan_fastcomp.txt @@ -0,0 +1,3 @@ +hello, world nan! +hello, world 0.000000! +hello, world 0.000000! diff --git a/tests/cases/sillybitcast.ll b/tests/cases/sillybitcast.ll index 50a54da9..e9baf74d 100644 --- a/tests/cases/sillybitcast.ll +++ b/tests/cases/sillybitcast.ll @@ -1,13 +1,13 @@ ; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] ; [#uses=2] -define void @"\01_Z5hellov"() { +define void @"_Z5hellov"() { entry: - %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0)) ; [#uses=0] + %0 = call i32 bitcast (i32 (i8*)* @puts to i32 (i32*)*)(i32* bitcast (i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0) to i32*)) ; [#uses=0] br label %return return: ; preds = %entry @@ -23,7 +23,7 @@ entry: %retval = alloca i32 ; [#uses=2] %0 = alloca i32 ; [#uses=2] %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @"\01_Z5hellov"() + call void @"_Z5hellov"() store i32 0, i32* %0, align 4 %1 = load i32* %0, align 4 ; [#uses=1] store i32 %1, i32* %retval, align 4 diff --git a/tests/cases/sillybitcast2.ll b/tests/cases/sillybitcast2.ll index 02cf8615..6ef0f32d 100644 --- a/tests/cases/sillybitcast2.ll +++ b/tests/cases/sillybitcast2.ll @@ -1,6 +1,6 @@ ; ModuleID = '/tmp/emscripten/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [14 x i8] c"hello, world!\00", align 1 ; [#uses=1] diff --git a/tests/cases/sillyfuncast.ll b/tests/cases/sillyfuncast.ll index 33598104..af03e975 100644 --- a/tests/cases/sillyfuncast.ll +++ b/tests/cases/sillyfuncast.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/sillyfuncast2.ll b/tests/cases/sillyfuncast2_noasm.ll index f72ebe28..6c55b990 100644 --- a/tests/cases/sillyfuncast2.ll +++ b/tests/cases/sillyfuncast2_noasm.ll @@ -14,6 +14,7 @@ entry: %retval = alloca i32, align 4 ; [#uses=1 type=i32*] store i32 0, i32* %retval call i32 bitcast (void (i32, i32)* @doit to i32 (i32, i64)*)(i32 0, i64 0) nounwind + call void bitcast (void (i32, i32)* @doit to void (i32, float)*)(i32 0, float 0.0) nounwind ret i32 1 } diff --git a/tests/cases/storebigfloat.ll b/tests/cases/storebigfloat.ll index b940f5ca..6348fd5f 100644 --- a/tests/cases/storebigfloat.ll +++ b/tests/cases/storebigfloat.ll @@ -1,5 +1,5 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/storestruct.ll b/tests/cases/storestruct.ll index 3e996195..272b8d5a 100644 --- a/tests/cases/storestruct.ll +++ b/tests/cases/storestruct.ll @@ -1,6 +1,6 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" ; Load and store an entire structure as a whole (and also load as a whole, extract values and save separately, etc.) diff --git a/tests/cases/structinparam.ll b/tests/cases/structinparam.ll index d81f5e67..a85a50ae 100644 --- a/tests/cases/structinparam.ll +++ b/tests/cases/structinparam.ll @@ -1,6 +1,6 @@ ; ModuleID = 'min.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %ac = type { i8*, i32 } diff --git a/tests/cases/structparam.ll b/tests/cases/structparam.ll index c59ad600..53ee5a93 100644 --- a/tests/cases/structparam.ll +++ b/tests/cases/structparam.ll @@ -27,7 +27,7 @@ cond.end: ; preds = %cond.false, %cond.t %cond = phi { i32, i32 } [ { i32 5, i32 6 }, %entry ], [ zeroinitializer, %cond.null ] ; [#uses=1] store { i32, i32 } %cond, { i32, i32 }* %comp %call = call i32 (i32, { i32, i32 })* @doit(i32 1, { i32, i32 } %cond) ; - store { i32, i32 } { i32 ptrtoint (i64* @_dispatchTable to i32), i32 0 }, { i32, i32 }* getelementptr inbounds ([1 x i64]* @_dispatchTable, i32 0, i32 0, i32 1), align 4 + store { i32, i32 } { i32 ptrtoint (i64* @_dispatchTable to i32), i32 0 }, { i32, i32 }* bitcast (i64* getelementptr inbounds ([1 x i64]* bitcast (i64* @_dispatchTable to [1 x i64]*), i32 0, i32 0) to { i32, i32 }*), align 4 ret i32 0 ; [debug line = 6:13] } diff --git a/tests/cases/structphiparam.ll b/tests/cases/structphiparam.ll index fadf4d29..8ce7b9ae 100644 --- a/tests/cases/structphiparam.ll +++ b/tests/cases/structphiparam.ll @@ -1,6 +1,6 @@ ; ModuleID = '/dev/shm/tmp/src.cpp.o' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, %d %d!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] @_dispatchTable = internal global i64 0 diff --git a/tests/cases/sub_11_0.ll b/tests/cases/sub_11_0.ll index d4094556..aab61866 100644 --- a/tests/cases/sub_11_0.ll +++ b/tests/cases/sub_11_0.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cases/switch64_ta2.ll b/tests/cases/switch64_ta2.ll index 1a6d52f3..23413847 100644 --- a/tests/cases/switch64_ta2.ll +++ b/tests/cases/switch64_ta2.ll @@ -1,5 +1,5 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [18 x i8] c"hello, world: %d\0A\00", align 1 diff --git a/tests/cases/switch64b_ta2.ll b/tests/cases/switch64b_ta2.ll index 4364725f..60aca441 100644 --- a/tests/cases/switch64b_ta2.ll +++ b/tests/cases/switch64b_ta2.ll @@ -1,5 +1,5 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private constant [18 x i8] c"hello, world: %d\0A\00", align 1 diff --git a/tests/cases/switch64c_ta2.ll b/tests/cases/switch64c_ta2.ll new file mode 100644 index 00000000..6826a412 --- /dev/null +++ b/tests/cases/switch64c_ta2.ll @@ -0,0 +1,68 @@ +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +@.str = private constant [18 x i8] c"hello, world: %d\0A\00", align 1 + +declare i32 @printf(i8*, ...) + +define i32 @main() { + %a333 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 5) + %a400 = zext i32 %a333 to i64 + %check = trunc i32 %a333 to i1 + br i1 %check, label %l1, label %l2 + +l1: + %bbb = phi i64 [ %a400, %0 ], [ 10, %l2 ] + %bbb32 = trunc i64 %bbb to i32 + %a333z = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %bbb32) + %check2 = trunc i32 %bbb32 to i1 + br i1 %check2, label %l2, label %label999 + +l2: + %a410 = phi i64 [ %a400, %0 ], [ %bbb, %l1 ] + %a444 = udiv i64 %a410, 3 + switch i64 %a444, label %l1 [ + i64 1000, label %label9950 + i64 1001, label %label9951 + i64 1002, label %label9952 + i64 1003, label %label9953 + i64 1004, label %label9954 + i64 1005, label %label9955 + i64 1006, label %label9956 + i64 1007, label %label9957 + i64 1008, label %label9958 + i64 1009, label %label9959 + ] + +label9950: + %waka = phi i64 [1000, %l2], [0, %label9951], [1, %label9952], [2, %label9953], [3, %label9954], [4, %label9955], [5, %label9956], [6, %label9957], [7, %label9958], [8, %label9959] + %waka32 = trunc i64 %waka to i32 + %a333b = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %waka32) + br label %label999 + +label9951: + br label %label9950 +label9952: + br label %label9950 +label9953: + br label %label9950 +label9954: + br label %label9950 +label9955: + br label %label9950 +label9956: + br label %label9950 +label9957: + br label %label9950 +label9958: + br label %label9950 +label9959: + br label %label9950 + +label999: ; preds = %555 + %last = phi i64 [1, %l1], [2, %label9950] + %last32 = trunc i64 %last to i32 + %a333c = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([18 x i8]* @.str, i32 0, i32 0), i32 %last32) + ret i32 0 +} + diff --git a/tests/cases/switch64c_ta2.txt b/tests/cases/switch64c_ta2.txt new file mode 100644 index 00000000..29999663 --- /dev/null +++ b/tests/cases/switch64c_ta2.txt @@ -0,0 +1,3 @@ +hello, world: 5 +hello, world: 10 +hello, world: 1 diff --git a/tests/cases/uadd_overflow_ta2.ll b/tests/cases/uadd_overflow_ta2.ll index e827cb38..1268f78a 100644 --- a/tests/cases/uadd_overflow_ta2.ll +++ b/tests/cases/uadd_overflow_ta2.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str2 = private constant [9 x i8] c"*%d,%d*\0A\00", align 1 ; [#uses=1] diff --git a/tests/cases/usenullcall_fastcomp.ll b/tests/cases/usenullcall_fastcomp.ll new file mode 100644 index 00000000..f0996e08 --- /dev/null +++ b/tests/cases/usenullcall_fastcomp.ll @@ -0,0 +1,31 @@ +; ModuleID = 'tests/hello_world.bc' +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" + +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 +@.str1 = private unnamed_addr constant [15 x i8] c"hello, worldA\0A\00", align 1 +@.str2 = private unnamed_addr constant [15 x i8] c"hello, worldB\0A\00", align 1 + +define i32 @main() { +entry: + %retval = alloca i32, align 4 ; [#uses=1 type=i32*] + store i32 0, i32* %retval + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0), i32 1) + %bad = call zeroext i1 null() + %bad2 = call zeroext i1 null(i32 5, float 1.0E2, double 0.02, i64 1000, i1 0, i32* %retval) + %bad3 = call zeroext i1 (i32, float, double, i64, i1, i32*)* null(i32 5, float 1.0E2, double 0.02, i64 1000, i1 0, i32* %retval) + %bad4 = or i1 %bad, %bad2 + %bad5 = or i1 %bad3, %bad4 + br i1 %bad5, label %pre, label %finish + +pre: + %call0 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str1, i32 0, i32 0), i32 0) + ret i32 0 + +finish: + %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str2, i32 0, i32 0), i32 1) + ret i32 1 +} + +; [#uses=1] +declare i32 @printf(i8*, ...) diff --git a/tests/cases/usenullcall_fastcomp.txt b/tests/cases/usenullcall_fastcomp.txt new file mode 100644 index 00000000..270c611e --- /dev/null +++ b/tests/cases/usenullcall_fastcomp.txt @@ -0,0 +1 @@ +hello, world! diff --git a/tests/cases/zeroembedded.ll b/tests/cases/zeroembedded.ll index 167fe278..7acbc017 100644 --- a/tests/cases/zeroembedded.ll +++ b/tests/cases/zeroembedded.ll @@ -1,5 +1,5 @@ -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" %struct.pypy_str = type { i32, [0 x i8] } %struct.pypy_strval = type { i32, [13 x i8] } diff --git a/tests/cases/zeroextarg.ll b/tests/cases/zeroextarg.ll index a3caa74c..d02b671b 100644 --- a/tests/cases/zeroextarg.ll +++ b/tests/cases/zeroextarg.ll @@ -1,6 +1,6 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" @.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] diff --git a/tests/cmake/target_html/CMakeLists.txt b/tests/cmake/target_html/CMakeLists.txt index b5c69417..ce26c541 100644 --- a/tests/cmake/target_html/CMakeLists.txt +++ b/tests/cmake/target_html/CMakeLists.txt @@ -10,6 +10,38 @@ else() # Either MinSizeRel, RelWithDebInfo or Release, all which run with optimi SET(linkFlags "-O2") endif() +if (NOT CMAKE_AR OR NOT EXISTS "${CMAKE_AR}") + message(FATAL_ERROR "CMAKE_AR='${CMAKE_AR}' does not exist for Emscripten toolchain!") +endif() + +if (NOT CMAKE_RANLIB OR NOT EXISTS "${CMAKE_RANLIB}") + message(FATAL_ERROR "CMAKE_RANLIB='${CMAKE_RANLIB}' does not exist for Emscripten toolchain!") +endif() + +if (NOT CMAKE_C_COMPILER OR NOT EXISTS "${CMAKE_C_COMPILER}") + message(FATAL_ERROR "CMAKE_C_COMPILER='${CMAKE_C_COMPILER}' does not exist for Emscripten toolchain!") +endif() + +if (NOT CMAKE_CXX_COMPILER OR NOT EXISTS "${CMAKE_CXX_COMPILER}") + message(FATAL_ERROR "CMAKE_CXX_COMPILER='${CMAKE_CXX_COMPILER}' does not exist for Emscripten toolchain!") +endif() + +if (WIN32) + message(FATAL_ERROR "WIN32 should not be defined when cross-compiling!") +endif() + +if (APPLE) + message(FATAL_ERROR "APPLE should not be defined when cross-compiling!") +endif() + +if (NOT EMSCRIPTEN) + message(FATAL_ERROR "EMSCRIPTEN should be defined when cross-compiling!") +endif() + +if (NOT CMAKE_C_SIZEOF_DATA_PTR) + message(FATAL_ERROR "CMAKE_C_SIZEOF_DATA_PTR was not defined!") +endif() + SET(CMAKE_EXECUTABLE_SUFFIX ".html") add_executable(hello_world_gles ${sourceFiles}) diff --git a/tests/core/test_atomic_cxx.cpp b/tests/core/test_atomic_cxx.cpp new file mode 100644 index 00000000..f78922a1 --- /dev/null +++ b/tests/core/test_atomic_cxx.cpp @@ -0,0 +1,130 @@ +//------------------------------------------------------------------------------ +// test C++11 atomics +// compile native version with: +// clang -std=c++11 -Wno-format atomic_test.cpp +// compile emscripten version with: +// emcc -std=c++11 -Wno-format atomic_test.cpp +//------------------------------------------------------------------------------ +#include <atomic> +#include <cstdio> + +template<typename TYPE, typename UNSIGNED_TYPE> void test(TYPE mask0, TYPE mask1, TYPE mask2) { + typedef TYPE dog; + + const TYPE numMemoryOrders = 6; + std::memory_order memoryOrder[numMemoryOrders] = { + std::memory_order_relaxed, + std::memory_order_consume, + std::memory_order_acquire, + std::memory_order_release, + std::memory_order_acq_rel, + std::memory_order_seq_cst, + }; + + // test atomic<int> + std::atomic<dog> atomicDog(5); + printf("atomic<int>.is_lock_free(): %s\n", atomicDog.is_lock_free() ? "true" : "false"); + printf("atomic<int> value: %lld\n", (long long)TYPE(atomicDog)); + + // test store/load + for (TYPE i = 0; i < numMemoryOrders; i++) { + atomicDog.store(i, memoryOrder[i]); + printf("store/load %lld: %lld\n", (long long)i, (long long)atomicDog.load(memoryOrder[i])); + } + + // test exchange + for (TYPE i = 0; i < numMemoryOrders; i++) { + TYPE old = atomicDog.exchange(i, memoryOrder[i]); + printf("exchange %lld: old=%lld new=%lld\n", (long long)i, (long long)old, (long long)TYPE(atomicDog)); + } + + // compare_exchange_weak + for (TYPE i = 0; i < numMemoryOrders; i++) { + bool success = atomicDog.compare_exchange_weak(i, i + 1, memoryOrder[i], memoryOrder[i]); + printf("compare_exchange_weak %lld: success = %s\n", (long long)i, success ? "true" : "false"); + } + + // compare_exchange_strong + for (TYPE i = 0; i < numMemoryOrders; i++) { + bool success = atomicDog.compare_exchange_strong(i, i + 1, memoryOrder[i], memoryOrder[i]); + printf("compare_exchange_strong %lld: success = %s\n", (long long)i, success ? "true" : "false"); + } + + // fetch_add + atomicDog = 0; + for (TYPE i = 0; i < numMemoryOrders; i++) { + TYPE old = atomicDog.fetch_add(1, memoryOrder[i]); + printf("fetch_add %lld: old=%lld new=%lld\n", (long long)i, (long long)old, (long long)TYPE(atomicDog)); + } + + // fetch_sub + for (TYPE i = 0; i < numMemoryOrders; i++) { + TYPE old = atomicDog.fetch_sub(1, memoryOrder[i]); + printf("fetch_sub %lld: old=%lld new=%lld\n", (long long)i, (long long)old, (long long)TYPE(atomicDog)); + } + + // fetch_and + for (TYPE i = 0; i < numMemoryOrders; i++) { + atomicDog.store(mask0, memoryOrder[i]); + TYPE old = atomicDog.fetch_and((1<<i), memoryOrder[i]); + printf("fetch_and %lld: old=%llx, new=%llx\n", (long long)i, (unsigned long long)UNSIGNED_TYPE(old), (unsigned long long)UNSIGNED_TYPE(atomicDog)); + } + + // fetch_or + atomicDog = 0; + for (TYPE i = 0; i < numMemoryOrders; i++) { + TYPE old = atomicDog.fetch_or((1<<i), memoryOrder[i]); + printf("fetch_or %lld: old=%llx, new=%llx\n", (long long)i, (unsigned long long)UNSIGNED_TYPE(old), (unsigned long long)UNSIGNED_TYPE(atomicDog)); + } + + // fetch_xor + atomicDog = 0; + for (int i = 0; i < numMemoryOrders; i++) { + int old = atomicDog.fetch_xor((1<<i), memoryOrder[i]); + printf("fetch_xor %lld: old=%llx, new=%llx\n", (long long)i, (unsigned long long)UNSIGNED_TYPE(old), (unsigned long long)UNSIGNED_TYPE(atomicDog)); + } + + // operator++, -- + atomicDog = 0; + atomicDog++; + printf("operator++: %lld\n", (long long)TYPE(atomicDog)); + atomicDog--; + printf("operator--: %lld\n", (long long)TYPE(atomicDog)); + + // operator +=, -=, &=, |=, ^= + atomicDog += 10; + printf("operator+=: %lld\n", (long long)TYPE(atomicDog)); + atomicDog -= 5; + printf("operator-=: %lld\n", (long long)TYPE(atomicDog)); + atomicDog |= mask0; + printf("operator|=: %llx\n", (unsigned long long)UNSIGNED_TYPE(atomicDog)); + atomicDog &= mask1; + printf("operator&=: %llx\n", (unsigned long long)UNSIGNED_TYPE(atomicDog)); + atomicDog ^= mask2; + printf("operator^=: %llx\n", (unsigned long long)UNSIGNED_TYPE(atomicDog)); + +} + +int main() { + + // test 8, 16, 32 and 64-bit data types + printf("\n8 bits\n\n"); + test<char, unsigned char>(0xFF, 0xF0, 0x0F); + printf("\n16 bits\n\n"); + test<short, unsigned short>(0xFFFF, 0xF0F0, 0x0F0F); + printf("\n32 bits\n\n"); + test<int, unsigned int>(0xFFFFFFFF, 0xF0F0F0F0, 0x0F0F0F0F); + printf("\n64 bits\n\n"); + test<long long, unsigned long long>(0xFFFFFFFFFFFFFFFF, 0xF0F0F0F0F0F0F0F0, 0x0F0F0F0F0F0F0F0F); + + // test atomic_flag (should also have memory_orders, but probably doesn't matter + // to find the missing atomic functions) + std::atomic_flag af; + af.clear(); + bool b = af.test_and_set(); + printf("atomic_flag: %s\n", b ? "true" : "false"); + + printf("done.\n"); + return 0; +} + diff --git a/tests/core/test_atomic_cxx.txt b/tests/core/test_atomic_cxx.txt new file mode 100644 index 00000000..da437b57 --- /dev/null +++ b/tests/core/test_atomic_cxx.txt @@ -0,0 +1,226 @@ + +8 bits + +atomic<int>.is_lock_free(): true +atomic<int> value: 5 +store/load 0: 0 +store/load 1: 1 +store/load 2: 2 +store/load 3: 3 +store/load 4: 4 +store/load 5: 5 +exchange 0: old=5 new=0 +exchange 1: old=0 new=1 +exchange 2: old=1 new=2 +exchange 3: old=2 new=3 +exchange 4: old=3 new=4 +exchange 5: old=4 new=5 +compare_exchange_weak 5: success = false +compare_exchange_strong 5: success = false +fetch_add 0: old=0 new=1 +fetch_add 1: old=1 new=2 +fetch_add 2: old=2 new=3 +fetch_add 3: old=3 new=4 +fetch_add 4: old=4 new=5 +fetch_add 5: old=5 new=6 +fetch_sub 0: old=6 new=5 +fetch_sub 1: old=5 new=4 +fetch_sub 2: old=4 new=3 +fetch_sub 3: old=3 new=2 +fetch_sub 4: old=2 new=1 +fetch_sub 5: old=1 new=0 +fetch_and 0: old=ff, new=1 +fetch_and 1: old=ff, new=2 +fetch_and 2: old=ff, new=4 +fetch_and 3: old=ff, new=8 +fetch_and 4: old=ff, new=10 +fetch_and 5: old=ff, new=20 +fetch_or 0: old=0, new=1 +fetch_or 1: old=1, new=3 +fetch_or 2: old=3, new=7 +fetch_or 3: old=7, new=f +fetch_or 4: old=f, new=1f +fetch_or 5: old=1f, new=3f +fetch_xor 0: old=0, new=1 +fetch_xor 1: old=1, new=3 +fetch_xor 2: old=3, new=7 +fetch_xor 3: old=7, new=f +fetch_xor 4: old=f, new=1f +fetch_xor 5: old=1f, new=3f +operator++: 1 +operator--: 0 +operator+=: 10 +operator-=: 5 +operator|=: ff +operator&=: f0 +operator^=: ff + +16 bits + +atomic<int>.is_lock_free(): true +atomic<int> value: 5 +store/load 0: 0 +store/load 1: 1 +store/load 2: 2 +store/load 3: 3 +store/load 4: 4 +store/load 5: 5 +exchange 0: old=5 new=0 +exchange 1: old=0 new=1 +exchange 2: old=1 new=2 +exchange 3: old=2 new=3 +exchange 4: old=3 new=4 +exchange 5: old=4 new=5 +compare_exchange_weak 5: success = false +compare_exchange_strong 5: success = false +fetch_add 0: old=0 new=1 +fetch_add 1: old=1 new=2 +fetch_add 2: old=2 new=3 +fetch_add 3: old=3 new=4 +fetch_add 4: old=4 new=5 +fetch_add 5: old=5 new=6 +fetch_sub 0: old=6 new=5 +fetch_sub 1: old=5 new=4 +fetch_sub 2: old=4 new=3 +fetch_sub 3: old=3 new=2 +fetch_sub 4: old=2 new=1 +fetch_sub 5: old=1 new=0 +fetch_and 0: old=ffff, new=1 +fetch_and 1: old=ffff, new=2 +fetch_and 2: old=ffff, new=4 +fetch_and 3: old=ffff, new=8 +fetch_and 4: old=ffff, new=10 +fetch_and 5: old=ffff, new=20 +fetch_or 0: old=0, new=1 +fetch_or 1: old=1, new=3 +fetch_or 2: old=3, new=7 +fetch_or 3: old=7, new=f +fetch_or 4: old=f, new=1f +fetch_or 5: old=1f, new=3f +fetch_xor 0: old=0, new=1 +fetch_xor 1: old=1, new=3 +fetch_xor 2: old=3, new=7 +fetch_xor 3: old=7, new=f +fetch_xor 4: old=f, new=1f +fetch_xor 5: old=1f, new=3f +operator++: 1 +operator--: 0 +operator+=: 10 +operator-=: 5 +operator|=: ffff +operator&=: f0f0 +operator^=: ffff + +32 bits + +atomic<int>.is_lock_free(): true +atomic<int> value: 5 +store/load 0: 0 +store/load 1: 1 +store/load 2: 2 +store/load 3: 3 +store/load 4: 4 +store/load 5: 5 +exchange 0: old=5 new=0 +exchange 1: old=0 new=1 +exchange 2: old=1 new=2 +exchange 3: old=2 new=3 +exchange 4: old=3 new=4 +exchange 5: old=4 new=5 +compare_exchange_weak 5: success = false +compare_exchange_strong 5: success = false +fetch_add 0: old=0 new=1 +fetch_add 1: old=1 new=2 +fetch_add 2: old=2 new=3 +fetch_add 3: old=3 new=4 +fetch_add 4: old=4 new=5 +fetch_add 5: old=5 new=6 +fetch_sub 0: old=6 new=5 +fetch_sub 1: old=5 new=4 +fetch_sub 2: old=4 new=3 +fetch_sub 3: old=3 new=2 +fetch_sub 4: old=2 new=1 +fetch_sub 5: old=1 new=0 +fetch_and 0: old=ffffffff, new=1 +fetch_and 1: old=ffffffff, new=2 +fetch_and 2: old=ffffffff, new=4 +fetch_and 3: old=ffffffff, new=8 +fetch_and 4: old=ffffffff, new=10 +fetch_and 5: old=ffffffff, new=20 +fetch_or 0: old=0, new=1 +fetch_or 1: old=1, new=3 +fetch_or 2: old=3, new=7 +fetch_or 3: old=7, new=f +fetch_or 4: old=f, new=1f +fetch_or 5: old=1f, new=3f +fetch_xor 0: old=0, new=1 +fetch_xor 1: old=1, new=3 +fetch_xor 2: old=3, new=7 +fetch_xor 3: old=7, new=f +fetch_xor 4: old=f, new=1f +fetch_xor 5: old=1f, new=3f +operator++: 1 +operator--: 0 +operator+=: 10 +operator-=: 5 +operator|=: ffffffff +operator&=: f0f0f0f0 +operator^=: ffffffff + +64 bits + +atomic<int>.is_lock_free(): false +atomic<int> value: 5 +store/load 0: 0 +store/load 1: 1 +store/load 2: 2 +store/load 3: 3 +store/load 4: 4 +store/load 5: 5 +exchange 0: old=5 new=0 +exchange 1: old=0 new=1 +exchange 2: old=1 new=2 +exchange 3: old=2 new=3 +exchange 4: old=3 new=4 +exchange 5: old=4 new=5 +compare_exchange_weak 5: success = false +compare_exchange_strong 5: success = false +fetch_add 0: old=0 new=1 +fetch_add 1: old=1 new=2 +fetch_add 2: old=2 new=3 +fetch_add 3: old=3 new=4 +fetch_add 4: old=4 new=5 +fetch_add 5: old=5 new=6 +fetch_sub 0: old=6 new=5 +fetch_sub 1: old=5 new=4 +fetch_sub 2: old=4 new=3 +fetch_sub 3: old=3 new=2 +fetch_sub 4: old=2 new=1 +fetch_sub 5: old=1 new=0 +fetch_and 0: old=ffffffffffffffff, new=1 +fetch_and 1: old=ffffffffffffffff, new=2 +fetch_and 2: old=ffffffffffffffff, new=4 +fetch_and 3: old=ffffffffffffffff, new=8 +fetch_and 4: old=ffffffffffffffff, new=10 +fetch_and 5: old=ffffffffffffffff, new=20 +fetch_or 0: old=0, new=1 +fetch_or 1: old=1, new=3 +fetch_or 2: old=3, new=7 +fetch_or 3: old=7, new=f +fetch_or 4: old=f, new=1f +fetch_or 5: old=1f, new=3f +fetch_xor 0: old=0, new=1 +fetch_xor 1: old=1, new=3 +fetch_xor 2: old=3, new=7 +fetch_xor 3: old=7, new=f +fetch_xor 4: old=f, new=1f +fetch_xor 5: old=1f, new=3f +operator++: 1 +operator--: 0 +operator+=: 10 +operator-=: 5 +operator|=: ffffffffffffffff +operator&=: f0f0f0f0f0f0f0f0 +operator^=: ffffffffffffffff +atomic_flag: false +done. diff --git a/tests/core/test_inlinejs3.in b/tests/core/test_inlinejs3.in index 9ddd5907..c3b9b769 100644 --- a/tests/core/test_inlinejs3.in +++ b/tests/core/test_inlinejs3.in @@ -1,12 +1,19 @@ #include <stdio.h> #include <emscripten.h> +void loop_iter() { + EM_ASM(Module.print('loop iter!')); +} + int main(int argc, char **argv) { EM_ASM(Module.print('hello dere1')); EM_ASM("Module.print('hello dere2');"); + emscripten_debugger(); // does nothing in shells; check for validation error though for (int i = 0; i < 3; i++) { EM_ASM(Module.print('hello dere3'); Module.print('hello dere' + 4);); } + EM_ASM_({ Module.print('hello input ' + $0) }, 123); + EM_ASM_ARGS({ Module.print('hello input ' + $0) }, 456); int sum = 0; for (int i = 0; i < argc * 3; i++) { sum += EM_ASM_INT({ @@ -19,5 +26,6 @@ int main(int argc, char **argv) { sum = 0; sum = EM_ASM_INT_V({ return globalVar }); // no inputs, just output printf("sum: %d\n", sum); + for (int i = 0; i < argc*2; i++) loop_iter(); return 0; } diff --git a/tests/core/test_inlinejs3.out b/tests/core/test_inlinejs3.out index c293e80b..c48cc3c8 100644 --- a/tests/core/test_inlinejs3.out +++ b/tests/core/test_inlinejs3.out @@ -6,7 +6,11 @@ hello dere3 hello dere4 hello dere3 hello dere4 +hello input 123 +hello input 456 i: 0,0.00 i: 1,0.08 i: 2,0.17 sum: 6 +loop iter! +loop iter! diff --git a/tests/core/test_sscanf_other_whitespace.in b/tests/core/test_sscanf_other_whitespace.in index 467fa4f0..3ae23d92 100644 --- a/tests/core/test_sscanf_other_whitespace.in +++ b/tests/core/test_sscanf_other_whitespace.in @@ -1,8 +1,8 @@ #include <stdio.h> int main() { - short int x; - short int y; + int x; + int y; const char* buffer[] = { "\t2\t3\t", /* TAB - horizontal tab */ diff --git a/tests/core/test_strndup.out b/tests/core/test_strndup.out index 681f00cc..f86db64e 100644 --- a/tests/core/test_strndup.out +++ b/tests/core/test_strndup.out @@ -3,4 +3,4 @@ 3:strndup - duplicate a specific number of bytes from a string 4:strndup - duplicate a specific number of bytes from a string 5:strndup - duplicate -6: +6:strndup - duplicate a specific number of bytes from a string diff --git a/tests/cube_explosion.c b/tests/cube_explosion.c index 0c6eb674..a899f068 100644 --- a/tests/cube_explosion.c +++ b/tests/cube_explosion.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -216,7 +216,7 @@ int main(int argc, char *argv[]) glDeleteTextures(1, &texture); assert(!glIsTexture(texture)); // but not anymore -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom.c b/tests/cubegeom.c index e749045b..950439ec 100644 --- a/tests/cubegeom.c +++ b/tests/cubegeom.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -316,7 +316,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_color.c b/tests/cubegeom_color.c index ff30e1a9..7a41c64d 100644 --- a/tests/cubegeom_color.c +++ b/tests/cubegeom_color.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -38,10 +38,6 @@ void verify() { for (int x = 0; x < width*height*4; x++) { if (x % 4 != 3) sum += x * data[x]; } -#if EMSCRIPTEN - int result = sum; - REPORT_RESULT(); -#endif } int main(int argc, char *argv[]) @@ -286,7 +282,7 @@ int main(int argc, char *argv[]) verify(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_color2.c b/tests/cubegeom_color2.c index 76d71d00..76bbb119 100644 --- a/tests/cubegeom_color2.c +++ b/tests/cubegeom_color2.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -273,7 +273,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_fog.c b/tests/cubegeom_fog.c index cae6ca2d..50d2843b 100644 --- a/tests/cubegeom_fog.c +++ b/tests/cubegeom_fog.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_glew.c b/tests/cubegeom_glew.c index 210e1c60..96f401c6 100644 --- a/tests/cubegeom_glew.c +++ b/tests/cubegeom_glew.c @@ -287,7 +287,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_mt.c b/tests/cubegeom_mt.c index b4ad28a7..cbfcbfdf 100644 --- a/tests/cubegeom_mt.c +++ b/tests/cubegeom_mt.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -274,7 +274,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_normal.c b/tests/cubegeom_normal.c index 02655edf..e56286fb 100644 --- a/tests/cubegeom_normal.c +++ b/tests/cubegeom_normal.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_normal_dap.c b/tests/cubegeom_normal_dap.c index 752911a8..594aec05 100644 --- a/tests/cubegeom_normal_dap.c +++ b/tests/cubegeom_normal_dap.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -266,7 +266,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_normal_dap_far.c b/tests/cubegeom_normal_dap_far.c index 35a068d9..da28f775 100644 --- a/tests/cubegeom_normal_dap_far.c +++ b/tests/cubegeom_normal_dap_far.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#if !defined(__EMSCRIPTEN__) #define USE_GLEW 1 #endif @@ -263,7 +263,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#if !defined(__EMSCRIPTEN__) SDL_Delay(1500); #endif diff --git a/tests/cubegeom_normal_dap_far_glda.c b/tests/cubegeom_normal_dap_far_glda.c index 849245b8..ee381458 100644 --- a/tests/cubegeom_normal_dap_far_glda.c +++ b/tests/cubegeom_normal_dap_far_glda.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -254,7 +254,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_normal_dap_far_glda_quad.c b/tests/cubegeom_normal_dap_far_glda_quad.c index 93c157a4..91f60031 100644 --- a/tests/cubegeom_normal_dap_far_glda_quad.c +++ b/tests/cubegeom_normal_dap_far_glda_quad.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -254,7 +254,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_normal_dap_far_range.c b/tests/cubegeom_normal_dap_far_range.c index 17691ce9..3f041668 100644 --- a/tests/cubegeom_normal_dap_far_range.c +++ b/tests/cubegeom_normal_dap_far_range.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -263,7 +263,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_pre.c b/tests/cubegeom_pre.c index 40b03cf7..70e3435f 100644 --- a/tests/cubegeom_pre.c +++ b/tests/cubegeom_pre.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -283,7 +283,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_pre2.c b/tests/cubegeom_pre2.c index df04ae31..88c82541 100644 --- a/tests/cubegeom_pre2.c +++ b/tests/cubegeom_pre2.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_pre2_vao.c b/tests/cubegeom_pre2_vao.c index 733c8fc6..5abe1868 100644 --- a/tests/cubegeom_pre2_vao.c +++ b/tests/cubegeom_pre2_vao.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -354,7 +354,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_pre2_vao2.c b/tests/cubegeom_pre2_vao2.c index 69096833..d2d55597 100644 --- a/tests/cubegeom_pre2_vao2.c +++ b/tests/cubegeom_pre2_vao2.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -355,7 +355,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_pre3.c b/tests/cubegeom_pre3.c index ceaa757e..81c87589 100644 --- a/tests/cubegeom_pre3.c +++ b/tests/cubegeom_pre3.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_pre_vao.c b/tests/cubegeom_pre_vao.c index 8c598143..4f7adf9e 100644 --- a/tests/cubegeom_pre_vao.c +++ b/tests/cubegeom_pre_vao.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -308,7 +308,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_proc.c b/tests/cubegeom_proc.c index e80b9b31..2dfe85ae 100644 --- a/tests/cubegeom_proc.c +++ b/tests/cubegeom_proc.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -321,7 +321,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/cubegeom_texturematrix.c b/tests/cubegeom_texturematrix.c index abb667eb..21824344 100644 --- a/tests/cubegeom_texturematrix.c +++ b/tests/cubegeom_texturematrix.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -287,7 +287,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/dirent/test_readdir_empty.c b/tests/dirent/test_readdir_empty.c new file mode 100644 index 00000000..00102733 --- /dev/null +++ b/tests/dirent/test_readdir_empty.c @@ -0,0 +1,47 @@ +#include <stdio.h> +#include <dirent.h> +#include <sys/stat.h> +#include <string.h> +#include <errno.h> + + +int main(int argc, char** argv) { + if (mkdir("/tmp", S_IRWXG) != 0 && errno != EEXIST) { + printf("Unable to create dir '/tmp'\n"); + return -1; + } + + if (mkdir("/tmp/1", S_IRWXG) != 0 && errno != EEXIST) { + printf("Unable to create dir '/tmp/1'\n"); + return -1; + } + + if (mkdir("/tmp/1/", S_IRWXG) != 0 && errno != EEXIST) { + printf("Unable to create dir '/tmp/1/'\n"); + return -1; + } + + DIR *dir = opendir("/tmp"); + + if (!dir) { + printf("Unable to open dir '/tmp'\n"); + return -2; + } + + struct dirent *dirent; + + while ((dirent = readdir(dir)) != 0) { + printf("Found '%s'\n", dirent->d_name); + + if (strlen(dirent->d_name) == 0) { + printf("Found empty path!\n"); + return -3; + } + } + + closedir(dir); + + printf("success\n"); + return 0; +} + diff --git a/tests/embind/build_benchmark b/tests/embind/build_benchmark index 3d5d816b..74239406 100644 --- a/tests/embind/build_benchmark +++ b/tests/embind/build_benchmark @@ -1,2 +1,2 @@ #!/bin/bash -EMCC_LLVM_TARGET=le32-unknown-nacl ../../emcc --minify 0 --bind --post-js embind.benchmark.js -O2 --shell-file shell.html -o embind_benchmark.html embind_benchmark.cpp +EMCC_LLVM_TARGET=asmjs-unknown-emscripten ../../emcc --minify 0 --bind --post-js embind.benchmark.js -O2 --shell-file shell.html -o embind_benchmark.html embind_benchmark.cpp diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index 5ca972be..6bba4de0 100644 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -1408,7 +1408,7 @@ module({ var e = assert.throws(cm.BindingError, function() { cm.passThroughCustomSmartPtr(o); }); - assert.equal('Cannot convert argument of type NSt3__110shared_ptrI20HeldByCustomSmartPtrEE to parameter type 14CustomSmartPtrI20HeldByCustomSmartPtrE', e.message); + assert.equal('Cannot convert argument of type shared_ptr<HeldByCustomSmartPtr> to parameter type CustomSmartPtr<HeldByCustomSmartPtr>', e.message); o.delete(); }); @@ -1646,6 +1646,10 @@ module({ if (typeof INVOKED_FROM_EMSCRIPTEN_TEST_RUNNER === "undefined") { // TODO: Enable this to work in Emscripten runner as well! BaseFixture.extend("unbound types", function() { + if (!cm.hasUnboundTypeNames) { + return; + } + function assertMessage(fn, message) { var e = assert.throws(cm.UnboundTypeError, fn); assert.equal(message, e.message); @@ -1938,10 +1942,84 @@ module({ derived.delete(); // Let the memory leak test superfixture check that no leaks occurred. }); + + BaseFixture.extend("val::as", function() { + test("built-ins", function() { + assert.equal(true, cm.val_as_bool(true)); + assert.equal(false, cm.val_as_bool(false)); + assert.equal(127, cm.val_as_char(127)); + assert.equal(32767, cm.val_as_short(32767)); + assert.equal(65536, cm.val_as_int(65536)); + assert.equal(65536, cm.val_as_long(65536)); + assert.equal(10.5, cm.val_as_float(10.5)); + assert.equal(10.5, cm.val_as_double(10.5)); + + assert.equal("foo", cm.val_as_string("foo")); + assert.equal("foo", cm.val_as_wstring("foo")); + + var obj = {}; + assert.equal(obj, cm.val_as_val(obj)); + + // JS->C++ memory view not implemented + //var ab = cm.val_as_memory_view(new ArrayBuffer(13)); + //assert.equal(13, ab.byteLength); + }); + + test("value types", function() { + var tuple = [1, 2, 3, 4]; + assert.deepEqual(tuple, cm.val_as_value_array(tuple)); + + var struct = {x: 1, y: 2, z: 3, w: 4}; + assert.deepEqual(struct, cm.val_as_value_object(struct)); + }); + + test("enums", function() { + assert.equal(cm.Enum.ONE, cm.val_as_enum(cm.Enum.ONE)); + }); + }); + + BaseFixture.extend("val::new_", function() { + test("variety of types", function() { + function factory() { + this.arguments = Array.prototype.slice.call(arguments, 0); + } + var instance = cm.construct_with_6_arguments(factory); + assert.deepEqual( + [6, -12.5, "a3", {x: 1, y: 2, z: 3, w: 4}, cm.EnumClass.TWO, [-1, -2, -3, -4]], + instance.arguments); + }); + + test("memory view", function() { + function factory(before, view, after) { + this.before = before; + this.view = view; + this.after = after; + } + + var instance = cm.construct_with_memory_view(factory); + assert.equal("before", instance.before); + assert.equal(10, instance.view.byteLength); + assert.equal("after", instance.after); + }); + + test("ints_and_float", function() { + function factory(a, b, c) { + this.a = a; + this.b = b; + this.c = c; + } + + var instance = cm.construct_with_ints_and_float(factory); + assert.equal(65537, instance.a); + assert.equal(4.0, instance.b); + assert.equal(65538, instance.c); + }); + }); }); /* global run_all_tests */ // If running as part of the emscripten test runner suite, and not as part of the IMVU suite, // we launch the test execution from here. IMVU suite uses its own dedicated mechanism instead of this. -if (typeof run_all_tests !== "undefined") +if (typeof run_all_tests !== "undefined") { run_all_tests(); +} diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp index 4efc4bd8..1b835751 100644 --- a/tests/embind/embind_test.cpp +++ b/tests/embind/embind_test.cpp @@ -842,7 +842,7 @@ Enum emval_test_take_and_return_Enum(Enum e) { return e; } -enum class EnumClass { ONE, TWO }; +enum class EnumClass : char { ONE, TWO }; EnumClass emval_test_take_and_return_EnumClass(EnumClass e) { return e; @@ -1150,8 +1150,8 @@ void callDifferentArguments(AbstractClass& ac, int i, double d, unsigned char f, EMSCRIPTEN_BINDINGS(interface_tests) { class_<AbstractClass>("AbstractClass") - .smart_ptr<std::shared_ptr<AbstractClass>>() - .allow_subclass<AbstractClassWrapper>() + .smart_ptr<std::shared_ptr<AbstractClass>>("shared_ptr<AbstractClass>") + .allow_subclass<AbstractClassWrapper>("AbstractClassWrapper") .function("abstractMethod", &AbstractClass::abstractMethod) .function("optionalMethod", &AbstractClass::optionalMethod) ; @@ -1483,7 +1483,7 @@ EMSCRIPTEN_BINDINGS(tests) { function("emval_test_take_and_return_TupleInStruct", &emval_test_take_and_return_TupleInStruct); class_<ValHolder>("ValHolder") - .smart_ptr<std::shared_ptr<ValHolder>>() + .smart_ptr<std::shared_ptr<ValHolder>>("std::shared_ptr<ValHolder>") .constructor<val>() .function("getVal", &ValHolder::getVal) .function("getValNonConst", &ValHolder::getValNonConst) @@ -1522,7 +1522,7 @@ EMSCRIPTEN_BINDINGS(tests) { function("emval_test_take_and_call_functor", &emval_test_take_and_call_functor); class_<StringHolder>("StringHolder") - .smart_ptr<std::shared_ptr<StringHolder>>() + .smart_ptr<std::shared_ptr<StringHolder>>("shared_ptr<StringHolder>") .constructor<std::string>() .function("set", &StringHolder::set) .function("get", &StringHolder::get) @@ -1566,7 +1566,7 @@ EMSCRIPTEN_BINDINGS(tests) { // register Derived before Base as a test that it's possible to // register base classes afterwards class_<Derived, base<Base>>("Derived") - .smart_ptr<std::shared_ptr<Derived>>() + .smart_ptr<std::shared_ptr<Derived>>("shared_ptr<Derived>") .constructor<>() .function("getClassName", &Derived::getClassName) .function("getMember", &Derived::getMember) @@ -1575,7 +1575,7 @@ EMSCRIPTEN_BINDINGS(tests) { ; class_<Base>("Base") - .smart_ptr<std::shared_ptr<Base>>() + .smart_ptr<std::shared_ptr<Base>>("shared_ptr<Base") .constructor<>() .function("getClassName", &Base::getClassName) .function("getClassNameFromBase", &Base::getClassNameFromBase) @@ -1589,7 +1589,7 @@ EMSCRIPTEN_BINDINGS(tests) { ; class_<SecondBase>("SecondBase") - .smart_ptr<std::shared_ptr<SecondBase>>() + .smart_ptr<std::shared_ptr<SecondBase>>("shared_ptr<SecondBase>") .constructor<>() .function("getClassName", &SecondBase::getClassName) .function("getClassNameFromSecondBase", &SecondBase::getClassNameFromSecondBase) @@ -1612,13 +1612,13 @@ EMSCRIPTEN_BINDINGS(tests) { ; class_<SiblingDerived>("SiblingDerived") - .smart_ptr<std::shared_ptr<SiblingDerived>>() + .smart_ptr<std::shared_ptr<SiblingDerived>>("shared_ptr<SiblingDerived>") .constructor<>() .function("getClassName", &SiblingDerived::getClassName) ; class_<MultiplyDerived, base<Base>>("MultiplyDerived") - .smart_ptr<std::shared_ptr<MultiplyDerived>>() + .smart_ptr<std::shared_ptr<MultiplyDerived>>("shared_ptr<MultiplyDerived>") .constructor<>() .function("getClassName", &MultiplyDerived::getClassName) .class_function("getInstanceCount", &MultiplyDerived::getInstanceCount) @@ -1630,26 +1630,26 @@ EMSCRIPTEN_BINDINGS(tests) { ; class_<DerivedThrice, base<Derived> >("DerivedThrice") - .smart_ptr<std::shared_ptr<DerivedThrice>>() + .smart_ptr<std::shared_ptr<DerivedThrice>>("shared_ptr<DerivedThrice>") .constructor<>() .function("getClassName", &DerivedThrice::getClassName) ; class_<PolyBase>("PolyBase") - .smart_ptr<std::shared_ptr<PolyBase>>() + .smart_ptr<std::shared_ptr<PolyBase>>("shared_ptr<PolyBase>") .constructor<>() .function("virtualGetClassName", &PolyBase::virtualGetClassName) .function("getClassName", &PolyBase::getClassName) ; class_<PolySecondBase>("PolySecondBase") - .smart_ptr<std::shared_ptr<PolySecondBase>>() + .smart_ptr<std::shared_ptr<PolySecondBase>>("shared_ptr<PolySecondBase>") .constructor<>() .function("getClassName", &PolySecondBase::getClassName) ; class_<PolyDerived, base<PolyBase>>("PolyDerived") - .smart_ptr<std::shared_ptr<PolyDerived>>() + .smart_ptr<std::shared_ptr<PolyDerived>>("shared_ptr<PolyDerived>") .constructor<>() .function("virtualGetClassName", &PolyDerived::virtualGetClassName) .function("getClassName", &PolyDerived::getClassName) @@ -1671,43 +1671,43 @@ EMSCRIPTEN_BINDINGS(tests) { // } class_<PolySiblingDerived, base<PolyBase>>("PolySiblingDerived") - .smart_ptr<std::shared_ptr<PolySiblingDerived>>() + .smart_ptr<std::shared_ptr<PolySiblingDerived>>("shared_ptr<PolySiblingDerived>") .constructor<>() .function("getClassName", &PolySiblingDerived::getClassName) ; class_<PolyMultiplyDerived, base<PolyBase>>("PolyMultiplyDerived") - .smart_ptr<std::shared_ptr<PolyMultiplyDerived>>() + .smart_ptr<std::shared_ptr<PolyMultiplyDerived>>("shared_ptr<PolyMultiplyDerived>") .constructor<>() .function("getClassName", &PolyMultiplyDerived::getClassName) ; class_<PolyDerivedThrice, base<PolyDerived>>("PolyDerivedThrice") - .smart_ptr<std::shared_ptr<PolyDerivedThrice>>() + .smart_ptr<std::shared_ptr<PolyDerivedThrice>>("shared_ptr<PolyDerivedThrice>") .constructor<>() .function("getClassName", &PolyDerivedThrice::getClassName) ; class_<PolyDiamondBase>("PolyDiamondBase") - .smart_ptr<std::shared_ptr<PolyDiamondBase>>() + .smart_ptr<std::shared_ptr<PolyDiamondBase>>("shared_ptr<PolyDiamondBase>") .constructor<>() .function("getClassName", &PolyDiamondBase::getClassName) ; class_<PolyDiamondDerived>("PolyDiamondDerived") - .smart_ptr<std::shared_ptr<PolyDiamondDerived>>() + .smart_ptr<std::shared_ptr<PolyDiamondDerived>>("shared_ptr<PolyDiamondDerived>") .constructor<>() .function("getClassName", &PolyDiamondDerived::getClassName) ; class_<PolyDiamondSiblingDerived>("PolyDiamondSiblingDerived") - .smart_ptr<std::shared_ptr<PolyDiamondSiblingDerived>>() + .smart_ptr<std::shared_ptr<PolyDiamondSiblingDerived>>("shared_ptr<PolyDiamondSiblingDerived>") .constructor<>() .function("getClassName", &PolyDiamondSiblingDerived::getClassName) ; class_<PolyDiamondMultiplyDerived>("PolyDiamondMultiplyDerived") - .smart_ptr<std::shared_ptr<PolyDiamondMultiplyDerived>>() + .smart_ptr<std::shared_ptr<PolyDiamondMultiplyDerived>>("shared_ptr<PolyDiamondMultiplyDerived>") .constructor<>() .function("getClassName", &PolyDiamondMultiplyDerived::getClassName) ; @@ -1825,8 +1825,8 @@ EMSCRIPTEN_BINDINGS(tests) { auto HeldBySmartPtr_class = class_<HeldBySmartPtr>("HeldBySmartPtr"); HeldBySmartPtr_class - .smart_ptr<CustomSmartPtr<HeldBySmartPtr>>() - .smart_ptr_constructor(&std::make_shared<HeldBySmartPtr, int, std::string>) + .smart_ptr<CustomSmartPtr<HeldBySmartPtr>>("CustomSmartPtr<HeldBySmartPtr>") + .smart_ptr_constructor("shared_ptr<HeldbySmartPtr>", &std::make_shared<HeldBySmartPtr, int, std::string>) .class_function("newCustomPtr", HeldBySmartPtr::newCustomPtr) .function("returnThis", &takesHeldBySmartPtrSharedPtr) .property("i", &HeldBySmartPtr::i) @@ -1836,8 +1836,8 @@ EMSCRIPTEN_BINDINGS(tests) { function("takesHeldBySmartPtrSharedPtr", &takesHeldBySmartPtrSharedPtr); class_<HeldByCustomSmartPtr>("HeldByCustomSmartPtr") - .smart_ptr<std::shared_ptr<HeldByCustomSmartPtr>>() - .smart_ptr_constructor(&HeldByCustomSmartPtr::create) + .smart_ptr<std::shared_ptr<HeldByCustomSmartPtr>>("shared_ptr<HeldByCustomSmartPtr>") + .smart_ptr_constructor("CustomSmartPtr<HeldByCustomSmartPtr>", &HeldByCustomSmartPtr::create) .class_function("createSharedPtr", &HeldByCustomSmartPtr::createSharedPtr) .property("i", &HeldByCustomSmartPtr::i) .property("s", &HeldByCustomSmartPtr::s) @@ -2022,7 +2022,7 @@ EMSCRIPTEN_BINDINGS(overloads) { ; class_<MultipleSmartCtors>("MultipleSmartCtors") - .smart_ptr<std::shared_ptr<MultipleSmartCtors>>() + .smart_ptr<std::shared_ptr<MultipleSmartCtors>>("shared_ptr<MultipleSmartCtors>") .constructor(&std::make_shared<MultipleSmartCtors, int>) .constructor(&std::make_shared<MultipleSmartCtors, int, int>) .function("WhichCtorCalled", &MultipleSmartCtors::WhichCtorCalled) @@ -2147,6 +2147,8 @@ struct BoundClass { }; EMSCRIPTEN_BINDINGS(incomplete) { + constant("hasUnboundTypeNames", emscripten::has_unbound_type_names); + function("getUnboundClass", &passThrough<UnboundClass>); class_<HasUnboundBase, base<UnboundClass>>("HasUnboundBase") @@ -2247,7 +2249,7 @@ std::shared_ptr<Base> return_Base_from_DerivedWithOffset(std::shared_ptr<Derived EMSCRIPTEN_BINDINGS(with_adjustment) { class_<DerivedWithOffset, base<Base>>("DerivedWithOffset") - .smart_ptr_constructor(&std::make_shared<DerivedWithOffset>) + .smart_ptr_constructor("shared_ptr<DerivedWithOffset>", &std::make_shared<DerivedWithOffset>) ; function("return_Base_from_DerivedWithOffset", &return_Base_from_DerivedWithOffset); @@ -2304,3 +2306,60 @@ EMSCRIPTEN_BINDINGS(mixins) { .constructor<>() ); } + +template<typename T> +T val_as(const val& v) { + return v.as<T>(); +} + +EMSCRIPTEN_BINDINGS(val_as) { + function("val_as_bool", &val_as<bool>); + function("val_as_char", &val_as<char>); + function("val_as_short", &val_as<short>); + function("val_as_int", &val_as<int>); + function("val_as_long", &val_as<long>); + + function("val_as_float", &val_as<float>); + function("val_as_double", &val_as<double>); + + function("val_as_string", &val_as<std::string>); + function("val_as_wstring", &val_as<std::wstring>); + function("val_as_val", &val_as<val>); + + function("val_as_value_object", &val_as<StructVector>); + function("val_as_value_array", &val_as<TupleVector>); + + function("val_as_enum", &val_as<Enum>); + + // memory_view is always JS -> C++ + //function("val_as_memory_view", &val_as<memory_view>); +} + +val construct_with_6(val factory) { + unsigned char a1 = 6; + double a2 = -12.5; + std::string a3("a3"); + StructVector a4(1, 2, 3, 4); + EnumClass a5 = EnumClass::TWO; + TupleVector a6(-1, -2, -3, -4); + return factory.new_(a1, a2, a3, a4, a5, a6); +} + +val construct_with_memory_view(val factory) { + static const char data[11] = "0123456789"; + return factory.new_( + std::string("before"), + memory_view(10, data), + std::string("after")); +} + +val construct_with_ints_and_float(val factory) { + static const char data[11] = "0123456789"; + return factory.new_(65537, 4.0f, 65538); +} + +EMSCRIPTEN_BINDINGS(val_new_) { + function("construct_with_6_arguments", &construct_with_6); + function("construct_with_memory_view", &construct_with_memory_view); + function("construct_with_ints_and_float", &construct_with_ints_and_float); +} diff --git a/tests/emscripten_log/emscripten_log.cpp b/tests/emscripten_log/emscripten_log.cpp index a5bb8432..f4cc41db 100644 --- a/tests/emscripten_log/emscripten_log.cpp +++ b/tests/emscripten_log/emscripten_log.cpp @@ -5,10 +5,6 @@ #define STRINGIZE_HELPER(x) #x #define STRINGIZE(x) STRINGIZE_HELPER(x) -#ifndef REPORT_RESULT -#define REPORT_RESULT int dummy -#endif - int result = 1; // If 1, this test succeeded. // A custom assert macro to test varargs routing to emscripten_log(). @@ -83,14 +79,14 @@ void __attribute__((noinline)) bar(int = 0, char * = 0, double = 0) // Arbitrary if ((flags & EM_LOG_C_STACK) != 0) { - MYASSERT(!!strstr(callstack, "at bar(int, char*, double) (src.cpp:"), "Callstack was %s!", callstack); - MYASSERT(!!strstr(callstack, "at void Foo<int>() (src.cpp:"), "Callstack was %s!", callstack); + MYASSERT(!!strstr(callstack, ".cpp:"), "Callstack was %s!", callstack); } else { - MYASSERT(!!strstr(callstack, "at bar(int, char*, double) (src.cpp.o.js:"), "Callstack was %s!", callstack); - MYASSERT(!!strstr(callstack, "at void Foo<int>() (src.cpp.o.js:"), "Callstack was %s!", callstack); + MYASSERT(!!strstr(callstack, ".js:"), "Callstack was %s!", callstack); } + MYASSERT(!!strstr(callstack, "at bar(int, char*, double)"), "Callstack was %s!", callstack); + MYASSERT(!!strstr(callstack, "at void Foo<int>()"), "Callstack was %s!", callstack); // 5. Clean up. delete[] callstack; @@ -99,6 +95,14 @@ void __attribute__((noinline)) bar(int = 0, char * = 0, double = 0) // Arbitrary char str[1024]; emscripten_get_callstack(EM_LOG_NO_PATHS | EM_LOG_JS_STACK, str, 1024); + // Test that obtaining a truncated callstack works. (https://github.com/kripken/emscripten/issues/2171) + char *buffer = new char[21]; + buffer[20] = 0x01; // Magic sentinel that should not change its value. + emscripten_get_callstack(EM_LOG_C_STACK | EM_LOG_DEMANGLE | EM_LOG_NO_PATHS | EM_LOG_FUNC_PARAMS, buffer, 20); + MYASSERT(!!strstr(buffer, "at bar(int,"), "Truncated callstack was %s!", buffer); + MYASSERT(buffer[20] == 0x01); + delete[] buffer; + /* With EM_LOG_JS_STACK, the callstack will be at __Z3bariPcd (src.cpp.o.js:5394:12) at __Z3FooIiEvv (src.cpp.o.js:5417:4) @@ -126,11 +130,10 @@ void __attribute__((noinline)) Foo() // Arbitrary function signature to add some int main() { Foo<int>(); -#ifndef RUN_FROM_JS_SHELL +#ifdef REPORT_RESULT REPORT_RESULT(); - return 0; -#else +#endif if (result) printf("Success!\n"); -#endif + return 0; } diff --git a/tests/fs/test_idbfs_sync.c b/tests/fs/test_idbfs_sync.c index ff356416..0d8f4d71 100644 --- a/tests/fs/test_idbfs_sync.c +++ b/tests/fs/test_idbfs_sync.c @@ -1,8 +1,6 @@ #include <stdio.h> #include <emscripten.h> -#define EM_ASM_REEXPAND(x) EM_ASM(x) - void success() { int result = 1; REPORT_RESULT(); @@ -15,31 +13,35 @@ int main() { ); #if FIRST - // store local files to backing IDB - EM_ASM_REEXPAND( + // store local files to backing IDB. Note that we use the JS FS API for everything here, but we + // could use normal libc fwrite etc. to do the writing. All we need the JS FS API for is to + // mount the filesystem and do syncfs. + EM_ASM_ARGS({ FS.writeFile('/working/waka.txt', 'az'); - FS.writeFile('/working/moar.txt', SECRET); + FS.writeFile('/working/moar.txt', $0); FS.syncfs(function (err) { assert(!err); - ccall('success', 'v', '', []); + ccall('success', 'v'); }); - ); + }, SECRET); #else // load files from backing IDB - EM_ASM_REEXPAND( + EM_ASM_ARGS({ FS.syncfs(true, function (err) { assert(!err); var contents = FS.readFile('/working/waka.txt', { encoding: 'utf8' }); - assert(contents === 'az'); + assert(contents === 'az', 'bad contents ' + contents); - var secret = FS.readFile('/working/moar.txt', { encoding: 'utf8' }); - assert(secret === SECRET); + // note we convert to a number here (using +), since we used writeFile, which writes a + // JS string. + var secret = +FS.readFile('/working/moar.txt', { encoding: 'utf8' }); + assert(secret === $0, 'bad secret ' + [secret, $0, typeof secret, typeof $0]); ccall('success', 'v', '', []); }); - ); + }, SECRET); #endif emscripten_exit_with_live_runtime(); diff --git a/tests/full_es2_sdlproc.c b/tests/full_es2_sdlproc.c index d9ac072b..3f72f2bf 100644 --- a/tests/full_es2_sdlproc.c +++ b/tests/full_es2_sdlproc.c @@ -704,6 +704,8 @@ gears_init(void) gear3 = create_gear(1.3, 2.0, 0.5, 10, 0.7); } +#include "SDL/SDL.h" + int main(int argc, char *argv[]) { diff --git a/tests/fuzz/11.c b/tests/fuzz/11.c new file mode 100644 index 00000000..5d5644fe --- /dev/null +++ b/tests/fuzz/11.c @@ -0,0 +1,1570 @@ +/* + * This is a RANDOMLY GENERATED PROGRAM. + * + * Generator: csmith 2.2.0 + * Git version: bf42ffd + * Options: --no-volatiles --no-packed-struct --no-math64 + * Seed: 3982457068 + */ + +#include "csmith.h" + + +static long __undefined; + +/* --- Struct/Union Declarations --- */ +struct S0 { + const int16_t f0; + uint16_t f1; + const uint16_t f2; + uint16_t f3; + const uint8_t f4; +}; + +struct S1 { + int8_t f0; + int32_t f1; + uint16_t f2; + struct S0 f3; + signed : 0; + uint16_t f4; +}; + +union U2 { + int32_t f0; + int8_t * f1; + uint16_t f2; +}; + +/* --- GLOBAL VARIABLES --- */ +static int8_t g_9 = 0L; +static int8_t *g_10 = &g_9; +static union U2 g_23 = {5L}; +static uint32_t g_27 = 0x763523E2L; +static int32_t g_29 = (-10L); +static int32_t *g_28[8] = {&g_29,&g_29,&g_29,&g_29,&g_29,&g_29,&g_29,&g_29}; +static int32_t g_33 = (-7L); +static int32_t g_82 = 0x6BCC6B82L; +static int16_t g_92 = 0x986BL; +static uint8_t g_94 = 0x71L; +static uint8_t g_96 = 9UL; +static const int32_t g_130[8][6] = {{0xBB608825L,0x2773D60BL,(-4L),(-1L),0x16DB7C97L,(-4L)},{0xB3C507C2L,0L,0x16DB7C97L,0x013F98BFL,0x16DB7C97L,0L},{(-1L),0x2773D60BL,1L,0x013F98BFL,0x2773D60BL,0x16DB7C97L},{0xB3C507C2L,0x16DB7C97L,1L,(-1L),0L,0L},{0xBB608825L,0x16DB7C97L,0x16DB7C97L,0xBB608825L,0x2773D60BL,(-4L)},{0xBB608825L,0x2773D60BL,(-4L),(-1L),0x16DB7C97L,(-4L)},{0xB3C507C2L,0L,8L,0x2773D60BL,8L,0x73286A6EL},{(-4L),1L,8L,0x2773D60BL,1L,8L}}; +static const int32_t g_132 = 0xBF8BA2E1L; +static const int32_t *g_131 = &g_132; +static const int32_t *g_133[1] = {&g_82}; +static int32_t g_140 = 1L; +static uint8_t g_141[6][7] = {{0x59L,0x4EL,0x2EL,0xA7L,0xDAL,247UL,0x90L},{246UL,1UL,0x97L,0x54L,247UL,0x54L,0x97L},{247UL,247UL,0xF6L,0xC5L,247UL,0x54L,0x38L},{0x0EL,0xF6L,0x38L,255UL,246UL,247UL,0x4EL},{0x54L,0x6EL,247UL,0x38L,247UL,0x6EL,0x54L},{0xDAL,0x54L,0x59L,0x38L,247UL,0x4EL,255UL}}; +static uint16_t *g_146 = &g_23.f2; +static struct S0 g_193 = {0L,0UL,65535UL,0x6792L,0xD8L}; +static struct S1 g_203 = {8L,-1L,65531UL,{-8L,0xE92DL,0x7043L,0x3039L,253UL},0xF5C3L}; +static struct S1 *g_202[5][10] = {{&g_203,(void*)0,&g_203,&g_203,&g_203,(void*)0,&g_203,&g_203,(void*)0,(void*)0},{&g_203,(void*)0,(void*)0,&g_203,&g_203,(void*)0,(void*)0,&g_203,(void*)0,&g_203},{(void*)0,(void*)0,&g_203,(void*)0,&g_203,(void*)0,&g_203,(void*)0,(void*)0,&g_203},{&g_203,(void*)0,&g_203,&g_203,(void*)0,(void*)0,&g_203,&g_203,(void*)0,&g_203},{(void*)0,(void*)0,(void*)0,&g_203,(void*)0,&g_203,(void*)0,&g_203,(void*)0,(void*)0}}; +static uint32_t g_275[6][3] = {{0xB93AAF63L,0xB93AAF63L,0xB93AAF63L},{0x949218ACL,0x949218ACL,0x949218ACL},{0xB93AAF63L,0xB93AAF63L,0xB93AAF63L},{0x949218ACL,0x949218ACL,0x949218ACL},{0xB93AAF63L,0xB93AAF63L,0xB93AAF63L},{0x949218ACL,0x949218ACL,0x949218ACL}}; +static int32_t *g_364 = &g_23.f0; +static int32_t **g_363 = &g_364; +static int32_t ***g_362[4][6] = {{(void*)0,&g_363,&g_363,&g_363,(void*)0,&g_363},{&g_363,(void*)0,&g_363,&g_363,(void*)0,&g_363},{(void*)0,&g_363,&g_363,(void*)0,&g_363,&g_363},{&g_363,(void*)0,&g_363,&g_363,&g_363,&g_363}}; +static int16_t g_367 = 0x405BL; +static int8_t g_368[9][8][3] = {{{0x36L,(-4L),0x84L},{3L,(-1L),0L},{0xADL,0x36L,0x84L},{(-1L),0x20L,3L},{8L,(-1L),8L},{1L,0x30L,(-6L)},{0L,0xE3L,0x5BL},{0x30L,0L,0xF6L}},{{(-1L),0x5BL,0xF7L},{0x30L,(-8L),1L},{0L,1L,1L},{1L,0xF6L,(-1L)},{8L,(-1L),0x6DL},{(-1L),0xE6L,0x8CL},{0xADL,(-9L),0x47L},{3L,1L,(-1L)}},{{(-1L),1L,8L},{0x8BL,0x8BL,1L},{0xADL,0x47L,0L},{0xC2L,1L,0x30L},{0L,(-8L),(-1L)},{0xFBL,0xC2L,0x30L},{0xF7L,(-9L),0L},{1L,(-1L),1L}},{{(-4L),0x5BL,8L},{0xE6L,0x0AL,(-1L)},{0x5BL,(-1L),0xADL},{(-1L),(-1L),3L},{0x5BL,0x6DL,0x36L},{0xE6L,0xF6L,0xF6L},{(-4L),0xADL,0x47L},{1L,(-1L),0L}},{{0xF7L,0xBDL,(-2L)},{0xFBL,0xCAL,0x8BL},{0L,0xBDL,(-8L)},{0xC2L,(-1L),0xE6L},{0xADL,0xADL,0xBDL},{0x8BL,0xF6L,(-6L)},{(-1L),0x6DL,(-1L)},{(-6L),(-1L),0xC2L}},{{0L,(-1L),(-1L)},{0x8CL,0x0AL,(-6L)},{0xBDL,0x5BL,0xBDL},{(-8L),(-1L),0xE6L},{8L,(-9L),(-8L)},{(-1L),0xC2L,0x8BL},{1L,(-8L),(-2L)},{(-1L),1L,0L}},{{8L,0x47L,0x47L},{(-8L),0x8BL,0xF6L},{0xBDL,1L,0x36L},{0x8CL,1L,3L},{0L,0x84L,0xADL},{(-6L),1L,(-1L)},{(-1L),1L,8L},{0x8BL,0x8BL,1L}},{{0xADL,0x47L,0L},{0xC2L,1L,0x30L},{0L,(-8L),(-1L)},{0xFBL,0xC2L,0x30L},{0xF7L,(-9L),0L},{1L,(-1L),1L},{(-4L),0x5BL,8L},{0xE6L,0x0AL,(-1L)}},{{0x5BL,(-1L),0xADL},{(-1L),(-1L),3L},{0x5BL,0x6DL,0x36L},{0xE6L,0xF6L,0xF6L},{(-4L),0xADL,0x47L},{1L,(-1L),0L},{0xF7L,0xBDL,(-2L)},{0xFBL,0xCAL,0x8BL}}}; +static struct S1 g_429[4][6][6] = {{{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}}},{{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}}},{{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}}},{{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{7L,9L,0xCB7DL,{1L,0UL,0x1D7BL,0x4424L,0xF9L},0xC9D4L}},{{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x0CL,0xF59095C9L,0x632BL,{1L,65528UL,0xAC68L,0UL,1UL},0UL}},{{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{-8L,0xEF94E310L,0xE17EL,{0xF561L,0xE7EFL,65535UL,0xF583L,255UL},0xF36CL},{0x3CL,0xDFB0633DL,65527UL,{8L,1UL,65530UL,0UL,2UL},0x7E5AL},{0x8AL,9L,65535UL,{0x291EL,1UL,0UL,65530UL,0x41L},0xB256L}}}}; +static int8_t g_448 = (-3L); +static uint32_t g_491 = 9UL; +static uint16_t *g_522 = &g_203.f3.f1; +static struct S0 g_663 = {0xB058L,0xD411L,0UL,0x1BCDL,4UL}; +static int32_t *g_688 = &g_82; +static uint32_t g_709[9][3] = {{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL},{1UL,1UL,1UL},{0xF128B38DL,0xF128B38DL,0xF128B38DL}}; +static uint8_t * const g_713 = &g_94; +static uint8_t * const * const g_712 = &g_713; +static uint32_t **g_737 = (void*)0; +static struct S0 *g_803 = (void*)0; +static struct S0 **g_802 = &g_803; +static int8_t g_870 = 0xBAL; +static int32_t g_902 = 0L; +static uint32_t g_1001 = 0xCE9223C1L; +static const union U2 g_1007 = {-1L}; +static const union U2 *g_1006 = &g_1007; +static int8_t *g_1010 = &g_429[3][2][4].f0; +static union U2 *g_1059 = (void*)0; +static union U2 **g_1058 = &g_1059; +static uint8_t *g_1153 = &g_96; +static const int8_t ***g_1346 = (void*)0; +static uint32_t g_1359 = 6UL; +static uint32_t g_1361 = 0UL; +static uint8_t **g_1455 = &g_1153; +static int8_t g_1473[9] = {0x70L,0x70L,0x70L,0x70L,0x70L,0x70L,0x70L,0x70L,0x70L}; +static uint32_t g_1474 = 0x2827E164L; +static uint32_t g_1492 = 0x98C6FA4DL; +static uint32_t *g_1707 = (void*)0; +static uint32_t * const *g_1706 = &g_1707; +static const int32_t g_1725 = 0xA265A2AFL; +static uint32_t ****g_1766 = (void*)0; +static int16_t g_1798 = 0xD17FL; +static struct S1 ** const g_1899 = (void*)0; +static const uint32_t *g_1931[2] = {(void*)0,(void*)0}; +static const uint32_t **g_1930 = &g_1931[0]; +static const int32_t *g_1949 = &g_132; +static int32_t ****g_2039 = &g_362[0][3]; +static uint32_t g_2122 = 18446744073709551612UL; +static int16_t *g_2213[9][3][4] = {{{&g_92,&g_1798,&g_92,(void*)0},{(void*)0,&g_367,(void*)0,&g_92},{&g_92,&g_367,&g_1798,&g_1798}},{{&g_1798,&g_1798,&g_367,&g_367},{(void*)0,&g_92,&g_367,&g_92},{&g_1798,(void*)0,&g_1798,(void*)0}},{{&g_92,&g_1798,(void*)0,(void*)0},{(void*)0,&g_1798,&g_367,(void*)0},{&g_92,&g_1798,&g_1798,&g_367}},{{&g_1798,&g_1798,&g_1798,(void*)0},{&g_92,&g_367,&g_1798,&g_1798},{&g_1798,&g_1798,&g_92,&g_92}},{{(void*)0,(void*)0,(void*)0,&g_1798},{&g_92,&g_92,&g_1798,(void*)0},{&g_1798,&g_367,&g_1798,&g_1798}},{{&g_367,&g_367,&g_1798,(void*)0},{&g_367,&g_92,(void*)0,&g_1798},{&g_92,(void*)0,(void*)0,&g_92}},{{&g_367,&g_1798,&g_1798,&g_1798},{(void*)0,&g_367,&g_1798,(void*)0},{&g_1798,&g_1798,&g_92,&g_367}},{{(void*)0,&g_1798,(void*)0,(void*)0},{&g_1798,&g_1798,(void*)0,&g_1798},{&g_92,(void*)0,&g_92,&g_1798}},{{(void*)0,&g_1798,&g_92,(void*)0},{&g_1798,&g_92,&g_367,(void*)0},{&g_1798,&g_367,&g_92,&g_92}}}; +static int16_t * const *g_2212 = &g_2213[8][2][2]; +static int16_t g_2341 = 0x2E6AL; +static union U2 ***g_2562 = &g_1058; +static union U2 ****g_2561 = &g_2562; +static uint32_t g_2575 = 0xBF53EBB2L; +static struct S0 g_2686 = {1L,0UL,1UL,65529UL,0UL}; +static struct S0 *g_2718[3][2] = {{(void*)0,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0}}; +static uint8_t ***g_2741 = &g_1455; +static const int32_t *g_2749 = &g_1007.f0; +static const int32_t **g_2748 = &g_2749; +static const int32_t ***g_2747 = &g_2748; +static uint32_t g_2898 = 18446744073709551615UL; + + +/* --- FORWARD DECLARATIONS --- */ +static uint16_t func_1(void); +static int32_t * func_2(int8_t * p_3); +static int8_t * func_4(uint32_t p_5, int8_t * p_6, int8_t * p_7); +static int8_t * func_11(uint8_t p_12, int32_t * p_13, struct S0 p_14, int32_t * p_15); +static int32_t * func_16(struct S1 p_17, uint32_t p_18, int8_t * p_19, union U2 p_20); +static int32_t func_34(int8_t * p_35, int8_t * p_36, uint16_t p_37); +static int8_t * func_38(int32_t * p_39); +static union U2 func_40(int32_t * p_41, int8_t * p_42, struct S0 p_43, int32_t p_44); +static int32_t * func_45(int8_t * const p_46, int32_t * p_47, int8_t * p_48); +static int32_t * func_50(uint32_t p_51, int8_t p_52, int8_t p_53, int8_t * p_54, const int32_t p_55); + + +/* --- FUNCTIONS --- */ +/* ------------------------------------------ */ +/* + * reads : g_10 g_23 g_27 g_28 g_29 g_33 g_688 g_82 g_1006 g_522 g_203.f3.f1 g_713 g_146 g_23.f2 g_9 g_448 g_23.f0 g_193 g_130 g_96 g_202 g_94 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_362 g_367 g_203.f1 g_368 g_802 g_803 g_491 g_1725 g_712 g_203.f3.f3 g_902 g_1359 g_1058 g_2341 g_1153 g_1059 g_663.f1 g_1455 g_1492 g_2561 g_1949 g_203.f4 g_2575 g_1010 g_429.f0 g_131 g_2562 g_870 g_92 g_2741 g_2898 g_709 + * writes: g_27 g_28 g_29 g_33 g_82 g_23 g_94 g_1010 g_202 g_203.f1 g_92 g_275 g_448 g_203.f0 g_96 g_141 g_193.f3 g_9 g_663.f1 g_803 g_491 g_367 g_2212 g_203.f3.f1 g_2039 g_203.f3.f3 g_902 g_2213 g_1359 g_1059 g_688 g_1492 g_131 g_203.f4 g_2575 g_737 g_2562 g_10 g_870 g_2898 g_429.f0 + */ +static uint16_t func_1(void) +{ /* block id: 0 */ + int8_t *l_8[3]; + struct S1 l_21 = {0xF7L,-1L,0x9D9EL,{1L,0x422DL,0xFBA2L,0UL,0xBFL},0xC2F5L}; + int32_t l_22 = 0xB6930509L; + int32_t *l_30 = &l_22; + int32_t *l_31 = &g_29; + int8_t **l_2633[1][9][5] = {{{(void*)0,(void*)0,&g_10,&g_10,&g_10},{&l_8[0],&l_8[0],&l_8[0],&l_8[2],&g_1010},{&g_10,(void*)0,(void*)0,&l_8[2],&l_8[1]},{&l_8[0],&l_8[0],&l_8[0],&l_8[0],&l_8[0]},{&l_8[0],&l_8[0],(void*)0,&l_8[1],(void*)0},{&l_8[0],&g_10,&l_8[0],&g_10,&l_8[0]},{&l_8[0],&l_8[2],&g_10,&l_8[1],&l_8[1]},{(void*)0,&g_10,&l_8[0],&l_8[0],&g_10},{&g_10,(void*)0,&l_8[0],&l_8[2],&l_8[1]}}}; + int8_t *l_2634 = &g_203.f0; + int32_t **l_2857 = &l_30; + int16_t l_2858[2][2]; + int32_t l_2861 = 0x6E8C1F75L; + int32_t l_2862 = (-1L); + int32_t l_2863 = 0x3B8928E0L; + int32_t l_2864 = 0L; + int8_t l_2865[8][9] = {{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L},{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L},{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L},{0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L,0x42L},{0x92L,0L,0x92L,0L,0x92L,0L,0x92L,0L,0x92L}}; + int32_t l_2866[7][5] = {{1L,3L,(-8L),(-1L),3L},{0L,3L,(-7L),(-7L),3L},{1L,0L,(-7L),(-1L),0L},{1L,3L,(-8L),(-1L),3L},{0L,3L,(-7L),(-7L),3L},{1L,0L,(-7L),(-1L),0L},{1L,3L,(-8L),(-1L),3L}}; + uint32_t l_2868 = 6UL; + uint32_t **l_2888[1][6][4] = {{{(void*)0,&g_1707,(void*)0,&g_1707},{&g_1707,(void*)0,&g_1707,&g_1707},{(void*)0,(void*)0,&g_1707,&g_1707},{&g_1707,&g_1707,(void*)0,(void*)0},{(void*)0,(void*)0,&g_1707,(void*)0},{&g_1707,(void*)0,(void*)0,(void*)0}}}; + int32_t l_2889 = (-8L); + int16_t l_2890 = 0x4B0FL; + uint32_t l_2893 = 0x1C1D9EF6L; + struct S0 **l_2894[8][7][1] = {{{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]}},{{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803}},{{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]}},{{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]}},{{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803}},{{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]}},{{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803}},{{&g_803},{&g_2718[2][0]},{&g_2718[2][0]},{&g_2718[2][0]},{&g_803},{&g_803},{&g_2718[2][0]}}}; + const int32_t **l_2916 = &g_131; + int32_t l_2917 = 0x0EA97E1BL; + int i, j, k; + for (i = 0; i < 3; i++) + l_8[i] = &g_9; + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + l_2858[i][j] = 0xD331L; + } + (*l_2857) = func_2((l_2634 = (g_10 = func_4(((l_8[0] == &g_9) & 0L), g_10, func_11((((g_28[4] = func_16(l_21, l_22, l_8[0], g_23)) != l_30) , 246UL), &g_29, l_21.f3, l_31))))); + for (g_92 = 0; (g_92 <= 2); g_92 += 1) + { /* block id: 1369 */ + int32_t *l_2859 = &g_33; + int32_t *l_2860[7]; + int8_t l_2867 = 1L; + int32_t l_2891 = 0x72B71305L; + const int32_t l_2892 = 0x51C3213CL; + struct S0 ***l_2895 = &l_2894[7][4][0]; + struct S0 l_2907 = {9L,0xF377L,0x63B9L,0x3BAFL,0UL}; + uint32_t l_2910[1][4]; + uint16_t l_2914[10] = {3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL,3UL}; + int i, j; + for (i = 0; i < 7; i++) + l_2860[i] = &g_33; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 4; j++) + l_2910[i][j] = 0x60BEB07CL; + } + --l_2868; + if ((**l_2857)) + break; + l_2864 &= (safe_lshift_func_int16_t_s_s((safe_div_func_uint16_t_u_u(((l_2890 |= ((((***g_2741) ^ (((safe_rshift_func_uint8_t_u_s(((((safe_lshift_func_int8_t_s_s(0xB5L, ((safe_lshift_func_uint8_t_u_s((safe_unary_minus_func_uint8_t_u(0UL)), (safe_add_func_uint16_t_u_u((0x77B217B0L >= (*l_30)), (safe_lshift_func_uint8_t_u_s(7UL, 0)))))) > (!(*l_31))))) != (((safe_rshift_func_uint8_t_u_u(((((*l_2859) & (((*l_2859) > 0x42ED6365L) == 1L)) , &g_1707) != l_2888[0][3][2]), (*g_1153))) > (-1L)) == 0x52L)) < (*g_1153)) < (*l_2859)), 0)) == 0L) | l_2889)) , (void*)0) == l_31)) , l_2891), l_2892)), l_2893)); + (*l_2895) = l_2894[7][4][0]; + for (g_1359 = 0; (g_1359 <= 2); g_1359 += 1) + { /* block id: 1377 */ + int32_t l_2896 = 0x735C2B59L; + int32_t l_2897[2][1][5] = {{{0x220C6B73L,0x220C6B73L,0x220C6B73L,0x220C6B73L,0x220C6B73L}},{{7L,7L,7L,7L,7L}}}; + int16_t *l_2911 = &g_367; + int32_t l_2915 = 0xA181D5A4L; + int i, j, k; + g_2898--; + (*l_2859) ^= (safe_add_func_uint16_t_u_u(((g_709[(g_1359 + 4)][g_1359] < g_203.f4) >= ((safe_add_func_uint32_t_u_u(((*g_146) == (&g_1707 == (l_2907 , l_2888[0][3][2]))), (((*g_1010) = ((safe_sub_func_int16_t_s_s(((*l_2911) ^= (l_2910[0][2] != g_709[(g_1359 + 4)][g_1359])), (l_2914[5] = (safe_mod_func_int32_t_s_s(((l_2897[0][0][3] | l_2897[1][0][1]) , (*g_1949)), (-1L)))))) < 7L)) ^ l_2915))) >= 4294967293UL)), 0x562AL)); + } + } + (*l_2916) = &g_130[3][5]; + return l_2917; +} + + +/* ------------------------------------------ */ +/* + * reads : g_203.f4 g_368 g_2561 g_2562 g_1058 g_902 g_522 g_203.f3.f1 g_96 g_29 g_870 g_193.f3 + * writes: g_203.f4 g_902 g_96 g_29 g_870 g_193.f3 + */ +static int32_t * func_2(int8_t * p_3) +{ /* block id: 1266 */ + uint16_t l_2646 = 0UL; + union U2 * const *l_2680[10]; + union U2 * const **l_2679 = &l_2680[2]; + int32_t l_2717 = 0x771D7A8EL; + uint32_t ***** const l_2724 = &g_1766; + int32_t l_2787[8][5][6] = {{{(-10L),0xF9A7B154L,(-5L),0x9BBB8C36L,(-1L),0x08AF0ED7L},{(-6L),0x86CA5DE9L,1L,3L,3L,1L},{0x86CA5DE9L,0x86CA5DE9L,0x491AC390L,(-6L),(-1L),(-1L)},{1L,0xF9A7B154L,1L,0x3E0CF12FL,(-5L),0x491AC390L},{0x9BBB8C36L,1L,1L,7L,0x86CA5DE9L,(-1L)}},{{2L,7L,0x491AC390L,3L,(-10L),1L},{3L,(-10L),1L,3L,0x3E0CF12FL,0x08AF0ED7L},{2L,3L,(-5L),0x91A2E884L,0x30B718DFL,(-6L)},{0x30B718DFL,0xF241A0ADL,2L,0xF241A0ADL,0x30B718DFL,(-1L)},{0x743F44F9L,0xD802313DL,(-5L),0L,0xF241A0ADL,0x3E0CF12FL}},{{0x8A63E951L,(-7L),(-10L),0xD802313DL,(-7L),0x3E0CF12FL},{0L,0x91A2E884L,(-5L),0x30B718DFL,0x8A63E951L,(-1L)},{(-7L),0x743F44F9L,2L,0x8A63E951L,0x0F0E2B35L,(-6L)},{(-7L),(-1L),0x3E0CF12FL,0x30B718DFL,(-5L),0xF9A7B154L},{0L,0x8A63E951L,3L,0xD802313DL,0xD802313DL,3L}},{{0x8A63E951L,0x8A63E951L,1L,0L,(-5L),(-10L)},{0x743F44F9L,(-1L),3L,0xF241A0ADL,0x0F0E2B35L,1L},{0x30B718DFL,0x743F44F9L,3L,0x91A2E884L,0x8A63E951L,(-10L)},{0x1D6DE8D3L,0x91A2E884L,1L,0L,(-7L),3L},{0L,(-7L),3L,0L,0xF241A0ADL,0xF9A7B154L}},{{0x1D6DE8D3L,0xD802313DL,0x3E0CF12FL,0x91A2E884L,0x30B718DFL,(-6L)},{0x30B718DFL,0xF241A0ADL,2L,0xF241A0ADL,0x30B718DFL,(-1L)},{0x743F44F9L,0xD802313DL,(-5L),0L,0xF241A0ADL,0x3E0CF12FL},{0x8A63E951L,(-7L),(-10L),0xD802313DL,(-7L),0x3E0CF12FL},{0L,0x91A2E884L,(-5L),0x30B718DFL,0x8A63E951L,(-1L)}},{{(-7L),0x743F44F9L,2L,0x8A63E951L,0x0F0E2B35L,(-6L)},{(-7L),(-1L),0x3E0CF12FL,0x30B718DFL,(-5L),0xF9A7B154L},{0L,0x8A63E951L,3L,0xD802313DL,0xD802313DL,3L},{0x8A63E951L,0x8A63E951L,1L,0L,(-5L),(-10L)},{0x743F44F9L,(-1L),3L,0xF241A0ADL,0x0F0E2B35L,1L}},{{0x30B718DFL,0x743F44F9L,3L,0x91A2E884L,0x8A63E951L,(-10L)},{0x1D6DE8D3L,0x91A2E884L,1L,0L,(-7L),3L},{0L,(-7L),3L,0L,0xF241A0ADL,0xF9A7B154L},{0x1D6DE8D3L,0xD802313DL,0x3E0CF12FL,0x91A2E884L,0x30B718DFL,(-6L)},{0x30B718DFL,0xF241A0ADL,2L,0xF241A0ADL,0x30B718DFL,(-1L)}},{{0x743F44F9L,0xD802313DL,(-5L),0L,0xF241A0ADL,0x3E0CF12FL},{0x8A63E951L,(-7L),(-10L),0xD802313DL,(-7L),0x3E0CF12FL},{0L,0x91A2E884L,(-5L),0x30B718DFL,0x8A63E951L,(-1L)},{(-7L),0x743F44F9L,2L,0x8A63E951L,0x0F0E2B35L,(-6L)},{(-7L),0x05AD1AD2L,0xF241A0ADL,1L,(-4L),(-1L)}}}; + int16_t l_2789 = 0x673BL; + int32_t l_2841 = 0x2CD58772L; + int8_t l_2852 = 0L; + int i, j, k; + for (i = 0; i < 10; i++) + l_2680[i] = &g_1059; + for (g_203.f4 = 0; (g_203.f4 != 20); g_203.f4++) + { /* block id: 1269 */ + int32_t l_2643 = 1L; + int32_t * const l_2644 = &g_902; + union U2 l_2645 = {0x1AA6AB60L}; + (*l_2644) = (g_368[5][5][0] ^ (safe_lshift_func_uint16_t_u_u(((safe_lshift_func_uint16_t_u_s((safe_mod_func_uint8_t_u_u(((l_2643 , l_2644) != &g_130[0][5]), 0x95L)), 9)) ^ (+(((l_2645 , (**g_2561)) != (*g_2562)) != (*l_2644)))), (*g_522)))); + } + l_2646 &= 0xAF285910L; + for (g_96 = (-5); (g_96 > 36); g_96 = safe_add_func_int32_t_s_s(g_96, 3)) + { /* block id: 1275 */ + int32_t *l_2649 = &g_29; + uint32_t *l_2658 = &g_1474; + struct S0 l_2659 = {0x69D3L,0x6483L,65534UL,65535UL,0xDBL}; + union U2 l_2660[6][6] = {{{0x33AAE0C5L},{1L},{-1L},{-1L},{1L},{0x33AAE0C5L}},{{1L},{0x33AAE0C5L},{0x8D8CFE7FL},{1L},{0x8D8CFE7FL},{0x33AAE0C5L}},{{0x8D8CFE7FL},{1L},{-1L},{0xFE9A6640L},{0xFE9A6640L},{-1L}},{{0x8D8CFE7FL},{0x8D8CFE7FL},{0xFE9A6640L},{1L},{0x044F48E9L},{1L}},{{1L},{0x8D8CFE7FL},{1L},{-1L},{0xFE9A6640L},{0xFE9A6640L}},{{0x33AAE0C5L},{1L},{1L},{0x33AAE0C5L},{0x8D8CFE7FL},{1L}}}; + struct S0 *l_2685 = &g_2686; + uint8_t ** const *l_2765 = (void*)0; + uint8_t l_2822 = 0x03L; + int32_t l_2847 = 0x610288B5L; + int32_t l_2848 = 0x0907996FL; + int8_t l_2849 = 6L; + int32_t l_2850 = 0xE1502438L; + uint8_t l_2856 = 0x00L; + int i, j; + (*l_2649) ^= (l_2660[4][5] , (-2L)); + for (g_870 = 0; (g_870 >= 1); g_870 = safe_add_func_int8_t_s_s(g_870, 3)) + { /* block id: 1280 */ + union U2 ***l_2681[4]; + uint16_t l_2684 = 65534UL; + int32_t l_2733 = 0x838200D5L; + uint8_t l_2812 = 0xADL; + int32_t *l_2842 = &l_2733; + int32_t *l_2843 = &g_902; + int32_t *l_2844 = &l_2733; + int32_t *l_2845 = &l_2787[4][1][3]; + int32_t *l_2846[9]; + int16_t l_2851 = 0x13C2L; + uint32_t l_2853[1]; + int i; + for (i = 0; i < 4; i++) + l_2681[i] = &g_1058; + for (i = 0; i < 9; i++) + l_2846[i] = &l_2717; + for (i = 0; i < 1; i++) + l_2853[i] = 0xA045A241L; + for (g_193.f3 = 0; (g_193.f3 <= 0); g_193.f3 += 1) + { /* block id: 1283 */ + struct S0 *l_2664[7][10] = {{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0},{&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0,&g_193,(void*)0}}; + union U2 l_2687 = {6L}; + const union U2 **l_2699 = &g_1006; + int32_t l_2704 = (-1L); + uint32_t *** const **l_2725 = (void*)0; + int8_t *l_2755 = (void*)0; + uint8_t *l_2788 = &g_141[2][3]; + int16_t l_2790 = 0L; + int32_t l_2820 = (-8L); + int i, j; + } + ++l_2853[0]; + } + if (l_2852) + break; + l_2856 ^= l_2787[1][4][0]; + } + l_2717 ^= l_2787[1][4][0]; + return &g_902; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static int8_t * func_4(uint32_t p_5, int8_t * p_6, int8_t * p_7) +{ /* block id: 1262 */ + return &g_448; +} + + +/* ------------------------------------------ */ +/* + * reads : g_29 g_33 g_688 g_82 g_23 g_1006 g_522 g_203.f3.f1 g_713 g_146 g_23.f2 g_10 g_9 g_448 g_23.f0 g_193 g_27 g_130 g_96 g_202 g_94 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_362 g_367 g_203.f1 g_368 g_802 g_803 g_491 g_1725 g_712 g_203.f3.f3 g_902 g_1359 g_1058 g_2341 g_1153 g_1059 g_28 g_663.f1 g_1455 g_1492 g_2561 g_1949 g_203.f4 g_2575 g_1010 g_429.f0 g_131 + * writes: g_29 g_33 g_82 g_23 g_94 g_1010 g_202 g_203.f1 g_92 g_275 g_448 g_28 g_203.f0 g_96 g_141 g_193.f3 g_9 g_663.f1 g_803 g_491 g_367 g_2212 g_203.f3.f1 g_2039 g_203.f3.f3 g_902 g_2213 g_1359 g_1059 g_27 g_688 g_1492 g_131 g_203.f4 g_2575 g_737 g_2562 + */ +static int8_t * func_11(uint8_t p_12, int32_t * p_13, struct S0 p_14, int32_t * p_15) +{ /* block id: 9 */ + int32_t *l_32 = &g_33; + int8_t * const l_49 = (void*)0; + struct S1 l_62 = {0xA5L,0xA880E1B4L,2UL,{0xC5A9L,0x5881L,1UL,1UL,0xD0L},0xD52FL}; + struct S1 l_73 = {0xF3L,-1L,0UL,{0L,65535UL,4UL,65534UL,0x08L},0x1B1EL}; + int8_t *l_74 = &g_9; + union U2 l_980 = {1L}; + int8_t **l_1316 = &l_74; + const int32_t * const l_2258[1][3] = {{&l_62.f1,&l_62.f1,&l_62.f1}}; + const int32_t * const *l_2257[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + int16_t *l_2262 = &g_92; + int32_t l_2301 = 8L; + int32_t l_2303 = (-3L); + int32_t l_2306 = 0xEA8C3DEFL; + int32_t l_2307 = 0xEA47795FL; + int32_t l_2310 = 0x333383BBL; + int32_t l_2311 = 1L; + uint32_t l_2312 = 0x999F81ACL; + int32_t l_2386[5][8][6] = {{{0xEE22978CL,(-3L),0x7AF8184EL,0x0F0D664EL,1L,0x0C8FFBCAL},{(-1L),(-1L),0L,0x0F0D664EL,0x9FE7ED45L,0L},{0xEE22978CL,(-1L),2L,0L,0L,0x09D63F88L},{(-1L),(-1L),0xF204F565L,5L,0x3873AA4BL,0x2D1F59DCL},{0xA34C36F6L,0x724D8378L,(-1L),(-1L),0x8F1CC965L,0x8F1CC965L},{0x47C53492L,0x306D3644L,0x306D3644L,0x47C53492L,(-1L),0x0F0D664EL},{0x724D8378L,1L,0x62D68D50L,0L,0xAD839B02L,0xF204F565L},{0x9FE7ED45L,0x47C53492L,1L,0xEE22978CL,0xAD839B02L,0xA512C38CL}},{{0x8F1CC965L,1L,0x3873AA4BL,(-1L),(-1L),0x8B705FA7L},{1L,0x306D3644L,0xA34C36F6L,0xDDD7E864L,0x8F1CC965L,0L},{0xA512C38CL,0x724D8378L,5L,0x8F1CC965L,0x3873AA4BL,0x306D3644L},{0L,(-1L),0x8B705FA7L,(-1L),0L,0x18B14613L},{1L,1L,0xEE22978CL,0xF79A781AL,0xAD839B02L,1L},{2L,0x0C8FFBCAL,(-1L),1L,0x3873AA4BL,1L},{(-3L),0L,0xEE22978CL,(-1L),(-1L),0x18B14613L},{0x3873AA4BL,0x09D63F88L,(-1L),(-3L),1L,1L}},{{(-1L),0x2D1F59DCL,0xA34C36F6L,1L,1L,0x0F0D664EL},{(-1L),0x8F1CC965L,0x47C53492L,0x47C53492L,0x8F1CC965L,(-1L)},{(-1L),0x0F0D664EL,0x724D8378L,0x09D63F88L,0x8B705FA7L,0x7AF8184EL},{0L,0xF204F565L,0x9FE7ED45L,0x8F1CC965L,1L,0L},{0L,0xA512C38CL,0x8F1CC965L,0x09D63F88L,(-1L),2L},{(-1L),0x8B705FA7L,1L,0x47C53492L,0xEE22978CL,0xF204F565L},{(-1L),0L,0xA512C38CL,1L,0xDDD7E864L,(-1L)},{(-1L),0x306D3644L,0L,(-3L),0L,0x306D3644L}},{{0x3873AA4BL,0x47C53492L,(-1L),(-1L),0x18B14613L,0x62D68D50L},{(-3L),0x7AF8184EL,0x0F0D664EL,1L,0x0C8FFBCAL,1L},{2L,0x7AF8184EL,1L,0xF79A781AL,0x18B14613L,0x3873AA4BL},{1L,0x47C53492L,1L,5L,0L,0xA34C36F6L},{0x0F0D664EL,0x306D3644L,2L,0xF204F565L,0xDDD7E864L,5L},{0x7AF8184EL,0L,0x8B705FA7L,0xEE22978CL,0xEE22978CL,0x8B705FA7L},{0x8B705FA7L,0x8B705FA7L,0x2D1F59DCL,0x0C8FFBCAL,(-1L),0xDDD7E864L},{0xF204F565L,0xA512C38CL,(-3L),(-1L),1L,0x2D1F59DCL}},{{0xAD839B02L,0xF204F565L,(-3L),0x0F0D664EL,0x8B705FA7L,0xDDD7E864L},{(-1L),0x0F0D664EL,0x2D1F59DCL,0x18B14613L,0x8F1CC965L,0x8B705FA7L},{0x18B14613L,0x8F1CC965L,0x8B705FA7L,(-1L),1L,5L},{0x47C53492L,0x2D1F59DCL,2L,0xA34C36F6L,1L,0xA34C36F6L},{1L,0x09D63F88L,1L,0x62D68D50L,(-1L),0x3873AA4BL},{(-1L),0L,1L,2L,0x3873AA4BL,1L},{0xA512C38CL,0x0C8FFBCAL,0x0F0D664EL,2L,0xAD839B02L,0x62D68D50L},{(-1L),1L,(-1L),0x62D68D50L,0x0F0D664EL,0x306D3644L}}}; + int32_t l_2465 = (-2L); + int32_t l_2488 = 1L; + uint32_t **l_2543 = &g_1707; + int8_t l_2545 = 0L; + uint32_t *****l_2548[2][6][5] = {{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}}}; + const int32_t ***l_2557 = (void*)0; + union U2 **** const l_2563 = &g_2562; + uint8_t ** const l_2629 = (void*)0; + int i, j, k; + (*l_32) = ((*p_13) = (*p_13)); + (*p_13) = func_34(((*l_1316) = func_38(&g_33)), &g_368[0][7][2], p_14.f2); +lbl_2351: + (*g_688) = (*p_15); + for (g_902 = 3; (g_902 >= 0); g_902 -= 1) + { /* block id: 1101 */ + struct S1 **l_2255 = (void*)0; + struct S1 **l_2256[4]; + int32_t l_2259[9] = {0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL,0x516D507AL}; + int16_t **l_2263 = &g_2213[8][2][2]; + uint16_t l_2289 = 65529UL; + union U2 *l_2315 = &l_980; + uint32_t l_2330[9][8][1] = {{{0x6A3C0208L},{0x610F5ECBL},{0xE9A408D8L},{1UL},{2UL},{1UL},{0xE9A408D8L},{0x610F5ECBL}},{{0x6A3C0208L},{0xEE99DD9DL},{2UL},{1UL},{1UL},{0x610F5ECBL},{1UL},{1UL}},{{2UL},{0xEE99DD9DL},{0x6A3C0208L},{0x610F5ECBL},{0xE9A408D8L},{1UL},{2UL},{1UL}},{{0xE9A408D8L},{0x610F5ECBL},{0x6A3C0208L},{0xEE99DD9DL},{2UL},{1UL},{1UL},{0x610F5ECBL}},{{1UL},{1UL},{2UL},{0xEE99DD9DL},{0x6A3C0208L},{0x610F5ECBL},{0xE9A408D8L},{1UL}},{{2UL},{1UL},{0xE9A408D8L},{0x610F5ECBL},{0x6A3C0208L},{0xEE99DD9DL},{2UL},{1UL}},{{1UL},{0x610F5ECBL},{1UL},{1UL},{2UL},{0xEE99DD9DL},{0x6A3C0208L},{0x610F5ECBL}},{{0xE9A408D8L},{1UL},{2UL},{1UL},{0xE9A408D8L},{0x610F5ECBL},{0x6A3C0208L},{0xEE99DD9DL}},{{2UL},{1UL},{1UL},{0x610F5ECBL},{1UL},{1UL},{2UL},{0xEE99DD9DL}}}; + uint16_t **l_2378 = (void*)0; + uint32_t l_2423 = 4294967293UL; + int32_t l_2489 = 0x7F7BAA7EL; + int16_t l_2494 = (-2L); + uint32_t l_2522 = 0x57A978C3L; + int8_t *l_2524 = (void*)0; + int32_t *l_2527[9][10] = {{&l_62.f1,&g_203.f1,&g_429[3][2][4].f1,&g_429[3][2][4].f1,&g_203.f1,&l_62.f1,&g_203.f1,&g_140,(void*)0,&g_203.f1},{(void*)0,&g_203.f1,&l_73.f1,&l_980.f0,&g_140,&l_980.f0,&l_73.f1,&g_203.f1,(void*)0,&l_62.f1},{(void*)0,&g_429[3][2][4].f1,&l_2489,&g_203.f1,&l_980.f0,&l_62.f1,&l_62.f1,&l_980.f0,&g_203.f1,&l_2489},{&l_62.f1,&l_62.f1,&l_980.f0,&g_203.f1,&l_2489,&g_429[3][2][4].f1,(void*)0,&g_140,(void*)0,&g_429[3][2][4].f1},{&l_73.f1,&l_980.f0,&g_140,&l_980.f0,&l_73.f1,&g_203.f1,(void*)0,&l_62.f1,(void*)0,(void*)0},{&g_203.f1,&l_62.f1,&g_203.f1,&g_429[3][2][4].f1,&g_429[3][2][4].f1,&g_203.f1,&l_62.f1,&g_203.f1,&g_140,(void*)0},{&g_140,&g_429[3][2][4].f1,&l_62.f1,(void*)0,&l_73.f1,(void*)0,&l_73.f1,(void*)0,&l_62.f1,&g_429[3][2][4].f1},{&g_203.f1,&l_2489,&l_980.f0,&g_429[3][2][4].f1,&g_140,&g_203.f1,(void*)0,(void*)0,&g_203.f1,&g_140},{&l_62.f1,(void*)0,(void*)0,&l_62.f1,(void*)0,&g_203.f1,&l_73.f1,&l_980.f0,&g_140,&l_980.f0}}; + struct S0 ** const l_2546[4] = {&g_803,&g_803,&g_803,&g_803}; + uint32_t ** const l_2587 = &g_1707; + uint32_t *l_2596 = &l_2312; + uint32_t **l_2595 = &l_2596; + int8_t *l_2632[2]; + int i, j, k; + for (i = 0; i < 4; i++) + l_2256[i] = &g_202[2][4]; + for (i = 0; i < 2; i++) + l_2632[i] = &g_448; + g_202[4][9] = &l_62; + (*g_688) &= ((*p_15) = ((((l_2257[0] == &l_2258[0][0]) , l_2259[7]) , ((**g_712) = (((l_2259[3] = 0x447DL) ^ ((((void*)0 == &l_32) | (((*l_2263) = l_2262) == l_2262)) || ((void*)0 == &l_73))) , 0x29L))) >= (*l_32))); + for (l_62.f2 = 1; (l_62.f2 <= 5); l_62.f2 += 1) + { /* block id: 1110 */ + int32_t l_2264 = 1L; + int8_t *l_2280 = (void*)0; + int32_t l_2302[5]; + int32_t l_2408 = 0x81C9B156L; + union U2 l_2415 = {0L}; + uint16_t l_2448 = 0xBC8EL; + int16_t l_2466 = 0xFD66L; + const int32_t l_2521 = 0x4B7359ADL; + union U2 ***l_2624 = &g_1058; + int i, j; + for (i = 0; i < 5; i++) + l_2302[i] = 0xFE7F3AB0L; + if (g_141[g_902][l_62.f2]) + { /* block id: 1111 */ + for (g_1359 = 0; (g_1359 <= 2); g_1359 += 1) + { /* block id: 1114 */ + return &g_9; + } + } + else + { /* block id: 1117 */ + uint8_t l_2277 = 0xA1L; + int32_t l_2279 = 0xC2AC5853L; + int32_t l_2294 = 9L; + int32_t l_2308 = 0x91F0493EL; + int32_t l_2309 = (-7L); + struct S1 l_2379 = {-1L,-10L,0x3B90L,{0x3487L,8UL,1UL,65535UL,1UL},65535UL}; + uint32_t l_2380 = 1UL; + int32_t l_2384 = 0x5899C3A7L; + int32_t l_2385[10][4][6] = {{{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L},{0L,1L,(-1L),0L,0x4B3A9EFEL,0xE7D02930L},{0L,(-1L),0x1040F8BCL,0x344D9AE6L,0x768803A5L,0xA63F859BL},{(-1L),(-9L),0L,0x344D9AE6L,9L,0xE9596E70L}},{{0L,0xF96B3B99L,0x130F37B5L,0L,0x6EB652C0L,0L},{0L,1L,0x88DA25D8L,0x344D9AE6L,(-7L),0x78B3DEB0L},{(-1L),(-1L),0x62ACFAC9L,0x344D9AE6L,0xFAC4ED1CL,0x344D9AE6L},{0L,0L,0L,0L,(-5L),(-8L)}},{{0L,0xB281438FL,2L,0x344D9AE6L,0x38BED929L,0xA980789AL},{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L},{0L,1L,(-1L),0L,0x4B3A9EFEL,0xE7D02930L},{0L,(-1L),0x1040F8BCL,0x344D9AE6L,0x768803A5L,0xA63F859BL}},{{(-1L),(-9L),0L,0x344D9AE6L,9L,0xE9596E70L},{0L,0xF96B3B99L,0x130F37B5L,0L,0x6EB652C0L,0L},{0L,1L,0x88DA25D8L,0x344D9AE6L,(-7L),0x78B3DEB0L},{(-1L),(-1L),0x62ACFAC9L,0x344D9AE6L,0xFAC4ED1CL,0x344D9AE6L}},{{0L,0L,0L,0L,(-5L),(-8L)},{0L,0xB281438FL,2L,0x344D9AE6L,0x38BED929L,0xA980789AL},{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L},{0L,1L,(-1L),0L,0x4B3A9EFEL,0xE7D02930L}},{{0L,(-1L),0x1040F8BCL,0x344D9AE6L,0x768803A5L,0xA63F859BL},{(-1L),(-9L),0L,0x344D9AE6L,9L,0xE9596E70L},{0L,0xF96B3B99L,0x130F37B5L,0L,0x6EB652C0L,0L},{0L,1L,0x88DA25D8L,0x344D9AE6L,(-7L),0x78B3DEB0L}},{{(-1L),(-1L),0x62ACFAC9L,0x344D9AE6L,0xFAC4ED1CL,0x344D9AE6L},{0L,0L,0L,0L,(-5L),(-8L)},{0L,0xB281438FL,2L,0x344D9AE6L,0x38BED929L,0xA980789AL},{(-1L),0x9819E421L,0x16FE54D0L,0x344D9AE6L,(-1L),0L}},{{1L,0L,(-7L),(-1L),0L,0x0594ECFCL},{1L,0xE9596E70L,7L,0xB5891EFAL,2L,0x290904F0L},{(-7L),0xA63F859BL,(-1L),0xB5891EFAL,0x130F37B5L,0x06C85D14L},{1L,0xE7D02930L,(-5L),(-1L),0x16FE54D0L,0xD3FD5C8DL}},{{1L,0L,1L,0xB5891EFAL,0x88DA25D8L,1L},{(-7L),0xA980789AL,0x2A735ED7L,0xB5891EFAL,(-1L),0xB5891EFAL},{1L,(-8L),1L,(-1L),0x62ACFAC9L,0x5A705F23L},{1L,0x344D9AE6L,(-4L),0xB5891EFAL,0x1040F8BCL,0xAFA1E74CL}},{{(-7L),0x78B3DEB0L,(-4L),0xB5891EFAL,0L,(-1L)},{1L,0L,(-7L),(-1L),0L,0x0594ECFCL},{1L,0xE9596E70L,7L,0xB5891EFAL,2L,0x290904F0L},{(-7L),0xA63F859BL,(-1L),0xB5891EFAL,0x130F37B5L,0x06C85D14L}}}; + uint16_t l_2387[8][8][2] = {{{0x1F77L,0x8916L},{0x5EB1L,1UL},{0xD941L,0xD941L},{0xB4D7L,1UL},{0x156AL,0xF827L},{1UL,0UL},{0xF674L,1UL},{0xB773L,0x4CDCL}},{{0xB773L,1UL},{0xF674L,0UL},{1UL,0xF827L},{0x156AL,1UL},{0xB4D7L,0xD941L},{0xD941L,1UL},{0x5EB1L,0x8916L},{0x1F77L,0xF827L}},{{0UL,8UL},{0xDCD7L,0x9ED6L},{0xB773L,0xFBAAL},{65531UL,0xE04EL},{1UL,0UL},{0UL,0xEEC3L},{0UL,0xA55FL},{0xB4D7L,1UL}},{{0xB9FBL,0x9C21L},{8UL,0x8916L},{0x156AL,0xEEC3L},{0x9ED6L,0xB4D7L},{0xDCD7L,1UL},{65531UL,0xE953L},{0UL,0xE04EL},{0xF674L,8UL}},{{0x9ED6L,0x45EEL},{0UL,1UL},{0x5EB1L,0x9C21L},{1UL,0x9C21L},{0x5EB1L,1UL},{0UL,0x45EEL},{0x9ED6L,8UL},{0xF674L,0xE04EL}},{{0UL,0xE953L},{65531UL,1UL},{0xDCD7L,0xB4D7L},{0x9ED6L,0xEEC3L},{0x156AL,0x8916L},{8UL,0x9C21L},{0xB9FBL,1UL},{0xB4D7L,0xA55FL}},{{0UL,0xEEC3L},{0UL,0UL},{1UL,0xE04EL},{65531UL,0xFBAAL},{0xB773L,0x9ED6L},{0xDCD7L,8UL},{0UL,0xF827L},{0x1F77L,0x8916L}},{{0x5EB1L,1UL},{0xD941L,0xD941L},{0xB4D7L,1UL},{0x156AL,0xDCD7L},{65535UL,0xD941L},{0xE4A2L,65535UL},{1UL,0x77A6L},{1UL,65535UL}}}; + int i, j, k; + if ((*l_32)) + break; + if (((0x32L >= (((l_2264 = p_14.f2) , (-5L)) & (safe_lshift_func_int8_t_s_u(p_14.f1, 5)))) < p_12)) + { /* block id: 1120 */ + struct S0 *l_2278 = &l_62.f3; + if (l_2259[3]) + break; + l_2279 |= (~((*p_15) = (((*p_15) || ((*l_32) != (l_2259[7] || 9L))) > (((safe_lshift_func_int8_t_s_s(((((((safe_sub_func_int32_t_s_s(((*p_13) & 0xD5DB01E4L), (l_2277 = ((l_980 , (((*g_688) = (safe_mod_func_int32_t_s_s((safe_div_func_int8_t_s_s(0L, 8L)), 0xEA115DFCL))) < 5L)) & 0xD3L)))) > (-1L)) && (*l_32)) != p_14.f0) || l_2259[7]) <= p_14.f1), 1)) , l_2278) != &p_14)))); + return l_2280; + } + else + { /* block id: 1127 */ + int16_t *l_2295 = &g_1798; + int32_t l_2300 = 0L; + int32_t l_2304 = 0xE4A6017EL; + int32_t l_2305 = 0xBB491C39L; + for (g_94 = 0; (g_94 <= 3); g_94 += 1) + { /* block id: 1130 */ + int i, j; + (*g_688) = (((safe_add_func_uint16_t_u_u((1UL < (0xCD44D46BL != (safe_add_func_uint8_t_u_u((((p_12 , (safe_lshift_func_uint8_t_u_s((safe_mul_func_int16_t_s_s(l_2289, (safe_lshift_func_int8_t_s_u((0UL != (~((safe_add_func_uint8_t_u_u((g_141[g_94][(g_94 + 3)] = ((3UL == 0x8855L) , (0x099BL ^ l_2279))), 0x5DL)) & l_2259[5]))), l_2294)))), 7))) , 0x6B32L) >= 0x40A0L), 0x1BL)))), 65530UL)) >= 0x84L) < (*p_15)); + } + l_2264 = (*p_13); + for (g_29 = 0; (g_29 <= 3); g_29 += 1) + { /* block id: 1137 */ + const int16_t *l_2296 = &g_193.f0; + int32_t *l_2297 = (void*)0; + int32_t *l_2298 = &l_2259[2]; + int32_t *l_2299[2][7][6] = {{{&l_2259[7],&g_33,&l_2259[7],&l_2279,&l_2264,&g_82},{&g_82,(void*)0,&g_33,&g_33,(void*)0,&g_82},{&l_2279,&l_2264,&l_2259[7],&g_902,&g_82,&g_29},{(void*)0,&l_2259[7],&g_82,&g_82,&g_82,&l_2259[7]},{(void*)0,&g_29,&g_82,&g_902,&l_2259[7],&l_2264},{&l_2279,&g_82,(void*)0,&g_33,&g_33,(void*)0},{&g_82,&g_82,&l_2264,&l_2279,&l_2259[7],&g_33}},{{&l_2259[7],&g_29,&g_902,&l_2264,&g_82,&l_2264},{&g_902,&l_2259[7],&g_902,&l_2264,&g_82,&g_33},{&l_2259[7],&l_2264,&l_2264,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&l_2264,&l_2264},{&l_2259[7],&g_33,&g_82,&l_2264,&g_902,&l_2259[7]},{&g_902,&l_2264,&g_82,&l_2264,&g_902,&g_29},{&l_2259[7],&g_33,&l_2259[7],&l_2279,&l_2264,&g_82}}}; + int i, j, k; + (*l_32) = (l_2295 != l_2296); + --l_2312; + } + } + if (l_2308) + { /* block id: 1142 */ + int8_t l_2321 = 1L; + uint32_t l_2326 = 6UL; + int32_t l_2329[4]; + struct S1 l_2350 = {-1L,1L,0xD5C0L,{0x8AE0L,65528UL,1UL,1UL,255UL},65535UL}; + int i; + for (i = 0; i < 4; i++) + l_2329[i] = 3L; + (*g_1058) = l_2315; + (*p_13) = (*g_688); + if ((safe_lshift_func_uint16_t_u_s(p_14.f3, 15))) + { /* block id: 1145 */ + int32_t *l_2318 = &l_2294; + int32_t *l_2319 = &l_2259[4]; + int32_t *l_2320 = (void*)0; + int32_t *l_2322 = (void*)0; + int32_t *l_2323 = &l_2307; + int32_t *l_2324 = &l_2302[0]; + int32_t *l_2325[5]; + int i; + for (i = 0; i < 5; i++) + l_2325[i] = &l_2294; + (*l_32) = 8L; + --l_2326; + l_2330[1][2][0]++; + (*l_2318) = ((*p_15) = ((((0x7027L <= 3UL) , (safe_add_func_uint16_t_u_u((l_2262 != (void*)0), p_14.f2))) ^ (safe_rshift_func_uint16_t_u_u(p_14.f1, ((safe_mod_func_uint16_t_u_u((safe_div_func_uint8_t_u_u(((((g_2341 , ((safe_rshift_func_uint16_t_u_s((safe_add_func_uint16_t_u_u(((*p_15) | (*p_13)), 1L)), 15)) || p_12)) & (*p_13)) | p_12) < l_2277), (*g_713))), 0x4026L)) || (-6L))))) ^ (*l_32))); + } + else + { /* block id: 1151 */ + if ((*p_13)) + break; + } + (*p_13) = ((*g_1153) & (((0UL >= l_2330[7][3][0]) | (((*l_32) |= (safe_div_func_uint16_t_u_u((l_2264 >= (l_2259[4] || (safe_sub_func_int32_t_s_s(((!((p_15 == (g_688 = func_16(l_2350, l_2326, &l_2321, (*g_1059)))) < 0xC144L)) | p_14.f2), g_663.f1)))), p_14.f2))) < p_14.f4)) && 65532UL)); + } + else + { /* block id: 1157 */ + int8_t l_2373 = (-1L); + int32_t *l_2381 = &l_2302[3]; + int32_t *l_2382[3][1]; + int32_t l_2383 = 0xD4D53D12L; + int i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + l_2382[i][j] = &l_2309; + } + if (p_12) + goto lbl_2351; + for (g_663.f1 = 0; (g_663.f1 <= 5); g_663.f1 += 1) + { /* block id: 1161 */ + uint32_t *l_2372 = &g_1492; + int i, j; + (*g_688) = (((safe_lshift_func_uint8_t_u_s((g_141[g_663.f1][l_62.f2] = 0xA0L), 5)) , l_62) , ((safe_div_func_uint32_t_u_u((safe_rshift_func_uint16_t_u_u((p_14.f4 ^ ((((safe_div_func_int16_t_s_s(g_141[g_663.f1][l_62.f2], 0xF306L)) & ((*g_146) = p_14.f1)) == ((safe_mod_func_uint16_t_u_u((safe_mul_func_uint8_t_u_u((p_14 , (safe_sub_func_uint32_t_u_u(p_14.f1, ((*l_2372) &= ((((safe_mul_func_int16_t_s_s(((*l_2262) = (safe_mul_func_int8_t_s_s((safe_mul_func_uint8_t_u_u(((**g_1455) = (p_14.f3 != (*l_32))), 6UL)), p_12))), p_12)) > (-1L)) < (*p_13)) , p_14.f1))))), 0xC5L)), l_2309)) , 0x0BB3L)) ^ (*p_13))), l_2373)), (*p_15))) <= p_14.f4)); + (*p_13) |= (!(safe_add_func_uint8_t_u_u((p_14.f0 != (*g_1153)), 0xB4L))); + return &g_870; + } + if ((safe_rshift_func_int16_t_s_s(((void*)0 == l_2378), (l_2379 , p_14.f1)))) + { /* block id: 1171 */ + g_131 = &g_33; + return &g_1473[8]; + } + else + { /* block id: 1174 */ + if (l_2380) + break; + } + l_2387[3][1][1]++; + } + } + if ((safe_rshift_func_int8_t_s_u((*l_32), 1))) + { /* block id: 1180 */ + uint16_t l_2413 = 1UL; + union U2 l_2414[6] = {{0L},{0L},{0L},{0L},{0L},{0L}}; + int32_t **l_2440 = &g_364; + int32_t **l_2441 = &g_364; + int i; + if ((*p_13)) + break; + for (g_94 = 0; (g_94 <= 3); g_94 += 1) + { /* block id: 1184 */ + union U2 * const *l_2419 = &g_1059; + union U2 * const **l_2418 = &l_2419; + int32_t l_2420[9][1] = {{0x051709FCL},{1L},{0x051709FCL},{0x051709FCL},{1L},{0x051709FCL},{0x051709FCL},{1L},{0x051709FCL}}; + int32_t *l_2478 = &g_429[3][2][4].f1; + struct S1 l_2520 = {-2L,0L,0x57AFL,{0x21C3L,0x3511L,0x0B52L,65528UL,0xE3L},0x76F0L}; + int i, j; + } + return l_2524; + } + else + { /* block id: 1222 */ + const struct S1 l_2528 = {0x71L,0L,0UL,{0x3E7BL,2UL,0xA362L,0x52B0L,1UL},0x1C93L}; + uint32_t *l_2544 = &g_27; + struct S0 * const *l_2547[6] = {&g_803,&g_803,&g_803,&g_803,&g_803,&g_803}; + int8_t *l_2549 = (void*)0; + int32_t *l_2550 = &g_429[3][2][4].f1; + int32_t ***l_2556 = (void*)0; + const int32_t ****l_2558 = &l_2557; + uint16_t **l_2568 = &g_146; + int32_t l_2574[4] = {(-1L),(-1L),(-1L),(-1L)}; + int8_t l_2588 = 0L; + uint32_t l_2600 = 0x9044E83EL; + int i; + l_2302[3] = (safe_lshift_func_uint16_t_u_s(5UL, ((4L >= p_14.f4) & l_2302[3]))); + (*p_15) = ((((l_2527[5][4] != (l_2550 = func_16((l_2528 , l_73), (safe_mul_func_uint16_t_u_u((safe_rshift_func_int16_t_s_s(0L, ((safe_rshift_func_int8_t_s_s((p_14.f3 & 0xAEFE28DBL), 3)) & (safe_mod_func_int8_t_s_s((safe_mod_func_uint16_t_u_u((((((((l_2528 , (((safe_lshift_func_int8_t_s_s(((safe_div_func_uint8_t_u_u((((*l_2544) = (&g_1931[0] == l_2543)) != l_2545), 0x12L)) , l_2302[3]), 3)) && (*p_13)) , l_2546[0])) != l_2547[1]) || p_14.f4) == (*p_13)) , p_14.f3) , l_2548[1][3][0]) != &g_1766), (*g_522))), l_2330[1][2][0]))))), l_2415.f0)), l_2549, (*l_2315)))) < 0UL) < (*g_146)) >= 0UL); + (*l_32) = (safe_unary_minus_func_int32_t_s(((l_2528.f1 , (((p_14.f0 | ((safe_sub_func_int16_t_s_s((safe_rshift_func_int16_t_s_u(p_14.f0, 10)), (((l_2556 == ((*l_2558) = l_2557)) != (((((safe_mod_func_int16_t_s_s((g_2561 == l_2563), (((((safe_div_func_uint16_t_u_u(((safe_lshift_func_int8_t_s_s((0UL & 9UL), 7)) || p_14.f0), l_2289)) < 0x58L) >= (**g_1455)) < 0L) | 0x365904B0L))) > p_14.f2) , l_2568) != l_2378) < p_14.f2)) ^ l_2423))) != 0xE69B00F3L)) ^ (*g_1949)) || 0x2E1B5BAFL)) > p_14.f3))); + for (g_203.f4 = (-21); (g_203.f4 < 26); g_203.f4++) + { /* block id: 1231 */ + int8_t l_2594 = 9L; + int32_t * const *l_2599[2]; + union U2 ***l_2623 = (void*)0; + int32_t *l_2630 = &l_2574[3]; + int32_t *l_2631 = &l_2259[7]; + int i; + for (i = 0; i < 2; i++) + l_2599[i] = (void*)0; + for (g_1359 = 3; (g_1359 == 40); g_1359 = safe_add_func_int32_t_s_s(g_1359, 8)) + { /* block id: 1234 */ + int32_t *l_2573[6][7][6] = {{{&l_2386[3][6][3],&l_2302[4],&l_2259[4],&l_2302[4],&l_2386[3][6][3],&l_2264},{&g_82,&l_2302[3],&g_29,&l_2306,&l_2302[3],(void*)0},{&l_2259[4],&l_2264,&l_2465,&l_2302[3],&g_29,(void*)0},{&l_2259[6],(void*)0,&g_29,&l_2465,&l_2264,&l_2264},{&g_29,&l_2259[4],&l_2259[4],&g_29,&l_2259[6],&l_2307},{&l_2465,&g_29,(void*)0,&l_2259[6],&g_29,&g_29},{&l_2302[3],&l_2465,&l_2264,&l_2259[4],&g_29,&l_2465}},{{&l_2306,&g_29,&l_2302[3],&g_82,&l_2259[6],&g_82},{&l_2302[4],&l_2259[4],&l_2302[4],&l_2386[3][6][3],&l_2264,&g_29},{&g_29,(void*)0,&g_29,&l_2302[3],&g_29,&g_29},{(void*)0,&l_2264,&l_2306,&l_2302[3],&l_2302[3],&l_2386[3][6][3]},{&g_29,&l_2302[3],&l_2259[6],&l_2386[3][6][3],&l_2386[3][6][3],&l_2259[6]},{&l_2311,&l_2311,&l_2465,&l_2302[4],&g_82,&g_29},{&g_29,&l_2306,&g_82,&l_2301,&l_2259[6],&l_2465}},{{&l_2386[3][6][3],&g_29,&g_82,&l_2259[4],&l_2311,&g_29},{&g_29,&l_2259[4],&l_2465,(void*)0,&l_2465,&l_2259[4]},{(void*)0,&l_2465,&l_2259[4],&g_29,&l_2307,(void*)0},{&l_2259[4],&g_82,&g_29,&l_2386[3][6][3],&l_2301,&l_2264},{&l_2301,&g_82,&l_2306,&g_29,&l_2307,&l_2302[3]},{&l_2302[4],&l_2465,&l_2311,&l_2311,&l_2465,&l_2302[4]},{(void*)0,&l_2259[4],&l_2386[3][6][3],&l_2302[3],&l_2311,&g_29}},{{&l_2302[3],&g_29,&l_2488,&g_29,&l_2259[6],&l_2306},{&l_2302[3],&l_2306,&g_29,&l_2302[3],&g_82,&l_2259[6]},{(void*)0,&l_2311,&l_2301,&l_2311,(void*)0,&l_2488},{&l_2302[4],&l_2386[3][6][3],&l_2264,&g_29,&g_29,&g_29},{&l_2301,&l_2488,&l_2302[3],&l_2386[3][6][3],(void*)0,&g_29},{&l_2259[4],&g_29,&l_2264,&g_29,&l_2488,&l_2488},{(void*)0,&l_2301,&l_2301,(void*)0,&l_2259[4],&l_2259[6]}},{{&g_29,&l_2264,&g_29,&l_2259[4],&l_2302[3],&l_2306},{&l_2386[3][6][3],&l_2302[3],&l_2488,&l_2301,&l_2302[3],&g_29},{&g_29,&l_2264,&l_2386[3][6][3],&l_2302[4],&l_2259[4],&l_2302[4]},{&l_2311,&l_2301,&l_2311,(void*)0,&l_2488,&l_2302[3]},{&l_2302[3],&g_29,&l_2306,&l_2302[3],(void*)0,&l_2264},{&g_29,&l_2488,&g_29,&l_2302[3],&g_29,(void*)0},{&l_2302[3],&l_2386[3][6][3],&l_2259[4],(void*)0,(void*)0,&l_2259[4]}},{{&l_2311,&l_2311,&l_2465,&l_2302[4],&g_82,&g_29},{&g_29,&l_2306,&g_82,&l_2301,&l_2259[6],&l_2465},{&l_2386[3][6][3],&g_29,&g_82,&l_2259[4],&l_2311,&g_29},{&g_29,&l_2259[4],&l_2465,(void*)0,&l_2465,&l_2259[4]},{(void*)0,&l_2465,&l_2259[4],&g_29,&l_2307,(void*)0},{&l_2259[4],&g_82,&g_29,&l_2386[3][6][3],&l_2301,&l_2264},{&l_2301,&g_82,&l_2306,&g_29,&l_2307,&l_2302[3]}}}; + uint32_t **l_2586[7][2] = {{(void*)0,&g_1707},{&g_1707,(void*)0},{&g_1707,&g_1707},{(void*)0,&g_1707},{&g_1707,(void*)0},{&g_1707,(void*)0},{&g_1707,(void*)0}}; + uint32_t ***l_2597 = &g_737; + int32_t **l_2598 = &l_2550; + int i, j, k; + (*g_802) = (*g_802); + --g_2575; + (*p_15) = (l_2574[3] , (p_14.f1 , (safe_lshift_func_uint16_t_u_s((((p_14.f3 | ((-3L) < l_2528.f1)) ^ ((safe_unary_minus_func_uint8_t_u((((*g_146) ^= (~((*p_15) == p_14.f4))) != (((safe_unary_minus_func_int8_t_s(p_14.f4)) <= (((!((safe_lshift_func_int16_t_s_u((0x8ED8L > p_14.f0), 1)) , (*l_32))) , l_2586[2][0]) != l_2587)) <= (*l_32))))) != 1UL)) ^ p_12), l_2588)))); + l_2408 &= (((*l_32) <= (((safe_unary_minus_func_int16_t_s((safe_mul_func_int16_t_s_s(((*l_2262) = (((((*p_13) |= (~(p_14.f3 >= (((l_2594 = (g_193.f2 , (*g_146))) || (((*l_2597) = ((*g_522) , l_2595)) != &l_2596)) == 0x3CF58CB7L)))) || (l_2600 = ((l_2598 != l_2599[0]) , 4294967295UL))) == l_2522) | p_14.f2)), 0UL)))) != p_14.f2) & l_2521)) == l_2415.f0); + } + (*l_2631) = ((safe_sub_func_uint32_t_u_u(l_2588, ((*l_2544) |= (+(safe_add_func_uint16_t_u_u((safe_sub_func_int32_t_s_s(((*l_2630) &= ((*l_32) = (safe_unary_minus_func_int32_t_s(((*p_13) = (!((safe_rshift_func_int8_t_s_s((safe_mod_func_uint8_t_u_u((safe_unary_minus_func_uint8_t_u(((*g_1153) ^= (safe_sub_func_int8_t_s_s((((safe_div_func_uint8_t_u_u((p_14.f1 <= (safe_mul_func_uint16_t_u_u(((g_193 , (((safe_mul_func_int8_t_s_s((safe_sub_func_uint8_t_u_u(((l_2623 != ((*l_2563) = l_2624)) && ((((safe_div_func_int16_t_s_s((p_14.f0 != ((*g_713) = ((safe_rshift_func_int8_t_s_u(((((l_2629 != (void*)0) || ((0UL != (*g_1949)) , p_14.f0)) <= (*g_1010)) > l_2588), 1)) , 0UL))), 0xFB22L)) | 0xD46AL) && p_12) >= 0xF070L)), l_2594)), l_2594)) || l_2448) ^ 0UL)) ^ p_14.f4), l_2594))), l_2289)) < l_2594) , (*g_10)), 0L))))), l_2448)), 4)) >= 0x577BL))))))), p_14.f3)), p_12)))))) | p_14.f2); + if ((*g_131)) + continue; + } + } + return &g_1473[4]; + } + return l_2632[1]; + } + return &g_870; +} + + +/* ------------------------------------------ */ +/* + * reads : g_27 g_28 + * writes: g_27 + */ +static int32_t * func_16(struct S1 p_17, uint32_t p_18, int8_t * p_19, union U2 p_20) +{ /* block id: 1 */ + int32_t l_26[8][6] = {{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L},{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L},{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L},{1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L,0xAF1E2CD8L},{1L,1L,0xAF1E2CD8L,0xAF1E2CD8L,1L,1L}}; + int i, j; + for (p_17.f4 = 0; (p_17.f4 <= 11); p_17.f4 = safe_add_func_uint16_t_u_u(p_17.f4, 6)) + { /* block id: 4 */ + g_27 ^= l_26[5][1]; + } + return g_28[4]; +} + + +/* ------------------------------------------ */ +/* + * reads : g_1725 g_368 g_367 g_522 g_203.f3.f1 g_688 g_82 g_491 g_712 g_713 g_94 g_146 g_23.f2 g_203.f3.f3 g_33 + * writes: g_491 g_33 g_203.f0 g_367 g_82 g_2212 g_203.f3.f1 g_94 g_2039 g_203.f3.f3 + */ +static int32_t func_34(int8_t * p_35, int8_t * p_36, uint16_t p_37) +{ /* block id: 670 */ + struct S0 l_1321[7][5] = {{{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL}},{{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L}},{{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL}},{{-4L,1UL,0x33E9L,65532UL,248UL},{-1L,1UL,8UL,65530UL,2UL},{-4L,1UL,0x33E9L,65532UL,248UL},{-1L,1UL,8UL,65530UL,2UL},{-4L,1UL,0x33E9L,65532UL,248UL}},{{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL}},{{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L},{-1L,1UL,8UL,65530UL,2UL},{0xBD94L,0xF8F5L,0x5D41L,0x2316L,0xF3L}},{{-3L,0UL,0x0D39L,0x7666L,9UL},{-3L,0UL,0x0D39L,0x7666L,9UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{0x7E5BL,0UL,65535UL,65534UL,255UL},{-3L,0UL,0x0D39L,0x7666L,9UL}}}; + int16_t l_1379 = 4L; + uint32_t *l_1406 = (void*)0; + union U2 l_1407 = {0x4EADE60BL}; + int32_t l_1421 = 0x102DBB17L; + int32_t l_1424 = 0x2B1BCA3FL; + int32_t l_1428 = 0xEA818C76L; + uint8_t **l_1453 = &g_1153; + uint32_t **l_1709 = (void*)0; + uint16_t *l_1711 = &g_203.f3.f3; + struct S1 l_1720 = {0x40L,0x6FFD7AF9L,8UL,{0x2D4DL,0xA206L,65535UL,0x7873L,5UL},0xD12CL}; + int32_t ****l_1721 = &g_362[0][2]; + const int32_t *l_1724 = &g_1725; + uint32_t ***l_1768 = (void*)0; + uint32_t ****l_1767 = &l_1768; + int8_t *l_1795 = &g_203.f0; + const int32_t *l_1817 = &g_203.f1; + const int32_t **l_1816 = &l_1817; + union U2 *** const l_1840 = &g_1058; + int32_t l_1879 = 1L; + uint16_t l_1880[3][4][4] = {{{0xEBB3L,0x28F1L,0x5A36L,0x28F1L},{0xEBB3L,0x9C2CL,1UL,0x28F1L},{1UL,0x28F1L,1UL,0x9C2CL},{0xEBB3L,0x28F1L,0x5A36L,0x28F1L}},{{0xEBB3L,0x9C2CL,1UL,0x28F1L},{1UL,0x28F1L,1UL,0x9C2CL},{0xEBB3L,0x28F1L,0x5A36L,0x28F1L},{0xEBB3L,0x9C2CL,1UL,0x28F1L}},{{1UL,0x28F1L,1UL,0x9C2CL},{0xEBB3L,0x28F1L,0x5A36L,0x28F1L},{0xEBB3L,0x9C2CL,1UL,0x28F1L},{1UL,0x28F1L,1UL,0x9C2CL}}}; + struct S0 **l_1910 = &g_803; + int16_t l_1918 = (-9L); + uint32_t l_1946[7] = {0xEE53957CL,0xEE53957CL,0x80BFCBB2L,0xEE53957CL,0xEE53957CL,0x80BFCBB2L,0xEE53957CL}; + const int8_t *l_2008 = &g_1473[4]; + const int8_t **l_2007[1][3]; + int32_t l_2058 = (-1L); + int32_t l_2060 = 1L; + int32_t l_2062 = 0L; + int32_t l_2063 = 2L; + int32_t l_2064 = 0x983A5C25L; + int32_t l_2066 = (-4L); + int32_t l_2068[10] = {0L,(-4L),(-4L),0L,(-4L),(-4L),0L,(-4L),(-4L),0L}; + int32_t l_2107 = 0xA817EE1CL; + uint16_t l_2110 = 5UL; + int32_t l_2187[2][1][6] = {{{0xDE7BFC06L,1L,0xDE7BFC06L,0xDE7BFC06L,1L,0xDE7BFC06L}},{{0xDE7BFC06L,1L,0xDE7BFC06L,0xDE7BFC06L,1L,0xDE7BFC06L}}}; + int16_t * const l_2211 = (void*)0; + int16_t * const *l_2210 = &l_2211; + uint32_t l_2251 = 1UL; + int i, j, k; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 3; j++) + l_2007[i][j] = &l_2008; + } +lbl_2200: + for (g_491 = 0; (g_491 <= 2); g_491 += 1) + { /* block id: 673 */ + union U2 *** const l_1324 = &g_1058; + int32_t l_1338 = 0x5C08166EL; + struct S0 l_1356 = {-6L,0x5D1AL,2UL,4UL,255UL}; + struct S1 l_1369 = {7L,0x11B39F74L,0UL,{0x463DL,1UL,0x5561L,0UL,255UL},0UL}; + uint16_t *l_1374[2]; + int32_t l_1422 = 0x6B8C6F9AL; + int32_t l_1426[9][1] = {{0x9BCC42A8L},{1L},{0x9BCC42A8L},{1L},{0x9BCC42A8L},{1L},{0x9BCC42A8L},{1L},{0x9BCC42A8L}}; + uint32_t l_1461 = 1UL; + int8_t *l_1605 = &g_368[5][2][0]; + int32_t *l_1607 = &l_1421; + int32_t l_1684 = (-3L); + int32_t **** const l_1691 = &g_362[1][1]; + uint32_t *l_1715 = &g_1474; + uint32_t ***l_1733 = &l_1709; + uint32_t l_1760 = 0xCBADAB3CL; + int32_t **l_1761 = (void*)0; + uint8_t l_1804 = 0UL; + int16_t *l_1841 = &g_367; + int32_t l_1854[2][5] = {{0x57B5A700L,9L,0x57B5A700L,0x57B5A700L,9L},{9L,0x57B5A700L,0x57B5A700L,9L,0x57B5A700L}}; + int32_t **l_1855 = &l_1607; + const union U2 **l_1904 = &g_1006; + const union U2 ***l_1903 = &l_1904; + int16_t l_1948 = 0xC682L; + uint32_t l_2035 = 18446744073709551612UL; + int8_t l_2059 = 0x14L; + int16_t l_2072 = (-1L); + int32_t l_2099 = 1L; + struct S1 l_2115 = {0xA4L,0xBD652974L,0x549FL,{0xE04CL,65535UL,0x13F6L,2UL,0xCCL},65531UL}; + struct S1 **l_2135[6][2]; + struct S1 **l_2136 = &g_202[4][6]; + int i, j; + for (i = 0; i < 2; i++) + l_1374[i] = &g_429[3][2][4].f4; + for (i = 0; i < 6; i++) + { + for (j = 0; j < 2; j++) + l_2135[i][j] = (void*)0; + } + } + for (g_33 = (-20); (g_33 == 8); g_33++) + { /* block id: 1056 */ + const uint8_t l_2192 = 0xB9L; + int16_t *l_2197 = &g_367; + int32_t l_2206 = 0xFE778CABL; + int32_t l_2218 = (-1L); + int32_t l_2219 = (-6L); + int32_t l_2221 = 0x90AE588BL; + int32_t l_2222 = 0L; + int32_t l_2223 = 1L; + int32_t l_2225[1][3]; + int16_t l_2249[4] = {0xAF2AL,0xAF2AL,0xAF2AL,0xAF2AL}; + uint32_t l_2250[7] = {0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L,0xC3BA4CE7L}; + int32_t * const **l_2253 = (void*)0; + int32_t * const ***l_2252 = &l_2253; + int32_t *l_2254 = &l_2068[2]; + int i, j; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 3; j++) + l_2225[i][j] = 0x74BA6E8EL; + } + if (l_2187[1][0][2]) + break; + if (((safe_add_func_int8_t_s_s(((((((((safe_rshift_func_int8_t_s_s(((*l_1795) = (l_2192 >= ((0xB0C3E753L || p_37) > (*l_1724)))), 6)) , ((p_37 , 4UL) < (((safe_add_func_uint16_t_u_u(2UL, ((*l_2197) |= ((*l_1724) & ((safe_sub_func_int8_t_s_s(((((l_2058 = (l_2192 , l_2192)) & (*l_1724)) > (*l_1724)) , (-9L)), 1UL)) , (*p_36)))))) , l_2192) , p_37))) != (*p_36)) , (*g_522)) & (*l_1724)) , 4294967295UL) | p_37) | p_37), (*p_35))) || p_37)) + { /* block id: 1061 */ + if (p_37) + break; + } + else + { /* block id: 1063 */ + int32_t l_2201 = 5L; + int32_t l_2205[8] = {2L,2L,2L,2L,2L,2L,2L,2L}; + int i; + (*g_688) |= p_37; + for (l_1720.f4 = 0; (l_1720.f4 != 17); ++l_1720.f4) + { /* block id: 1067 */ + uint32_t l_2207 = 4294967294UL; + int32_t l_2217 = 0x44EE3AA8L; + int32_t l_2220[6][9] = {{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L},{0xB18AA35AL,0L,0L,0xB18AA35AL,0L,(-1L),0xB18AA35AL,(-1L),0L}}; + int8_t l_2224 = 0xF2L; + int8_t l_2229 = 8L; + int32_t l_2231[8][6][5] = {{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}},{{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)},{0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L,0x90F04890L},{(-1L),(-1L),(-1L),(-1L),(-1L)}}}; + int i, j, k; + if (g_491) + goto lbl_2200; + if (l_2201) + break; + for (l_1720.f0 = 0; (l_1720.f0 <= 5); l_1720.f0 += 1) + { /* block id: 1072 */ + int32_t *l_2202 = &g_902; + int32_t *l_2203 = &l_2060; + int32_t *l_2204[9][10][2] = {{{&g_33,&l_2187[1][0][0]},{(void*)0,&l_2060},{&l_2068[6],&l_2066},{&l_2187[0][0][3],&l_1879},{(void*)0,&g_82},{&l_2066,&g_902},{&l_2068[2],&l_1424},{&l_2066,&g_902},{&l_1879,&l_2060},{&l_2187[1][0][0],(void*)0}},{{&g_902,&l_2064},{&g_29,&l_2062},{&l_2062,&l_2062},{&g_29,&l_2068[2]},{&l_2060,&g_29},{&l_2064,&g_902},{&l_2060,&l_2064},{&l_2062,&g_29},{&l_2062,&l_2064},{&l_2060,&g_902}},{{&l_2064,&g_29},{&l_2060,&l_2068[2]},{&g_29,&l_2062},{&l_2062,&l_2062},{&g_29,&l_2064},{&g_902,(void*)0},{&l_2187[1][0][0],&l_2060},{&l_1879,&g_902},{&l_2066,&l_1424},{&l_2068[2],&g_902}},{{&l_2066,&g_82},{(void*)0,&l_1879},{&l_2187[0][0][3],&l_2066},{&l_2068[6],&l_2060},{(void*)0,&l_2187[1][0][0]},{&g_33,&l_2201},{&g_902,&l_2201},{&g_33,&l_2187[1][0][0]},{(void*)0,&l_2062},{&l_2201,(void*)0}},{{&g_29,&g_29},{&l_2063,&l_1424},{(void*)0,&l_2187[1][0][3]},{&g_33,&l_2062},{&l_2187[0][0][3],&g_29},{&g_29,&g_902},{&g_82,&l_2068[2]},{&l_2066,&l_2064},{&g_902,&l_2062},{&g_902,&g_902}},{{&g_902,&g_33},{&g_902,&l_2187[0][0][1]},{(void*)0,&l_2187[1][0][0]},{&l_2062,(void*)0},{&g_82,&g_902},{&g_82,(void*)0},{&l_2062,&l_2187[1][0][0]},{(void*)0,&l_2187[0][0][1]},{&g_902,&g_33},{&g_902,&g_902}},{{&g_902,&l_2062},{&g_902,&l_2064},{&l_2066,&l_2068[2]},{&g_82,&g_902},{&g_29,&g_29},{&l_2187[0][0][3],&l_2062},{&g_33,&l_2187[1][0][3]},{(void*)0,&l_1424},{&l_2063,&g_29},{&g_29,(void*)0}},{{&l_2201,&l_2062},{&l_2060,&g_82},{&l_2066,&l_2060},{&l_2187[1][0][0],&l_2060},{&l_2066,&g_82},{&l_2060,&l_2062},{&l_2201,(void*)0},{&g_29,&g_29},{&l_2063,&l_1424},{(void*)0,&l_2187[1][0][3]}},{{&g_33,&l_2062},{&l_2187[0][0][3],&g_29},{&g_29,&g_902},{&g_82,&l_2068[2]},{&l_2066,&l_2064},{&g_902,&l_2062},{&g_902,&g_902},{&g_902,&g_33},{&g_902,&l_2187[0][0][1]},{(void*)0,&l_2187[1][0][0]}}}; + int16_t l_2230 = 0xA55CL; + uint32_t l_2232 = 0xE71201CAL; + int i, j, k; + for (l_2107 = 0; (l_2107 <= 5); l_2107 += 1) + { /* block id: 1075 */ + return p_37; + } + ++l_2207; + for (l_2062 = 0; (l_2062 <= 3); l_2062 += 1) + { /* block id: 1081 */ + int8_t l_2214[9][2][1] = {{{1L},{(-1L)}},{{1L},{1L}},{{0xCDL},{1L}},{{1L},{(-1L)}},{{1L},{1L}},{{0xCDL},{1L}},{{1L},{(-1L)}},{{1L},{1L}},{{0xCDL},{1L}}}; + int32_t l_2215 = (-1L); + int32_t l_2216[8][5][6] = {{{0xFD5A2C04L,0L,5L,0x228BFD3AL,(-1L),8L},{0L,0xE3760A9BL,0x89E7159DL,0xA48B00B6L,0x89E7159DL,0xE3760A9BL},{0L,8L,(-1L),0x228BFD3AL,5L,0L},{0xFD5A2C04L,(-1L),0x533CC7D1L,0x4AD7B503L,(-1L),0x533CC7D1L},{0xA48B00B6L,(-1L),0xB16858CAL,0xFD5A2C04L,5L,(-1L)}},{{0x9AB37E89L,8L,0xE1CFE88EL,0xF47BBD48L,0x89E7159DL,0xB16858CAL},{0x228BFD3AL,0xE3760A9BL,0xE1CFE88EL,0x075C4389L,(-1L),(-1L)},{7L,0L,0xB16858CAL,(-3L),0x533CC7D1L,0x533CC7D1L},{(-3L),0x533CC7D1L,0x533CC7D1L,(-3L),0xB16858CAL,0L},{7L,(-1L),(-1L),0x075C4389L,0xE1CFE88EL,0xE3760A9BL}},{{0x228BFD3AL,0xB16858CAL,0x89E7159DL,0xF47BBD48L,0xE1CFE88EL,8L},{0x9AB37E89L,(-1L),5L,0xFD5A2C04L,0x70EF0CBEL,(-1L)},{0xB16858CAL,0xEADC0E19L,(-10L),0x533CC7D1L,0xEADC0E19L,(-1L)},{0L,(-7L),0x115524F0L,(-1L),(-1L),0L},{0L,0x8D68B320L,2L,0xB16858CAL,2L,0x8D68B320L}},{{0L,0L,(-1L),(-1L),0x115524F0L,(-7L)},{0L,(-1L),0xEADC0E19L,0x533CC7D1L,(-10L),0xEADC0E19L},{0xB16858CAL,(-1L),0x70EF0CBEL,0L,0x115524F0L,(-10L)},{0x7BCB3C11L,0L,(-1L),0xE3760A9BL,2L,0x70EF0CBEL},{(-1L),0x8D68B320L,(-1L),8L,(-1L),(-10L)}},{{0xE1CFE88EL,(-7L),0x70EF0CBEL,(-1L),0xEADC0E19L,0xEADC0E19L},{(-1L),0xEADC0E19L,0xEADC0E19L,(-1L),0x70EF0CBEL,(-7L)},{0xE1CFE88EL,(-10L),(-1L),8L,(-1L),0x8D68B320L},{(-1L),0x70EF0CBEL,2L,0xE3760A9BL,(-1L),0L},{0x7BCB3C11L,(-10L),0x115524F0L,0L,0x70EF0CBEL,(-1L)}},{{0xB16858CAL,0xEADC0E19L,(-10L),0x533CC7D1L,0xEADC0E19L,(-1L)},{0L,(-7L),0x115524F0L,(-1L),(-1L),0L},{0L,0x8D68B320L,2L,0xB16858CAL,2L,0x8D68B320L},{0L,0L,(-1L),(-1L),0x115524F0L,(-7L)},{0L,(-1L),0xEADC0E19L,0x533CC7D1L,(-10L),0xEADC0E19L}},{{0xB16858CAL,(-1L),0x70EF0CBEL,0L,0x115524F0L,(-10L)},{0x7BCB3C11L,0L,(-1L),0xE3760A9BL,2L,0x70EF0CBEL},{(-1L),0x8D68B320L,(-1L),8L,(-1L),(-10L)},{0xE1CFE88EL,(-7L),0x70EF0CBEL,(-1L),0xEADC0E19L,0xEADC0E19L},{(-1L),0xEADC0E19L,0xEADC0E19L,(-1L),0x70EF0CBEL,(-7L)}},{{0xE1CFE88EL,(-10L),(-1L),8L,(-1L),0x8D68B320L},{(-1L),0x70EF0CBEL,2L,0xE3760A9BL,(-1L),0L},{0x7BCB3C11L,(-10L),0x115524F0L,0L,0x70EF0CBEL,(-1L)},{0xB16858CAL,0xEADC0E19L,(-10L),0x533CC7D1L,0xEADC0E19L,(-1L)},{0L,(-7L),0x115524F0L,(-1L),(-1L),0L}}}; + uint16_t l_2226 = 0xF37BL; + int i, j, k; + g_2212 = l_2210; + l_2226--; + } + ++l_2232; + } + } + } + (*l_2254) &= ((((((*g_522) ^= l_2222) != (~l_2218)) & ((*l_1711) ^= (((!((**g_712)--)) < ((g_2039 = l_1721) != ((safe_mod_func_uint16_t_u_u((((safe_rshift_func_uint8_t_u_u(((safe_mod_func_int8_t_s_s((*p_35), p_37)) || (((safe_div_func_int32_t_s_s((!((*g_688) = 0L)), (safe_mul_func_uint8_t_u_u((p_37 > ((safe_sub_func_int16_t_s_s(((void*)0 == l_1453), 0x3F36L)) == p_37)), l_2206)))) && (*l_1724)) > l_2249[1])), p_37)) | l_2250[3]) & l_2251), (*g_146))) , l_2252))) & 0x16L))) & 0xDEL) , (-10L)); + } + return p_37; +} + + +/* ------------------------------------------ */ +/* + * reads : g_33 g_688 g_82 g_23 g_1006 g_522 g_203.f3.f1 g_713 g_146 g_29 g_23.f2 g_10 g_9 g_448 g_23.f0 g_193 g_27 g_130 g_96 g_202 g_94 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_362 g_367 g_203.f1 g_368 g_802 g_803 + * writes: g_82 g_23 g_94 g_1010 g_202 g_29 g_203.f1 g_92 g_275 g_448 g_28 g_203.f0 g_96 g_141 g_193.f3 g_9 g_663.f1 g_803 + */ +static int8_t * func_38(int32_t * p_39) +{ /* block id: 461 */ + union U2 l_983 = {0xA18EBFA4L}; + uint32_t *l_993[4][4][5] = {{{&g_27,&g_27,&g_491,&g_491,&g_27},{&g_491,&g_27,(void*)0,&g_27,&g_491},{&g_27,&g_491,&g_491,&g_27,&g_27},{&g_491,&g_27,&g_491,&g_491,&g_491}},{{&g_27,&g_27,&g_27,&g_491,&g_27},{&g_491,&g_491,(void*)0,&g_491,&g_491},{&g_27,&g_491,&g_27,&g_27,&g_27},{&g_491,&g_491,&g_491,&g_27,&g_491}},{{&g_27,&g_27,&g_491,&g_491,&g_27},{&g_491,&g_27,(void*)0,&g_27,&g_491},{&g_27,&g_491,&g_491,&g_27,&g_27},{&g_491,&g_27,&g_491,&g_491,&g_491}},{{&g_27,&g_27,&g_27,&g_491,&g_27},{&g_491,&g_491,(void*)0,&g_491,&g_491},{&g_27,&g_491,&g_27,&g_27,&g_27},{&g_491,&g_491,&g_491,&g_27,&g_491}}}; + uint32_t **l_992 = &l_993[1][2][2]; + uint32_t *l_994 = &g_275[5][2]; + int8_t *l_999 = &g_448; + int8_t **l_1000 = &l_999; + struct S1 l_1002 = {0x00L,1L,0x1C11L,{-1L,0xDCFBL,0UL,0x327FL,0x73L},0x0032L}; + int32_t l_1003 = 0x037EDC74L; + int8_t *l_1004 = &g_9; + union U2 *l_1005 = &g_23; + uint8_t *l_1008[3]; + uint32_t l_1020[10][5][5] = {{{0xF2AA9CB4L,0xF2AA9CB4L,0xB9798130L,1UL,0x84C3A2C5L},{9UL,6UL,0xDB4B8351L,0x79CDF276L,18446744073709551612UL},{2UL,1UL,4UL,0xCFC16537L,1UL},{0xED3C58A6L,6UL,18446744073709551615UL,0x05959D90L,0UL},{0x1FE60990L,0xF2AA9CB4L,18446744073709551611UL,2UL,1UL}},{{1UL,0xCE69CB81L,2UL,18446744073709551610UL,7UL},{0xBDDE72C4L,1UL,8UL,0x3AB83C40L,1UL},{6UL,1UL,0x412240A3L,0x38E14851L,0x56FAA21DL},{0xF174B866L,0xCFC16537L,18446744073709551613UL,0UL,0xB9798130L},{0x46E8FA96L,18446744073709551615UL,0x0979A739L,0xDB4B8351L,0x38E14851L}},{{0x23A25F20L,18446744073709551615UL,18446744073709551608UL,18446744073709551615UL,0x23A25F20L},{0xA159F13BL,0x56FAA21DL,18446744073709551610UL,0x255BB07DL,0x0979A739L},{0xA884EFE1L,9UL,0x0C1255E5L,1UL,0xBDDE72C4L},{0UL,0x79CDF276L,6UL,0x56FAA21DL,0x0979A739L},{18446744073709551612UL,1UL,18446744073709551615UL,0UL,0x23A25F20L}},{{0x0979A739L,18446744073709551615UL,0UL,6UL,0x38E14851L},{0UL,4UL,1UL,18446744073709551611UL,0xB9798130L},{1UL,0xA159F13BL,0x46E8FA96L,0x7D73904FL,0x56FAA21DL},{6UL,8UL,0UL,1UL,1UL},{0xDB4B8351L,0x31587566L,18446744073709551615UL,18446744073709551615UL,7UL}},{{3UL,0xED235A89L,0xC4ACEBD6L,1UL,1UL},{0x31587566L,9UL,0x31587566L,18446744073709551608UL,0UL},{0x8530C162L,0xC4ACEBD6L,0xA884EFE1L,0x4D4F19E2L,1UL},{0UL,1UL,18446744073709551608UL,1UL,18446744073709551612UL},{1UL,0x23A25F20L,0xA884EFE1L,1UL,0x84C3A2C5L}},{{0xF30BAE18L,7UL,0x31587566L,0x412240A3L,0xA159F13BL},{0UL,0xA884EFE1L,0xF2AA9CB4L,0xAC889584L,18446744073709551615UL},{1UL,1UL,0x412240A3L,18446744073709551608UL,0x34DC149FL},{0UL,18446744073709551615UL,0UL,0xA4772EFEL,0x2E7448B6L},{6UL,0x79CDF276L,0UL,0xCE69CB81L,18446744073709551615UL}},{{6UL,0x4007BECEL,8UL,18446744073709551613UL,4UL},{1UL,0xED3C58A6L,0x05959D90L,0x05959D90L,0xED3C58A6L},{0xCB204103L,0xC82A66DFL,0x6DA78595L,0x3AB83C40L,0x23A25F20L},{9UL,1UL,0xF30BAE18L,0x412240A3L,0xEDF2696BL},{0x9ADF3501L,0UL,18446744073709551611UL,18446744073709551612UL,1UL}},{{9UL,0x0979A739L,0UL,0x31587566L,1UL},{0xCB204103L,18446744073709551615UL,6UL,0x23A25F20L,0xB970E888L},{1UL,0x28F68007L,0x0281312AL,2UL,18446744073709551608UL},{6UL,0x8530C162L,1UL,18446744073709551607UL,18446744073709551615UL},{6UL,0x71A1A02CL,1UL,0xED3C58A6L,18446744073709551612UL}},{{0UL,0x84C3A2C5L,0xB9798130L,18446744073709551615UL,0UL},{1UL,0x38E14851L,6UL,18446744073709551610UL,0x31587566L},{1UL,1UL,1UL,1UL,18446744073709551608UL},{1UL,0xA159F13BL,0x31587566L,0x255BB07DL,1UL},{0xCFC16537L,18446744073709551612UL,18446744073709551615UL,1UL,18446744073709551615UL}},{{0x0979A739L,18446744073709551610UL,18446744073709551615UL,0x255BB07DL,1UL},{0xC82A66DFL,0xBDDE72C4L,9UL,1UL,0xA884EFE1L},{7UL,1UL,0UL,18446744073709551610UL,0x43467938L},{0xCA5F646AL,0xB970E888L,4UL,18446744073709551615UL,0xAC889584L},{18446744073709551615UL,0x412240A3L,1UL,0xED3C58A6L,18446744073709551610UL}}}; + int32_t l_1035[1]; + uint16_t l_1075[7]; + int8_t l_1104[2][6][3] = {{{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L}},{{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L},{(-1L),(-1L),(-1L)},{3L,0xE2L,3L}}}; + union U2 *l_1162[3][1]; + uint32_t l_1163 = 0x33E342EBL; + int8_t l_1263[4][4][5]; + const struct S0 *l_1312 = &g_663; + const struct S0 **l_1311 = &l_1312; + int i, j, k; + for (i = 0; i < 3; i++) + l_1008[i] = &g_141[1][4]; + for (i = 0; i < 1; i++) + l_1035[i] = (-4L); + for (i = 0; i < 7; i++) + l_1075[i] = 0xB9F4L; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + l_1162[i][j] = &l_983; + } + for (i = 0; i < 4; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < 5; k++) + l_1263[i][j][k] = 5L; + } + } + (*g_688) &= (*p_39); + if ((safe_rshift_func_uint8_t_u_u((l_983 , (l_1003 = ((*g_713) = ((((((*l_1005) = (l_983.f2 , g_23)) , &l_983) != g_1006) >= (*g_522)) , 0x0CL)))), 3))) + { /* block id: 469 */ + int8_t **l_1009[4][8][8] = {{{&g_10,&g_10,&l_1004,&l_999,&l_999,&g_10,&l_1004,&l_1004},{&l_999,&g_10,(void*)0,&g_10,&l_999,&g_10,&g_10,&l_1004},{&l_1004,&l_999,&g_10,&g_10,&l_1004,&l_999,&l_1004,(void*)0},{&g_10,&g_10,(void*)0,&l_1004,(void*)0,&l_1004,&l_999,&l_1004},{&l_999,&l_1004,(void*)0,&l_1004,&g_10,&g_10,&g_10,&l_999},{&l_999,(void*)0,&l_1004,&l_1004,&l_1004,(void*)0,&l_999,&l_999},{&g_10,(void*)0,&l_1004,&l_1004,&g_10,&l_999,&g_10,&l_1004},{&l_1004,&g_10,&l_1004,&l_999,(void*)0,&l_999,&g_10,&g_10}},{{(void*)0,&g_10,(void*)0,&l_1004,&g_10,(void*)0,&l_999,&g_10},{(void*)0,(void*)0,&l_1004,(void*)0,&l_999,&l_999,&l_1004,&l_999},{&l_1004,&g_10,&g_10,&g_10,(void*)0,&g_10,&l_1004,&l_999},{(void*)0,&l_999,&l_1004,&l_999,&l_1004,(void*)0,&g_10,(void*)0},{&l_999,&l_999,&l_999,&l_1004,&l_999,&g_10,&g_10,&l_1004},{&g_10,&g_10,&l_999,&g_10,&g_10,(void*)0,&l_1004,&g_10},{&l_999,&l_1004,&g_10,&g_10,&l_999,(void*)0,&l_1004,&g_10},{&l_999,(void*)0,&g_10,&l_999,&l_1004,(void*)0,(void*)0,(void*)0}},{{&g_10,&l_999,&l_1004,&l_999,&g_10,(void*)0,&l_1004,&l_1004},{(void*)0,&l_1004,&l_999,&l_999,&l_1004,(void*)0,&g_10,&l_1004},{&l_999,&l_1004,&l_999,&l_999,&g_10,(void*)0,&l_1004,(void*)0},{&l_1004,&l_1004,&g_10,&l_999,&l_999,&l_1004,&l_1004,&l_1004},{(void*)0,&l_999,&l_1004,&l_999,&g_10,&g_10,(void*)0,&l_1004},{&g_10,(void*)0,&l_1004,&l_999,&l_1004,(void*)0,&g_10,(void*)0},{&l_1004,&g_10,&l_999,&l_999,&g_10,&g_10,&g_10,&g_10},{&l_999,&g_10,(void*)0,&g_10,&l_1004,&l_999,&l_999,&g_10}},{{&l_1004,&g_10,&l_999,&g_10,(void*)0,&l_999,&g_10,&l_1004},{&g_10,&l_1004,&l_999,&l_1004,(void*)0,&g_10,&l_1004,(void*)0},{&l_999,&l_1004,&l_1004,&l_999,&g_10,(void*)0,(void*)0,&l_999},{&l_1004,&l_999,&l_999,&g_10,&g_10,&l_1004,&l_1004,&l_999},{&g_10,&g_10,(void*)0,(void*)0,&l_999,&g_10,&l_999,(void*)0},{&g_10,(void*)0,&g_10,&l_1004,(void*)0,&l_999,&l_1004,&l_1004},{&g_10,&l_1004,(void*)0,&l_1004,(void*)0,&l_1004,&g_10,&l_1004},{&l_999,(void*)0,&g_10,&g_10,(void*)0,&g_10,(void*)0,&l_999}}}; + int32_t **l_1011 = &g_28[0]; + int i, j, k; + (*l_1011) = func_45((g_1010 = &g_448), &g_29, &g_448); + } + else + { /* block id: 472 */ + const int16_t l_1021 = (-10L); + int32_t l_1032[10][2][6] = {{{1L,8L,3L,3L,8L,1L},{(-1L),1L,3L,1L,(-1L),(-1L)}},{{4L,1L,1L,4L,8L,4L},{4L,8L,4L,1L,1L,4L}},{{(-1L),(-1L),1L,3L,1L,(-1L)},{1L,8L,3L,3L,8L,1L}},{{(-1L),1L,3L,1L,(-1L),(-1L)},{4L,1L,1L,4L,8L,4L}},{{4L,8L,4L,1L,1L,4L},{(-1L),(-1L),1L,3L,1L,(-1L)}},{{1L,8L,3L,3L,8L,1L},{(-1L),1L,3L,1L,(-1L),(-1L)}},{{4L,1L,1L,4L,8L,4L},{4L,8L,4L,1L,1L,4L}},{{(-1L),(-1L),1L,3L,1L,(-1L)},{1L,8L,3L,3L,8L,1L}},{{(-1L),1L,3L,1L,(-1L),(-1L)},{4L,1L,1L,4L,8L,4L}},{{4L,8L,4L,1L,1L,4L},{(-1L),(-1L),1L,3L,1L,(-1L)}}}; + uint32_t l_1040 = 0x46C4402DL; + int32_t l_1048 = (-1L); + uint16_t l_1051 = 0xAEDFL; + int8_t ***l_1054 = &l_1000; + union U2 **l_1057[7]; + union U2 l_1091 = {0xD559D94EL}; + struct S1 l_1093 = {0x59L,-10L,0xE7A5L,{0x9AAAL,0x6F3EL,5UL,65533UL,1UL},0x1B19L}; + int32_t ***l_1137[4] = {(void*)0,(void*)0,(void*)0,(void*)0}; + int32_t ****l_1138[4]; + uint8_t **l_1144 = (void*)0; + uint8_t ***l_1143 = &l_1144; + uint32_t l_1178[3]; + const uint8_t *l_1224 = (void*)0; + const uint8_t **l_1223 = &l_1224; + uint32_t l_1264 = 18446744073709551615UL; + union U2 l_1304[5] = {{0xC351DB28L},{0xC351DB28L},{0xC351DB28L},{0xC351DB28L},{0xC351DB28L}}; + int i, j, k; + for (i = 0; i < 7; i++) + l_1057[i] = &l_1005; + for (i = 0; i < 4; i++) + l_1138[i] = &l_1137[0]; + for (i = 0; i < 3; i++) + l_1178[i] = 1UL; + for (g_193.f3 = 26; (g_193.f3 <= 11); g_193.f3 = safe_sub_func_uint8_t_u_u(g_193.f3, 1)) + { /* block id: 475 */ + int16_t l_1033 = 0L; + int32_t l_1036 = (-1L); + int32_t l_1037[8] = {2L,(-5L),2L,(-5L),2L,(-5L),2L,(-5L)}; + int i; + for (g_9 = 0; (g_9 == (-15)); g_9 = safe_sub_func_uint32_t_u_u(g_9, 4)) + { /* block id: 478 */ + int8_t l_1031 = 0x69L; + int32_t l_1034 = 0xDBC85C67L; + int32_t l_1038[1]; + int i; + for (i = 0; i < 1; i++) + l_1038[i] = 0x1432EEBAL; + if ((*p_39)) + break; + for (g_663.f1 = 0; (g_663.f1 == 24); g_663.f1 = safe_add_func_uint16_t_u_u(g_663.f1, 7)) + { /* block id: 482 */ + int8_t l_1022[10][10][2] = {{{0xA6L,0x74L},{(-3L),0x73L},{0xBAL,(-3L)},{0x73L,0x74L},{0x73L,(-3L)},{0xBAL,0x73L},{(-3L),0x74L},{0xA6L,0xA6L},{0xBAL,0xA6L},{0xA6L,0x74L}},{{(-3L),0x73L},{0xBAL,(-3L)},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L}},{{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L}},{{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L}},{{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L}},{{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L}},{{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L}},{{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL}},{{0x0AL,0xBAL},{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL}},{{0xBAL,1L},{0x74L,0x65L},{0x0AL,0x74L},{0x65L,1L},{0x65L,0x74L},{0x0AL,0x65L},{0x74L,1L},{0xBAL,0xBAL},{0x0AL,0xBAL},{0xBAL,1L}}}; + int32_t l_1029 = 0xD4525DBDL; + int32_t l_1039 = (-1L); + int i, j, k; + if ((((safe_rshift_func_uint8_t_u_s(l_1020[0][2][0], 2)) & l_1021) <= l_1022[5][2][1])) + { /* block id: 483 */ + int32_t *l_1023 = &g_82; + int32_t *l_1024 = &g_82; + int32_t *l_1025 = &g_33; + int32_t *l_1026 = &g_33; + int32_t *l_1027 = &g_33; + int32_t *l_1028 = &g_902; + int32_t *l_1030[3][9][6] = {{{(void*)0,(void*)0,&l_1029,&l_1029,&l_1029,(void*)0},{(void*)0,&l_1003,&l_1003,&l_1029,&l_1003,(void*)0},{&g_902,&g_29,&g_29,&g_29,&g_29,&l_1029},{(void*)0,(void*)0,&l_1003,&g_29,(void*)0,&l_1029},{(void*)0,&g_82,&l_1003,&g_29,(void*)0,&g_29},{(void*)0,&g_29,&g_82,&g_29,(void*)0,&l_1003},{&l_1029,(void*)0,&g_902,(void*)0,&g_902,(void*)0},{(void*)0,&l_1003,&l_1029,(void*)0,&g_902,(void*)0},{&g_82,&g_29,&g_902,&g_33,&l_1003,&l_1003}},{{&g_902,(void*)0,&g_82,&g_902,&g_82,&g_29},{&g_33,&g_33,&l_1003,&g_82,&g_29,&l_1029},{(void*)0,(void*)0,&l_1003,(void*)0,&g_29,&l_1029},{(void*)0,&g_33,&g_902,&l_1029,&g_82,&l_1029},{&g_29,(void*)0,&l_1029,(void*)0,&l_1003,&l_1003},{&g_29,&g_29,&l_1029,(void*)0,&g_902,&g_902},{&g_29,&l_1003,&l_1029,(void*)0,&g_902,&g_33},{&g_29,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_29,&g_29,(void*)0,&l_1029,(void*)0,&l_1003}},{{(void*)0,&g_82,(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,&g_82,&g_29,&l_1003},{&g_33,&g_82,(void*)0,&g_902,&l_1029,(void*)0},{&g_902,&l_1029,(void*)0,&g_33,&g_33,&g_33},{&g_82,(void*)0,&l_1029,(void*)0,(void*)0,&g_902},{(void*)0,(void*)0,&l_1029,(void*)0,&g_33,&l_1003},{&l_1029,&l_1029,&l_1029,&g_29,&l_1029,&l_1029},{(void*)0,&g_82,&g_902,&g_29,&g_29,&l_1029},{(void*)0,(void*)0,&l_1003,&g_29,(void*)0,&l_1029}}}; + int i, j, k; + ++l_1040; + (*l_1023) ^= 0x1C9C1B24L; + (*g_802) = (*g_802); + } + else + { /* block id: 487 */ + return &g_368[5][5][0]; + } + } + } + } + } + return &g_368[4][0][2]; +} + + +/* ------------------------------------------ */ +/* + * reads : g_712 g_713 g_94 g_146 g_23.f2 g_10 g_9 g_522 g_203.f3.f1 g_709 g_141 g_193.f3 g_33 g_82 g_29 g_663.f1 g_275 g_27 g_663.f0 g_870 g_368 g_688 g_802 g_663.f3 g_23 g_429.f3.f2 + * writes: g_33 g_82 g_29 g_709 g_94 g_193.f3 g_663.f1 g_27 g_23.f2 g_203.f3.f1 g_203.f1 g_203.f3.f3 g_28 g_131 g_9 g_803 g_663.f3 g_275 + */ +static union U2 func_40(int32_t * p_41, int8_t * p_42, struct S0 p_43, int32_t p_44) +{ /* block id: 368 */ + int16_t *l_813 = &g_367; + int32_t l_816[2]; + int32_t **l_829 = (void*)0; + int32_t **l_830 = (void*)0; + uint32_t *l_831 = &g_709[8][1]; + struct S1 *l_834 = (void*)0; + struct S0 l_841 = {-3L,0xA66BL,0x139EL,0x6331L,0x55L}; + int32_t l_923 = 0xBFDBBFDCL; + int32_t ** const l_926[1][9][9] = {{{&g_28[4],(void*)0,&g_28[2],&g_688,&g_688,&g_28[4],&g_28[1],&g_28[4],&g_28[4]},{&g_28[0],&g_688,&g_28[2],&g_688,&g_28[2],&g_688,&g_28[0],&g_688,&g_688},{&g_28[4],&g_28[4],&g_28[5],(void*)0,&g_28[4],&g_688,&g_28[1],(void*)0,&g_28[1]},{&g_688,(void*)0,&g_28[4],&g_28[4],(void*)0,&g_688,&g_688,&g_688,&g_28[0]},{(void*)0,&g_28[2],&g_688,&g_688,&g_28[4],&g_28[1],&g_28[4],&g_28[4],&g_28[4]},{&g_688,&g_28[2],&g_688,&g_28[2],&g_688,&g_28[0],&g_688,&g_688,&g_688},{&g_28[1],(void*)0,&g_28[5],&g_28[1],&g_28[4],&g_688,&g_28[4],&g_688,&g_28[4]},{&g_688,&g_688,&g_688,&g_688,(void*)0,&g_28[0],&g_688,&g_28[4],(void*)0},{&g_28[4],&g_28[2],&g_28[4],&g_28[5],&g_688,&g_28[4],&g_28[4],&g_688,&g_28[5]}}}; + int32_t l_967 = (-1L); + uint8_t *l_974 = &g_96; + uint8_t **l_973 = &l_974; + uint32_t l_977 = 0xBFD29E8DL; + int i, j, k; + for (i = 0; i < 2; i++) + l_816[i] = 1L; + (*p_41) = ((0xD2E1L || (safe_add_func_uint8_t_u_u(((&g_92 != l_813) & (**g_712)), ((((*g_146) > 0x6A77L) > (4294967295UL > ((*g_10) >= (safe_mod_func_uint32_t_u_u(((*g_10) < 0xCCL), 0x2EF7E0E9L))))) != l_816[1])))) & (*g_522)); + if ((((65535UL != (safe_div_func_int16_t_s_s((safe_sub_func_uint8_t_u_u((safe_add_func_uint8_t_u_u((safe_mod_func_int8_t_s_s((safe_add_func_uint32_t_u_u((((&p_41 == ((safe_sub_func_int16_t_s_s(p_44, ((((((!((((**g_712) = (((l_829 = l_829) != l_830) ^ (((*l_831) |= (l_816[1] | l_816[0])) , (~(~(safe_sub_func_int16_t_s_s(p_43.f0, (l_834 == (void*)0)))))))) || 0x4FL) & p_43.f0)) < p_43.f2) == l_816[0]) < 0UL) == 0x4FL) <= 0UL))) , (void*)0)) , p_44) , 0x00332CCCL), p_44)), p_43.f1)), g_141[5][6])), l_816[0])), l_816[1]))) <= (*g_10)) <= l_816[0])) + { /* block id: 373 */ + union U2 *l_835 = &g_23; + int32_t l_844 = 0L; + int32_t l_845 = 4L; + uint32_t *l_849 = &g_709[5][2]; + int32_t l_861 = 0x2D871063L; + int32_t l_874[6][4][7] = {{{0xEBD23C63L,0x86B45C9EL,0xDBC25A38L,9L,0x7306DC66L,0xE137DD82L,0x7306DC66L},{0L,0x708144BCL,0x7DC3FFEAL,(-1L),0xD4CDFA73L,4L,0x2AEFA674L},{(-4L),0xE137DD82L,0x04C8643BL,0x86B45C9EL,0x430DC65CL,1L,1L},{(-4L),0x3D08D363L,0x2AEFA674L,0x60F55FAEL,(-1L),0x60F55FAEL,0x2AEFA674L}},{{0xDBC25A38L,0xDBC25A38L,1L,0x8300C942L,1L,0x352C77AFL,0x7306DC66L},{4L,0x90ADCA77L,0x694C6AD6L,0x708144BCL,(-4L),0x2FF8803EL,0L},{0x352C77AFL,0xA85E05AAL,1L,0x7306DC66L,1L,0xA85E05AAL,0x352C77AFL},{1L,0x60F55FAEL,0L,(-1L),(-1L),(-6L),0x7DC3FFEAL}},{{1L,0x04C8643BL,0xE2858F44L,0x7C754C8AL,0x430DC65CL,0xEBD23C63L,0xEBD23C63L},{0xD4CDFA73L,(-4L),0L,(-4L),0xD4CDFA73L,0L,0x7DD96E50L},{1L,0x8300C942L,1L,0x352C77AFL,0x7306DC66L,0x58C09AECL,0x430DC65CL},{0x8CCDD4F0L,5L,0x694C6AD6L,0xF7130A0DL,0L,(-1L),0L}},{{1L,0x352C77AFL,1L,(-4L),0xE137DD82L,0x04C8643BL,0x86B45C9EL},{0xD4CDFA73L,4L,0x2AEFA674L,0L,0L,0x90ADCA77L,1L},{1L,1L,0x04C8643BL,0xA85E05AAL,0xA85E05AAL,0x04C8643BL,1L},{1L,(-1L),0x7DC3FFEAL,0x92B23D5EL,(-5L),(-1L),(-4L)}},{{0x352C77AFL,0xE2858F44L,0xDBC25A38L,1L,0x86B45C9EL,0x58C09AECL,0x7C754C8AL},{4L,(-6L),(-9L),0x92B23D5EL,0L,0L,(-1L)},{0xDBC25A38L,0x7C754C8AL,1L,0xA85E05AAL,(-4L),0xEBD23C63L,0xE137DD82L},{(-4L),0xF7130A0DL,(-1L),0L,0x694C6AD6L,(-6L),0x694C6AD6L}},{{(-4L),0x7C754C8AL,0x7C754C8AL,(-4L),0xE2858F44L,0xA85E05AAL,0x58C09AECL},{0L,(-6L),1L,0xF7130A0DL,1L,0x2FF8803EL,0L},{0xA8F0C9FCL,0x8300C942L,0x352C77AFL,0x04C8643BL,0xEBD23C63L,0x04C8643BL,0x352C77AFL},{(-4L),0xC335D284L,1L,0x708144BCL,0xD4CDFA73L,5L,(-9L)}}}; + int8_t l_892 = 0x14L; + uint32_t l_898 = 0UL; + uint8_t **l_972[2][5][1]; + int i, j, k; + for (i = 0; i < 2; i++) + { + for (j = 0; j < 5; j++) + { + for (k = 0; k < 1; k++) + l_972[i][j][k] = (void*)0; + } + } + for (g_193.f3 = 0; (g_193.f3 <= 2); g_193.f3 += 1) + { /* block id: 376 */ + union U2 **l_836 = &l_835; + int32_t l_871 = (-4L); + int32_t l_884 = (-5L); + int32_t l_888 = 0x753BF6FFL; + int32_t l_895 = (-1L); + int32_t l_896[8] = {9L,9L,0x5C7D4CE2L,9L,9L,0x5C7D4CE2L,9L,9L}; + int32_t l_901[4] = {2L,2L,2L,2L}; + struct S1 l_930[6] = {{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL},{0x79L,1L,1UL,{2L,65535UL,9UL,0x5A57L,255UL},0UL}}; + int i; + (*l_836) = l_835; + if ((*p_41)) + continue; + for (g_29 = 2; (g_29 >= 0); g_29 -= 1) + { /* block id: 381 */ + int8_t l_872 = 0xD6L; + int32_t l_881 = 0xC2359472L; + int32_t l_882 = 7L; + int32_t l_883 = (-1L); + int32_t l_885 = 0x0CE63601L; + int32_t l_887[6][3] = {{(-2L),(-2L),0xFF72B15AL},{0x336CEA91L,0x336CEA91L,(-10L)},{(-2L),(-2L),0xFF72B15AL},{0x336CEA91L,0x336CEA91L,(-10L)},{(-2L),(-2L),0xFF72B15AL},{0x336CEA91L,0x336CEA91L,(-10L)}}; + struct S0 *l_956 = (void*)0; + int i, j; + for (g_663.f1 = 0; (g_663.f1 <= 2); g_663.f1 += 1) + { /* block id: 384 */ + uint32_t *l_846 = &g_27; + uint32_t **l_850 = &l_831; + int32_t *l_862 = &g_203.f1; + uint32_t l_865 = 0UL; + uint32_t *l_873 = &l_865; + union U2 l_875 = {-6L}; + struct S1 *l_876[4][8] = {{(void*)0,(void*)0,&g_203,&g_429[3][2][4],(void*)0,&g_429[3][2][4],(void*)0,(void*)0},{&g_429[3][2][4],(void*)0,&g_203,&g_429[3][2][4],&g_429[0][4][4],&g_429[3][2][4],&g_203,(void*)0},{(void*)0,(void*)0,&g_429[3][2][4],&g_429[3][2][4],(void*)0,&g_203,&g_429[0][4][4],&g_429[3][2][4]},{&g_429[1][1][5],&g_429[0][4][4],&g_429[1][1][3],(void*)0,(void*)0,&g_429[1][1][3],&g_429[0][4][4],&g_429[1][1][5]}}; + int32_t l_886 = 0xC62C1A3DL; + int32_t l_889 = 1L; + int32_t l_890 = (-4L); + int32_t l_891 = 0xBBD98B66L; + int32_t l_894[6] = {9L,9L,9L,9L,9L,9L}; + int32_t l_897 = 0L; + int32_t *l_911 = &l_891; + int i, j; + if ((safe_mod_func_int32_t_s_s((safe_mul_func_int16_t_s_s((l_841 , 1L), ((((*l_873) = (((safe_lshift_func_int16_t_s_u(((l_844 ^= g_275[(g_663.f1 + 2)][g_29]) != ((*l_846)++)), (((l_849 = l_849) == ((*l_850) = &g_275[0][1])) , (safe_add_func_uint16_t_u_u((safe_rshift_func_uint16_t_u_u(((*g_146)--), ((((*g_522) = (*g_522)) <= (safe_rshift_func_uint16_t_u_u(((safe_mod_func_uint8_t_u_u((((*l_862) = (l_861 ^= l_845)) , ((safe_mul_func_int32_t_s_s(l_865, ((((safe_rshift_func_uint8_t_u_s((((((safe_lshift_func_uint8_t_u_u((p_43.f1 ^ (*g_10)), l_865)) , g_663.f0) , g_870) == p_43.f1) | (**g_712)), 6)) < l_871) | (*p_42)) != (*p_42)))) , p_43.f3)), (*g_713))) , 0x8497L), 0))) , (*g_522)))), (-6L)))))) >= 0xF1L) >= l_872)) < l_871) < p_43.f1))), l_874[4][3][3]))) + { /* block id: 394 */ + return l_875; + } + else + { /* block id: 396 */ + struct S1 **l_877 = &l_876[2][3]; + int32_t *l_878 = (void*)0; + int32_t *l_879 = (void*)0; + int32_t *l_880[5][6] = {{&l_874[2][2][5],&l_816[1],&l_845,&l_845,&l_816[1],&l_874[2][2][5]},{&l_874[2][2][5],(void*)0,&l_844,&l_845,(void*)0,&l_845},{&l_874[2][2][5],&l_871,&l_874[2][2][5],&l_845,&l_871,&l_844},{&l_874[2][2][5],&l_816[1],&l_845,&l_845,&l_816[1],&l_874[2][2][5]},{&l_874[2][2][5],(void*)0,&l_844,&l_845,(void*)0,&l_845}}; + int16_t l_893 = 0xC5C8L; + int i, j; + (*l_877) = l_876[2][5]; + l_898++; + l_816[1] |= (l_841.f3 != (l_888 = (*p_41))); + } + if (l_901[2]) + continue; + } + for (l_871 = 0; (l_871 <= 1); l_871 += 1) + { /* block id: 422 */ + uint16_t l_941[1]; + union U2 l_942[5][7] = {{{7L},{1L},{-3L},{7L},{0xD252D763L},{7L},{-3L}},{{-3L},{-3L},{-4L},{0x81C8047CL},{1L},{-7L},{-3L}},{{-3L},{-3L},{0x0CC969D1L},{1L},{-1L},{-1L},{1L}},{{7L},{0xD252D763L},{7L},{-3L},{1L},{7L},{0x1BEE06C4L}},{{1L},{0xD252D763L},{1L},{0x81C8047CL},{0xD252D763L},{-4L},{0xD252D763L}}}; + int32_t **l_951 = &g_364; + int i, j; + for (i = 0; i < 1; i++) + l_941[i] = 0x94B7L; + for (g_203.f3.f3 = 0; (g_203.f3.f3 <= 1); g_203.f3.f3 += 1) + { /* block id: 425 */ + int32_t **l_925 = (void*)0; + int8_t * const l_927 = &g_9; + int8_t *l_929 = &g_368[7][5][2]; + int8_t **l_928 = &l_929; + uint32_t *l_940 = &g_491; + int i; + (*g_688) = (l_925 != l_926[0][2][5]); + g_131 = (g_28[4] = &p_44); + if (l_881) + break; + } + p_44 = ((safe_div_func_int16_t_s_s(((((!l_883) != p_43.f3) <= ((((((*p_41) < (((*g_10) = (safe_lshift_func_int8_t_s_u((((**g_712)++) ^ (l_951 != (void*)0)), (0x1EDDL & ((safe_mod_func_int16_t_s_s(((l_884 = (safe_sub_func_uint32_t_u_u(l_861, (*p_41)))) > 4294967291UL), 0xD5B9L)) <= g_709[8][1]))))) <= 0UL)) , (*p_42)) || (*p_42)) || p_43.f2) , (*p_42))) < (*p_41)), 65535UL)) == 0L); + } + (*g_802) = l_956; + for (l_898 = 0; (l_898 <= 2); l_898 += 1) + { /* block id: 444 */ + for (g_663.f3 = 0; (g_663.f3 <= 3); g_663.f3 += 1) + { /* block id: 447 */ + int i, j; + (*g_688) &= (safe_add_func_uint16_t_u_u((1L == (-1L)), (safe_lshift_func_uint8_t_u_s(g_709[(g_29 + 4)][l_898], 1)))); + return g_23; + } + } + } + } + (*g_688) = ((g_275[3][1] = 18446744073709551612UL) , (safe_sub_func_uint16_t_u_u(p_43.f4, ((((**g_712) = (safe_mod_func_int32_t_s_s(((*g_522) && (((safe_lshift_func_int8_t_s_s(l_967, (*g_10))) & ((*l_835) , (safe_mul_func_int8_t_s_s(((void*)0 != &g_202[3][1]), (((safe_mul_func_int8_t_s_s(0xFDL, (*g_713))) , l_972[1][4][0]) == l_973))))) ^ (**g_712))), g_429[3][2][4].f3.f2))) || (*p_42)) , (*g_146))))); + } + else + { /* block id: 457 */ + int8_t l_975 = (-4L); + int32_t l_976[2]; + int i; + for (i = 0; i < 2; i++) + l_976[i] = 0xB56CD2F2L; + l_977++; + } + return g_23; +} + + +/* ------------------------------------------ */ +/* + * reads : g_146 g_33 g_82 g_23.f2 g_10 g_9 g_23.f0 g_193 g_23 g_27 g_130 g_96 g_202 g_94 g_203.f1 g_140 g_132 g_141 g_275 g_203.f3.f0 g_203.f3.f4 g_203.f0 g_362 g_367 g_368 g_29 g_448 + * writes: g_94 g_82 g_202 g_33 g_203.f1 g_92 g_275 g_9 g_23.f2 g_28 g_203.f0 g_96 g_141 g_29 g_448 + */ +static int32_t * func_45(int8_t * const p_46, int32_t * p_47, int8_t * p_48) +{ /* block id: 34 */ + int16_t l_149 = 0x2C69L; + int32_t l_158 = 1L; + uint8_t *l_159[6][2][6] = {{{(void*)0,&g_96,(void*)0,&g_96,&g_94,(void*)0},{&g_141[5][6],&g_96,&g_141[5][5],&g_141[3][4],&g_96,&g_141[5][6]}},{{(void*)0,&g_141[3][1],&g_141[0][2],&g_141[5][6],&g_141[5][6],&g_94},{&g_96,&g_141[5][5],(void*)0,(void*)0,(void*)0,(void*)0}},{{&g_96,&g_96,&g_141[3][4],&g_141[3][1],(void*)0,&g_141[0][1]},{&g_141[1][1],&g_141[0][1],&g_96,(void*)0,&g_141[5][6],&g_141[3][4]}},{{&g_141[3][4],(void*)0,&g_96,&g_141[5][6],&g_96,(void*)0},{&g_96,&g_141[5][6],&g_96,&g_96,&g_141[3][3],(void*)0}},{{&g_96,&g_141[3][3],(void*)0,(void*)0,&g_141[3][1],(void*)0},{(void*)0,&g_96,(void*)0,&g_96,&g_141[3][4],&g_94}},{{&g_141[3][4],(void*)0,&g_141[1][1],&g_141[5][6],&g_94,&g_141[5][5]},{&g_141[3][3],&g_96,&g_96,&g_141[5][6],&g_94,&g_96}}}; + int32_t l_162 = 0L; + int32_t l_163 = 0x368D4868L; + int32_t l_164 = (-1L); + int32_t l_165[5][8] = {{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L},{9L,1L,0xCF0CBDDEL,1L,9L,1L,0xCF0CBDDEL,1L}}; + uint16_t l_168 = 65531UL; + union U2 l_194 = {0x9F5D8235L}; + int8_t l_195 = (-8L); + uint32_t l_245 = 0x0D5D64FBL; + struct S1 l_261[4][9] = {{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}},{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}},{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}},{{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x15L,0xCBFC918AL,0xD33FL,{-10L,0x77D2L,65535UL,65530UL,0xBBL},65535UL},{0x3BL,9L,0xE902L,{0x2921L,1UL,0UL,0xE230L,0UL},0x52D0L},{0x41L,0L,65526UL,{0x72A8L,1UL,0x65E9L,0xAE67L,0x65L},0x7144L},{0x1AL,0xB8D20E8FL,0xAA2CL,{0x140FL,0UL,0UL,1UL,255UL},65535UL}}}; + int32_t **l_298 = (void*)0; + int8_t l_302 = 3L; + uint32_t l_384 = 8UL; + int32_t **l_615 = &g_364; + uint16_t **l_616 = &g_146; + int32_t l_659 = 0x16F391CCL; + struct S0 *l_660 = &l_261[3][8].f3; + uint16_t l_779[5] = {0xCE19L,0xCE19L,0xCE19L,0xCE19L,0xCE19L}; + uint8_t l_784 = 0xE9L; + int i, j, k; + if ((((safe_rshift_func_int8_t_s_s(((void*)0 != g_146), 4)) <= ((safe_add_func_uint32_t_u_u(l_149, 0xCFA7979AL)) , (l_149 && (g_94 = ((safe_rshift_func_uint16_t_u_u((safe_mod_func_int16_t_s_s(((*p_47) , ((g_23.f2 && 4294967286UL) & (safe_sub_func_int16_t_s_s((safe_rshift_func_uint16_t_u_u(((((((&l_149 == (void*)0) <= (*g_10)) > 0x5FL) & l_149) | (*p_48)) && l_158), 1)), (*g_146))))), l_149)), 13)) == l_158))))) >= g_23.f0)) + { /* block id: 36 */ + int32_t *l_160 = &g_82; + int32_t *l_161[5] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + int32_t l_166 = (-1L); + int16_t l_167 = (-3L); + const struct S0 l_224 = {-1L,1UL,65535UL,1UL,0x64L}; + union U2 l_228 = {-1L}; + int32_t *l_340 = &l_164; + int32_t *l_349 = &g_140; + int32_t **l_348[5]; + struct S1 *l_353[1][8][2] = {{{&l_261[2][5],&l_261[2][5]},{&l_261[0][4],&l_261[2][5]},{&l_261[2][5],&l_261[0][4]},{&l_261[2][5],&l_261[2][5]},{&l_261[0][4],&l_261[2][5]},{&l_261[2][5],&l_261[0][4]},{&l_261[2][5],&l_261[2][5]},{&l_261[0][4],&l_261[2][5]}}}; + int i, j, k; + for (i = 0; i < 5; i++) + l_348[i] = &l_349; + --l_168; + if (l_163) + { /* block id: 38 */ + int32_t l_175 = 0x58B35087L; + int8_t *l_186 = &g_9; + int16_t *l_189[8][1][3] = {{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}},{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}},{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}},{{&l_149,&g_92,&g_92}},{{&g_92,&l_149,&l_149}}}; + int32_t l_190 = 4L; + uint8_t **l_198 = &l_159[5][1][1]; + uint8_t *l_201 = &g_94; + union U2 *l_207 = &g_23; + uint32_t *l_219[5] = {&g_27,&g_27,&g_27,&g_27,&g_27}; + uint32_t *l_263 = &g_27; + int i, j, k; + (*l_160) = (((safe_lshift_func_int16_t_s_u(l_165[1][2], (safe_lshift_func_int8_t_s_s(((l_175 == ((safe_lshift_func_uint16_t_u_s((safe_mod_func_int8_t_s_s((safe_lshift_func_int16_t_s_s(((((-2L) | (safe_sub_func_int16_t_s_s((safe_mod_func_uint16_t_u_u((l_186 == p_46), (l_190 = (4UL | ((safe_mul_func_int8_t_s_s((*l_160), 0xE7L)) != 4294967295UL))))), 1L))) < (*p_48)) | l_168), l_175)), 0x48L)), 10)) ^ (*g_10))) | (*p_48)), l_175)))) , (*g_146)) != 0x7572L); + if ((safe_mul_func_uint8_t_u_u(((((-9L) && ((((g_193 , (l_194 = g_23)) , (((l_195 ^ (safe_mod_func_int16_t_s_s(((((*l_198) = &g_96) == (l_194 , (void*)0)) & (((safe_mul_func_int8_t_s_s(((*p_48) | ((*l_201) = 1UL)), g_27)) ^ g_27) != g_130[0][5])), g_193.f3))) || 0xACL) , l_194)) , l_195) != l_175)) != g_96) < 4UL), (*p_48)))) + { /* block id: 44 */ + struct S1 **l_204 = &g_202[1][9]; + union U2 *l_208[5][1][10] = {{{&g_23,&g_23,&l_194,&g_23,(void*)0,&l_194,&g_23,&g_23,&l_194,(void*)0}},{{&l_194,&g_23,&g_23,&l_194,&l_194,&l_194,&g_23,&g_23,(void*)0,&g_23}},{{&l_194,&l_194,&g_23,&l_194,&g_23,&l_194,&g_23,&l_194,&g_23,&l_194}},{{&g_23,(void*)0,&g_23,&g_23,(void*)0,&g_23,&g_23,&l_194,&l_194,&l_194}},{{&l_194,&g_23,&l_194,&g_23,&l_194,(void*)0,(void*)0,&l_194,&g_23,&l_194}}}; + int32_t l_210 = 1L; + int32_t l_225 = 0x90807700L; + int i, j, k; + (*l_204) = g_202[4][9]; + for (g_82 = (-22); (g_82 < 17); g_82++) + { /* block id: 48 */ + uint32_t l_209 = 0x1A28751EL; + l_208[0][0][0] = l_207; + l_190 = (!(l_210 = l_209)); + } + (*l_160) &= 0xBCAB29ADL; + (*p_47) = ((l_165[1][6] &= (safe_add_func_uint32_t_u_u(((((safe_sub_func_uint8_t_u_u(((safe_div_func_int8_t_s_s((safe_lshift_func_uint8_t_u_s((*l_160), (*p_48))), g_94)) | (l_219[2] == &g_27)), (l_225 |= (((*p_47) > (safe_div_func_int8_t_s_s(l_210, l_164))) ^ (safe_mod_func_uint16_t_u_u(((l_224 , (*p_47)) | (*l_160)), g_94)))))) & g_27) == l_210) > 9UL), 0x54DDF528L))) > l_194.f0); + } + else + { /* block id: 57 */ + int16_t l_237 = 0x7730L; + uint8_t l_246 = 1UL; + int32_t l_247 = 1L; + uint16_t *l_252 = &g_203.f3.f1; + struct S1 l_264 = {-1L,0L,0UL,{0x4C04L,0UL,65535UL,0x3C41L,0x23L},1UL}; + uint32_t *l_273 = (void*)0; + uint32_t *l_274 = &g_275[5][2]; + for (g_203.f1 = 0; (g_203.f1 <= 0); g_203.f1 += 1) + { /* block id: 60 */ + return p_47; + } + if ((safe_mod_func_int8_t_s_s((l_228 , (safe_sub_func_uint8_t_u_u(((safe_lshift_func_uint8_t_u_u((safe_mul_func_int16_t_s_s((g_92 = (safe_div_func_uint8_t_u_u((&g_133[0] != ((l_237 && (l_190 && (l_247 ^= (l_246 = (!(0x5600L <= (((safe_unary_minus_func_uint32_t_u((safe_mod_func_uint16_t_u_u(((safe_lshift_func_uint8_t_u_u((safe_lshift_func_uint8_t_u_s(g_140, (*p_48))), ((*l_201) = (~(((void*)0 == &p_48) == (*p_47)))))) && 0x43L), l_245)))) > (*p_47)) >= l_237))))))) , &p_47)), (*l_160)))), 0L)), g_132)) & g_140), 0x38L))), 4UL))) + { /* block id: 67 */ + uint8_t l_262 = 0x79L; + (*p_47) = (l_262 &= (l_246 || ((safe_lshift_func_uint8_t_u_s((safe_mod_func_uint16_t_u_u(((void*)0 == l_252), (l_246 && (*g_146)))), (l_190 | (g_146 != ((safe_add_func_int8_t_s_s((safe_rshift_func_int16_t_s_s((safe_mod_func_int16_t_s_s((safe_mul_func_uint16_t_u_u((l_261[3][8] , l_149), 0x2EB2L)), (*l_160))), l_190)), l_246)) , (void*)0))))) >= g_132))); + } + else + { /* block id: 70 */ + return p_47; + } + (*l_160) = ((((l_165[1][6] = l_237) , (l_263 != (((!0xDFC7L) && ((((*l_274) = (l_264 , ((safe_add_func_int8_t_s_s(0x54L, (safe_lshift_func_uint16_t_u_u((safe_mul_func_int8_t_s_s((safe_add_func_int32_t_s_s((l_189[4][0][0] != ((l_165[1][6] , l_264.f3) , &g_92)), (*p_47))), 0L)), (*g_146))))) , 0xF01E3291L))) , (void*)0) == (void*)0)) , (void*)0))) != l_237) == (*p_47)); + } + } + else + { /* block id: 77 */ + uint32_t l_276 = 18446744073709551615UL; + int32_t **l_281 = &g_28[2]; + int8_t *l_292[9][7][4] = {{{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{&g_203.f0,&l_261[3][8].f0,(void*)0,&g_203.f0},{&l_261[3][8].f0,&l_195,&g_203.f0,&l_195},{(void*)0,&l_261[3][8].f0,&l_195,&l_195},{&l_261[3][8].f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0}},{{&l_195,(void*)0,&g_203.f0,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_261[3][8].f0,&g_203.f0,&l_195,(void*)0},{(void*)0,&g_203.f0,&g_203.f0,&g_203.f0},{&l_261[3][8].f0,&l_261[3][8].f0,(void*)0,&l_195},{&g_203.f0,&l_195,&g_203.f0,&l_261[3][8].f0},{(void*)0,(void*)0,&g_203.f0,&g_203.f0}},{{&l_261[3][8].f0,(void*)0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_195,&l_195,&l_195},{&l_195,&l_261[3][8].f0,&l_195,&g_203.f0},{&g_203.f0,&g_203.f0,&g_203.f0,(void*)0},{&g_203.f0,&g_203.f0,&l_261[3][8].f0,&g_203.f0},{&g_203.f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{(void*)0,(void*)0,&l_261[3][8].f0,&g_203.f0}},{{&g_203.f0,&l_261[3][8].f0,&l_261[3][8].f0,&l_195},{&g_203.f0,&l_261[3][8].f0,&g_203.f0,&l_195},{&g_203.f0,&l_195,&l_195,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_195,&l_261[3][8].f0},{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_261[3][8].f0,&g_203.f0,&l_261[3][8].f0}},{{&g_203.f0,&l_261[3][8].f0,(void*)0,&g_203.f0},{&l_261[3][8].f0,&l_195,&g_203.f0,&l_195},{(void*)0,&l_261[3][8].f0,&l_195,&l_195},{&l_261[3][8].f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_195,(void*)0,&g_203.f0,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_261[3][8].f0,&g_203.f0,&l_195,(void*)0}},{{(void*)0,&g_203.f0,&g_203.f0,&g_203.f0},{&l_261[3][8].f0,&l_261[3][8].f0,(void*)0,&l_195},{&g_203.f0,&l_195,&g_203.f0,&l_261[3][8].f0},{(void*)0,(void*)0,&g_203.f0,&g_203.f0},{&l_261[3][8].f0,(void*)0,&g_203.f0,&l_261[3][8].f0},{(void*)0,&l_195,&l_195,&l_195},{&l_195,(void*)0,&g_203.f0,&g_203.f0}},{{&l_261[3][8].f0,&l_261[3][8].f0,&l_261[3][8].f0,&l_195},{&l_195,&g_203.f0,(void*)0,&l_261[3][8].f0},{&g_203.f0,(void*)0,&l_261[3][8].f0,&g_203.f0},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&l_195},{&g_203.f0,(void*)0,(void*)0,(void*)0},{&l_195,&l_195,&l_261[3][8].f0,&g_203.f0},{&l_261[3][8].f0,&g_203.f0,&g_203.f0,&l_261[3][8].f0}},{{&l_261[3][8].f0,&g_203.f0,(void*)0,(void*)0},{&l_195,&g_203.f0,&l_195,&l_261[3][8].f0},{&l_261[3][8].f0,(void*)0,&g_203.f0,&l_261[3][8].f0},{&g_203.f0,&g_203.f0,&l_261[3][8].f0,(void*)0},{&g_203.f0,&g_203.f0,&l_195,&l_261[3][8].f0},{(void*)0,&g_203.f0,&g_203.f0,&g_203.f0},{&l_195,&l_195,&l_261[3][8].f0,(void*)0}},{{&l_195,(void*)0,&g_203.f0,&l_195},{&l_195,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0},{&l_195,(void*)0,&g_203.f0,&l_261[3][8].f0},{&l_195,&g_203.f0,&l_261[3][8].f0,&l_195},{&l_195,&l_261[3][8].f0,&g_203.f0,&g_203.f0},{(void*)0,(void*)0,&l_195,&l_261[3][8].f0},{&g_203.f0,&l_261[3][8].f0,&l_261[3][8].f0,&g_203.f0}}}; + int32_t l_293 = 0xAF17BE23L; + struct S1 l_339 = {3L,0xC6CD4D1FL,0x97B2L,{-1L,65534UL,0xDC6FL,0x8F73L,3UL},0x1D13L}; + int32_t ***l_350 = &l_348[0]; + int i, j, k; + if ((((l_293 = ((((l_276 &= (*g_146)) || (safe_sub_func_uint16_t_u_u((~(((*g_146) = ((safe_lshift_func_uint8_t_u_s(((((*p_48) = (l_281 == &p_47)) | (l_165[0][4] |= (g_96 || (safe_div_func_uint8_t_u_u(g_193.f0, (safe_sub_func_uint16_t_u_u(((safe_sub_func_int32_t_s_s((((((safe_add_func_uint32_t_u_u(((void*)0 != &g_27), (safe_div_func_int16_t_s_s(1L, (((0xFA23E02CL == l_164) >= g_141[3][0]) ^ g_275[5][2]))))) , &l_194) != &l_194) , &l_245) != p_47), (-9L))) ^ l_261[3][8].f1), g_203.f3.f0))))))) || l_158), 7)) != g_23.f2)) , 0x8DBAL)), l_261[3][8].f3.f4))) , &l_261[2][7]) == (void*)0)) , g_203.f3.f4) < l_261[3][8].f3.f2)) + { /* block id: 83 */ + union U2 l_299[9][3][7] = {{{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}}},{{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}}},{{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}}},{{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}}},{{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}}},{{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}}},{{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}},{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}}},{{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}},{{0L},{0x52F59610L},{0L},{0x52F59610L},{0L},{0x52F59610L},{0L}}},{{{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L},{0x7F560B45L}},{{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L},{0x52F59610L},{0x193143B8L}},{{-6L},{-6L},{0x7F560B45L},{0x7F560B45L},{-6L},{-6L},{0x7F560B45L}}}}; + int16_t *l_303[10][2][5] = {{{&l_167,&g_92,&l_149,&l_149,&g_92},{(void*)0,(void*)0,&l_149,&l_167,&l_149}},{{(void*)0,(void*)0,&l_167,(void*)0,&l_167},{&g_92,&g_92,&l_149,&l_167,&g_92}},{{(void*)0,&l_167,(void*)0,&g_92,(void*)0},{(void*)0,(void*)0,&g_92,&g_92,&l_149}},{{&l_167,(void*)0,(void*)0,&l_167,(void*)0},{&g_92,&g_92,&l_149,(void*)0,&g_92}},{{(void*)0,(void*)0,&l_167,&l_167,&l_167},{(void*)0,(void*)0,(void*)0,&l_149,&l_167}},{{&g_92,&l_167,&l_149,&g_92,&g_92},{(void*)0,&g_92,&g_92,&g_92,(void*)0}},{{(void*)0,(void*)0,&l_149,&g_92,&l_149},{&g_92,(void*)0,(void*)0,&g_92,(void*)0}},{{&g_92,&g_92,&l_167,(void*)0,&g_92},{(void*)0,(void*)0,&l_149,&l_149,&l_167}},{{(void*)0,(void*)0,(void*)0,(void*)0,&l_149},{&g_92,&g_92,&g_92,&g_92,&g_92}},{{(void*)0,&g_92,(void*)0,&g_92,(void*)0},{(void*)0,(void*)0,&l_149,&g_92,&l_167}}}; + int32_t l_304 = (-1L); + int i, j, k; + (*p_47) |= (l_162 < ((l_304 |= (((safe_mul_func_int8_t_s_s((*p_48), (safe_mod_func_int8_t_s_s((l_298 == &g_133[0]), ((l_228 , l_299[6][2][1]) , (safe_add_func_uint16_t_u_u(l_302, (((void*)0 != &p_47) && l_299[6][2][1].f2)))))))) != (*g_146)) , g_193.f2)) <= (*g_146))); + } + else + { /* block id: 86 */ + int32_t *l_309 = &g_203.f1; + int32_t l_318 = (-1L); + int16_t *l_319 = &g_92; + if (((safe_lshift_func_int16_t_s_u((l_318 = ((safe_sub_func_uint16_t_u_u((*g_146), (((*l_309) = (g_23 , g_94)) , g_193.f3))) == ((*l_319) = (safe_sub_func_uint16_t_u_u((*g_146), ((safe_lshift_func_int8_t_s_u(5L, 4)) == (safe_rshift_func_int8_t_s_s((safe_lshift_func_int8_t_s_s(((0x4268F694L ^ l_318) <= g_96), (*p_48))), 5)))))))), 2)) != 0x143FL)) + { /* block id: 90 */ + int16_t l_335 = 1L; + int32_t l_338 = 0L; + (*l_281) = &g_29; + for (g_203.f0 = 0; (g_203.f0 >= 22); ++g_203.f0) + { /* block id: 94 */ + uint8_t l_328[2]; + int i; + for (i = 0; i < 2; i++) + l_328[i] = 0x73L; + l_338 &= ((((*g_146)++) > (0xCFFAL > ((0xDCFD5DADL != (safe_mul_func_uint8_t_u_u((~(g_96 = g_132)), ((safe_lshift_func_uint16_t_u_s((g_275[5][1] < l_328[1]), 10)) | (~((safe_sub_func_int32_t_s_s((*p_47), ((safe_mod_func_int32_t_s_s(0x7B9BFE1BL, ((safe_rshift_func_uint16_t_u_s((l_335 <= ((safe_rshift_func_uint8_t_u_u((g_141[0][1] = g_203.f3.f4), g_27)) || g_140)), g_193.f4)) && (*p_47)))) ^ 0x9CL))) == 0x78C5L)))))) || (-8L)))) == g_203.f3.f4); + return &g_82; + } + } + else + { /* block id: 101 */ + uint32_t l_344[4][4][4] = {{{4294967295UL,0x20A336BFL,0x508F9594L,0x20A336BFL},{1UL,0x4B5B738DL,1UL,0xFAAC7D03L},{0x20A336BFL,1UL,0xC65866FCL,0xFD1D0127L},{1UL,0x1FDA686FL,4294967286UL,4294967295UL}},{{1UL,0UL,0xC65866FCL,4294967286UL},{0x20A336BFL,4294967295UL,1UL,0x005F1C4FL},{0x005F1C4FL,4294967295UL,4294967295UL,4294967295UL},{1UL,1UL,0x005F1C4FL,1UL}},{{4294967295UL,4294967294UL,4294967286UL,0xC65866FCL},{0x508F9594L,0x005F1C4FL,4294967295UL,4294967286UL},{0UL,0x005F1C4FL,0xFD1D0127L,0xC65866FCL},{0x005F1C4FL,4294967294UL,0xFAAC7D03L,1UL}},{{0x05C4B03AL,1UL,0xBED9113FL,4294967295UL},{4294967286UL,4294967295UL,4294967286UL,0x005F1C4FL},{0x4687D50BL,4294967295UL,0UL,4294967286UL},{6UL,0UL,0UL,4294967295UL}}}; + int i, j, k; + if (((l_339 , (&g_33 != l_340)) != ((*p_48) = (-5L)))) + { /* block id: 103 */ + uint16_t l_341 = 0xCD7FL; + ++l_341; + } + else + { /* block id: 105 */ + int8_t **l_347[4]; + int i; + for (i = 0; i < 4; i++) + l_347[i] = &l_292[7][5][0]; + l_344[1][0][2]++; + (*p_47) &= (l_344[0][1][3] , ((g_23 , g_275[4][1]) > (&g_9 == (p_48 = (void*)0)))); + (*l_281) = p_47; + } + return &g_33; + } + } + (*l_340) = (*p_47); + (*l_350) = l_348[0]; + for (l_164 = (-28); (l_164 < (-6)); l_164 = safe_add_func_uint32_t_u_u(l_164, 6)) + { /* block id: 118 */ + struct S1 **l_354 = &g_202[4][9]; + (*l_354) = l_353[0][4][1]; + } + } + } + else + { /* block id: 122 */ + uint32_t l_355[5][5] = {{1UL,0x1EFE6392L,0x1EFE6392L,1UL,0x1EFE6392L},{1UL,1UL,1UL,1UL,1UL},{0x1EFE6392L,1UL,0x1EFE6392L,0x1EFE6392L,1UL},{1UL,0x08136386L,0x08136386L,1UL,0x08136386L},{1UL,1UL,4294967294UL,1UL,1UL}}; + int32_t l_369 = 0L; + struct S1 l_370 = {0x0FL,0x1D359E28L,0x2098L,{-1L,0UL,65535UL,0x21B8L,0x91L},0UL}; + uint8_t l_371 = 5UL; + int32_t *l_372 = &l_164; + int32_t *l_373 = &l_369; + int16_t *l_385[4]; + int32_t l_386 = 0x87316FB4L; + int32_t l_387[9] = {0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L,0x4A002CF8L}; + int8_t **l_402 = &g_10; + int8_t l_408 = (-2L); + uint32_t *l_459[7] = {&l_384,&l_384,&l_384,&l_384,&l_384,&l_384,&l_384}; + union U2 l_506 = {-1L}; + uint32_t * const l_541 = (void*)0; + uint32_t * const *l_540 = &l_541; + int8_t l_551 = (-7L); + int32_t l_562 = 0x7B63C334L; + int16_t l_572[2]; + uint32_t l_609[1][2][6] = {{{4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL},{4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL,4294967295UL}}}; + uint32_t l_610 = 0xA2210773L; + uint16_t **l_617[5][10][2] = {{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}},{{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522},{&g_522,&g_522}}}; + uint32_t l_622[8][10][3] = {{{4294967288UL,0xD980B936L,0UL},{0xCFF7DF80L,0xC6F50153L,4294967295UL},{4294967288UL,0x189C563AL,0xA0DDD608L},{0xB9019512L,5UL,1UL},{0UL,0xA209FE77L,0xF6C96FF1L},{0xF25DA586L,5UL,0xB9019512L},{0x55FB34F6L,9UL,0xA11D72F8L},{0x5C6871E7L,4294967290UL,0xB9019512L},{0UL,0xF6C96FF1L,0xF6C96FF1L},{0UL,0xE1B43826L,1UL}},{{4294967295UL,8UL,0xA0DDD608L},{0x35DA2F23L,1UL,4294967295UL},{0xA0DDD608L,0x55FB34F6L,0UL},{1UL,1UL,0x182BD3A5L},{0xD980B936L,8UL,0xD980B936L},{4294967287UL,0xE1B43826L,0xF25DA586L},{0xA209FE77L,0xF6C96FF1L,4294967288UL},{0x182BD3A5L,4294967290UL,4294967295UL},{0x29A9BD62L,9UL,0x15D08CC1L},{0x182BD3A5L,5UL,0x5C6871E7L}},{{0xA209FE77L,0xA209FE77L,8UL},{4294967287UL,5UL,1UL},{0xD980B936L,0x189C563AL,0xA209FE77L},{1UL,0xC6F50153L,0x48801177L},{0xA0DDD608L,0xD980B936L,0xA209FE77L},{0x35DA2F23L,0x2BCB943DL,1UL},{4294967295UL,0x29A9BD62L,8UL},{0UL,0xC6555B24L,0x5C6871E7L},{0UL,0UL,0x15D08CC1L},{0x5C6871E7L,7UL,4294967295UL}},{{0x55FB34F6L,0UL,4294967288UL},{0xF25DA586L,0xC6555B24L,0xF25DA586L},{0UL,0x29A9BD62L,0xD980B936L},{0xB9019512L,0x2BCB943DL,0x182BD3A5L},{4294967288UL,0xD980B936L,0UL},{0xCFF7DF80L,0xC6F50153L,4294967295UL},{4294967288UL,0x189C563AL,0xA0DDD608L},{0xB9019512L,5UL,1UL},{0UL,0xA209FE77L,0xF6C96FF1L},{0xF25DA586L,5UL,0xB9019512L}},{{0x55FB34F6L,9UL,0xA11D72F8L},{0x5C6871E7L,4294967290UL,0xB9019512L},{0UL,0xF6C96FF1L,0xF6C96FF1L},{0UL,0xE1B43826L,1UL},{4294967295UL,8UL,0xA0DDD608L},{0x35DA2F23L,1UL,4294967295UL},{0xA0DDD608L,0x55FB34F6L,0UL},{1UL,1UL,0x182BD3A5L},{0xD980B936L,8UL,0xD980B936L},{4294967287UL,0xE1B43826L,0xF25DA586L}},{{0xA209FE77L,0xF6C96FF1L,4294967288UL},{0x182BD3A5L,4294967290UL,4294967295UL},{0x29A9BD62L,9UL,0x15D08CC1L},{0x182BD3A5L,5UL,0x5C6871E7L},{0xA209FE77L,0xA209FE77L,8UL},{4294967287UL,5UL,1UL},{0xD980B936L,0x189C563AL,0xA0DDD608L},{0xDF803319L,7UL,0x182BD3A5L},{0x29A9BD62L,0x23F5EC66L,0xA0DDD608L},{0UL,6UL,4294967295UL}},{{0x15D08CC1L,0UL,9UL},{4294967295UL,0xC6F50153L,0xCFF7DF80L},{4294967295UL,0xF6C96FF1L,0UL},{0xCFF7DF80L,5UL,0x48801177L},{0x189C563AL,0xF6C96FF1L,0xD980B936L},{4294967290UL,0xC6F50153L,4294967290UL},{0xF6C96FF1L,0UL,0x23F5EC66L},{0x5C6871E7L,6UL,0xF25DA586L},{0xD980B936L,0x23F5EC66L,0xA11D72F8L},{0x35DA2F23L,7UL,4294967287UL}},{{0xD980B936L,0xA209FE77L,0x29A9BD62L},{0x5C6871E7L,4294967295UL,0x66955C2CL},{0xF6C96FF1L,0xA0DDD608L,0UL},{4294967290UL,5UL,0x5C6871E7L},{0x189C563AL,0x55FB34F6L,4294967288UL},{0xCFF7DF80L,0xC30C919DL,0x5C6871E7L},{4294967295UL,0UL,0UL},{4294967295UL,0xC0A101CBL,0x66955C2CL},{0x15D08CC1L,9UL,0x29A9BD62L},{0UL,0x2BCB943DL,4294967287UL}}}; + uint8_t l_625 = 1UL; + struct S0 **l_789 = &l_660; + int i, j, k; + for (i = 0; i < 4; i++) + l_385[i] = &l_149; + for (i = 0; i < 2; i++) + l_572[i] = 0xCE21L; + l_369 = (l_355[1][4] >= (safe_mod_func_int8_t_s_s((g_140 >= (((3UL & g_275[4][2]) | (safe_mod_func_uint32_t_u_u((safe_rshift_func_int16_t_s_u(((void*)0 == g_362[1][2]), (l_261[3][8].f3.f2 ^ ((*g_10) , ((((((*p_47) = (safe_mul_func_uint8_t_u_u((((0xA0C97CF4L < (*p_47)) >= 0xA05A7788L) < g_367), 1L))) && g_203.f1) < g_368[5][5][0]) >= l_355[2][0]) == l_355[1][4]))))), g_130[0][5]))) == l_355[3][0])), (*p_48)))); + (*l_373) &= ((l_370 , l_371) <= (((*p_47) = (*p_47)) <= ((*l_372) = (-3L)))); + } + return &g_29; +} + + +/* ------------------------------------------ */ +/* + * reads : g_9 g_82 g_33 g_92 g_23.f2 g_94 g_96 g_23 g_27 g_28 g_141 g_448 + * writes: g_82 g_92 g_96 g_9 g_27 g_131 g_133 g_141 g_448 + */ +static int32_t * func_50(uint32_t p_51, int8_t p_52, int8_t p_53, int8_t * p_54, const int32_t p_55) +{ /* block id: 13 */ + int8_t *l_81[10] = {&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9,&g_9}; + int16_t *l_91 = &g_92; + int32_t l_93 = (-8L); + uint8_t *l_95 = &g_96; + union U2 l_107 = {0x2706CD28L}; + int32_t l_113 = (-3L); + struct S1 l_114 = {8L,0x07506916L,0x6519L,{0xCEA1L,0UL,65531UL,0x6711L,251UL},1UL}; + const uint16_t l_127 = 0UL; + int32_t *l_135 = &l_113; + int32_t *l_136 = (void*)0; + int32_t *l_137 = (void*)0; + int32_t *l_138 = &l_113; + int32_t *l_139[6] = {(void*)0,&g_82,(void*)0,(void*)0,&g_82,(void*)0}; + int i; + l_93 = (safe_add_func_uint16_t_u_u(p_52, ((((safe_lshift_func_int16_t_s_u(((safe_div_func_int8_t_s_s((g_82 &= (*p_54)), (*p_54))) >= ((safe_mod_func_int8_t_s_s(((void*)0 != &p_53), (safe_add_func_int32_t_s_s((-3L), 0x3BD055D5L)))) <= 0x5DL)), 14)) ^ ((*l_95) |= (safe_mul_func_int8_t_s_s(((safe_rshift_func_int8_t_s_u(((((((*l_91) ^= g_33) | 0xA63FL) , l_93) >= l_93) > l_93), g_23.f2)) , g_94), 0xC7L)))) != l_93) , g_96))); + if (p_51) + { /* block id: 18 */ + int8_t **l_108[6] = {&l_81[4],&l_81[9],&l_81[4],&l_81[4],&l_81[9],&l_81[4]}; + struct S1 l_109 = {-3L,0xD4E8C809L,0x47BFL,{2L,0x3CBAL,0UL,65535UL,255UL},0xD01BL}; + uint16_t *l_110 = &l_107.f2; + int32_t *l_111 = &l_93; + int32_t *l_112[8] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + uint32_t *l_125 = &g_27; + uint8_t *l_126 = (void*)0; + const int32_t *l_129 = &g_130[0][5]; + const int32_t **l_128[9][6][4] = {{{&l_129,(void*)0,(void*)0,&l_129},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,&l_129,(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,&l_129},{&l_129,(void*)0,(void*)0,&l_129},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,(void*)0}},{{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,&l_129,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,&l_129}},{{&l_129,(void*)0,(void*)0,&l_129},{&l_129,&l_129,(void*)0,(void*)0},{(void*)0,&l_129,&l_129,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0},{&l_129,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0},{(void*)0,&l_129,(void*)0,(void*)0},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0}},{{(void*)0,&l_129,(void*)0,(void*)0},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,&l_129},{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0},{(void*)0,&l_129,(void*)0,(void*)0},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,&l_129}},{{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,(void*)0,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,&l_129,&l_129,&l_129},{(void*)0,(void*)0,&l_129,&l_129},{&l_129,(void*)0,&l_129,(void*)0}}}; + int i, j, k; + l_113 = ((*l_111) = (safe_mul_func_uint8_t_u_u((safe_lshift_func_uint16_t_u_u(((p_51 , ((*l_110) = (safe_rshift_func_int8_t_s_u((((*p_54) = (safe_mul_func_uint16_t_u_u(g_92, 0L))) & (safe_mul_func_int16_t_s_s(((0xF9L < (g_23 , (l_107 , ((l_81[9] = (void*)0) == &p_53)))) != ((((l_109 , &p_55) == &g_29) < 250UL) != l_109.f3.f2)), 65533UL))), l_109.f3.f0)))) & l_109.f3.f2), 5)), l_93))); + g_133[0] = (g_131 = func_16(l_114, (((void*)0 == p_54) != (((safe_mul_func_uint8_t_u_u(((safe_rshift_func_uint8_t_u_u(((safe_mul_func_uint16_t_u_u((((safe_mul_func_uint16_t_u_u(p_52, ((*p_54) == (((l_113 |= (l_109.f3 , ((*l_95) = (g_23.f2 <= (safe_add_func_int32_t_s_s(l_107.f2, (((+(((*l_125) ^= (l_91 == (void*)0)) <= p_55)) & 0x47876926L) , p_52))))))) ^ (*p_54)) ^ 0L)))) != 4294967288UL) <= p_53), l_114.f0)) & 0xEB91146BL), 2)) < p_51), 255UL)) , p_51) ^ l_127)), &g_9, g_23)); + } + else + { /* block id: 29 */ + int32_t *l_134 = &g_33; + return l_134; + } + ++g_141[5][6]; + return &g_82; +} + + + + +/* ---------------------------------------- */ +int main (int argc, char* argv[]) +{ + int i, j, k; + int print_hash_value = 0; + if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; + platform_main_begin(); + crc32_gentab(); + func_1(); + transparent_crc(g_9, "g_9", print_hash_value); + transparent_crc(g_23.f2, "g_23.f2", print_hash_value); + transparent_crc(g_27, "g_27", print_hash_value); + transparent_crc(g_29, "g_29", print_hash_value); + transparent_crc(g_33, "g_33", print_hash_value); + transparent_crc(g_82, "g_82", print_hash_value); + transparent_crc(g_92, "g_92", print_hash_value); + transparent_crc(g_94, "g_94", print_hash_value); + transparent_crc(g_96, "g_96", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 6; j++) + { + transparent_crc(g_130[i][j], "g_130[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_132, "g_132", print_hash_value); + transparent_crc(g_140, "g_140", print_hash_value); + for (i = 0; i < 6; i++) + { + for (j = 0; j < 7; j++) + { + transparent_crc(g_141[i][j], "g_141[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_193.f0, "g_193.f0", print_hash_value); + transparent_crc(g_193.f1, "g_193.f1", print_hash_value); + transparent_crc(g_193.f2, "g_193.f2", print_hash_value); + transparent_crc(g_193.f3, "g_193.f3", print_hash_value); + transparent_crc(g_193.f4, "g_193.f4", print_hash_value); + transparent_crc(g_203.f0, "g_203.f0", print_hash_value); + transparent_crc(g_203.f1, "g_203.f1", print_hash_value); + transparent_crc(g_203.f2, "g_203.f2", print_hash_value); + transparent_crc(g_203.f3.f0, "g_203.f3.f0", print_hash_value); + transparent_crc(g_203.f3.f1, "g_203.f3.f1", print_hash_value); + transparent_crc(g_203.f3.f2, "g_203.f3.f2", print_hash_value); + transparent_crc(g_203.f3.f3, "g_203.f3.f3", print_hash_value); + transparent_crc(g_203.f3.f4, "g_203.f3.f4", print_hash_value); + transparent_crc(g_203.f4, "g_203.f4", print_hash_value); + for (i = 0; i < 6; i++) + { + for (j = 0; j < 3; j++) + { + transparent_crc(g_275[i][j], "g_275[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_367, "g_367", print_hash_value); + for (i = 0; i < 9; i++) + { + for (j = 0; j < 8; j++) + { + for (k = 0; k < 3; k++) + { + transparent_crc(g_368[i][j][k], "g_368[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + for (i = 0; i < 4; i++) + { + for (j = 0; j < 6; j++) + { + for (k = 0; k < 6; k++) + { + transparent_crc(g_429[i][j][k].f0, "g_429[i][j][k].f0", print_hash_value); + transparent_crc(g_429[i][j][k].f1, "g_429[i][j][k].f1", print_hash_value); + transparent_crc(g_429[i][j][k].f2, "g_429[i][j][k].f2", print_hash_value); + transparent_crc(g_429[i][j][k].f3.f0, "g_429[i][j][k].f3.f0", print_hash_value); + transparent_crc(g_429[i][j][k].f3.f1, "g_429[i][j][k].f3.f1", print_hash_value); + transparent_crc(g_429[i][j][k].f3.f2, "g_429[i][j][k].f3.f2", print_hash_value); + transparent_crc(g_429[i][j][k].f3.f3, "g_429[i][j][k].f3.f3", print_hash_value); + transparent_crc(g_429[i][j][k].f3.f4, "g_429[i][j][k].f3.f4", print_hash_value); + transparent_crc(g_429[i][j][k].f4, "g_429[i][j][k].f4", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_448, "g_448", print_hash_value); + transparent_crc(g_491, "g_491", print_hash_value); + transparent_crc(g_663.f0, "g_663.f0", print_hash_value); + transparent_crc(g_663.f1, "g_663.f1", print_hash_value); + transparent_crc(g_663.f2, "g_663.f2", print_hash_value); + transparent_crc(g_663.f3, "g_663.f3", print_hash_value); + transparent_crc(g_663.f4, "g_663.f4", print_hash_value); + for (i = 0; i < 9; i++) + { + for (j = 0; j < 3; j++) + { + transparent_crc(g_709[i][j], "g_709[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_870, "g_870", print_hash_value); + transparent_crc(g_902, "g_902", print_hash_value); + transparent_crc(g_1001, "g_1001", print_hash_value); + transparent_crc(g_1007.f0, "g_1007.f0", print_hash_value); + transparent_crc(g_1007.f2, "g_1007.f2", print_hash_value); + transparent_crc(g_1359, "g_1359", print_hash_value); + transparent_crc(g_1361, "g_1361", print_hash_value); + for (i = 0; i < 9; i++) + { + transparent_crc(g_1473[i], "g_1473[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_1474, "g_1474", print_hash_value); + transparent_crc(g_1492, "g_1492", print_hash_value); + transparent_crc(g_1725, "g_1725", print_hash_value); + transparent_crc(g_1798, "g_1798", print_hash_value); + transparent_crc(g_2122, "g_2122", print_hash_value); + transparent_crc(g_2341, "g_2341", print_hash_value); + transparent_crc(g_2575, "g_2575", print_hash_value); + transparent_crc(g_2686.f0, "g_2686.f0", print_hash_value); + transparent_crc(g_2686.f1, "g_2686.f1", print_hash_value); + transparent_crc(g_2686.f2, "g_2686.f2", print_hash_value); + transparent_crc(g_2686.f3, "g_2686.f3", print_hash_value); + transparent_crc(g_2686.f4, "g_2686.f4", print_hash_value); + transparent_crc(g_2898, "g_2898", print_hash_value); + platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); + return 0; +} + +/************************ statistics ************************* +XXX max struct depth: 2 +breakdown: + depth: 0, occurrence: 717 + depth: 1, occurrence: 16 + depth: 2, occurrence: 33 +XXX total union variables: 30 + +XXX non-zero bitfields defined in structs: 1 +XXX zero bitfields defined in structs: 1 +XXX const bitfields defined in structs: 0 +XXX volatile bitfields defined in structs: 0 +XXX structs with bitfields in the program: 45 +breakdown: + indirect level: 0, occurrence: 33 + indirect level: 1, occurrence: 8 + indirect level: 2, occurrence: 4 +XXX full-bitfields structs in the program: 0 +breakdown: +XXX times a bitfields struct's address is taken: 36 +XXX times a bitfields struct on LHS: 0 +XXX times a bitfields struct on RHS: 66 +XXX times a single bitfield on LHS: 0 +XXX times a single bitfield on RHS: 0 + +XXX max expression depth: 42 +breakdown: + depth: 1, occurrence: 186 + depth: 2, occurrence: 44 + depth: 3, occurrence: 2 + depth: 4, occurrence: 4 + depth: 5, occurrence: 2 + depth: 6, occurrence: 3 + depth: 7, occurrence: 1 + depth: 11, occurrence: 2 + depth: 13, occurrence: 1 + depth: 14, occurrence: 1 + depth: 16, occurrence: 2 + depth: 17, occurrence: 1 + depth: 18, occurrence: 1 + depth: 19, occurrence: 4 + depth: 20, occurrence: 4 + depth: 21, occurrence: 2 + depth: 22, occurrence: 4 + depth: 23, occurrence: 4 + depth: 25, occurrence: 1 + depth: 27, occurrence: 1 + depth: 28, occurrence: 2 + depth: 29, occurrence: 2 + depth: 30, occurrence: 1 + depth: 31, occurrence: 1 + depth: 33, occurrence: 2 + depth: 41, occurrence: 1 + depth: 42, occurrence: 1 + +XXX total number of pointers: 576 + +XXX times a variable address is taken: 1577 +XXX times a pointer is dereferenced on RHS: 578 +breakdown: + depth: 1, occurrence: 540 + depth: 2, occurrence: 36 + depth: 3, occurrence: 2 +XXX times a pointer is dereferenced on LHS: 463 +breakdown: + depth: 1, occurrence: 432 + depth: 2, occurrence: 30 + depth: 3, occurrence: 1 +XXX times a pointer is compared with null: 72 +XXX times a pointer is compared with address of another variable: 17 +XXX times a pointer is compared with another pointer: 25 +XXX times a pointer is qualified to be dereferenced: 11097 + +XXX max dereference level: 4 +breakdown: + level: 0, occurrence: 0 + level: 1, occurrence: 2473 + level: 2, occurrence: 250 + level: 3, occurrence: 21 + level: 4, occurrence: 4 +XXX number of pointers point to pointers: 214 +XXX number of pointers point to scalars: 326 +XXX number of pointers point to structs: 20 +XXX percent of pointers has null in alias set: 29 +XXX average alias set size: 1.59 + +XXX times a non-volatile is read: 2782 +XXX times a non-volatile is write: 1303 +XXX times a volatile is read: 0 +XXX times read thru a pointer: 0 +XXX times a volatile is write: 0 +XXX times written thru a pointer: 0 +XXX times a volatile is available for access: 0 +XXX percentage of non-volatile access: 100 + +XXX forward jumps: 1 +XXX backward jumps: 8 + +XXX stmts: 189 +XXX max block depth: 5 +breakdown: + depth: 0, occurrence: 32 + depth: 1, occurrence: 30 + depth: 2, occurrence: 20 + depth: 3, occurrence: 30 + depth: 4, occurrence: 37 + depth: 5, occurrence: 40 + +XXX percentage a fresh-made variable is used: 15.4 +XXX percentage an existing variable is used: 84.6 +FYI: the random generator makes assumptions about the integer size. See platform.info for more details. +********************* end of statistics **********************/ + diff --git a/tests/fuzz/11.c.txt b/tests/fuzz/11.c.txt new file mode 100644 index 00000000..d878ac9d --- /dev/null +++ b/tests/fuzz/11.c.txt @@ -0,0 +1 @@ +checksum = F3170034 diff --git a/tests/fuzz/15.c b/tests/fuzz/15.c new file mode 100644 index 00000000..d84af705 --- /dev/null +++ b/tests/fuzz/15.c @@ -0,0 +1,1581 @@ +/* + * This is a RANDOMLY GENERATED PROGRAM. + * + * Generator: csmith 2.2.0 + * Git version: bf42ffd + * Options: --no-volatiles --no-packed-struct + * Seed: 797096764 + */ + +#include "csmith.h" + + +static long __undefined; + +/* --- Struct/Union Declarations --- */ +union U0 { + const int16_t f0; + int8_t f1; + uint32_t f2; +}; + +union U1 { + uint32_t f0; + signed f1 : 23; +}; + +union U2 { + int32_t f0; + const int8_t f1; + uint32_t f2; + uint64_t f3; + const int16_t f4; +}; + +/* --- GLOBAL VARIABLES --- */ +static uint8_t g_2 = 0x99L; +static union U2 g_10[10] = {{0x98764276L},{0xDA7EF5D8L},{0x1AFA9B64L},{0x1AFA9B64L},{0xDA7EF5D8L},{0x98764276L},{0xDA7EF5D8L},{0x1AFA9B64L},{0x1AFA9B64L},{0xDA7EF5D8L}}; +static union U2 *g_9 = &g_10[9]; +static int64_t g_49 = 0x47CDD5376E30F4AELL; +static uint8_t g_53[6] = {0xA8L,0xA8L,255UL,0xA8L,0xA8L,255UL}; +static union U2 **g_54 = (void*)0; +static int16_t g_75 = 0xDA77L; +static int32_t g_89 = 0x94124F91L; +static int32_t g_92 = (-10L); +static uint32_t g_93 = 0UL; +static uint8_t g_101 = 1UL; +static int32_t g_111[9][9] = {{0xA052AF0DL,(-6L),0x1281BCF5L,(-7L),0xA052AF0DL,(-1L),(-6L),0x453539CAL,(-7L)},{0xD59F121BL,0xADC77BC6L,9L,0x74088AFDL,(-7L),0x0F6EBCB2L,(-7L),0x74088AFDL,9L},{0xA052AF0DL,0xA052AF0DL,(-6L),0x1281BCF5L,(-7L),0xA052AF0DL,(-1L),(-6L),0x453539CAL},{9L,0xADC77BC6L,9L,(-1L),9L,0x74088AFDL,0L,0x74088AFDL,9L},{0x453539CAL,0L,0L,0x453539CAL,0xA052AF0DL,0x1281BCF5L,0L,(-4L),0x453539CAL},{0xD59F121BL,(-1L),(-7L),(-1L),0xD59F121BL,0x0F6EBCB2L,0xC841BEEAL,0xADC77BC6L,0xC841BEEAL},{(-4L),0xA052AF0DL,0x90AFEB5AL,0x90AFEB5AL,0xA052AF0DL,(-4L),(-1L),0x90AFEB5AL,1L},{0x01AA1EC4L,0x0F6EBCB2L,9L,0xADC77BC6L,9L,0x0F6EBCB2L,0x01AA1EC4L,(-1L),0L},{0x453539CAL,(-1L),0x1281BCF5L,(-4L),(-4L),0x1281BCF5L,(-1L),0x453539CAL,(-4L)}}; +static int16_t *g_136[6][10] = {{&g_75,&g_75,&g_75,&g_75,&g_75,&g_75,(void*)0,(void*)0,&g_75,&g_75},{&g_75,&g_75,&g_75,&g_75,(void*)0,&g_75,&g_75,&g_75,(void*)0,&g_75},{&g_75,&g_75,&g_75,(void*)0,&g_75,&g_75,&g_75,&g_75,(void*)0,&g_75},{(void*)0,(void*)0,&g_75,&g_75,&g_75,&g_75,&g_75,&g_75,&g_75,(void*)0},{&g_75,&g_75,&g_75,&g_75,(void*)0,(void*)0,&g_75,&g_75,&g_75,&g_75},{&g_75,(void*)0,&g_75,(void*)0,(void*)0,(void*)0,&g_75,(void*)0,&g_75,&g_75}}; +static int8_t g_147 = 0x73L; +static int64_t g_149 = 0x9236ECDBE2488046LL; +static union U2 g_223 = {0x3CAFA4DCL}; +static union U2 *g_222 = &g_223; +static union U0 g_226 = {-1L}; +static union U0 *g_225 = &g_226; +static union U0 g_229[3][1][5] = {{{{0xF0CDL},{1L},{0x1C62L},{0x7D68L},{0x7D68L}}},{{{1L},{0xF0CDL},{1L},{0x1C62L},{0x7D68L}}},{{{0x095AL},{0xCCBBL},{0x7D68L},{0xCCBBL},{0x095AL}}}}; +static union U0 g_231[6][9][4] = {{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}},{{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}},{{0x2038L},{0x2038L},{0x2038L},{0x2038L}}}}; +static uint16_t g_245 = 0xE292L; +static const uint16_t *g_244 = &g_245; +static const uint16_t **g_243[4][5][5] = {{{&g_244,&g_244,(void*)0,&g_244,&g_244},{(void*)0,(void*)0,(void*)0,&g_244,&g_244},{&g_244,(void*)0,&g_244,(void*)0,&g_244},{(void*)0,&g_244,(void*)0,(void*)0,(void*)0},{&g_244,&g_244,&g_244,&g_244,(void*)0}},{{&g_244,(void*)0,(void*)0,&g_244,(void*)0},{(void*)0,&g_244,(void*)0,(void*)0,&g_244},{(void*)0,(void*)0,&g_244,&g_244,(void*)0},{&g_244,(void*)0,&g_244,&g_244,&g_244},{&g_244,(void*)0,(void*)0,(void*)0,&g_244}},{{&g_244,&g_244,(void*)0,(void*)0,(void*)0},{&g_244,&g_244,(void*)0,&g_244,&g_244},{&g_244,&g_244,&g_244,&g_244,(void*)0},{(void*)0,&g_244,&g_244,&g_244,&g_244},{(void*)0,&g_244,&g_244,&g_244,&g_244}},{{(void*)0,&g_244,(void*)0,&g_244,(void*)0},{(void*)0,&g_244,&g_244,&g_244,(void*)0},{(void*)0,(void*)0,&g_244,&g_244,&g_244},{(void*)0,(void*)0,&g_244,(void*)0,(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&g_244}}}; +static const uint16_t **g_250[3] = {&g_244,&g_244,&g_244}; +static int32_t **g_251[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; +static const union U0 g_255 = {0x8343L}; +static const uint64_t g_319 = 1UL; +static const uint64_t *g_318 = &g_319; +static uint32_t g_375 = 0x72D6932EL; +static union U1 g_428[8][1][4] = {{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}},{{{0x698E2022L},{1UL},{0x698E2022L},{1UL}}}}; +static uint16_t g_444 = 0x21E0L; +static int8_t g_479 = 0x73L; +static int16_t g_507 = 0x62B6L; +static union U2 *** const g_604 = &g_54; +static int32_t g_627 = 0x6061E963L; +static int8_t g_706 = (-10L); +static const union U2 g_814 = {0x1ABBD7A4L}; +static union U0 **g_815 = &g_225; +static union U0 **g_819 = &g_225; +static const union U1 *g_902 = &g_428[0][0][2]; +static uint32_t *g_912 = &g_93; +static uint32_t **g_911 = &g_912; +static uint8_t *g_931 = &g_2; +static uint8_t **g_930 = &g_931; +static int32_t g_1007 = 1L; +static int32_t ***g_1075 = &g_251[3]; +static int32_t ****g_1074[10] = {&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075,&g_1075}; +static int8_t g_1178 = 1L; +static uint32_t g_1198[10][6] = {{0x6E30EC80L,1UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,1UL},{0x10B3A749L,18446744073709551615UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,18446744073709551615UL},{0x6E30EC80L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,1UL,1UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x74CE00C5L,18446744073709551615UL,18446744073709551615UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,18446744073709551615UL,18446744073709551615UL},{0x6E30EC80L,1UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,1UL},{0x10B3A749L,18446744073709551615UL,18446744073709551615UL,0x603D3624L,18446744073709551615UL,18446744073709551615UL},{0x6E30EC80L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,1UL,1UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x74CE00C5L,18446744073709551615UL,18446744073709551615UL},{0x74CE00C5L,18446744073709551615UL,18446744073709551615UL,0x10B3A749L,18446744073709551615UL,18446744073709551615UL}}; +static int32_t g_1232 = 0x71F484AAL; +static int64_t g_1399[3][1][5] = {{{0xDD9AC679BAAAA7DCLL,0xDD9AC679BAAAA7DCLL,(-1L),0xA0F8C1174F6453ADLL,(-1L)}},{{0xDD9AC679BAAAA7DCLL,0xDD9AC679BAAAA7DCLL,(-1L),0xA0F8C1174F6453ADLL,(-1L)}},{{0xDD9AC679BAAAA7DCLL,0xDD9AC679BAAAA7DCLL,(-1L),0xA0F8C1174F6453ADLL,(-1L)}}}; +static union U1 *g_1459 = &g_428[0][0][2]; +static uint32_t *g_1502 = &g_375; +static union U1 g_1574[2] = {{4294967286UL},{4294967286UL}}; +static uint64_t g_1582 = 0xDE7693F682AE7AA6LL; +static int8_t g_1693 = 0x0CL; +static int64_t g_1695 = 0x84AF5CDD96B38B31LL; +static uint16_t g_1743 = 0x3C40L; +static int32_t g_1771 = 0x66C24BEBL; +static const uint64_t g_1864[2][4][3] = {{{5UL,1UL,1UL},{18446744073709551615UL,0x14DC4E3CB165692BLL,18446744073709551615UL},{5UL,5UL,1UL},{0xE46C208F0BCDDE06LL,0x14DC4E3CB165692BLL,0xE46C208F0BCDDE06LL}},{{5UL,1UL,1UL},{18446744073709551615UL,0x14DC4E3CB165692BLL,18446744073709551615UL},{5UL,5UL,1UL},{0xE46C208F0BCDDE06LL,0x14DC4E3CB165692BLL,0xE46C208F0BCDDE06LL}}}; +static const int32_t *g_1948[8][5][2] = {{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}},{{&g_92,(void*)0},{&g_1232,&g_92},{&g_111[6][0],&g_111[6][0]},{&g_111[6][0],&g_92},{&g_1232,(void*)0}}}; +static uint16_t * const g_2081 = (void*)0; +static uint16_t * const *g_2080 = &g_2081; +static uint16_t * const **g_2079[6][9] = {{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,(void*)0,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080},{&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080,&g_2080}}; +static uint16_t *g_2110 = &g_444; +static uint16_t **g_2109 = &g_2110; +static int32_t g_2120 = 0x6DA12724L; +static uint16_t *g_2144 = (void*)0; +static uint32_t * const *g_2212 = (void*)0; +static union U1 **g_2317[4] = {&g_1459,&g_1459,&g_1459,&g_1459}; +static union U1 ***g_2316 = &g_2317[1]; + + +/* --- FORWARD DECLARATIONS --- */ +static uint32_t func_1(void); +static union U2 * const func_3(union U1 p_4, int16_t p_5); +static union U1 func_6(union U2 * p_7, const int64_t p_8); +static const uint64_t func_16(uint64_t p_17, union U1 p_18); +static union U2 func_20(union U2 * p_21); +static int8_t func_26(const int64_t p_27, uint32_t p_28, uint64_t p_29, union U2 p_30); +static uint8_t func_33(union U2 * p_34, uint32_t p_35, union U0 p_36, uint8_t p_37, union U2 * p_38); +static uint32_t func_40(union U2 * p_41, union U2 ** p_42, union U2 * p_43); +static int16_t func_66(uint8_t * const p_67, int64_t p_68, union U2 *** const p_69); +static uint8_t * func_70(int64_t p_71, int32_t p_72, uint8_t * p_73); + + +/* --- FUNCTIONS --- */ +/* ------------------------------------------ */ +/* + * reads : g_2 g_10.f1 g_53 g_54 g_231.f1 g_223.f4 g_318 g_319 g_10 g_706 g_428 g_92 g_444 g_10.f4 g_89 g_111 g_149 g_93 g_225 g_226 g_223.f0 g_428.f0 g_223.f3 g_930 g_931 g_627 g_912 g_911 g_1007 g_226.f2 g_244 g_245 g_1074 g_147 g_101 g_375 g_1198 g_604 g_814.f0 g_229 g_222 g_223 g_75 g_814.f1 g_902 g_223.f1 g_1232 g_9 g_255.f0 g_1502 g_1574 g_479 g_1695 g_1459 g_229.f0 g_1582 g_507 g_1743 g_1574.f1 g_819 g_2110 g_2144 g_1864 g_223.f2 g_2212 g_2316 + * writes: g_9 g_49 g_2 g_53 g_706 g_444 g_93 g_245 g_223.f0 g_149 g_111 g_223.f3 g_75 g_226.f2 g_89 g_507 g_479 g_147 g_1198 g_54 g_1399 g_231.f1 g_1502 g_931 g_92 g_1232 g_375 g_10.f3 g_428 g_222 g_1743 g_1695 g_1007 g_10.f2 g_2079 g_2109 g_2120 g_1948 g_223.f2 g_2212 + */ +static uint32_t func_1(void) +{ /* block id: 0 */ + int64_t l_1967[2]; + uint8_t l_1977[4]; + uint32_t l_1980 = 1UL; + int32_t l_1982 = 0xD67F4E36L; + int32_t l_1983 = 0xF965B165L; + uint16_t l_1999 = 0x9388L; + int32_t l_2011 = 0xE1C04DFFL; + int32_t l_2012 = 0xFCA65305L; + int32_t l_2013 = 0xADB23608L; + int32_t l_2014 = 0x0E5033ACL; + int32_t ****l_2054 = &g_1075; + uint32_t l_2062 = 0x1B47355CL; + const int8_t l_2064 = 0xCCL; + uint64_t l_2066[1][3][9] = {{{1UL,1UL,0UL,1UL,1UL,0UL,1UL,1UL,0UL},{1UL,1UL,0UL,1UL,1UL,0UL,1UL,1UL,0UL},{1UL,1UL,0UL,1UL,1UL,0UL,1UL,1UL,0UL}}}; + int64_t l_2071 = 0L; + int32_t l_2099[1][7][8] = {{{0x189E11A8L,5L,0xA01202B2L,5L,(-3L),5L,(-3L),0x33D3B688L},{0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L},{(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL},{(-3L),0x33D3B688L,0x189E11A8L,0x33D3B688L,(-3L),5L,(-3L),0x33D3B688L},{0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L},{(-3L),0xB69E8CCFL,0xA01202B2L,0x33D3B688L,0xA01202B2L,0xB69E8CCFL,(-3L),0xB69E8CCFL},{(-3L),0x33D3B688L,0x189E11A8L,0x33D3B688L,(-3L),5L,(-3L),0x33D3B688L}}}; + int32_t l_2104 = 3L; + uint16_t **l_2111 = &g_2110; + int64_t *l_2115 = &g_1399[2][0][3]; + const int16_t l_2123[10] = {(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}; + const uint64_t **l_2168[4]; + uint32_t ****l_2184 = (void*)0; + int64_t l_2198[1]; + int8_t l_2208 = 5L; + uint32_t l_2232 = 18446744073709551612UL; + uint32_t l_2239 = 4294967289UL; + uint64_t l_2304 = 0UL; + int8_t l_2308[10] = {0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL,0xFFL}; + int i, j, k; + for (i = 0; i < 2; i++) + l_1967[i] = 1L; + for (i = 0; i < 4; i++) + l_1977[i] = 0x3AL; + for (i = 0; i < 4; i++) + l_2168[i] = &g_318; + for (i = 0; i < 1; i++) + l_2198[i] = (-10L); + if (g_2) + { /* block id: 1 */ + union U2 **l_1971 = &g_222; + int32_t *l_1972 = &g_111[1][3]; + int64_t *l_1981[4]; + int16_t *l_1996 = &g_507; + uint16_t l_1997 = 4UL; + uint16_t *l_1998 = &g_1743; + uint64_t l_2000 = 1UL; + int i; + for (i = 0; i < 4; i++) + l_1981[i] = &g_1399[1][0][0]; + (*l_1971) = func_3(((*g_1459) = func_6((g_9 = (void*)0), g_10[9].f1)), l_1967[0]); + l_1972 = l_1972; + l_1983 = ((((*g_1459) , (!l_1967[1])) && ((safe_mod_func_uint8_t_u_u((l_1977[1] != (l_1982 = (g_149 = (0x8EL >= ((((safe_sub_func_int32_t_s_s((l_1977[1] < (*l_1972)), ((l_1980 , &g_1075) == &g_1075))) || (*l_1972)) , (*l_1972)) , (**g_930)))))), l_1980)) != l_1967[1])) >= g_111[1][3]); + l_2000 |= (((safe_mod_func_uint8_t_u_u((((*l_1998) = (~((((**g_911) = (safe_sub_func_int64_t_s_s((((safe_lshift_func_uint16_t_u_s(0xCB04L, ((*l_1996) |= (3L >= (safe_unary_minus_func_int8_t_s((0L == (((safe_unary_minus_func_uint64_t_u((g_229[0][0][3].f0 & 0x70L))) <= ((safe_mul_func_int8_t_s_s((l_1980 , g_1582), (((*l_1972) | ((*l_1972) <= g_223.f4)) || 4UL))) >= (*g_318))) , (*l_1972))))))))) , l_1967[0]) , g_428[0][0][2].f0), l_1997))) < (*l_1972)) , (*l_1972)))) && (*l_1972)), l_1977[1])) || (*l_1972)) , l_1999); + } + else + { /* block id: 890 */ + int8_t l_2010 = 0L; + int32_t l_2018[9][4][7] = {{{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L}},{{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L}},{{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L}},{{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L},{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0L,0L,1L,0L,0L,1L,0L},{0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L}},{{0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L}},{{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L}},{{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L}},{{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L}},{{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L},{0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L},{1L,0xBD0DEF51L,1L,1L,0xBD0DEF51L,1L,1L},{0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L,0xBD0DEF51L,0L,0xBD0DEF51L}}}; + uint8_t l_2026 = 0xC8L; + int8_t l_2029[9] = {0L,0L,0L,0L,0L,0L,0L,0L,0L}; + const int16_t l_2061 = 0x8AA0L; + uint32_t *l_2063 = &g_10[9].f2; + uint64_t l_2065 = 7UL; + int64_t l_2067 = 1L; + uint32_t l_2070 = 18446744073709551615UL; + uint16_t *l_2076[4] = {(void*)0,(void*)0,(void*)0,(void*)0}; + uint16_t **l_2075 = &l_2076[0]; + uint16_t ***l_2074[9][8] = {{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075},{&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075,&l_2075}}; + union U0 l_2096[7] = {{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L},{0x5C67L}}; + uint16_t l_2107 = 65534UL; + union U2 *l_2156 = &g_10[9]; + uint64_t *l_2166 = (void*)0; + uint64_t **l_2165 = &l_2166; + const uint32_t l_2171 = 8UL; + union U1 l_2190 = {0xC236650BL}; + union U1 **l_2204 = &g_1459; + union U1 **l_2205 = &g_1459; + uint64_t l_2215 = 0x96E9BBDEA25EDF34LL; + int16_t l_2227[5][9][5] = {{{0x0EB5L,0x1960L,0x1960L,0x0EB5L,0x6030L},{0xDD4AL,(-1L),7L,7L,0x1FD4L},{0x1960L,(-1L),0xCA87L,1L,0xCA87L},{0xE2CEL,0xE2CEL,0x1FD4L,7L,7L},{0x735EL,0x2B2BL,0x6030L,0x0EB5L,0x1960L},{(-9L),0x1FD4L,1L,0x1FD4L,(-9L)},{2L,0x2B2BL,1L,0x248EL,1L},{7L,0xE2CEL,1L,(-1L),(-1L)},{0x248EL,(-1L),0x248EL,0x2B2BL,1L}},{{1L,(-1L),0xE2CEL,0L,(-9L)},{1L,0x1960L,(-1L),(-1L),0x1960L},{1L,0x8BCEL,0xE2CEL,(-9L),7L},{(-1L),7L,0x248EL,0x6030L,0xCA87L},{(-5L),1L,1L,(-5L),0x1FD4L},{(-1L),(-1L),1L,2L,0x6030L},{1L,0xDD4AL,1L,0xE2CEL,1L},{1L,1L,0x6030L,2L,1L},{1L,0L,0x1FD4L,(-5L),1L}},{{0x248EL,0x6030L,0xCA87L,0x6030L,0x248EL},{7L,0L,7L,(-9L),0xE2CEL},{2L,1L,0x1960L,(-1L),(-1L)},{(-9L),0xDD4AL,(-9L),0L,0xE2CEL},{0x735EL,(-1L),1L,0x2B2BL,0x248EL},{0xE2CEL,1L,(-1L),(-1L),1L},{0x1960L,7L,1L,0x248EL,1L},{0xDD4AL,0x8BCEL,(-9L),0x1FD4L,1L},{0x0EB5L,0x1960L,0x1960L,0x0EB5L,0x6030L}},{{0xDD4AL,(-1L),7L,7L,0x1FD4L},{0x1960L,(-1L),0xCA87L,1L,0xCA87L},{0xE2CEL,0xE2CEL,0x1FD4L,7L,7L},{0x735EL,0x2B2BL,0x6030L,0x0EB5L,0x1960L},{(-9L),0xDD4AL,1L,0xDD4AL,(-1L)},{0x2B2BL,7L,0xCA87L,(-1L),0x6030L},{0L,0x1FD4L,(-5L),1L,1L},{(-1L),2L,(-1L),7L,0x6030L},{(-9L),1L,0x1FD4L,0x8BCEL,(-1L)}},{{0x6030L,0x0EB5L,0x1960L,0x1960L,0x0EB5L},{(-5L),7L,0x1FD4L,(-1L),1L},{2L,1L,(-1L),(-1L),0x735EL},{0xE2CEL,(-5L),(-5L),0xE2CEL,0xDD4AL},{2L,0x1960L,0xCA87L,0x2B2BL,(-1L)},{(-5L),7L,1L,0x1FD4L,1L},{0x6030L,0x6030L,(-1L),0x2B2BL,0xCA87L},{(-9L),0x8BCEL,0xDD4AL,0xE2CEL,(-5L)},{(-1L),(-1L),0x735EL,(-1L),(-1L)}}}; + int16_t l_2229 = 0xCCBFL; + int16_t l_2238[10][5][5] = {{{0x26A1L,0x93F8L,0xCE93L,9L,0xB42DL},{0L,1L,0x34A3L,0L,0L},{9L,(-1L),9L,0x93F8L,0xB42DL},{(-1L),0L,1L,0x5701L,1L},{0xB42DL,0L,0xA442L,0xA442L,0L}},{{0x34A3L,(-1L),1L,1L,(-1L)},{(-1L),(-9L),9L,1L,(-9L)},{0x1869L,0x34A3L,0x34A3L,0x1869L,0x878EL},{(-1L),0xA442L,0xCE93L,0x26A1L,1L},{0x34A3L,0x0254L,0xEC99L,1L,0xEC99L}},{{0xB42DL,0xB42DL,1L,0x26A1L,0xCE93L},{(-1L),0x5701L,0x878EL,0x1869L,0x34A3L},{9L,1L,(-9L),1L,9L},{0L,0x5701L,(-1L),1L,1L},{0x26A1L,0xB42DL,0L,0xA442L,0xA442L}},{{1L,0x0254L,1L,0x5701L,1L},{0x1300L,0xA442L,0xB42DL,0x93F8L,9L},{1L,0x34A3L,0L,0L,0x34A3L},{0L,(-9L),0xB42DL,9L,0xCE93L},{0x0254L,(-1L),1L,0x878EL,0xEC99L}},{{7L,0L,0L,7L,1L},{0x0254L,0L,(-1L),0L,0x878EL},{0L,(-1L),(-9L),0xB42DL,(-9L)},{1L,1L,0x878EL,0L,(-1L)},{0x1300L,0x93F8L,(-1L),0xB42DL,7L}},{{0L,0x0254L,(-1L),0x0254L,0L},{0x93F8L,(-9L),(-9L),0xA442L,1L},{0x5701L,0x878EL,0x1869L,0x34A3L,0x34A3L},{0xA442L,0x26A1L,0xA442L,(-9L),1L},{1L,0x34A3L,0x878EL,(-1L),0L}},{{1L,7L,0L,0L,7L},{0x1869L,(-1L),0x878EL,0L,0xEC99L},{0x26A1L,0xCE93L,0xA442L,(-1L),0x1300L},{1L,0x1869L,0x1869L,1L,0x0254L},{0x26A1L,0L,(-9L),0x93F8L,(-1L)}},{{0x1869L,0L,(-1L),0x878EL,(-1L)},{1L,1L,(-1L),0x93F8L,(-9L)},{1L,(-1L),0x0254L,1L,0x1869L},{0xA442L,(-1L),0x1300L,(-1L),0xA442L},{0x5701L,(-1L),0xEC99L,0L,0x878EL}},{{0x93F8L,1L,7L,0L,0L},{0L,0L,0L,(-1L),0x878EL},{9L,0L,1L,(-9L),0xA442L},{0x878EL,0x1869L,0x34A3L,0x34A3L,0x1869L},{7L,0xCE93L,1L,0xA442L,(-9L)}},{{0L,(-1L),0L,0x0254L,(-1L)},{0xB42DL,7L,7L,0xB42DL,(-1L)},{0L,0x34A3L,0xEC99L,0x5701L,0x0254L},{7L,0x26A1L,0x1300L,1L,0x1300L},{0x878EL,0x878EL,0x0254L,0x5701L,0xEC99L}}}; + uint32_t l_2271[9]; + uint64_t l_2305[10] = {0x2AFF29B5EB439595LL,0x31A843976A988D39LL,0x739F945BCAB457C2LL,0x739F945BCAB457C2LL,0x31A843976A988D39LL,0x2AFF29B5EB439595LL,0x31A843976A988D39LL,0x739F945BCAB457C2LL,0x739F945BCAB457C2LL,0x31A843976A988D39LL}; + int i, j, k; + for (i = 0; i < 9; i++) + l_2271[i] = 18446744073709551610UL; +lbl_2214: + for (g_1695 = 0; (g_1695 > (-5)); g_1695 = safe_sub_func_int64_t_s_s(g_1695, 1)) + { /* block id: 893 */ + int32_t *l_2003 = &l_1982; + int32_t *l_2004 = &g_89; + int32_t l_2005 = 0x4B4F5FC8L; + int32_t *l_2006 = &l_1983; + int32_t *l_2007 = &g_89; + int32_t *l_2008 = &g_1232; + int32_t *l_2009[3]; + uint64_t l_2015 = 8UL; + int32_t l_2019 = 8L; + int32_t l_2020 = 0x34E658EBL; + uint32_t l_2021 = 0UL; + uint16_t *l_2034 = &g_444; + uint16_t *l_2037 = &g_1743; + int32_t *l_2038 = &g_1007; + int32_t *l_2039 = &g_223.f0; + int i; + for (i = 0; i < 3; i++) + l_2009[i] = &g_1232; + l_2015++; + --l_2021; + (*l_2008) |= (safe_add_func_int64_t_s_s(((((l_2026 ^= 0x41L) & l_1977[2]) < ((*l_2003) && (l_2029[2] & (((safe_sub_func_int8_t_s_s((+(*l_2003)), ((safe_mul_func_uint16_t_u_u(((*l_2037) |= (++(*l_2034))), 0x45A3L)) < ((((*l_2039) = ((*l_2038) = g_92)) , (*l_2003)) ^ (l_1999 , g_1574[1].f1))))) , (void*)0) != (void*)0)))) <= 0x9A7C15D3L), l_1977[1])); + if (l_2018[3][2][5]) + continue; + } + if (((safe_div_func_uint16_t_u_u((255UL > (safe_lshift_func_int16_t_s_s((l_2029[2] ^ (((((safe_rshift_func_uint16_t_u_s((0x41132324FECFB523LL > ((safe_lshift_func_uint16_t_u_s((0L && ((((**g_819) , ((safe_add_func_int64_t_s_s(g_1198[5][5], (safe_mul_func_int8_t_s_s((((*l_2063) = (safe_add_func_int32_t_s_s((&g_1075 == l_2054), (safe_rshift_func_int16_t_s_s((safe_sub_func_uint8_t_u_u((!(safe_mod_func_int64_t_s_s((((*g_318) >= l_2018[3][2][5]) >= 4294967287UL), l_2061))), 0x8EL)), l_2062))))) , l_2064), 0x8CL)))) ^ l_2029[2])) >= l_1982) | l_2065)), l_1967[1])) , l_2066[0][1][6])), 8)) > l_2026) , l_1977[3]) >= (*g_1502)) , l_2067)), 15))), l_2010)) || l_2018[3][2][5])) + { /* block id: 905 */ + int32_t l_2068 = 3L; + int32_t *l_2069[9][7] = {{&l_2018[3][2][5],&l_2013,&l_2012,&l_2012,&l_2013,&l_2018[3][2][5],&l_2013},{&g_111[1][3],&l_1982,&l_2012,&g_1232,(void*)0,&g_1232,&l_2012},{&l_2013,&l_2013,&l_2018[3][2][5],&l_2012,&l_2018[3][2][5],&l_2013,&l_2013},{&l_1982,&l_1982,&l_2013,&l_1982,&l_1982,&g_1232,&l_2012},{&l_2018[5][2][3],&l_2013,&l_2018[5][2][3],&l_2018[3][2][5],&l_2018[3][2][5],&l_2018[5][2][3],&l_2013},{&l_2012,(void*)0,&l_2013,&l_2014,(void*)0,&l_1982,(void*)0},{&l_2018[5][2][3],&l_2018[3][2][5],&l_2018[3][2][5],&l_2018[5][2][3],&l_2013,&l_2018[5][2][3],&l_2018[3][2][5]},{&l_1982,&g_1232,&l_2012,(void*)0,&g_111[1][3],&l_1982,&l_2012},{&l_2018[3][2][5],&l_2018[5][2][3],&l_2013,&l_2018[5][2][3],&l_2018[3][2][5],&l_2018[3][2][5],&l_2018[5][2][3]}}; + int32_t l_2105 = 0L; + uint64_t l_2106 = 18446744073709551611UL; + uint16_t **l_2108 = &l_2076[0]; + int16_t *l_2134 = &g_75; + int64_t l_2172 = (-1L); + int16_t l_2221 = 1L; + int32_t l_2230 = (-10L); + int8_t l_2237 = 0x72L; + int32_t l_2286 = 1L; + int i, j; + l_2070 = l_2068; + if (l_2071) + { /* block id: 907 */ + uint16_t * const *l_2078[4][10][6] = {{{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[0],(void*)0,&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[1]},{&l_2076[0],(void*)0,&l_2076[0],&l_2076[0],(void*)0,&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[2],&l_2076[0],(void*)0,&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[1],(void*)0,&l_2076[3],&l_2076[0],(void*)0},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[3]},{&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[1],&l_2076[1],&l_2076[0],(void*)0,(void*)0}},{{&l_2076[1],&l_2076[1],(void*)0,&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[1],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[1],&l_2076[3]},{&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{(void*)0,&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3]},{&l_2076[3],(void*)0,&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[0],(void*)0,&l_2076[0],&l_2076[2],(void*)0},{&l_2076[3],&l_2076[0],&l_2076[1],(void*)0,(void*)0,&l_2076[0]},{&l_2076[3],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[3],&l_2076[3]},{&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0]}},{{&l_2076[1],&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[3],(void*)0},{&l_2076[3],&l_2076[0],(void*)0,&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[2],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0]},{&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],(void*)0,&l_2076[0]},{&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[2],&l_2076[0]},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[0],&l_2076[1]},{&l_2076[2],(void*)0,&l_2076[2],&l_2076[0],&l_2076[0],&l_2076[0]}},{{&l_2076[3],&l_2076[0],&l_2076[3],(void*)0,(void*)0,&l_2076[0]},{&l_2076[1],&l_2076[0],&l_2076[0],(void*)0,&l_2076[0],(void*)0},{&l_2076[3],&l_2076[0],&l_2076[0],(void*)0,&l_2076[3],&l_2076[0]},{&l_2076[3],&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[0]},{&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1]},{&l_2076[0],&l_2076[0],&l_2076[3],&l_2076[0],&l_2076[1],&l_2076[0]},{&l_2076[1],&l_2076[0],&l_2076[2],&l_2076[0],&l_2076[0],(void*)0},{&l_2076[0],&l_2076[0],&l_2076[0],&l_2076[1],&l_2076[1],&l_2076[0]},{&l_2076[0],&l_2076[0],(void*)0,&l_2076[2],(void*)0,&l_2076[0]},{(void*)0,&l_2076[3],&l_2076[1],&l_2076[0],(void*)0,(void*)0}}}; + uint16_t * const **l_2077[9]; + union U1 l_2097 = {4294967287UL}; + int64_t *l_2098[5][10] = {{&l_1967[0],&g_1399[2][0][3],(void*)0,&l_2071,(void*)0,&g_1399[2][0][3],&l_1967[0],&l_1967[0],&g_1399[2][0][3],(void*)0},{&g_1399[2][0][3],&l_1967[0],&l_1967[0],&g_1399[2][0][3],(void*)0,&l_2071,(void*)0,&g_1399[2][0][3],&l_1967[0],&l_1967[0]},{(void*)0,&l_1967[0],&l_1967[0],&l_2071,&l_2071,&l_1967[0],&l_1967[0],(void*)0,&l_1967[0],&l_1967[0]},{&l_2071,&g_1399[2][0][3],&l_2071,&g_1399[2][0][3],&l_2071,&l_1967[0],&l_1967[0],&l_2071,&g_1399[2][0][3],&l_2071},{(void*)0,(void*)0,&l_2071,&l_2071,&g_1399[2][0][3],&l_2071,&l_2071,(void*)0,(void*)0,&l_2071}}; + int16_t *l_2100 = &g_75; + int16_t *l_2101 = (void*)0; + int16_t *l_2102 = (void*)0; + int16_t *l_2103[4][8] = {{(void*)0,&g_507,&g_507,&g_507,&g_507,&g_507,&g_507,&g_507},{&g_507,&g_507,&g_507,&g_507,(void*)0,(void*)0,&g_507,&g_507},{&g_507,&g_507,&g_507,&g_507,&g_507,&g_507,&g_507,(void*)0},{&g_507,&g_507,&g_507,(void*)0,(void*)0,(void*)0,(void*)0,&g_507}}; + int64_t **l_2112 = &l_2098[4][0]; + int64_t **l_2113 = (void*)0; + int64_t *l_2114 = &l_2071; + int16_t l_2133 = 0x534CL; + int i, j, k; + for (i = 0; i < 9; i++) + l_2077[i] = &l_2078[3][8][1]; + l_2097.f1 = ((safe_sub_func_uint8_t_u_u((((*g_225) , (((void*)0 == &g_319) | ((l_2104 &= (((g_93 && 254UL) , ((l_2074[2][7] == (g_2079[3][8] = l_2077[8])) != (~l_2018[2][1][2]))) , ((*l_2100) = (((safe_mod_func_int32_t_s_s(((safe_mul_func_uint8_t_u_u((((safe_rshift_func_int8_t_s_u(((safe_mul_func_uint8_t_u_u(((l_2018[3][2][5] = ((safe_lshift_func_uint16_t_u_s((safe_sub_func_uint16_t_u_u((safe_sub_func_uint64_t_u_u(((l_2096[3] , l_2097) , l_2097.f0), 1L)), l_2097.f1)), 12)) <= 0x6B0AE9BDFA119AC2LL)) && 0xE2F6AABA98EB6A18LL), g_1198[8][5])) , l_2097.f0), 3)) > l_2097.f0) , 255UL), 0xAAL)) < l_2099[0][4][2]), l_2061)) == l_2026) ^ 0xABAFL)))) , (**g_930)))) > l_2097.f1), l_2105)) == l_2106); + l_2014 = (l_2018[3][2][5] = (l_2099[0][4][2] != (l_2107 , (((g_2109 = l_2108) != l_2111) < ((**g_930) = (4UL <= ((((*l_2112) = l_2098[1][5]) == (l_2115 = (l_2114 = &g_1399[0][0][0]))) != ((g_2120 = (safe_sub_func_int64_t_s_s(l_2065, (safe_div_func_uint16_t_u_u(l_2065, l_2067))))) == l_2097.f1)))))))); + l_1982 ^= (safe_lshift_func_uint16_t_u_u(l_2123[6], 14)); + if ((safe_lshift_func_uint16_t_u_u((--(*g_2110)), l_2070))) + { /* block id: 923 */ + int8_t l_2130 = 0xA8L; + int16_t **l_2135 = &l_2100; + int32_t l_2138 = 0x0DE8473CL; + l_2138 ^= ((safe_sub_func_uint64_t_u_u(((l_2130 | (safe_lshift_func_int8_t_s_s(g_706, 1))) >= (l_2133 == (((*l_2135) = l_2134) == &g_75))), (safe_sub_func_int16_t_s_s(1L, 0x844EL)))) && l_2018[4][2][3]); + } + else + { /* block id: 926 */ + for (l_2013 = 0; (l_2013 <= 9); l_2013 += 1) + { /* block id: 929 */ + return g_223.f4; + } + for (l_2014 = 25; (l_2014 == (-20)); l_2014 = safe_sub_func_int32_t_s_s(l_2014, 4)) + { /* block id: 934 */ + uint32_t l_2143 = 4294967289UL; + l_2143 = ((safe_sub_func_uint32_t_u_u((*g_1502), (l_2070 | l_2097.f1))) < l_2010); + } + l_2097.f1 = 0L; + } + } + else + { /* block id: 939 */ + int8_t *l_2149 = (void*)0; + int8_t *l_2150 = &g_479; + int8_t *l_2151 = (void*)0; + int8_t *l_2152[4][9] = {{&g_226.f1,&g_231[2][3][1].f1,&g_226.f1,&g_231[2][3][1].f1,&g_226.f1,&g_231[2][3][1].f1,&g_226.f1,&g_231[2][3][1].f1,&g_226.f1},{&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1,&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1,&g_226.f1},{&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1,&g_231[2][3][1].f1},{&g_226.f1,&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1,&g_226.f1,&l_2029[4],&l_2029[4],&g_226.f1}}; + int32_t l_2153 = 0x98A48BC2L; + uint64_t ***l_2167 = &l_2165; + uint32_t ***l_2182 = &g_911; + uint32_t ****l_2181 = &l_2182; + uint8_t l_2199 = 0xADL; + int32_t l_2216 = 0xFB679376L; + int32_t l_2220 = 0xC71D761AL; + int32_t l_2223 = 0xB664C4E1L; + int32_t l_2228[10] = {7L,0L,5L,0L,7L,7L,0L,5L,0L,7L}; + int8_t l_2231[6][6][4] = {{{0L,0x8DL,0x8DL,0x98L},{0x62L,0x06L,1L,0x83L},{0x97L,0x99L,0x31L,0xBBL},{0L,1L,0x17L,0xBBL},{0x9FL,0x99L,0L,0x83L},{(-9L),0x06L,0xD0L,0x98L}},{{0x47L,4L,0x97L,(-9L)},{0x99L,8L,1L,0x8AL},{0x06L,0x17L,0x74L,0xABL},{0xFDL,0x83L,0x83L,7L},{4L,0x31L,0L,(-9L)},{1L,0x83L,1L,(-1L)}},{{(-1L),0L,(-1L),0x9FL},{0x8AL,0L,0x83L,(-6L)},{0x1BL,(-9L),0L,0L},{(-6L),0L,0L,0xD0L},{0x1BL,1L,0x83L,4L},{0x8AL,(-10L),(-1L),(-9L)}},{{(-1L),(-9L),1L,0xFDL},{1L,0x98L,0L,0x17L},{4L,0L,0x83L,0x62L},{0xFDL,8L,0x74L,1L},{0x06L,0x1BL,1L,1L},{0x99L,(-9L),0x97L,0x97L}},{{0x47L,0x47L,0xD0L,0L},{(-9L),(-1L),0L,0x06L},{0x9FL,0x97L,0x17L,0L},{0L,0x97L,0x31L,0x06L},{0x97L,(-1L),1L,0L},{0x62L,0x47L,4L,0x97L}},{{0x98L,(-9L),0x62L,1L},{0x17L,0x1BL,(-9L),1L},{7L,8L,0x9FL,0x62L},{(-1L),0L,1L,0x17L},{8L,0x98L,7L,0xFDL},{(-10L),(-9L),(-6L),(-9L)}}}; + int i, j, k; + l_2018[3][2][5] ^= (0x7276L <= ((void*)0 != g_2144)); + l_1982 = (safe_rshift_func_int8_t_s_u((l_2153 = ((*l_2150) = ((safe_mod_func_uint64_t_u_u((*g_318), 18446744073709551613UL)) != g_231[2][3][1].f1))), 0)); + if ((((g_9 = l_2156) == (void*)0) < ((((((g_319 , (((*g_2110) = (safe_div_func_int64_t_s_s(((g_444 , (((safe_rshift_func_uint8_t_u_u((*g_931), 3)) , ((safe_lshift_func_uint16_t_u_u(((((!g_319) >= ((((*l_2167) = l_2165) != l_2168[3]) < (safe_add_func_int32_t_s_s(0x4BE7EAE3L, 0xE2FB1C89L)))) | 18446744073709551615UL) , l_2153), l_2153)) == 0UL)) , l_2026)) > 0xD9F5L), g_1864[1][2][0]))) >= l_2171)) < g_319) , (-5L)) || l_2172) ^ 0x99E19607FCAEFB6CLL) != l_2065))) + { /* block id: 947 */ + for (g_375 = 0; (g_375 <= 0); g_375 += 1) + { /* block id: 950 */ + uint64_t l_2173 = 0x7E0A1EE474B83E5FLL; + --l_2173; + } + for (l_2070 = 0; (l_2070 <= 1); l_2070 += 1) + { /* block id: 955 */ + union U2 *l_2178 = &g_223; + uint32_t *****l_2183 = &l_2181; + int16_t *l_2187 = &g_507; + uint16_t **l_2188 = &l_2076[2]; + int32_t l_2189 = 0L; + union U2 **l_2191 = &g_9; + int i; + if (l_1967[l_2070]) + break; + l_2018[3][2][5] = ((**g_930) | 1UL); + } + for (l_2068 = 0; l_2068 < 8; l_2068 += 1) + { + for (g_375 = 0; g_375 < 5; g_375 += 1) + { + for (l_2012 = 0; l_2012 < 2; l_2012 += 1) + { + g_1948[l_2068][g_375][l_2012] = &l_1982; + } + } + } + } + else + { /* block id: 968 */ + int32_t *l_2200 = (void*)0; + int32_t l_2217 = 0x4FE96332L; + int32_t l_2218 = (-10L); + int32_t l_2219 = 0x079E3D68L; + int32_t l_2222[5]; + uint32_t l_2224 = 0x695369B6L; + int i; + for (i = 0; i < 5; i++) + l_2222[i] = 0x0EC35639L; + if (((safe_mod_func_uint8_t_u_u(l_1999, (safe_mul_func_uint8_t_u_u((*g_931), (safe_lshift_func_int16_t_s_s((-3L), 5)))))) , l_2198[0])) + { /* block id: 969 */ + return l_2199; + } + else + { /* block id: 971 */ + int32_t **l_2201 = &l_2200; + (*l_2201) = l_2200; + l_2208 ^= (((safe_lshift_func_int16_t_s_s(((*l_2134) &= ((l_2204 = &g_1459) == l_2205)), 11)) <= (l_2070 <= (safe_rshift_func_int16_t_s_u(0xCB44L, 15)))) , (~0xF110CC3CL)); + } + for (g_223.f2 = (-12); (g_223.f2 == 7); g_223.f2++) + { /* block id: 979 */ + int16_t l_2211 = 1L; + uint32_t * const **l_2213 = &g_2212; + l_2153 = l_2211; + l_2153 = (0x968C6B2DL & (((*l_2213) = g_2212) != (void*)0)); + if (g_627) + goto lbl_2214; + if (l_2215) + continue; + } + ++l_2224; + } + ++l_2232; + } + for (g_147 = 2; (g_147 != (-18)); g_147 = safe_sub_func_int16_t_s_s(g_147, 9)) + { /* block id: 992 */ + int32_t l_2249 = (-4L); + int32_t l_2267 = 0x9D46F976L; + int32_t l_2268[10] = {0x5F78B802L,0L,0L,0L,0L,0x5F78B802L,0L,0L,0L,0L}; + int i; + --l_2239; + } + } + else + { /* block id: 1030 */ + const int32_t l_2313[7][8][4] = {{{0L,0xC17774FEL,0x22684D08L,(-1L)},{(-5L),0xCB537E5CL,0xCF8749F9L,0x5B8E73CDL},{0x24574F0DL,0x0B1950AEL,0x37612EECL,0x5B8E73CDL},{0xD050476FL,0xCB537E5CL,0x549F2490L,(-1L)},{8L,0xC17774FEL,4L,0xCB537E5CL},{(-1L),(-4L),0L,0x24574F0DL},{0x22684D08L,0x72EECBFFL,0x549F2490L,7L},{0x6AEDCBCAL,(-5L),1L,(-5L)}},{{0x24574F0DL,0x549F2490L,0xD050476FL,0xC17774FEL},{0x549F2490L,0x72EECBFFL,0x22684D08L,0x9AA1FD11L},{(-4L),0x6DDE5AC8L,0x5B8E73CDL,(-4L)},{(-4L),4L,1L,(-1L)},{0xD168EDB2L,(-4L),1L,5L},{7L,(-1L),0xC17774FEL,0x549F2490L},{0x22684D08L,0x2E56501BL,0xD168EDB2L,(-1L)},{1L,0L,0x2E56501BL,0x2E56501BL}},{{0x6DDE5AC8L,0x6DDE5AC8L,(-1L),7L},{0x37612EECL,0xCF8749F9L,0xD168EDB2L,0L},{1L,0x0B1950AEL,0x9AA1FD11L,0xD168EDB2L},{7L,0x0B1950AEL,8L,0L},{0x0B1950AEL,0xCF8749F9L,1L,7L},{0x2E56501BL,0x6DDE5AC8L,(-1L),0x2E56501BL},{(-4L),0L,0x24574F0DL,(-1L)},{0x0B1950AEL,0x2E56501BL,1L,0x549F2490L}},{{0x9AA1FD11L,(-1L),0x9AA1FD11L,5L},{0x22684D08L,(-4L),0L,(-1L)},{0x37612EECL,4L,0x2E56501BL,(-4L)},{(-1L),0x6DDE5AC8L,0x2E56501BL,0x9AA1FD11L},{0x37612EECL,0xD050476FL,0L,0L},{0x22684D08L,0xD168EDB2L,0x9AA1FD11L,0x0B1950AEL},{0x9AA1FD11L,0x0B1950AEL,1L,4L},{0x0B1950AEL,0xD050476FL,0x24574F0DL,7L}},{{(-4L),(-1L),(-1L),(-4L)},{0x2E56501BL,0L,1L,(-8L)},{0x0B1950AEL,(-4L),8L,0x549F2490L},{7L,0x247ABAC3L,0x9AA1FD11L,0x549F2490L},{1L,(-4L),0xD168EDB2L,(-8L)},{0x37612EECL,0L,(-1L),(-4L)},{0x6DDE5AC8L,(-1L),0x2E56501BL,7L},{1L,0xD050476FL,0xD168EDB2L,4L}},{{0x22684D08L,0x0B1950AEL,0xC17774FEL,0x0B1950AEL},{7L,0xD168EDB2L,1L,0L},{0xD168EDB2L,0xD050476FL,1L,0x9AA1FD11L},{(-4L),0x6DDE5AC8L,0x5B8E73CDL,(-4L)},{(-4L),4L,1L,(-1L)},{0xD168EDB2L,(-4L),1L,5L},{7L,(-1L),0xC17774FEL,0x549F2490L},{0x22684D08L,0x2E56501BL,0xD168EDB2L,(-1L)}},{{1L,0L,0x2E56501BL,0x2E56501BL},{0x6DDE5AC8L,0x6DDE5AC8L,(-1L),7L},{0x37612EECL,0xCF8749F9L,0xD168EDB2L,0L},{1L,0x0B1950AEL,0x9AA1FD11L,0xD168EDB2L},{7L,0x0B1950AEL,8L,0L},{0x0B1950AEL,0xCF8749F9L,1L,7L},{0x2E56501BL,0x6DDE5AC8L,(-1L),0x2E56501BL},{(-4L),0L,0x24574F0DL,(-1L)}}}; + union U1 ***l_2318 = &g_2317[2]; + uint8_t *l_2319 = &l_2026; + uint32_t l_2320 = 18446744073709551615UL; + int i, j, k; + if (((safe_div_func_int8_t_s_s((&g_149 != (void*)0), ((((((safe_add_func_uint64_t_u_u((l_2313[5][1][3] , ((((l_2305[3] >= ((*g_318) ^ (safe_rshift_func_uint16_t_u_u((g_2316 != l_2318), 6)))) < l_2313[5][1][3]) , l_2319) == &l_1977[3])), 0x27D3C5AEB2740B3BLL)) & 0L) <= l_2313[5][1][3]) > l_2313[5][1][3]) & l_2320) | (*g_318)))) , l_2313[5][1][3])) + { /* block id: 1031 */ + int32_t *l_2321 = &l_2012; + if (l_2010) + goto lbl_2214; + (*l_2321) |= 0x8BD5E6EBL; + (*l_2321) &= 0x7E3A8021L; + } + else + { /* block id: 1035 */ + int32_t *l_2323[1][1][10] = {{{&l_2012,(void*)0,(void*)0,&l_2012,(void*)0,(void*)0,(void*)0,&g_111[6][3],&g_111[6][3],(void*)0}}}; + int32_t **l_2322 = &l_2323[0][0][1]; + int i, j, k; + (*l_2322) = &l_2018[5][0][0]; + return g_101; + } + return g_93; + } + } + return g_1232; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static union U2 * const func_3(union U1 p_4, int16_t p_5) +{ /* block id: 878 */ + int32_t *l_1968[4][3][10] = {{{&g_89,&g_111[3][5],&g_111[7][8],&g_111[3][5],&g_89,&g_92,(void*)0,(void*)0,&g_111[1][5],&g_111[1][3]},{&g_111[3][5],&g_89,&g_92,(void*)0,&g_111[1][3],&g_89,&g_111[0][6],(void*)0,&g_92,&g_111[1][3]},{&g_111[1][3],(void*)0,&g_111[7][7],&g_92,&g_89,&g_111[7][8],&g_89,&g_89,&g_111[7][8],&g_89}},{{(void*)0,(void*)0,(void*)0,(void*)0,&g_92,&g_111[0][6],&g_1232,&g_89,(void*)0,&g_111[3][5]},{&g_111[1][3],&g_111[1][3],&g_111[3][5],&g_1232,&g_89,(void*)0,(void*)0,&g_1232,(void*)0,&g_111[1][3]},{(void*)0,&g_92,&g_111[1][3],(void*)0,&g_111[7][8],&g_92,(void*)0,&g_92,&g_111[7][8],(void*)0}},{{&g_111[1][5],&g_89,&g_111[1][5],&g_92,&g_111[0][6],(void*)0,&g_111[1][3],&g_1232,&g_92,&g_111[1][3]},{&g_1232,&g_89,&g_111[0][6],(void*)0,(void*)0,&g_111[1][3],&g_92,&g_1232,&g_111[1][5],(void*)0},{(void*)0,&g_111[0][6],&g_111[1][5],&g_111[3][5],&g_92,&g_1232,&g_1232,&g_92,&g_111[3][5],&g_111[1][5]}},{{&g_92,&g_92,&g_111[1][3],(void*)0,(void*)0,&g_111[3][5],&g_111[1][3],&g_1232,&g_89,&g_1232},{&g_89,&g_111[7][7],&g_111[3][5],&g_111[0][6],&g_111[1][3],&g_111[1][3],&g_111[1][3],&g_89,(void*)0,(void*)0},{&g_111[6][8],&g_92,(void*)0,&g_89,&g_1232,&g_1232,&g_1232,&g_89,(void*)0,&g_92}}}; + int32_t **l_1969 = &l_1968[1][0][7]; + union U2 * const l_1970 = &g_223; + int i, j, k; + (*l_1969) = l_1968[3][2][3]; + return l_1970; +} + + +/* ------------------------------------------ */ +/* + * reads : g_2 g_53 g_54 g_231.f1 g_223.f4 g_318 g_319 g_10 g_706 g_428 g_92 g_444 g_10.f4 g_89 g_111 g_149 g_93 g_225 g_226 g_223.f0 g_428.f0 g_223.f3 g_930 g_931 g_627 g_912 g_911 g_1007 g_226.f2 g_244 g_245 g_1074 g_147 g_101 g_375 g_1198 g_604 g_814.f0 g_229 g_222 g_223 g_75 g_814.f1 g_902 g_223.f1 g_1232 g_9 g_255.f0 g_1502 g_1574 g_479 g_1695 + * writes: g_9 g_49 g_2 g_53 g_706 g_444 g_93 g_245 g_223.f0 g_149 g_111 g_223.f3 g_75 g_226.f2 g_89 g_507 g_479 g_147 g_1198 g_54 g_1399 g_231.f1 g_1502 g_931 g_92 g_1232 g_375 g_10.f3 + */ +static union U1 func_6(union U2 * p_7, const int64_t p_8) +{ /* block id: 3 */ + int16_t l_13[5][4][3] = {{{0xF903L,1L,0xF6B3L},{0x35D5L,0L,(-1L)},{(-1L),(-1L),0x6B5BL},{1L,(-1L),0xD9DCL}},{{0L,0L,(-1L)},{0xAF87L,1L,8L},{(-1L),0L,(-1L)},{0x713EL,0xD9DCL,0xD9DCL}},{{(-1L),0xF903L,0x6B5BL},{(-1L),0x6B5BL,(-1L)},{0x713EL,1L,0xF6B3L},{(-1L),0xAF87L,1L}},{{0xAF87L,1L,0x35D5L},{0L,0x6B5BL,0L},{1L,0xF903L,0L},{(-1L),0xD9DCL,0x35D5L}},{{0x35D5L,0L,1L},{0xF903L,1L,0xF6B3L},{0x35D5L,0L,(-1L)},{(-1L),(-1L),0x6B5BL}}}; + union U2 *l_19 = &g_10[0]; + union U2 **l_39 = &g_9; + union U1 l_44 = {0UL}; + union U1 *l_45 = &l_44; + int64_t *l_48 = &g_49; + uint8_t *l_50 = &g_2; + uint8_t *l_51 = (void*)0; + uint8_t *l_52 = &g_53[1]; + union U0 l_675[7][2] = {{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}},{{1L},{1L}}}; + union U1 l_1377 = {1UL}; + uint16_t ***l_1529 = (void*)0; + uint16_t **** const l_1528[1] = {&l_1529}; + int32_t *l_1542 = (void*)0; + int32_t *l_1550 = &g_1232; + int8_t *l_1555[8]; + uint64_t *l_1556 = &g_10[9].f3; + uint64_t *l_1557[3]; + int16_t ** const l_1561 = &g_136[1][4]; + int32_t l_1672 = 0xE1877820L; + int32_t l_1673 = 5L; + int16_t l_1674 = 0xF8F5L; + int32_t l_1675 = (-10L); + int32_t l_1676 = 0xEAAD7C91L; + int32_t l_1677[7][2] = {{0L,0L},{0L,0L},{0L,7L},{0L,0L},{0L,0L},{0L,0L},{7L,0L}}; + int8_t l_1691[1]; + int32_t l_1694 = 1L; + int32_t l_1697 = (-9L); + int16_t l_1698 = (-1L); + uint32_t l_1699 = 0xEC9D5EB3L; + uint8_t l_1731 = 6UL; + union U2 l_1738 = {1L}; + uint32_t ***l_1778 = &g_911; + union U1 **l_1828 = &l_45; + union U1 ***l_1827 = &l_1828; + uint32_t l_1855 = 9UL; + const uint64_t *l_1863 = &g_1864[1][0][1]; + union U2 ***l_1904 = &g_54; + union U2 ****l_1903 = &l_1904; + int32_t l_1911[2][6][2] = {{{0x3EBE484EL,0x9E187370L},{3L,0x9E187370L},{0x3EBE484EL,3L},{1L,1L},{1L,3L},{0x3EBE484EL,0x9E187370L}},{{3L,0x9E187370L},{0x3EBE484EL,3L},{1L,1L},{1L,3L},{0x3EBE484EL,0x9E187370L},{3L,0x9E187370L}}}; + union U0 l_1940 = {0xFC0AL}; + uint64_t l_1951 = 18446744073709551613UL; + int i, j, k; + for (i = 0; i < 8; i++) + l_1555[i] = &g_229[0][0][3].f1; + for (i = 0; i < 3; i++) + l_1557[i] = &g_223.f3; + for (i = 0; i < 1; i++) + l_1691[i] = (-2L); + if ((safe_mul_func_uint8_t_u_u(0x1AL, (l_13[1][0][1] & (safe_div_func_uint64_t_u_u(func_16((g_2 , (l_13[3][2][0] <= (l_19 == (func_20(((safe_mul_func_int16_t_s_s(((safe_mod_func_int8_t_s_s(func_26((func_33(((*l_39) = &g_10[9]), func_40((((*l_52) &= ((*l_50) = (!((((l_13[1][0][1] >= (((*l_45) = l_44) , ((safe_mod_func_int64_t_s_s(((*l_48) = (&g_10[1] == l_19)), p_8)) && l_13[1][0][2]))) , l_13[2][2][1]) ^ 0x68L) > l_13[3][0][2])))) , (void*)0), g_54, p_7), l_675[6][1], l_13[3][0][2], l_19) <= 0UL), g_223.f4, (*g_318), (*l_19)), p_8)) <= p_8), 0x6D7BL)) , p_7)) , (void*)0)))), l_1377), 0xC3FDE676F061A725LL)))))) + { /* block id: 645 */ + int16_t l_1486 = 0x7754L; + uint8_t **l_1493 = &g_931; + uint32_t *l_1500 = &l_1377.f0; + uint32_t **l_1501[7][5][6] = {{{&l_1500,&g_912,&l_1500,&l_1500,(void*)0,(void*)0},{(void*)0,&g_912,&g_912,&l_1500,&l_1500,&g_912},{&l_1500,&l_1500,&l_1500,&l_1500,&l_1500,(void*)0},{&l_1500,(void*)0,(void*)0,&g_912,(void*)0,&l_1500},{&l_1500,&l_1500,(void*)0,&g_912,&l_1500,(void*)0}},{{&l_1500,&g_912,&l_1500,(void*)0,&l_1500,&g_912},{(void*)0,&l_1500,&g_912,&l_1500,&g_912,(void*)0},{&g_912,&l_1500,&l_1500,&l_1500,&l_1500,&l_1500},{&l_1500,&g_912,&g_912,&g_912,(void*)0,&l_1500},{&l_1500,&l_1500,&g_912,&g_912,(void*)0,(void*)0}},{{&l_1500,&l_1500,&l_1500,&g_912,(void*)0,&g_912},{(void*)0,&g_912,&l_1500,&g_912,&l_1500,&l_1500},{(void*)0,&l_1500,&l_1500,&g_912,&g_912,&g_912},{&g_912,&l_1500,&g_912,&g_912,&l_1500,&g_912},{&g_912,&g_912,&g_912,&g_912,&l_1500,&l_1500}},{{(void*)0,&l_1500,&l_1500,&g_912,(void*)0,&g_912},{(void*)0,(void*)0,&g_912,&g_912,&l_1500,&l_1500},{&g_912,&l_1500,&l_1500,&g_912,&l_1500,&g_912},{&g_912,&g_912,(void*)0,&g_912,(void*)0,&g_912},{(void*)0,&g_912,&g_912,&g_912,(void*)0,&g_912}},{{(void*)0,&g_912,&l_1500,&g_912,&l_1500,(void*)0},{&l_1500,&g_912,(void*)0,&g_912,&l_1500,(void*)0},{&l_1500,&g_912,&l_1500,&g_912,&l_1500,&g_912},{&l_1500,(void*)0,&g_912,&l_1500,&g_912,&g_912},{&g_912,&l_1500,&l_1500,&g_912,&l_1500,&l_1500}},{{(void*)0,&l_1500,&l_1500,(void*)0,(void*)0,&g_912},{&g_912,&g_912,&g_912,&l_1500,&g_912,&g_912},{&l_1500,&l_1500,&g_912,(void*)0,&g_912,&l_1500},{&l_1500,&g_912,&g_912,&g_912,(void*)0,&l_1500},{&l_1500,&l_1500,(void*)0,(void*)0,&l_1500,&l_1500}},{{&l_1500,&l_1500,(void*)0,&g_912,&l_1500,&g_912},{&l_1500,(void*)0,&l_1500,&g_912,(void*)0,&g_912},{&l_1500,&g_912,&l_1500,&g_912,&l_1500,&l_1500},{&g_912,&g_912,(void*)0,&g_912,&g_912,&g_912},{&l_1500,&g_912,(void*)0,&g_912,&l_1500,&l_1500}}}; + int i, j, k; + l_1486 &= ((void*)0 == &g_931); + l_1377.f1 ^= (l_44.f1 &= ((safe_lshift_func_int8_t_s_u((safe_lshift_func_uint16_t_u_u((safe_div_func_uint64_t_u_u(((void*)0 != l_1493), ((safe_add_func_int16_t_s_s((safe_rshift_func_uint8_t_u_u((safe_add_func_int32_t_s_s(0xFC0D237BL, (((*g_911) == (g_1502 = l_1500)) , (l_1486 == (((*g_902) , (((void*)0 != l_1500) < p_8)) , 0L))))), (**g_930))), l_1486)) , g_1007))), p_8)), (*g_931))) & p_8)); + } + else + { /* block id: 650 */ + int8_t l_1503 = (-1L); + int8_t *l_1530 = (void*)0; + int32_t *l_1531 = &g_92; + int32_t *l_1532 = &g_1232; + union U1 l_1537 = {0x0E8069F6L}; + (*l_1532) |= ((1L ^ l_1503) & ((safe_div_func_uint64_t_u_u((safe_div_func_int64_t_s_s(((l_1503 >= (-1L)) || (((((*l_1531) = ((((*g_930) = func_70(((safe_mod_func_uint32_t_u_u(p_8, (safe_rshift_func_int16_t_s_u(((l_44.f1 = (safe_mul_func_uint8_t_u_u((((*l_48) = ((safe_div_func_uint16_t_u_u((+0xA86AL), (safe_rshift_func_int16_t_s_s((safe_add_func_uint64_t_u_u((safe_div_func_int16_t_s_s(((safe_add_func_uint16_t_u_u((safe_mod_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u(((void*)0 != l_1528[0]), l_44.f0)), 1L)), l_1503)) >= l_675[6][1].f0), l_1377.f1)), g_223.f1)), l_1503)))) && 0xBAL)) , l_44.f0), 0x20L))) >= p_8), 7)))) <= 65531UL), p_8, l_52)) == (void*)0) || l_1503)) && 0x71B749F4L) < 7L) <= p_8)), 0x09F26AADB4610C8FLL)), p_8)) >= 4294967292UL)); + (*l_1531) = ((((safe_rshift_func_int16_t_s_u((((safe_mul_func_int8_t_s_s(((((((void*)0 == l_48) , ((l_1537 , (~1L)) != (safe_mul_func_uint16_t_u_u((p_8 <= ((safe_mod_func_int8_t_s_s(((void*)0 == l_1542), (((func_20((*l_39)) , (*g_318)) <= g_255.f0) | 0xDEL))) , 0x18L)), l_675[6][1].f0)))) >= p_8) < p_8) <= l_13[2][0][0]), l_675[6][1].f1)) >= 4L) < (*l_1531)), (*l_1531))) , (-1L)) & g_627) , 0x66A190CFL); + for (g_375 = 14; (g_375 == 5); g_375--) + { /* block id: 659 */ + union U1 l_1545 = {0x21DB83E7L}; + return l_1545; + } + } + (*l_1550) &= (safe_lshift_func_uint8_t_u_u((safe_rshift_func_uint8_t_u_u(((((((&g_1459 == (void*)0) && (*g_318)) , (*g_911)) == ((*l_45) , (*g_911))) <= 0xC39A113BL) == l_675[6][1].f1), 5)), 5)); + if (((p_8 > ((l_1377.f1 ^= ((g_444 = ((safe_mul_func_int8_t_s_s(p_8, ((*l_1550) = (p_8 ^ ((*l_1550) || ((8UL == (*l_1550)) | (((*l_45) , &g_479) == l_52))))))) && g_814.f1)) && p_8)) < 0xA9CC9107554708AALL)) <= l_675[6][1].f0)) + { /* block id: 667 */ + int32_t *l_1558 = (void*)0; + l_1558 = l_1542; + return (*g_902); + } + else + { /* block id: 670 */ + uint32_t *l_1566 = &g_375; + int32_t l_1569 = 0x08A23406L; + union U1 *l_1570 = &l_44; + uint32_t *l_1571 = (void*)0; + uint32_t *l_1572[8] = {&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2,&g_10[9].f2}; + int32_t l_1573 = 0xA3C5E453L; + uint16_t *l_1600 = (void*)0; + uint16_t *l_1601 = &g_245; + uint32_t l_1608 = 0x9F9F4AECL; + int32_t l_1632[6] = {0xD2B77DEEL,0xD2B77DEEL,0x2136032EL,0xD2B77DEEL,0xD2B77DEEL,0x2136032EL}; + int32_t ***l_1653 = (void*)0; + int32_t *l_1684 = &g_89; + int32_t l_1692 = (-1L); + int64_t l_1696 = 1L; + int16_t *l_1726 = &l_13[3][1][2]; + int8_t *l_1770[1]; + int8_t l_1819[9] = {0L,0L,0L,0L,0L,0L,0L,0L,0L}; + union U0 l_1929 = {0L}; + int32_t l_1950 = 0x0CB4EE2CL; + int i; + for (i = 0; i < 1; i++) + l_1770[i] = &l_1691[0]; + if (((((*l_1556) = ((((((*g_1502) = (safe_mul_func_int8_t_s_s(((l_1561 == &g_136[5][3]) && 0x9A21L), ((((*l_1550) |= (+((l_1569 = (safe_lshift_func_uint16_t_u_s((((safe_mod_func_uint32_t_u_u((l_1566 == (void*)0), p_8)) == (safe_sub_func_int16_t_s_s(l_1569, (1UL >= ((g_1198[6][4] , l_1570) == l_1570))))) > 0L), l_1569))) , 65535UL))) && 0x1566L) >= l_1573)))) > l_1573) & l_1573) | p_8) == (*g_931))) , 0L) > l_1573)) + { /* block id: 675 */ + return g_1574[1]; + } + else + { /* block id: 677 */ + union U1 **l_1595 = &g_1459; + int32_t l_1596 = 0x29729CF3L; + int32_t *l_1612 = &l_1596; + int8_t l_1655 = 0L; + int32_t l_1669 = 0x1660C04CL; + int32_t l_1670[8][7][3] = {{{0x3317BB98L,(-3L),0x534DB89AL},{0xF05BDE44L,0xD135A330L,0x4166F292L},{0x7DC4BDB8L,0x82C06C68L,0xC513462EL},{0x7DC4BDB8L,0xFDAF309DL,0x33BA3285L},{0xF05BDE44L,5L,0L},{0x3317BB98L,0xFDAF309DL,0x42993B24L},{0xD135A330L,0x82C06C68L,0x42993B24L}},{{0xE8018D86L,0xD135A330L,0L},{(-3L),(-3L),0x33BA3285L},{0xE8018D86L,0x3317BB98L,0xC513462EL},{0xD135A330L,0x3317BB98L,0x4166F292L},{0x3317BB98L,(-3L),0x534DB89AL},{0xF05BDE44L,0xD135A330L,0x4166F292L},{0x7DC4BDB8L,0x82C06C68L,0xC513462EL}},{{0x7DC4BDB8L,0xFDAF309DL,0x33BA3285L},{0xF05BDE44L,5L,0L},{0x3317BB98L,0xFDAF309DL,0x42993B24L},{0xD135A330L,0x82C06C68L,0x42993B24L},{0xE8018D86L,0xD135A330L,0L},{(-3L),(-3L),0x33BA3285L},{0xE8018D86L,0x3317BB98L,0xC513462EL}},{{0xD135A330L,0x3317BB98L,0x4166F292L},{0x3317BB98L,(-3L),0x534DB89AL},{0xF05BDE44L,0xD135A330L,0x4166F292L},{0x7DC4BDB8L,0x82C06C68L,0xC513462EL},{0x7DC4BDB8L,0xFDAF309DL,0x33BA3285L},{0xF05BDE44L,5L,0L},{0x3317BB98L,0xFDAF309DL,0x42993B24L}},{{0xD135A330L,0x82C06C68L,0x42993B24L},{0xE8018D86L,0xD135A330L,0L},{(-3L),(-3L),0x33BA3285L},{0xE8018D86L,0x3317BB98L,0xC513462EL},{0xD135A330L,0x3317BB98L,0x4166F292L},{0x3317BB98L,(-3L),0x534DB89AL},{1L,0x5984A900L,0x7DC4BDB8L}},{{(-1L),0xC4140F93L,5L},{(-1L),(-1L),(-3L)},{1L,0x3633256DL,0xFDAF309DL},{8L,(-1L),0xF05BDE44L},{0x5984A900L,0xC4140F93L,0xF05BDE44L},{0x2E44F393L,0x5984A900L,0xFDAF309DL},{0x1E79692DL,0x1E79692DL,(-3L)}},{{0x2E44F393L,8L,5L},{0x5984A900L,8L,0x7DC4BDB8L},{8L,0x1E79692DL,0x14C84822L},{1L,0x5984A900L,0x7DC4BDB8L},{(-1L),0xC4140F93L,5L},{(-1L),(-1L),(-3L)},{1L,0x3633256DL,0xFDAF309DL}},{{8L,(-1L),0xF05BDE44L},{0x5984A900L,0xC4140F93L,0xF05BDE44L},{0x2E44F393L,0x5984A900L,0xFDAF309DL},{0x1E79692DL,0x1E79692DL,(-3L)},{0x2E44F393L,8L,5L},{0x5984A900L,8L,0x7DC4BDB8L},{8L,0x1E79692DL,0x14C84822L}}}; + int8_t l_1671 = 1L; + const union U2 l_1683 = {-10L}; + int32_t l_1685[3]; + int32_t *l_1686 = &l_1676; + int32_t *l_1687 = &l_1669; + int32_t *l_1688 = &g_89; + int32_t *l_1689 = &l_1573; + int32_t *l_1690[5]; + const int16_t *l_1714 = &l_675[6][1].f0; + int i, j, k; + for (i = 0; i < 3; i++) + l_1685[i] = 9L; + for (i = 0; i < 5; i++) + l_1690[i] = &l_1632[2]; + for (g_706 = 2; (g_706 >= 0); g_706 -= 1) + { /* block id: 680 */ + uint16_t *l_1581 = &g_245; + uint16_t ** const l_1580 = &l_1581; + uint16_t ** const *l_1579 = &l_1580; + int32_t l_1597 = 9L; + union U1 *l_1599 = &l_44; + int32_t l_1611 = (-1L); + uint8_t * const *l_1646 = (void*)0; + uint32_t **l_1649 = &l_1566; + int32_t l_1667[8] = {2L,(-2L),2L,(-2L),2L,(-2L),2L,(-2L)}; + int i; + for (g_479 = 2; (g_479 >= 0); g_479 -= 1) + { /* block id: 683 */ + uint32_t l_1585 = 1UL; + union U1 ***l_1592 = (void*)0; + union U1 **l_1594[6][4][8] = {{{&g_1459,&g_1459,&g_1459,&g_1459,&g_1459,&g_1459,&l_1570,&l_45},{(void*)0,(void*)0,(void*)0,&l_45,&l_45,(void*)0,&g_1459,&l_45},{(void*)0,(void*)0,&l_45,&g_1459,&g_1459,&g_1459,&l_45,(void*)0},{&l_1570,&g_1459,&l_1570,&l_45,&l_1570,&l_45,&g_1459,&l_1570}},{{(void*)0,&l_1570,&g_1459,&l_1570,(void*)0,&l_1570,&g_1459,(void*)0},{&l_1570,&g_1459,&g_1459,&l_1570,&l_1570,&l_45,&l_1570,&l_1570},{(void*)0,&l_1570,(void*)0,&l_1570,&l_1570,&g_1459,(void*)0,&g_1459},{(void*)0,&l_1570,(void*)0,&l_45,(void*)0,(void*)0,(void*)0,&l_45}},{{&g_1459,&l_45,(void*)0,&l_1570,&l_45,(void*)0,&l_45,&g_1459},{(void*)0,&g_1459,&l_45,&l_45,&l_1570,&l_45,&l_45,&g_1459},{&g_1459,(void*)0,&g_1459,&l_45,&l_45,&l_45,(void*)0,&l_1570},{(void*)0,&l_45,&l_1570,(void*)0,&g_1459,(void*)0,(void*)0,&g_1459}},{{&l_1570,(void*)0,&g_1459,&l_45,(void*)0,&g_1459,&l_45,&l_1570},{(void*)0,&g_1459,&l_45,&l_1570,&g_1459,&g_1459,&l_45,&l_1570},{&l_45,&g_1459,(void*)0,(void*)0,&g_1459,&g_1459,&l_45,(void*)0},{&g_1459,&g_1459,&l_45,&g_1459,(void*)0,(void*)0,&l_1570,&l_1570}},{{&g_1459,&l_1570,&g_1459,&l_1570,&l_1570,&l_1570,(void*)0,&g_1459},{&g_1459,(void*)0,&l_45,&g_1459,&l_1570,(void*)0,(void*)0,&g_1459},{&l_45,&l_45,&l_45,&g_1459,&g_1459,&g_1459,&l_1570,&l_1570},{(void*)0,&l_1570,&l_45,&l_45,&l_1570,(void*)0,&g_1459,(void*)0}},{{&l_1570,(void*)0,&g_1459,(void*)0,&g_1459,(void*)0,&g_1459,&g_1459},{&l_45,&g_1459,&g_1459,(void*)0,&l_45,&g_1459,&l_45,(void*)0},{&l_1570,&l_45,(void*)0,&l_45,&l_45,(void*)0,&l_45,&l_1570},{&g_1459,&g_1459,(void*)0,&g_1459,&l_45,(void*)0,&g_1459,&g_1459}}}; + union U1 ***l_1593 = &l_1594[0][3][0]; + int32_t l_1598[6][6] = {{0x3EEF7D26L,0xA3191B49L,0x3EEF7D26L,1L,0xF4E79753L,0x3EEF7D26L},{(-5L),0xCF041577L,1L,0xE57F6CC9L,0xF4E79753L,(-5L)},{1L,0xA3191B49L,0xE57F6CC9L,0xE57F6CC9L,0xA3191B49L,1L},{(-5L),0xF4E79753L,0xE57F6CC9L,1L,0xCF041577L,(-5L)},{0x3EEF7D26L,0xF4E79753L,1L,0x3EEF7D26L,0xA3191B49L,0x3EEF7D26L},{0x3EEF7D26L,0xA3191B49L,0x3EEF7D26L,1L,0xF4E79753L,0x3EEF7D26L}}; + union U0 ***l_1604 = (void*)0; + union U0 ***l_1605 = &g_815; + int16_t *l_1609[8][9][2] = {{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}},{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}},{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}},{{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0}},{{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0},{&g_75,(void*)0},{&l_13[1][0][1],(void*)0}}}; + int32_t l_1610 = 0L; + int i, j, k; + } + for (g_75 = 2; (g_75 >= 0); g_75 -= 1) + { /* block id: 732 */ + int8_t l_1654 = 0L; + int32_t l_1668[5]; + uint64_t l_1678[9]; + int i; + for (i = 0; i < 5; i++) + l_1668[i] = 1L; + for (i = 0; i < 9; i++) + l_1678[i] = 18446744073709551615UL; + } + } + l_1550 = l_1684; + --l_1699; + (*l_1688) = (safe_div_func_int16_t_s_s((((g_444 = ((*l_1684) <= (*g_244))) >= (safe_mod_func_uint64_t_u_u((safe_mod_func_int32_t_s_s(((*l_1686) = (((g_1695 < ((safe_sub_func_uint8_t_u_u((safe_div_func_uint16_t_u_u(((safe_sub_func_uint16_t_u_u(((0x696A82E2L & ((((void*)0 != l_1714) , (safe_add_func_uint64_t_u_u((safe_unary_minus_func_uint8_t_u((safe_add_func_int16_t_s_s(0x5C2EL, (safe_add_func_uint32_t_u_u((safe_add_func_uint64_t_u_u(((void*)0 != &l_1608), p_8)), p_8)))))), g_319))) & (*l_1686))) <= 0x911E72491D7C01F5LL), 0x41B8L)) != p_8), 2UL)), g_75)) , (-6L))) , (*g_931)) != (*g_931))), 0xE8F5704DL)), p_8))) == 0xD20EL), (*g_244))); + } + l_1731 = ((0x5465FD2D39850ADCLL && ((p_8 | ((((safe_lshift_func_uint16_t_u_s(p_8, ((*l_1726) = (!((*l_1684) = p_8))))) , (p_8 == (l_1572[7] == ((safe_mul_func_int8_t_s_s(0x36L, (*l_1550))) , (((safe_sub_func_uint64_t_u_u(((g_10[9].f4 ^ (*g_318)) <= (*l_1550)), 18446744073709551615UL)) == p_8) , &g_1007))))) | p_8) > p_8)) != 0x0EL)) , (*l_1550)); + for (l_1608 = 0; (l_1608 != 16); ++l_1608) + { /* block id: 763 */ + int16_t l_1741 = 0x6876L; + uint16_t *l_1742 = &g_1743; + int32_t * const *l_1745[4] = {&l_1550,&l_1550,&l_1550,&l_1550}; + int32_t * const **l_1744 = &l_1745[2]; + uint32_t ***l_1752 = &g_911; + union U2 *l_1779 = &g_10[7]; + uint64_t l_1802 = 18446744073709551615UL; + uint8_t * const *l_1809 = &l_50; + uint32_t l_1820 = 0xA20A1AFDL; + uint16_t * const *l_1853 = &l_1601; + uint16_t * const **l_1852 = &l_1853; + uint16_t * const ***l_1851 = &l_1852; + int32_t l_1854[10][7][3] = {{{0xB2A1302FL,5L,7L},{(-1L),1L,(-1L)},{6L,(-1L),0x2617E67EL},{0x055AC6CEL,0x2617E67EL,0x055AC6CEL},{0L,0x9966CFEAL,0x7F53882FL},{0L,0x3BA83663L,0x2E0E4AE9L},{0xC3E47ADDL,1L,0x8BBFA625L}},{{0x2617E67EL,0x7F53882FL,(-1L)},{0xC3E47ADDL,1L,0x199D5833L},{0L,0x85A3A27FL,1L},{0L,7L,8L},{0x055AC6CEL,(-1L),8L},{6L,3L,0x8139E0D0L},{(-1L),8L,(-1L)}},{{0xB2A1302FL,(-1L),1L},{(-1L),0xC3F8B041L,0L},{(-1L),0xA1D8305EL,0x228FD4CBL},{(-1L),0xB386BFE8L,0xDE9C09DDL},{0xA1D8305EL,0L,(-1L)},{(-1L),0L,0x6259268EL},{0x9D15D649L,0xB386BFE8L,1L}},{{0x2E0E4AE9L,0xA1D8305EL,0xE9DBB44FL},{1L,0xC3F8B041L,(-6L)},{0x1EDDD83FL,(-1L),0xB386BFE8L},{0x8BBFA625L,8L,0L},{1L,3L,0x94D57003L},{0x0E07BC25L,(-1L),0x3BA83663L},{7L,7L,0x0E07BC25L}},{{3L,0x85A3A27FL,0xC3E47ADDL},{1L,1L,0xC9E9E146L},{(-1L),0x7F53882FL,(-6L)},{0L,1L,0xC9E9E146L},{(-1L),0x3BA83663L,0xC3E47ADDL},{0x8139E0D0L,0x9966CFEAL,0x0E07BC25L},{1L,0x2617E67EL,0x3BA83663L}},{{8L,(-1L),0x94D57003L},{0x378498A2L,1L,0L},{(-6L),5L,0xB386BFE8L},{0x86784362L,0xC9E9E146L,(-6L)},{0xA48CE08BL,0x86784362L,0xE9DBB44FL},{0xDE9C09DDL,0L,6L},{1L,0L,0xB386BFE8L}},{{(-2L),0x9D15D649L,0xC9E9E146L},{(-2L),0L,0L},{1L,0x2E0E4AE9L,0xA1D8305EL},{0L,0x3A4500ACL,0L},{(-1L),0x2DFA94E1L,8L},{0x8139E0D0L,8L,0xC3E47ADDL},{0x6259268EL,(-6L),(-1L)}},{{(-9L),0xA1D8305EL,(-1L)},{(-1L),0x9966CFEAL,0x9966CFEAL},{0x2DFA94E1L,0x7F53882FL,0x73C793C8L},{(-1L),(-1L),0x2E0E4AE9L},{0xC3F8B041L,1L,0x75B2328CL},{0xE9DBB44FL,6L,0L},{5L,1L,0x100E7AA8L}},{{(-1L),(-1L),0L},{(-1L),0x7F53882FL,3L},{0L,0x9966CFEAL,(-1L)},{0x8BBFA625L,0xA1D8305EL,0xC3F8B041L},{8L,(-6L),0L},{0L,8L,0x7F53882FL},{8L,0x2DFA94E1L,1L}},{{0x73C793C8L,0x3A4500ACL,0x640675F7L},{0x100E7AA8L,0x2E0E4AE9L,0x055AC6CEL},{1L,0L,(-1L)},{0xC3E47ADDL,0x9D15D649L,(-1L)},{0xB2A1302FL,0L,0x055AC6CEL},{0x75B2328CL,0L,0x640675F7L},{0L,0x8139E0D0L,1L}}}; + uint64_t l_1867 = 18446744073709551612UL; + union U1 l_1891 = {4294967291UL}; + union U2 ***l_1901 = &l_39; + union U2 ****l_1900[10][2] = {{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901},{&l_1901,&l_1901}}; + union U2 *****l_1902 = (void*)0; + int8_t l_1936 = (-1L); + uint32_t l_1937 = 0x8A6D3A2FL; + int i, j, k; + } + } + return (*g_902); +} + + +/* ------------------------------------------ */ +/* + * reads : g_444 g_223.f0 g_75 g_244 g_245 g_814.f1 g_318 g_319 g_53 g_89 g_149 g_92 + * writes: g_444 g_75 g_1399 g_231.f1 g_89 g_149 g_507 + */ +static const uint64_t func_16(uint64_t p_17, union U1 p_18) +{ /* block id: 592 */ + int8_t l_1386 = 0xEBL; + uint16_t *l_1389 = &g_444; + uint64_t l_1393 = 18446744073709551615UL; + uint32_t ***l_1394 = &g_911; + int16_t *l_1395 = &g_75; + uint16_t *l_1398[4][6] = {{&g_245,&g_245,(void*)0,(void*)0,&g_245,&g_245},{&g_245,&g_245,(void*)0,(void*)0,&g_245,(void*)0},{&g_245,&g_245,&g_245,(void*)0,&g_245,(void*)0},{&g_245,&g_245,(void*)0,(void*)0,&g_245,&g_245}}; + int32_t l_1400 = 0L; + int32_t l_1401 = 0xADEB96C4L; + uint16_t l_1405 = 0xFE0CL; + int32_t ***l_1409 = &g_251[3]; + union U0 l_1422 = {0x3EC3L}; + int64_t l_1423 = 0L; + int32_t l_1479[10] = {0x48A6F4D1L,7L,0x48A6F4D1L,0x48A6F4D1L,7L,0x48A6F4D1L,0x48A6F4D1L,7L,0x48A6F4D1L,0x48A6F4D1L}; + int i, j; + if ((safe_rshift_func_int16_t_s_s(p_18.f0, (safe_div_func_int16_t_s_s((safe_add_func_int16_t_s_s((l_1400 = ((safe_add_func_int32_t_s_s(((l_1386 ^ (((*l_1395) = (safe_div_func_uint16_t_u_u(((*l_1389) = ((-8L) && 6UL)), (safe_unary_minus_func_uint8_t_u((safe_rshift_func_int16_t_s_s(l_1393, (l_1394 == l_1394)))))))) != 0xE77CL)) , ((((g_1399[2][0][3] = ((*l_1389) |= (safe_div_func_int8_t_s_s((0L >= 0xE9FB419A1EFB1097LL), (-1L))))) | 0x08C3L) || g_223.f0) != l_1393)), (-2L))) , l_1386)), l_1401)), l_1386))))) + { /* block id: 598 */ + union U1 l_1402 = {4294967295UL}; + int8_t *l_1406 = &g_231[2][3][1].f1; + int32_t ***l_1410 = &g_251[3]; + int32_t *l_1411[3][10] = {{(void*)0,(void*)0,(void*)0,&g_111[7][6],&g_1232,(void*)0,&l_1400,(void*)0,&g_1232,&g_111[7][6]},{&g_111[7][6],&g_111[5][1],&g_111[7][6],(void*)0,(void*)0,&g_111[1][3],&l_1400,&l_1400,&g_111[1][3],(void*)0},{(void*)0,(void*)0,(void*)0,(void*)0,&g_111[7][6],&g_1232,(void*)0,&l_1400,(void*)0,&g_1232}}; + int i, j; + l_1423 = ((l_1402 , ((l_1402.f1 = (((*l_1406) = l_1405) == (-1L))) | (((safe_mod_func_int8_t_s_s((0xB61EL && (((l_1400 && (p_18.f1 ^= (l_1409 != l_1410))) && (safe_lshift_func_uint16_t_u_s((safe_add_func_int8_t_s_s((p_18.f1 , (safe_rshift_func_int16_t_s_u(((safe_mod_func_uint32_t_u_u(((safe_sub_func_uint16_t_u_u((((*l_1395) &= (((l_1422 , p_17) , 0xF25EF439L) == p_17)) , 9UL), p_17)) & 0UL), 0xD5507FF8L)) == (*g_244)), 2))), p_17)), p_17))) | p_17)), g_814.f1)) <= (*g_318)) != g_53[1]))) > 0x2F5002ECB99A8F88LL); + for (g_89 = 0; (g_89 != 23); g_89 = safe_add_func_uint8_t_u_u(g_89, 1)) + { /* block id: 606 */ + uint32_t l_1426 = 0x9900E60AL; + int32_t *l_1436 = &g_1232; + uint32_t l_1445 = 4294967295UL; + int32_t l_1460 = 8L; + int32_t l_1478[2]; + uint32_t l_1480 = 0x8DC4F29BL; + int i; + for (i = 0; i < 2; i++) + l_1478[i] = 2L; + ++l_1426; + for (g_149 = 0; (g_149 >= (-5)); g_149 = safe_sub_func_int16_t_s_s(g_149, 1)) + { /* block id: 610 */ + int32_t *l_1433 = (void*)0; + int32_t *l_1437 = &g_111[1][3]; + union U1 *l_1456[4]; + union U2 ***l_1473 = (void*)0; + union U2 **** const l_1472 = &l_1473; + int32_t l_1477 = (-9L); + int i; + for (i = 0; i < 4; i++) + l_1456[i] = &g_428[0][0][2]; + } + --l_1480; + } + } + else + { /* block id: 639 */ + int16_t *l_1483 = &g_507; + int32_t *l_1484 = (void*)0; + int32_t *l_1485 = &l_1400; + (*l_1485) &= ((((*l_1483) = ((*l_1395) ^= p_17)) != (p_17 > g_92)) || (*g_318)); + } + return (*g_318); +} + + +/* ------------------------------------------ */ +/* + * reads : g_2 g_93 g_225 g_226 g_223.f0 g_149 g_231.f1 g_428.f0 g_92 g_223.f3 g_930 g_931 g_627 g_912 g_318 g_319 g_911 g_1007 g_89 g_226.f2 g_244 g_245 g_10.f4 g_444 g_428 g_1074 g_147 g_101 g_375 g_1198 g_604 g_814.f0 g_229 g_53 g_706 g_222 g_223 + * writes: g_93 g_245 g_223.f0 g_149 g_111 g_223.f3 g_75 g_2 g_226.f2 g_89 g_444 g_507 g_479 g_147 g_1198 g_54 g_706 g_53 + */ +static union U2 func_20(union U2 * p_21) +{ /* block id: 334 */ + int64_t l_751 = 0x5E75AE4C622A21C5LL; + union U2 * const l_752[8][4] = {{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]},{&g_10[9],&g_10[9],&g_10[9],&g_10[9]}}; + int32_t l_759 = 0x817DE0C4L; + uint16_t l_792 = 0xE74AL; + union U0 **l_817 = &g_225; + uint16_t l_822[3][6]; + uint32_t l_857[7][2][6] = {{{0x151888D0L,0x069C0D93L,0x151888D0L,4294967294UL,0x52F0D1DCL,0x151888D0L},{4294967295UL,0x8F364602L,4294967294UL,1UL,0x52F0D1DCL,4294967295UL}},{{4294967294UL,0x069C0D93L,1UL,1UL,0x069C0D93L,4294967294UL},{4294967295UL,0x52F0D1DCL,1UL,4294967294UL,0x8F364602L,4294967295UL}},{{0x151888D0L,0x52F0D1DCL,4294967294UL,0x151888D0L,0x069C0D93L,0x151888D0L},{0x151888D0L,0x069C0D93L,0x151888D0L,4294967294UL,0x52F0D1DCL,0x151888D0L}},{{4294967295UL,0x8F364602L,4294967294UL,1UL,0x52F0D1DCL,4294967295UL},{4294967294UL,0x069C0D93L,1UL,1UL,0x069C0D93L,4294967294UL}},{{4294967295UL,0x52F0D1DCL,1UL,4294967294UL,0x8F364602L,4294967295UL},{0x151888D0L,0x52F0D1DCL,4294967294UL,0x151888D0L,0x069C0D93L,0x151888D0L}},{{0x151888D0L,0x069C0D93L,0x151888D0L,4294967294UL,0x52F0D1DCL,0x151888D0L},{4294967295UL,0x8F364602L,4294967294UL,1UL,0x52F0D1DCL,4294967295UL}},{{4294967294UL,0x069C0D93L,1UL,1UL,0x069C0D93L,4294967294UL},{4294967295UL,0x52F0D1DCL,1UL,4294967294UL,0x8F364602L,4294967295UL}}}; + uint16_t *l_871 = &g_245; + uint16_t **l_870[10] = {&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871,&l_871}; + uint16_t ***l_869[4]; + int8_t *l_880 = &g_147; + union U2 ***l_900 = &g_54; + union U2 ****l_899 = &l_900; + uint32_t *l_909 = &l_857[5][0][1]; + uint32_t **l_908[9][3] = {{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909},{&l_909,&l_909,&l_909}}; + uint32_t l_932 = 1UL; + int64_t l_943[1][7][4] = {{{0x31817ECD765582DFLL,0x3C4000B56088A104LL,0x3C4000B56088A104LL,0x31817ECD765582DFLL},{(-8L),5L,0L,2L},{0x0E65A79A37AC998BLL,(-1L),2L,8L},{2L,8L,(-4L),8L},{0x3C4000B56088A104LL,(-1L),0x3941FF1ADCFF6FFCLL,2L},{0x07095D56C55A0754LL,5L,8L,0x31817ECD765582DFLL},{0x3941FF1ADCFF6FFCLL,0x3C4000B56088A104LL,(-5L),(-5L)}}}; + int32_t l_964 = 6L; + int32_t l_975 = 1L; + int32_t l_976 = 0xA8F33034L; + int32_t l_980 = 1L; + int32_t l_1042 = 4L; + uint32_t l_1090 = 18446744073709551609UL; + int16_t l_1101 = 0xE3F0L; + uint8_t l_1130 = 251UL; + int32_t l_1183 = 0x99FFB991L; + int32_t l_1189 = 0x193C6D4BL; + int32_t l_1191 = 0x799703FFL; + int32_t l_1192[6][5] = {{0x7D50E986L,0x1D2A5D45L,0x1D2A5D45L,0x7D50E986L,0x1D2A5D45L},{0xB0F500FBL,0xB0F500FBL,0x9F171E12L,0xB0F500FBL,0xB0F500FBL},{0x1D2A5D45L,0x7D50E986L,0x1D2A5D45L,0x1D2A5D45L,0x7D50E986L},{0xB0F500FBL,6L,6L,0xB0F500FBL,6L},{0x7D50E986L,0x7D50E986L,(-2L),0x7D50E986L,0x7D50E986L},{6L,0xB0F500FBL,6L,6L,6L}}; + int16_t l_1212[10][3][8] = {{{0L,(-1L),4L,1L,0x39A8L,(-8L),(-9L),0x74A8L},{(-9L),2L,1L,0xE2F5L,0x43FCL,0x976FL,0xEC7EL,(-1L)},{0xE00DL,0x74A8L,0L,0xA987L,(-1L),0xAE8AL,1L,0L}},{{(-1L),(-3L),0x925EL,0xE00DL,0xEC7EL,0x74A8L,(-1L),(-1L)},{0L,0x4D21L,(-5L),0x74A8L,0x0AB7L,0x1B3AL,0L,0x1EE1L},{0xFD58L,0L,0L,(-9L),(-9L),0L,0L,0xFD58L}},{{0xE096L,0L,0x2447L,0x5CD9L,0x5027L,0L,(-4L),0x4433L},{0x0518L,(-1L),0L,1L,0x5CD9L,0L,0x0AB7L,0xEC7EL},{0xE2F5L,0L,0x450AL,0x1B3AL,(-5L),0L,0x1126L,1L}},{{0xEC7EL,0L,(-3L),0x3336L,(-6L),0x1B3AL,0x4D21L,4L},{(-1L),0x4D21L,1L,(-8L),7L,0x74A8L,(-3L),(-1L)},{(-3L),(-3L),0x8D33L,0x1EE1L,0x94DEL,0xAE8AL,(-6L),1L}},{{0x1FC3L,0x74A8L,(-5L),0x0950L,(-4L),0x976FL,0L,0x1B3AL},{1L,2L,(-1L),(-3L),0L,(-8L),1L,0xE00DL},{(-8L),(-1L),0xA987L,(-1L),0L,(-4L),4L,1L}},{{0x0950L,0x1E22L,0xAE8AL,(-1L),1L,0x5027L,0xFD58L,0x5CD9L},{0x39A8L,4L,(-8L),0L,0x1605L,0L,(-8L),4L},{2L,0L,0x74A8L,1L,4L,(-1L),0L,0xF390L}},{{0x2447L,0xFD58L,(-4L),(-8L),2L,0L,0L,0x450AL},{0x450AL,(-8L),0x74A8L,(-1L),(-3L),0x1EE1L,(-8L),0L},{(-3L),0x1EE1L,(-8L),0L,(-1L),(-1L),0xFD58L,0xEC64L}},{{(-5L),0x5CD9L,0xAE8AL,(-3L),0xB3BFL,0x0950L,4L,(-1L)},{0L,0x0AB7L,0xA987L,0x0518L,(-7L),0x4433L,1L,0L},{0xF390L,1L,(-1L),0x6038L,0x1B3AL,0xB3BFL,0xA987L,(-8L)}},{{7L,0xE2F5L,0x97EAL,0xFD58L,0x6038L,2L,0x0492L,0x5CD9L},{0x1E22L,(-1L),0xF390L,0xF2C9L,(-8L),0x0518L,0x8D48L,1L},{(-1L),1L,0x0518L,(-3L),1L,(-1L),(-3L),0L}},{{0xE2F5L,(-8L),(-1L),0L,(-1L),(-1L),0L,(-1L)},{(-4L),(-4L),0x1B3AL,(-8L),2L,0L,0xEC7EL,(-3L)},{0x0950L,0xF2C9L,0xA987L,7L,0L,(-1L),1L,(-3L)}}}; + int32_t *l_1237 = &l_1192[5][0]; + int32_t *l_1238[6][5][8] = {{{&l_980,(void*)0,&l_1192[0][0],(void*)0,&l_980,&l_964,(void*)0,&g_92},{&g_111[2][8],&l_1189,&g_111[1][3],&l_1191,&l_759,&g_111[3][4],&l_1192[5][0],&l_1189},{&g_92,&l_1192[5][0],&l_759,&g_111[1][3],&l_759,&g_1232,&l_964,&g_111[1][3]},{&l_1042,&l_964,&l_980,&l_1191,&l_980,&l_964,&l_1042,&l_1192[0][1]},{&g_111[3][8],&l_1189,&l_1192[0][0],&l_976,&l_1189,&l_1192[5][1],(void*)0,&l_980}},{{&l_980,&l_1042,&g_89,&l_1042,&l_1189,&l_1192[5][0],&l_1191,&l_1191},{&g_111[3][8],&l_976,(void*)0,&l_980,&l_980,&l_759,&g_111[5][8],&l_964},{&l_1042,&l_1192[4][0],&l_1192[5][1],&l_980,&l_759,&l_976,(void*)0,&l_976},{&g_92,&l_759,&g_1232,(void*)0,&l_759,&l_1191,&l_980,&l_980},{&g_111[2][8],&l_964,&l_1191,(void*)0,&l_980,&g_1232,&l_980,(void*)0}},{{&l_980,&g_111[3][8],&g_1232,&l_1189,(void*)0,(void*)0,&l_1192[5][0],(void*)0},{&l_759,&l_1192[5][0],&g_111[1][3],(void*)0,&g_89,&l_1189,&l_1191,(void*)0},{&l_976,&l_1192[3][1],&l_1042,&g_89,(void*)0,&l_976,&l_1042,&l_964},{&g_111[5][8],(void*)0,&g_89,&l_1189,&g_89,&g_1232,(void*)0,&l_1192[5][0]},{&l_1192[0][1],&g_111[8][4],(void*)0,&l_1042,&l_1042,&g_111[1][3],&l_1042,&l_1189}},{{&l_1192[5][0],&l_1191,&l_980,(void*)0,&l_1042,(void*)0,&g_111[3][8],&l_1192[0][1]},{&l_1042,&l_1189,&g_89,(void*)0,&l_1191,&l_759,&l_1191,&g_111[2][8]},{&g_1232,&l_1189,(void*)0,&g_111[1][3],&l_964,&g_111[1][3],&g_111[1][3],&l_964},{&l_1191,&l_964,&l_964,&l_1191,&l_1042,&l_1189,&g_111[3][5],&l_1042},{&l_980,&l_1042,&l_1042,&g_111[1][3],&l_1191,&l_1189,&g_1232,(void*)0}},{{(void*)0,&l_1042,&g_111[1][3],(void*)0,&l_980,&l_1189,&l_976,&l_1192[5][0]},{&l_980,&l_964,&l_1192[4][0],&l_1189,(void*)0,&g_111[1][3],(void*)0,&l_980},{&l_980,&g_89,&l_1189,&l_964,&g_1232,&l_976,&l_964,(void*)0},{(void*)0,&l_759,(void*)0,&g_1232,&l_980,&l_1192[4][0],&g_1232,&l_1192[0][1]},{&l_1192[5][0],&g_111[1][3],(void*)0,&g_111[1][3],&l_1192[4][0],(void*)0,&l_759,(void*)0}},{{(void*)0,&l_964,(void*)0,&l_964,&l_759,&l_1189,&l_1042,&l_980},{(void*)0,&l_964,&l_980,&l_1042,&l_964,&l_1192[0][0],&g_111[1][3],(void*)0},{&g_111[3][5],&g_1232,&l_759,&l_1191,(void*)0,(void*)0,&l_1191,(void*)0},{(void*)0,&l_759,&l_1189,&l_1192[5][0],&l_1192[0][0],&l_1042,&l_759,(void*)0},{(void*)0,&g_111[1][3],&g_89,&g_111[1][3],(void*)0,&g_111[1][3],&l_964,&l_980}}}; + int32_t l_1239 = 0x5078E770L; + int32_t l_1240 = 0L; + uint32_t l_1241 = 0x263AC74CL; + int32_t l_1251[7][5][4] = {{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x603D9C89L},{6L,6L,1L,0x603D9C89L},{0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL,1L}},{{0xAA29CFDBL,1L,1L,0xAA29CFDBL},{6L,1L,0x603D9C89L,1L},{1L,0x721A6F8FL,0x603D9C89L,0x721A6F8FL},{1L,1L,0xAA29CFDBL,0x721A6F8FL},{0x603D9C89L,6L,0x603D9C89L,0xAA29CFDBL}},{{0x603D9C89L,0xAA29CFDBL,0xAA29CFDBL,0x603D9C89L},{1L,0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL},{0xAA29CFDBL,6L,0x721A6F8FL,0x721A6F8FL},{1L,1L,0xAA29CFDBL,0x721A6F8FL},{0x603D9C89L,6L,0x603D9C89L,0xAA29CFDBL}},{{0x603D9C89L,0xAA29CFDBL,0xAA29CFDBL,0x603D9C89L},{1L,0xAA29CFDBL,0x721A6F8FL,0xAA29CFDBL},{0xAA29CFDBL,6L,0x721A6F8FL,0x721A6F8FL},{1L,1L,0xAA29CFDBL,0x721A6F8FL},{0x603D9C89L,6L,0x603D9C89L,0xAA29CFDBL}}}; + int16_t l_1252 = 0x8099L; + union U1 l_1296[6][10][4] = {{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}}},{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}}},{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}}},{{{0x1D574646L},{0x71DBF36DL},{0x71DBF36DL},{0x1D574646L}},{{0xC1A11E5DL},{0x71DBF36DL},{4294967289UL},{0x89B10B99L}},{{0x89B10B99L},{0xC0F3DB2DL},{4294967289UL},{0x0C3A5D39L}},{{0xC1A11E5DL},{0xD393D14CL},{0x71DBF36DL},{0x0C3A5D39L}},{{0x1D574646L},{0xC0F3DB2DL},{9UL},{0x89B10B99L}},{{0x1D574646L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}}},{{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}},{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}}},{{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}},{{0x0C3A5D39L},{9UL},{9UL},{0x0C3A5D39L}},{{0x89B10B99L},{9UL},{0xC0F3DB2DL},{0x1D574646L}},{{0x1D574646L},{0xD393D14CL},{0xC0F3DB2DL},{4294967286UL}},{{0x89B10B99L},{0x71DBF36DL},{9UL},{4294967286UL}},{{0x0C3A5D39L},{0xD393D14CL},{4294967289UL},{0x1D574646L}}}}; + uint32_t ****l_1337 = (void*)0; + uint32_t *****l_1336 = &l_1337; + int32_t l_1352 = 0L; + int i, j, k; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 6; j++) + l_822[i][j] = 4UL; + } + for (i = 0; i < 4; i++) + l_869[i] = &l_870[3]; + if ((safe_rshift_func_uint16_t_u_s((safe_mul_func_int8_t_s_s(0x74L, (g_2 >= l_751))), 10))) + { /* block id: 335 */ + uint32_t *l_757[4][4][10] = {{{(void*)0,&g_428[0][0][2].f0,&g_375,&g_375,&g_428[0][0][2].f0,(void*)0,&g_93,(void*)0,&g_428[0][0][2].f0,&g_375},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0},{(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_428[0][0][2].f0}},{{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375},{&g_428[0][0][2].f0,(void*)0,&g_93,(void*)0,&g_428[0][0][2].f0,&g_375,&g_375,&g_428[0][0][2].f0,(void*)0,&g_93},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93},{(void*)0,&g_428[0][0][2].f0,&g_375,&g_375,&g_428[0][0][2].f0,(void*)0,&g_93,(void*)0,&g_428[0][0][2].f0,&g_375}},{{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,(void*)0,&g_428[0][0][2].f0,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93}},{{&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,(void*)0,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0},{&g_428[0][0][2].f0,&g_375,&g_93,&g_93,&g_375,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_375,&g_93},{&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_93,&g_428[0][0][2].f0,&g_428[0][0][2].f0,&g_428[0][0][2].f0}}}; + int32_t l_758[1][4][8] = {{{0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL},{0x13BCAF3AL,0x13BCAF3AL,0x748F0485L,0x13BCAF3AL,0x13BCAF3AL,0x748F0485L,0x13BCAF3AL,0x13BCAF3AL},{0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL},{0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL,0x34EFA39DL,0x13BCAF3AL,0x34EFA39DL}}}; + union U1 l_762 = {0x3F18B329L}; + int32_t l_769 = 0xC76289FEL; + uint16_t *l_774 = &g_245; + union U1 l_775 = {4294967288UL}; + int32_t *l_776[10][6]; + int64_t *l_777 = &g_149; + int32_t *l_778 = &g_111[1][3]; + int32_t **l_779 = &l_778; + int i, j, k; + for (i = 0; i < 10; i++) + { + for (j = 0; j < 6; j++) + l_776[i][j] = &g_223.f0; + } + (*l_778) = (((void*)0 != l_752[1][2]) | ((*l_777) = (safe_div_func_int16_t_s_s((safe_div_func_uint32_t_u_u((++g_93), (l_762 , (safe_rshift_func_uint8_t_u_s((((safe_add_func_int16_t_s_s(((((safe_mul_func_int8_t_s_s(((0x8DD6L < l_769) | (((g_223.f0 ^= ((safe_mul_func_uint8_t_u_u((0x3C13D321L < (safe_mod_func_int8_t_s_s((((*l_774) = l_762.f0) | ((l_775 , (*g_225)) , l_758[0][2][3])), 1UL))), 0x55L)) > l_775.f0)) , 0L) | g_149)), g_231[2][3][1].f1)) && 0x9AL) , l_759) || l_759), l_759)) >= g_428[0][0][2].f0) < g_92), 6))))), l_751)))); + (*l_779) = &l_758[0][2][0]; + } + else + { /* block id: 342 */ + int8_t l_789 = 0L; + int32_t l_791 = 0xA19943A3L; + uint32_t *l_849 = (void*)0; + uint8_t *l_875 = &g_2; + union U0 *l_883 = &g_229[0][0][4]; + const union U1 *l_901 = &g_428[0][0][2]; + int32_t *l_916[9][9][2] = {{{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0}},{{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0}},{{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0}},{{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0}},{{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0},{&g_223.f0,&g_223.f0},{&g_223.f0,(void*)0},{&g_627,&g_10[9].f0},{(void*)0,&g_10[9].f0},{&g_627,(void*)0}},{{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0}},{{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0}},{{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627}},{{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0},{(void*)0,&g_627},{&g_223.f0,&g_223.f0},{&g_627,&g_223.f0},{&g_223.f0,&g_627},{(void*)0,(void*)0}}}; + int64_t l_918[7] = {0x7A51C65C262453B0LL,0x7A51C65C262453B0LL,5L,0x7A51C65C262453B0LL,0x7A51C65C262453B0LL,5L,0x7A51C65C262453B0LL}; + union U0 ***l_963[5][5][5] = {{{&l_817,&g_815,(void*)0,&l_817,(void*)0},{&g_815,(void*)0,&g_815,&g_815,&g_815},{&g_815,&l_817,&g_815,(void*)0,&l_817},{&g_815,&g_815,&l_817,(void*)0,&g_819},{&l_817,(void*)0,&g_815,&l_817,&g_819}},{{&g_819,&l_817,&l_817,&g_819,&l_817},{&l_817,(void*)0,&g_815,(void*)0,&l_817},{(void*)0,(void*)0,&g_815,(void*)0,(void*)0},{&g_819,&l_817,(void*)0,&l_817,&g_815},{&g_819,&g_815,&g_819,&g_819,&l_817}},{{(void*)0,&l_817,&g_819,&l_817,&g_815},{&g_819,&g_819,&g_815,&l_817,(void*)0},{&g_815,&g_815,&l_817,(void*)0,&l_817},{&g_815,&g_815,&g_815,&g_815,&l_817},{&g_815,&g_819,&l_817,&l_817,&g_819}},{{(void*)0,&g_819,&g_819,&g_815,&g_819},{&l_817,&g_819,&g_819,&l_817,&l_817},{&g_815,&g_815,&g_815,&g_819,&g_815},{&l_817,&g_815,&g_815,&l_817,(void*)0},{&l_817,&g_819,&g_815,&g_815,(void*)0}},{{&g_815,&l_817,&g_819,(void*)0,&l_817},{(void*)0,&g_815,&l_817,&g_815,&g_819},{(void*)0,&l_817,(void*)0,(void*)0,&l_817},{&g_819,&l_817,&g_815,&g_815,&l_817},{&l_817,&g_819,&g_815,(void*)0,&l_817}}}; + const uint8_t **l_966 = (void*)0; + const uint8_t ** const *l_965 = &l_966; + int32_t l_974 = (-6L); + int32_t l_977 = 0L; + int32_t l_978 = 0x13F01D48L; + int32_t l_979 = 1L; + int32_t l_982 = 0L; + uint64_t l_983 = 18446744073709551615UL; + uint32_t l_1013 = 0xCE3163D8L; + uint8_t l_1067 = 0xD4L; + int32_t l_1180 = 0xF57081BFL; + int32_t l_1181 = 0xFB5777F6L; + int32_t l_1182 = 0x275AD62DL; + int32_t l_1184 = 6L; + int32_t l_1185 = (-1L); + int32_t l_1186 = 0x7A2C130CL; + int32_t l_1188 = (-7L); + int32_t l_1190 = 0x38A4EFDBL; + int32_t l_1193 = 0xBF70D8C0L; + int32_t l_1194 = 1L; + int32_t l_1195 = 0x0CE7F4DEL; + int32_t l_1196 = (-2L); + int32_t l_1197[9] = {0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L,0x1F2C8116L}; + uint64_t l_1233 = 0x13588E024B8FA85ALL; + int32_t *l_1236[6][9][4] = {{{(void*)0,&l_1182,&l_1182,&l_1197[1]},{&l_1186,&l_1194,&l_1194,&l_1186},{&l_1196,&l_1185,&l_1192[5][0],&l_977},{(void*)0,&l_1184,&l_1197[7],(void*)0},{(void*)0,(void*)0,&l_1193,(void*)0},{&l_1194,&l_1184,&l_1185,&l_977},{&l_1186,&l_1185,&l_1191,&l_1186},{&l_1182,&l_1194,&l_1193,&l_1197[1]},{&l_1185,&l_1182,(void*)0,&l_1196}},{{&l_1186,&l_1197[1],&l_1197[1],&l_1185},{&l_1195,(void*)0,&l_1193,&l_1182},{&l_977,(void*)0,&l_977,(void*)0},{(void*)0,&l_1197[1],(void*)0,(void*)0},{(void*)0,&l_1185,&l_1194,&l_1197[1]},{&l_964,&l_1195,&l_1194,&l_964},{(void*)0,&l_1185,(void*)0,(void*)0},{(void*)0,&l_982,&l_977,(void*)0},{&l_977,(void*)0,&l_1193,(void*)0}},{{&l_1195,&l_1184,&l_1197[1],(void*)0},{&l_1186,(void*)0,(void*)0,&l_1186},{&l_1185,&l_1195,&l_1193,&l_1193},{&l_1182,&l_1182,&l_1191,(void*)0},{&l_1186,&l_1193,&l_1185,&l_1185},{&l_1194,(void*)0,&l_1193,&l_1185},{(void*)0,(void*)0,&l_1197[7],&l_1185},{(void*)0,&l_1193,&l_1192[5][0],(void*)0},{&l_1196,&l_1182,&l_1194,&l_1193}},{{&l_1186,&l_1195,&l_1182,&l_1186},{(void*)0,(void*)0,&l_1192[5][0],(void*)0},{(void*)0,&l_1184,&l_977,(void*)0},{(void*)0,(void*)0,&l_976,(void*)0},{&l_1195,&l_982,&l_1185,(void*)0},{(void*)0,&l_1185,(void*)0,&l_964},{&l_1182,&l_1195,&l_982,&l_1197[1]},{&l_1182,&l_1185,(void*)0,(void*)0},{(void*)0,&l_1197[1],&l_1185,(void*)0}},{{&l_1195,(void*)0,&l_976,&l_1182},{(void*)0,(void*)0,&l_977,&l_1185},{(void*)0,&l_1197[1],&l_1192[5][0],&l_1196},{(void*)0,&l_1182,&l_1182,&l_1197[1]},{&l_1186,&l_1194,&l_1194,&l_1186},{&l_1196,&l_1185,&l_1192[5][0],&l_977},{(void*)0,&l_1192[5][0],&l_1197[1],(void*)0},{&l_1193,&l_1042,&l_1196,(void*)0},{&l_1196,&l_1192[5][0],&l_1191,&l_982}},{{&l_977,&l_982,(void*)0,&l_1185},{(void*)0,&l_1196,&l_1182,&l_1194},{&l_1191,(void*)0,&l_1042,&l_980},{&l_977,&l_1194,(void*)0,&l_982},{&l_964,&l_1192[0][0],&l_1196,(void*)0},{&l_982,&l_1196,&l_982,&l_1196},{&l_1196,&l_1194,&l_1188,(void*)0},{(void*)0,&l_1191,&l_1196,&l_1194},{&l_1197[1],&l_964,&l_1196,&l_1197[1]}}}; + int i, j, k; + for (g_223.f3 = 14; (g_223.f3 >= 16); g_223.f3 = safe_add_func_int32_t_s_s(g_223.f3, 9)) + { /* block id: 345 */ + int32_t l_788 = 0x9C835BFDL; + int32_t l_790 = 0L; + uint8_t *l_824 = (void*)0; + uint8_t **l_823 = &l_824; + union U1 l_856 = {4294967286UL}; + uint16_t ***l_873 = &l_870[0]; + int8_t *l_876 = &g_479; + const union U0 l_937 = {7L}; + const int32_t *l_950[1]; + const int32_t **l_949[4]; + const int32_t ***l_948 = &l_949[3]; + uint32_t l_967 = 0x77B72420L; + int32_t l_981 = 1L; + union U2 * const l_994 = (void*)0; + uint32_t l_1008 = 4294967295UL; + int32_t l_1038 = 0xCA27D7C2L; + int32_t l_1041 = 2L; + int32_t l_1043[10][5] = {{0L,0L,0x66C6F2F5L,1L,(-7L)},{0x77081B5EL,0xEF4C7256L,0x5589E398L,0x77081B5EL,0L},{0x90D8465BL,(-5L),0xAF1CDC4BL,5L,(-5L)},{0L,0xEF4C7256L,0xB86532B7L,0x944B88F4L,0x944B88F4L},{0x5589E398L,0L,0x5589E398L,0xAF1CDC4BL,0x944B88F4L},{1L,0x77081B5EL,0x48DB9371L,0x90D8465BL,(-5L)},{0xEF4C7256L,0x90D8465BL,0xDAE9F189L,1L,0L},{0x832C4FFEL,0L,0x48DB9371L,(-5L),(-7L)},{0x90D8465BL,0x5589E398L,0x5589E398L,0x90D8465BL,0x832C4FFEL},{0x90D8465BL,1L,0xB86532B7L,5L,1L}}; + uint8_t l_1044[1][4][6] = {{{0xD3L,0xE8L,0xD3L,255UL,255UL,0xD3L},{0UL,0UL,255UL,250UL,255UL,0UL},{255UL,0xE8L,250UL,250UL,0xE8L,255UL},{0UL,255UL,250UL,255UL,0UL,0UL}}}; + uint32_t ***l_1127 = (void*)0; + uint32_t ****l_1126 = &l_1127; + uint32_t *****l_1125 = &l_1126; + uint32_t ****l_1129 = &l_1127; + uint32_t *****l_1128 = &l_1129; + int16_t l_1187[2][3][7] = {{{0x8B62L,1L,0x8B62L,1L,1L,(-9L),(-9L)},{1L,3L,0x2A4CL,3L,1L,0x2A4CL,0xC3E2L},{0xC3E2L,(-9L),1L,0xC3E2L,1L,(-9L),0xC3E2L}},{{0x8B62L,0xC3E2L,(-9L),1L,0xC3E2L,1L,(-9L)},{0xC3E2L,0xC3E2L,0x2A4CL,1L,3L,0x2A4CL,3L},{1L,(-9L),(-9L),1L,1L,0x8B62L,1L}}}; + int i, j, k; + for (i = 0; i < 1; i++) + l_950[i] = &l_791; + for (i = 0; i < 4; i++) + l_949[i] = &l_950[0]; + for (g_75 = 0; (g_75 <= 5); g_75 += 1) + { /* block id: 348 */ + int32_t *l_782 = &g_111[4][0]; + int32_t *l_783 = &g_92; + int32_t *l_784 = (void*)0; + int32_t *l_785 = &g_111[1][3]; + int32_t *l_786 = &g_92; + int32_t *l_787[8] = {&g_92,&g_89,&g_92,&g_89,&g_92,&g_89,&g_92,&g_89}; + union U0 **l_803 = &g_225; + uint8_t *l_809 = &g_53[1]; + uint8_t **l_808 = &l_809; + const union U2 *l_813 = &g_814; + const union U2 **l_812 = &l_813; + union U0 **l_816 = (void*)0; + union U0 ***l_818[1][8] = {{(void*)0,&l_803,&l_803,(void*)0,&l_803,&l_803,(void*)0,&l_803}}; + int16_t *l_820 = (void*)0; + int16_t *l_821 = &g_507; + union U0 l_848 = {0L}; + int32_t l_865 = 0xD0F7F5FBL; + uint16_t ***l_868 = (void*)0; + int64_t *l_940 = &g_49; + int i, j; + l_792++; + } + if (((~(0x961AFC41136F22A9LL | (safe_add_func_uint16_t_u_u(((safe_div_func_uint32_t_u_u((((((l_790 | ((void*)0 == l_948)) == ((safe_rshift_func_uint16_t_u_s(((safe_lshift_func_uint8_t_u_u(((*g_931) = (safe_lshift_func_uint16_t_u_u((safe_mul_func_uint16_t_u_u(((((safe_rshift_func_int16_t_s_s((((l_918[2] || (0x5CL != ((((l_964 = (safe_sub_func_int8_t_s_s(((l_963[4][2][3] == l_963[4][2][3]) == (l_759 = 18446744073709551615UL)), 0x1DL))) > 0x1AL) , &l_856) == &g_428[6][0][2]))) , (**g_930)) < g_627), l_857[0][0][1])) , &g_930) != l_965) || 0x2A4742A4L), 0x19AAL)), 10))), l_918[3])) == (*g_912)), 5)) != (*g_912))) & (*g_318)) , l_950[0]) == (*g_911)), 0xDFE9E75CL)) > l_967), 1L)))) == l_932)) + { /* block id: 423 */ + int32_t *l_968 = &l_759; + int32_t *l_969 = &g_89; + int32_t *l_970 = &l_790; + int32_t *l_971 = &l_791; + int32_t *l_972 = (void*)0; + int32_t *l_973[5]; + union U2 ***l_1006 = &g_54; + uint16_t *l_1024 = &l_792; + int8_t l_1035 = 0L; + int i; + for (i = 0; i < 5; i++) + l_973[i] = (void*)0; + l_983++; + if ((*l_971)) + break; + (**l_948) = l_970; + for (g_226.f2 = 0; (g_226.f2 <= 2); g_226.f2 += 1) + { /* block id: 429 */ + uint32_t l_986 = 4294967295UL; + int32_t l_987 = 1L; + int32_t l_988[5][9] = {{0L,0x09DD368BL,2L,0L,0L,2L,0x09DD368BL,0L,2L},{0L,0x09DD368BL,0L,0L,0L,0L,0x0A634DD4L,6L,0L},{6L,0x0A634DD4L,0L,0L,0L,0L,0x0A634DD4L,6L,0L},{6L,0x0A634DD4L,0L,0L,0L,0L,0x0A634DD4L,6L,0L},{6L,0x0A634DD4L,0L,0L,0L,0L,0x0A634DD4L,6L,0L}}; + int32_t *l_1016 = (void*)0; + uint16_t *l_1023 = &g_245; + int i, j; + if (l_986) + { /* block id: 430 */ + uint16_t l_989[1][1][7]; + uint32_t *l_1009[5][7][5] = {{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,&g_226.f2,&g_226.f2,&l_932},{&g_226.f2,(void*)0,&g_226.f2,(void*)0,(void*)0},{&g_223.f2,&g_226.f2,&g_223.f2,&g_226.f2,(void*)0},{&l_932,&g_226.f2,(void*)0,&g_223.f2,&l_932}},{{&g_223.f2,&g_226.f2,&g_10[9].f2,(void*)0,&g_226.f2},{&g_226.f2,&g_226.f2,(void*)0,(void*)0,&g_10[9].f2},{(void*)0,(void*)0,&g_223.f2,&g_223.f2,&g_226.f2},{(void*)0,&l_932,(void*)0,(void*)0,(void*)0},{&g_223.f2,(void*)0,(void*)0,&g_226.f2,&l_967},{&g_223.f2,(void*)0,&l_932,(void*)0,&l_967},{&l_967,&g_226.f2,&g_226.f2,(void*)0,(void*)0}}}; + int32_t l_1010 = 0xE506438AL; + int32_t l_1011 = (-3L); + int32_t l_1012 = 0x265CF71AL; + int i, j, k; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 7; k++) + l_989[i][j][k] = 0xDF33L; + } + } + (**l_948) = &l_791; + l_989[0][0][3]++; + (*l_969) |= (safe_lshift_func_uint8_t_u_u((((void*)0 != l_994) , (safe_unary_minus_func_uint32_t_u(((l_988[1][6] = (safe_lshift_func_int8_t_s_u(((void*)0 == &g_627), ((safe_lshift_func_uint16_t_u_u((safe_mod_func_uint16_t_u_u((safe_lshift_func_uint16_t_u_s((l_975 , (safe_lshift_func_int16_t_s_s(((*l_899) == l_1006), 7))), (((*g_931) = g_1007) == g_223.f3))), 0xDB6DL)), l_1008)) , l_974)))) , 4294967291UL)))), 7)); + l_1013++; + } + else + { /* block id: 437 */ + uint16_t *l_1025 = (void*)0; + int32_t l_1034 = (-1L); + int32_t l_1036 = 0xB9E319BAL; + int32_t l_1037 = 5L; + int32_t l_1039 = (-1L); + int32_t l_1040 = 0x5EEBA298L; + l_1016 = l_972; + (*l_968) ^= (safe_rshift_func_int8_t_s_s((+((safe_mod_func_int16_t_s_s((safe_div_func_int8_t_s_s(l_791, 0x24L)), (((l_1024 = l_1023) != (l_1025 = l_1025)) , (((safe_lshift_func_int8_t_s_u(((safe_div_func_uint64_t_u_u((safe_rshift_func_uint16_t_u_u((*l_971), ((*g_931) || (0x69EAL < (((*g_912) = (safe_sub_func_uint16_t_u_u(((g_226.f2 ^ (l_982 ^ l_988[3][6])) == (*g_318)), (*g_244)))) >= l_789))))), (*g_318))) == (*l_971)), 7)) & l_1034) , (-7L))))) , g_149)), 6)); + l_1044[0][3][5]++; + } + } + } + else + { /* block id: 446 */ + uint32_t l_1053 = 18446744073709551612UL; + const uint16_t ****l_1061 = (void*)0; + int32_t l_1089 = 0x58936FB3L; + uint8_t l_1099 = 0x88L; + int32_t l_1108[7] = {4L,0xBE5E93A0L,0xBE5E93A0L,4L,0xBE5E93A0L,0xBE5E93A0L,4L}; + int i; + for (l_792 = 0; (l_792 <= 3); l_792 += 1) + { /* block id: 449 */ + int32_t *l_1047 = (void*)0; + int32_t *l_1048 = &l_759; + int32_t *l_1049 = (void*)0; + int32_t *l_1050 = (void*)0; + int32_t *l_1051 = &l_981; + int32_t *l_1052[6] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + uint32_t ***l_1059 = (void*)0; + uint32_t ****l_1058[6][9] = {{&l_1059,(void*)0,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059},{&l_1059,(void*)0,&l_1059,(void*)0,&l_1059,&l_1059,(void*)0,&l_1059,&l_1059},{&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,(void*)0},{&l_1059,&l_1059,(void*)0,&l_1059,&l_1059,&l_1059,(void*)0,&l_1059,&l_1059},{&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059},{(void*)0,(void*)0,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059,&l_1059}}; + uint32_t ***l_1060 = &l_908[8][1]; + union U1 l_1064[9] = {{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L},{0xCCDF0B70L}}; + union U0 **l_1076[7]; + uint32_t l_1077[10] = {18446744073709551615UL,0x091F9E54L,0xCE927A92L,0x091F9E54L,18446744073709551615UL,18446744073709551615UL,0x091F9E54L,0xCE927A92L,0x091F9E54L,18446744073709551615UL}; + union U2 l_1104[1] = {{1L}}; + int i, j; + for (i = 0; i < 7; i++) + l_1076[i] = &l_883; + l_1053++; + l_1067 ^= (((g_10[9].f4 & (safe_add_func_uint64_t_u_u(((l_1060 = &g_911) != &l_908[5][0]), (l_974 , ((void*)0 != l_1061))))) , l_1053) <= ((safe_sub_func_uint16_t_u_u(((l_1064[0] , (safe_mul_func_uint8_t_u_u(255UL, l_975))) || 0x62FFL), l_979)) , (*g_912))); + if ((((l_1067 , (((((((g_444--) <= (((*l_901) , ((*g_244) , ((l_976 < (g_627 , ((g_245 = (safe_rshift_func_int16_t_s_u((((safe_mul_func_uint32_t_u_u((g_1074[2] != (void*)0), (l_1076[4] == (((g_147 < g_231[2][3][1].f1) > g_101) , (void*)0)))) , l_791) >= l_1053), l_918[3]))) , 9L))) | l_976))) >= 0x0FL)) && (*l_1051)) || l_932) , l_1077[0]) & l_1053) , l_1013)) && (*l_1051)) && (**g_930))) + { /* block id: 455 */ + uint32_t *l_1086 = &l_1064[0].f0; + int16_t *l_1087 = &g_507; + int16_t *l_1088[8] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + int32_t l_1091 = 0x536FF2CFL; + int i; + l_974 |= ((*l_1051) = ((safe_mod_func_int8_t_s_s((*l_1048), 8UL)) <= (safe_sub_func_int16_t_s_s(((l_1089 &= ((*l_1087) = (safe_rshift_func_uint16_t_u_u(((void*)0 == &g_911), (safe_mul_func_uint16_t_u_u(((&l_1008 != (l_1086 = &l_1013)) >= 0xC6D2L), ((-7L) == l_822[0][4]))))))) && 0x72AFL), l_857[5][1][3])))); + if (l_1090) + continue; + if (l_1091) + continue; + } + else + { /* block id: 463 */ + uint32_t l_1094 = 18446744073709551615UL; + int32_t l_1100 = (-7L); + l_1043[4][0] = (((((safe_sub_func_uint64_t_u_u((((0xC7L <= ((l_918[5] , (l_1094 = (*g_912))) > ((safe_add_func_uint64_t_u_u((safe_rshift_func_int8_t_s_u(l_1099, ((*l_875) = l_1100))), (~(l_1101 <= (safe_mul_func_uint16_t_u_u((l_1100 , ((((l_1104[0] , ((***l_948) > l_1099)) , l_1100) & l_983) <= (*g_912))), l_1100)))))) || l_857[1][1][0]))) == g_375) <= 0xECL), (*g_318))) , l_1089) ^ (**g_911)) != 0x48965DBB2790DDDDLL) | 1L); + } + for (l_1099 = 0; (l_1099 <= 4); l_1099 += 1) + { /* block id: 470 */ + int8_t l_1105 = 0xADL; + int32_t l_1106 = 0x413B3C1FL; + int32_t l_1107[10][4] = {{1L,(-6L),0x7FC6FB02L,0x7FC6FB02L},{0xAD222DD9L,0xAD222DD9L,1L,0x7FC6FB02L},{0xEEC01B30L,(-6L),0xEEC01B30L,1L},{0xEEC01B30L,1L,1L,0xEEC01B30L},{0xAD222DD9L,1L,0x7FC6FB02L,1L},{1L,(-6L),0x7FC6FB02L,0x7FC6FB02L},{0xAD222DD9L,0xAD222DD9L,1L,0x7FC6FB02L},{0xEEC01B30L,(-6L),0xEEC01B30L,1L},{0xEEC01B30L,1L,1L,0xEEC01B30L},{0xAD222DD9L,1L,0x7FC6FB02L,1L}}; + uint16_t l_1109 = 65534UL; + int i, j; + (*l_1051) |= l_1013; + l_1109++; + if (l_789) + break; + } + for (l_976 = 3; (l_976 >= 1); l_976 -= 1) + { /* block id: 477 */ + union U2 l_1112 = {0x95AB76F0L}; + (**l_948) = (void*)0; + return l_1112; + } + } + } + if (l_751) + break; + if ((((*l_876) = (safe_rshift_func_int16_t_s_s((safe_div_func_int32_t_s_s((safe_lshift_func_int8_t_s_s(((*g_318) , ((safe_mul_func_uint16_t_u_u((l_822[0][5] == ((l_983 <= l_759) > ((((safe_rshift_func_int16_t_s_s(0x99CFL, 1)) , (safe_rshift_func_uint8_t_u_u(l_1042, 5))) <= (((*l_1128) = ((*l_1125) = (void*)0)) == (void*)0)) < ((g_149 != l_1130) > l_943[0][6][1])))), 7L)) == 0x7FA5L)), l_857[3][1][2])), l_822[2][5])), 11))) | 0xFEL)) + { /* block id: 487 */ + int32_t *l_1131 = &l_982; + for (l_1038 = 0; l_1038 < 10; l_1038 += 1) + { + l_870[l_1038] = &l_871; + } + (*l_1131) |= (0xE835L >= 1L); + } + else + { /* block id: 490 */ + int32_t l_1132 = 3L; + const uint32_t l_1157 = 0xC3A60DA1L; + int8_t l_1158 = 1L; + int32_t l_1168 = 1L; + int32_t l_1169 = 8L; + int32_t l_1170 = 0xAC0D721EL; + int32_t l_1173 = 0xFDFA3AE3L; + int32_t l_1174[6] = {0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L,0x0CF5CB29L}; + int32_t *l_1229 = &l_1182; + int32_t *l_1230 = &l_1185; + int32_t *l_1231[7]; + int i; + for (i = 0; i < 7; i++) + l_1231[i] = &l_1190; + for (l_979 = 5; (l_979 >= 0); l_979 -= 1) + { /* block id: 493 */ + uint8_t l_1135 = 8UL; + int32_t *l_1138 = &g_89; + int32_t l_1171 = (-3L); + int32_t l_1172 = 0x574353F2L; + int32_t l_1175 = 0x9B33C241L; + int32_t l_1176 = 0x272F75CEL; + int32_t l_1177 = 5L; + int32_t l_1179[3]; + union U1 l_1207 = {4294967295UL}; + int i; + for (i = 0; i < 3; i++) + l_1179[i] = 0L; + if (l_1132) + break; + (*l_1138) = ((0L > ((l_943[0][3][1] & (l_1132 ^ (l_1135 != ((safe_mul_func_uint16_t_u_u(l_1135, 65535UL)) ^ ((l_975 , 2UL) >= (0x64L & l_1135)))))) , l_1135)) && 0UL); + if (((**l_817) , (((safe_mul_func_int16_t_s_s((((+0L) & (safe_mod_func_int8_t_s_s((((*l_880) |= (safe_mul_func_int16_t_s_s(((((((((*l_1138) == (((*l_909)++) < (((*l_871) = l_1132) & (safe_div_func_uint64_t_u_u(((*l_1138) < (safe_lshift_func_int8_t_s_s((l_1132 | ((safe_add_func_int8_t_s_s(((((safe_mul_func_uint8_t_u_u((((l_1132 > l_974) ^ (safe_mod_func_uint64_t_u_u(((1UL > 0x8F25A903L) == (*g_931)), l_789))) , (*l_1138)), g_627)) == (*l_1138)) == (*l_1138)) , (*l_1138)), 1L)) & l_918[1])), 2))), (*g_318)))))) != (*g_318)) || l_1132) > (-1L)) || 8L) != l_1132) ^ l_1132), l_1157))) & (*g_931)), 0x0CL))) <= 0L), 0x96EEL)) != l_1158) , (*l_1138)))) + { /* block id: 499 */ + int32_t *l_1159 = &l_759; + int32_t *l_1160 = &l_980; + int32_t *l_1161 = &l_981; + int32_t *l_1162 = &g_92; + int32_t *l_1163 = &l_1041; + int32_t *l_1164 = (void*)0; + int32_t *l_1165 = &l_791; + int32_t *l_1166 = (void*)0; + int32_t *l_1167[4] = {&l_964,&l_964,&l_964,&l_964}; + int i; + g_1198[6][3]--; + (**l_948) = &l_976; + if (l_1158) + continue; + } + else + { /* block id: 503 */ + uint32_t l_1219 = 0x008FA38AL; + (*l_1138) = (((0xEFL < ((safe_div_func_uint64_t_u_u((safe_mul_func_int16_t_s_s(((*g_931) ^ ((~0x1F9CBF83EE15EE48LL) ^ ((((l_1207 , (*g_244)) < ((safe_add_func_uint64_t_u_u((safe_mul_func_uint8_t_u_u((l_1212[3][2][7] , l_1192[5][0]), (safe_add_func_uint32_t_u_u(((safe_sub_func_uint16_t_u_u((((safe_lshift_func_int16_t_s_s(((**l_817) , (((l_1219 == 65533UL) || 0xDF1FE933C61F5786LL) > 0x2F60BAB9L)), l_792)) < 7L) , l_1173), (-1L))) <= (-7L)), l_1174[5])))), (*l_1138))) > g_231[2][3][1].f1)) , 0UL) || 0x45C9L))), 0xB438L)), 0xD8DBB58FFCFC04ADLL)) & 1L)) >= (-7L)) | (*l_1138)); + } + for (l_1173 = 0; (l_1173 >= 0); l_1173 -= 1) + { /* block id: 508 */ + int32_t l_1226 = 0xE9D9050BL; + int16_t *l_1227 = &l_1101; + (*l_1138) = ((safe_sub_func_int16_t_s_s(((*l_1227) = ((((((*l_1138) > (((*g_604) = &p_21) == &p_21)) && g_814.f0) , 1L) != (((*g_912) = (safe_div_func_int64_t_s_s(l_1174[5], ((((void*)0 == &g_1075) , (*l_883)) , g_53[1])))) == l_1194)) > l_1226)), 0xCE39L)) ^ l_1226); + } + for (l_792 = 0; (l_792 <= 0); l_792 += 1) + { /* block id: 516 */ + uint32_t l_1228 = 3UL; + (*l_1138) |= l_1228; + } + } + l_1233++; + (**l_948) = l_1236[2][7][2]; + } + } + } + l_1241++; + for (g_706 = 2; (g_706 >= 0); g_706 -= 1) + { /* block id: 528 */ + int32_t l_1244 = 4L; + int32_t l_1245 = 0x5B87C714L; + int32_t l_1246[8][9][3] = {{{(-5L),0xB5ED473FL,0L},{1L,1L,0xF457B790L},{(-1L),1L,1L},{1L,0xA309F180L,0xFFF59FB6L},{(-5L),1L,0xFFF59FB6L},{0x10A1A9AFL,0xFFF59FB6L,1L},{5L,0L,0xF457B790L},{0xFFF59FB6L,0xFFF59FB6L,0L},{1L,1L,0x14D48AFEL}},{{1L,0x14D48AFEL,1L},{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L}},{{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L},{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L}},{{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L}},{{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)}},{{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L},{0L,(-1L),1L},{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)}},{{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)},{0L,0L,1L},{0x10A1A9AFL,1L,0xF457B790L},{0x10A1A9AFL,0x14D48AFEL,1L},{0L,(-1L),1L}},{{1L,0x10A1A9AFL,1L},{0xB5ED473FL,0xA309F180L,0xF457B790L},{5L,0xA309F180L,1L},{(-1L),0x10A1A9AFL,(-5L)},{0xFFF59FB6L,(-1L),(-1L)},{(-1L),0x14D48AFEL,0L},{5L,1L,0L},{0xB5ED473FL,0L,(-1L)},{1L,1L,(-5L)}}}; + uint32_t l_1247 = 0UL; + int16_t l_1250 = 0L; + uint32_t l_1253 = 5UL; + int32_t l_1257[9] = {(-7L),0x6AB92E35L,4L,4L,(-7L),4L,4L,(-7L),4L}; + int16_t l_1263[8][8] = {{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL},{0x20A9L,1L,0x20A9L,0x2CCCL,0x20A9L,1L,0x20A9L,0x2CCCL}}; + union U0 *l_1291 = (void*)0; + int8_t l_1292 = 0xCBL; + union U2 ***l_1297 = &g_54; + uint32_t *****l_1338[6][9] = {{&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,&l_1337,&l_1337},{&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,&l_1337},{(void*)0,&l_1337,&l_1337,(void*)0,(void*)0,&l_1337,&l_1337,&l_1337,&l_1337},{(void*)0,&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,(void*)0,&l_1337,&l_1337},{&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,&l_1337,&l_1337,(void*)0,&l_1337},{&l_1337,&l_1337,&l_1337,&l_1337,&l_1337,(void*)0,&l_1337,&l_1337,&l_1337}}; + int i, j, k; + l_1247--; + ++l_1253; + } + return (*g_222); +} + + +/* ------------------------------------------ */ +/* + * reads : g_706 g_428 g_92 g_444 g_10.f4 g_89 g_111 g_149 g_53 + * writes: g_706 g_444 + */ +static int8_t func_26(const int64_t p_27, uint32_t p_28, uint64_t p_29, union U2 p_30) +{ /* block id: 322 */ + int64_t l_678[10] = {0x7DABD13DDE14C484LL,0x7DABD13DDE14C484LL,0x92E72AE3C392FA5ELL,0x7DABD13DDE14C484LL,0x7DABD13DDE14C484LL,0x92E72AE3C392FA5ELL,0x7DABD13DDE14C484LL,0x7DABD13DDE14C484LL,0x92E72AE3C392FA5ELL,0x7DABD13DDE14C484LL}; + int32_t *l_679 = &g_111[1][3]; + int32_t *l_680 = &g_111[1][3]; + int32_t *l_681 = &g_111[1][3]; + int32_t *l_682 = &g_89; + int32_t *l_683 = (void*)0; + int32_t *l_684 = &g_111[6][3]; + int32_t *l_685 = &g_111[1][3]; + int32_t *l_686 = &g_111[4][8]; + int32_t *l_687 = &g_89; + int32_t *l_688 = &g_92; + int32_t *l_689 = &g_89; + int32_t *l_690 = &g_111[7][0]; + int32_t l_691 = (-1L); + int32_t *l_692 = &g_92; + int32_t *l_693 = &l_691; + int32_t *l_694 = &g_111[1][3]; + int32_t *l_695 = (void*)0; + int32_t *l_696 = &g_111[1][3]; + int32_t l_697 = 0x8F752B8FL; + int32_t *l_698 = &g_111[2][4]; + int32_t *l_699[6][5][7] = {{{(void*)0,&l_691,&g_89,&g_111[1][1],(void*)0,&l_691,&g_89},{&l_691,(void*)0,&l_691,&g_89,&l_691,&g_89,&g_111[1][3]},{&g_111[1][5],&l_691,&g_89,&g_89,&g_111[0][3],&g_111[1][3],&l_697},{(void*)0,&l_691,&l_697,&l_697,&l_697,&l_691,&g_89},{&g_111[1][3],&g_89,&l_697,&g_111[1][3],&g_89,&l_691,&l_691}},{{&g_111[1][3],&g_92,&g_111[1][3],&g_111[1][3],&g_92,&g_111[1][3],&g_111[7][4]},{&g_111[1][1],&g_89,(void*)0,&g_92,(void*)0,&g_89,&g_111[7][8]},{&g_89,(void*)0,&l_691,&g_111[7][4],&g_111[1][1],&l_691,&g_89},{(void*)0,&g_111[1][3],(void*)0,&l_697,(void*)0,&l_691,&g_89},{&g_92,&l_691,(void*)0,&g_89,&g_111[1][3],&l_691,&g_89}},{{&l_697,&g_92,(void*)0,(void*)0,&g_111[1][3],&l_691,&l_691},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0},{&g_92,&g_111[1][3],&g_111[7][4],&l_697,(void*)0,&g_89,&g_89},{&l_691,&l_691,&g_89,&g_111[0][8],&l_697,&l_697,&g_111[7][4]},{&g_92,&l_697,&g_92,&g_92,&l_691,(void*)0,&g_89}},{{(void*)0,&l_691,&g_89,&l_697,&g_111[1][2],(void*)0,(void*)0},{&l_697,&g_89,&l_691,&l_697,(void*)0,&l_691,(void*)0},{&g_92,(void*)0,(void*)0,&g_92,&g_89,&g_89,&l_691},{(void*)0,&g_92,&g_111[1][1],&g_111[0][8],(void*)0,&l_697,&g_111[7][8]},{(void*)0,&g_89,&l_691,&l_697,&l_691,&g_89,&l_691}},{{(void*)0,&l_697,&g_111[1][5],(void*)0,(void*)0,&g_89,(void*)0},{&l_697,&l_697,&g_92,(void*)0,&g_89,&g_111[7][8],(void*)0},{&g_111[7][8],(void*)0,&g_92,&g_89,&g_89,&g_89,&g_89},{&g_111[1][5],&g_111[1][1],&g_111[1][5],&l_697,&g_111[0][8],&g_111[1][2],&g_111[7][4]},{&g_89,&g_111[0][8],&l_691,(void*)0,(void*)0,&g_92,&g_89}},{{&g_111[1][3],&l_697,&g_111[1][1],&l_691,&g_111[0][3],&g_111[1][2],(void*)0},{&l_691,&l_691,(void*)0,&g_92,&g_111[1][1],&g_89,&l_691},{&g_111[1][2],(void*)0,&l_691,&l_697,&g_111[1][3],&g_111[7][8],&g_89},{&g_111[0][8],(void*)0,&g_89,&g_89,&g_92,&g_89,&g_89},{&l_691,&l_691,&g_92,&g_111[1][2],&l_691,&g_89,(void*)0}}}; + int64_t l_700 = 1L; + int16_t l_701 = 8L; + int32_t l_702[1][6][7] = {{{0L,1L,0x18B116A3L,0L,0x18B116A3L,1L,0L},{8L,0xF5B73F85L,3L,0x8478EF1FL,0xF5B73F85L,0x8478EF1FL,3L},{0L,0L,0x04248741L,(-1L),(-5L),0x04248741L,(-5L)},{6L,3L,3L,6L,0x8478EF1FL,8L,6L},{(-1L),(-5L),0x18B116A3L,0x18B116A3L,(-5L),(-1L),1L},{0xFEB019D1L,3L,0xF5B73F85L,8L,8L,0xF5B73F85L,3L}}}; + int8_t l_703 = 5L; + int16_t l_704 = 0x19F2L; + int8_t l_705 = (-1L); + int32_t l_707 = 0xCB0D6A35L; + int32_t l_708 = 0xC949726BL; + int8_t l_709[10] = {0x4FL,0x87L,0x4FL,0x87L,0x4FL,0x87L,0x4FL,0x87L,0x4FL,0x87L}; + int64_t l_710 = (-1L); + uint32_t l_711 = 1UL; + uint16_t l_714 = 0xFD9EL; + int i, j, k; + l_711--; + l_714--; + for (g_706 = (-3); (g_706 > (-9)); g_706--) + { /* block id: 327 */ + union U0 *l_723 = &g_229[1][0][4]; + uint16_t *l_734 = &g_444; + uint32_t l_735 = 8UL; + uint64_t *l_736 = &g_223.f3; + uint64_t *l_737 = &g_10[9].f3; + uint64_t *l_738 = &g_223.f3; + uint64_t *l_739 = (void*)0; + uint64_t *l_740 = &g_223.f3; + uint64_t *l_741 = &g_223.f3; + uint64_t *l_742 = &g_223.f3; + uint64_t *l_743 = &g_10[9].f3; + uint64_t *l_744 = &g_223.f3; + int32_t l_745 = 0x1A8AE3E5L; + int32_t l_746[6] = {0x10D458ECL,0x5D95F8E7L,0x10D458ECL,0x10D458ECL,0x5D95F8E7L,0x10D458ECL}; + int i; + l_746[5] ^= (((safe_mul_func_int16_t_s_s((((safe_mul_func_int8_t_s_s(((p_30.f0 , l_723) != l_723), (0x10ED398AEA39893FLL < ((safe_mul_func_uint8_t_u_u(((safe_mul_func_int8_t_s_s((g_428[0][0][2] , (((*l_692) & (0xD0L < (safe_mod_func_uint32_t_u_u((safe_div_func_uint64_t_u_u((l_745 ^= (((safe_lshift_func_uint8_t_u_u((((*l_734) &= 6UL) > p_28), 7)) , (*l_693)) > l_735)), 0x48414B2CEFF21B1FLL)), 4UL)))) , g_10[9].f4)), 1UL)) || 18446744073709551615UL), g_89)) & p_30.f0)))) == p_29) >= 0xEEE62B04L), (*l_684))) < 4UL) , p_30.f2); + return g_149; + } + return g_53[2]; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static uint8_t func_33(union U2 * p_34, uint32_t p_35, union U0 p_36, uint8_t p_37, union U2 * p_38) +{ /* block id: 319 */ + int32_t *l_676 = (void*)0; + int32_t **l_677 = &l_676; + (*l_677) = l_676; + return p_37; +} + + +/* ------------------------------------------ */ +/* + * reads : g_231.f1 + * writes: + */ +static uint32_t func_40(union U2 * p_41, union U2 ** p_42, union U2 * p_43) +{ /* block id: 9 */ + uint64_t l_55 = 0x80453D47EBDCF28DLL; + uint8_t *l_86 = &g_2; + int32_t l_113[10] = {0xF63A0E5FL,(-1L),0xBFF73A4BL,(-1L),0xF63A0E5FL,0xF63A0E5FL,(-1L),0xBFF73A4BL,(-1L),0xF63A0E5FL}; + uint32_t l_152[1]; + int64_t *l_176[6][9][4]; + uint32_t l_196 = 0x2BEC0524L; + int32_t *l_204 = &l_113[4]; + union U2 l_217 = {7L}; + union U0 *l_228[10] = {&g_226,(void*)0,&g_226,(void*)0,&g_226,(void*)0,&g_226,(void*)0,&g_226,(void*)0}; + union U0 *l_230 = &g_231[2][3][1]; + const union U0 *l_254[10][2][7] = {{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}},{{&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1],&g_231[2][3][1]},{&g_255,&g_255,&g_255,&g_255,&g_255,&g_255,&g_255}}}; + uint8_t l_273 = 0x57L; + int64_t l_401 = 0xD80C2B337075255ALL; + int32_t l_412 = 0xFC3C03E8L; + const uint16_t *l_449 = (void*)0; + int32_t * const *l_468[3]; + int32_t * const **l_467 = &l_468[1]; + uint16_t l_530 = 0x994DL; + uint64_t l_546 = 0UL; + int32_t ***l_550 = (void*)0; + union U1 l_561 = {0x4A4BD98AL}; + uint64_t l_565 = 1UL; + int64_t l_630 = 0x4F210B20CA5980E1LL; + uint8_t l_639 = 251UL; + int16_t *l_640 = (void*)0; + int16_t *l_641 = (void*)0; + int16_t *l_642 = &g_507; + uint32_t l_643 = 0x1483458EL; + uint64_t l_644 = 0x4B3D7633749DC52FLL; + uint8_t l_645[10][1] = {{1UL},{0x76L},{1UL},{0x76L},{1UL},{0x76L},{1UL},{0x76L},{1UL},{0x76L}}; + uint64_t l_646[3][1]; + int32_t l_647 = 0x551C0AE0L; + uint32_t l_666 = 0UL; + uint8_t l_667[3]; + uint32_t *l_668 = (void*)0; + uint32_t *l_669 = &l_152[0]; + uint32_t l_670 = 9UL; + int16_t *l_671 = &g_75; + int32_t l_672 = 0x0446CA0FL; + int8_t l_673[3][6]; + int32_t l_674[9] = {(-1L),(-4L),(-1L),(-4L),(-1L),(-4L),(-1L),(-4L),(-1L)}; + int i, j, k; + for (i = 0; i < 1; i++) + l_152[i] = 0x975F8E47L; + for (i = 0; i < 6; i++) + { + for (j = 0; j < 9; j++) + { + for (k = 0; k < 4; k++) + l_176[i][j][k] = &g_149; + } + } + for (i = 0; i < 3; i++) + l_468[i] = &l_204; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + l_646[i][j] = 5UL; + } + for (i = 0; i < 3; i++) + l_667[i] = 255UL; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 6; j++) + l_673[i][j] = 0x09L; + } + return g_231[2][3][1].f1; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static int16_t func_66(uint8_t * const p_67, int64_t p_68, union U2 *** const p_69) +{ /* block id: 26 */ + return p_68; +} + + +/* ------------------------------------------ */ +/* + * reads : g_93 + * writes: g_93 + */ +static uint8_t * func_70(int64_t p_71, int32_t p_72, uint8_t * p_73) +{ /* block id: 23 */ + int32_t *l_87 = (void*)0; + int32_t *l_88 = &g_89; + int32_t *l_90 = &g_89; + int32_t *l_91[7]; + uint8_t *l_96 = &g_53[4]; + int i; + for (i = 0; i < 7; i++) + l_91[i] = &g_89; + ++g_93; + return l_96; +} + + + + +/* ---------------------------------------- */ +int main (int argc, char* argv[]) +{ + int i, j, k; + int print_hash_value = 0; + if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; + platform_main_begin(); + crc32_gentab(); + func_1(); + transparent_crc(g_2, "g_2", print_hash_value); + for (i = 0; i < 10; i++) + { + transparent_crc(g_10[i].f0, "g_10[i].f0", print_hash_value); + transparent_crc(g_10[i].f1, "g_10[i].f1", print_hash_value); + transparent_crc(g_10[i].f2, "g_10[i].f2", print_hash_value); + transparent_crc(g_10[i].f4, "g_10[i].f4", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_49, "g_49", print_hash_value); + for (i = 0; i < 6; i++) + { + transparent_crc(g_53[i], "g_53[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_75, "g_75", print_hash_value); + transparent_crc(g_89, "g_89", print_hash_value); + transparent_crc(g_92, "g_92", print_hash_value); + transparent_crc(g_93, "g_93", print_hash_value); + transparent_crc(g_101, "g_101", print_hash_value); + for (i = 0; i < 9; i++) + { + for (j = 0; j < 9; j++) + { + transparent_crc(g_111[i][j], "g_111[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_147, "g_147", print_hash_value); + transparent_crc(g_149, "g_149", print_hash_value); + transparent_crc(g_223.f0, "g_223.f0", print_hash_value); + transparent_crc(g_223.f1, "g_223.f1", print_hash_value); + transparent_crc(g_223.f2, "g_223.f2", print_hash_value); + transparent_crc(g_223.f4, "g_223.f4", print_hash_value); + transparent_crc(g_226.f0, "g_226.f0", print_hash_value); + transparent_crc(g_226.f1, "g_226.f1", print_hash_value); + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 5; k++) + { + transparent_crc(g_229[i][j][k].f0, "g_229[i][j][k].f0", print_hash_value); + transparent_crc(g_229[i][j][k].f1, "g_229[i][j][k].f1", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + for (i = 0; i < 6; i++) + { + for (j = 0; j < 9; j++) + { + for (k = 0; k < 4; k++) + { + transparent_crc(g_231[i][j][k].f1, "g_231[i][j][k].f1", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_245, "g_245", print_hash_value); + transparent_crc(g_255.f0, "g_255.f0", print_hash_value); + transparent_crc(g_255.f1, "g_255.f1", print_hash_value); + transparent_crc(g_319, "g_319", print_hash_value); + transparent_crc(g_375, "g_375", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 4; k++) + { + transparent_crc(g_428[i][j][k].f0, "g_428[i][j][k].f0", print_hash_value); + transparent_crc(g_428[i][j][k].f1, "g_428[i][j][k].f1", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_444, "g_444", print_hash_value); + transparent_crc(g_479, "g_479", print_hash_value); + transparent_crc(g_507, "g_507", print_hash_value); + transparent_crc(g_627, "g_627", print_hash_value); + transparent_crc(g_706, "g_706", print_hash_value); + transparent_crc(g_814.f0, "g_814.f0", print_hash_value); + transparent_crc(g_814.f1, "g_814.f1", print_hash_value); + transparent_crc(g_814.f2, "g_814.f2", print_hash_value); + transparent_crc(g_814.f4, "g_814.f4", print_hash_value); + transparent_crc(g_1007, "g_1007", print_hash_value); + transparent_crc(g_1178, "g_1178", print_hash_value); + for (i = 0; i < 10; i++) + { + for (j = 0; j < 6; j++) + { + transparent_crc(g_1198[i][j], "g_1198[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_1232, "g_1232", print_hash_value); + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 5; k++) + { + transparent_crc(g_1399[i][j][k], "g_1399[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + for (i = 0; i < 2; i++) + { + transparent_crc(g_1574[i].f0, "g_1574[i].f0", print_hash_value); + transparent_crc(g_1574[i].f1, "g_1574[i].f1", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_1582, "g_1582", print_hash_value); + transparent_crc(g_1693, "g_1693", print_hash_value); + transparent_crc(g_1695, "g_1695", print_hash_value); + transparent_crc(g_1743, "g_1743", print_hash_value); + transparent_crc(g_1771, "g_1771", print_hash_value); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 4; j++) + { + for (k = 0; k < 3; k++) + { + transparent_crc(g_1864[i][j][k], "g_1864[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_2120, "g_2120", print_hash_value); + platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); + return 0; +} + +/************************ statistics ************************* +XXX max struct depth: 0 +breakdown: + depth: 0, occurrence: 713 +XXX total union variables: 42 + +XXX non-zero bitfields defined in structs: 1 +XXX zero bitfields defined in structs: 0 +XXX const bitfields defined in structs: 0 +XXX volatile bitfields defined in structs: 0 +XXX structs with bitfields in the program: 32 +breakdown: + indirect level: 0, occurrence: 20 + indirect level: 1, occurrence: 6 + indirect level: 2, occurrence: 3 + indirect level: 3, occurrence: 3 +XXX full-bitfields structs in the program: 0 +breakdown: +XXX times a bitfields struct's address is taken: 14 +XXX times a bitfields struct on LHS: 0 +XXX times a bitfields struct on RHS: 30 +XXX times a single bitfield on LHS: 14 +XXX times a single bitfield on RHS: 16 + +XXX max expression depth: 42 +breakdown: + depth: 1, occurrence: 160 + depth: 2, occurrence: 29 + depth: 3, occurrence: 2 + depth: 4, occurrence: 3 + depth: 5, occurrence: 1 + depth: 6, occurrence: 2 + depth: 7, occurrence: 1 + depth: 9, occurrence: 1 + depth: 10, occurrence: 2 + depth: 12, occurrence: 1 + depth: 14, occurrence: 1 + depth: 15, occurrence: 1 + depth: 16, occurrence: 1 + depth: 17, occurrence: 3 + depth: 18, occurrence: 2 + depth: 19, occurrence: 1 + depth: 20, occurrence: 2 + depth: 22, occurrence: 1 + depth: 23, occurrence: 2 + depth: 24, occurrence: 2 + depth: 25, occurrence: 1 + depth: 26, occurrence: 2 + depth: 27, occurrence: 3 + depth: 28, occurrence: 1 + depth: 29, occurrence: 2 + depth: 30, occurrence: 1 + depth: 34, occurrence: 1 + depth: 35, occurrence: 1 + depth: 36, occurrence: 1 + depth: 38, occurrence: 1 + depth: 42, occurrence: 1 + +XXX total number of pointers: 537 + +XXX times a variable address is taken: 1354 +XXX times a pointer is dereferenced on RHS: 255 +breakdown: + depth: 1, occurrence: 229 + depth: 2, occurrence: 25 + depth: 3, occurrence: 1 +XXX times a pointer is dereferenced on LHS: 245 +breakdown: + depth: 1, occurrence: 228 + depth: 2, occurrence: 17 +XXX times a pointer is compared with null: 50 +XXX times a pointer is compared with address of another variable: 8 +XXX times a pointer is compared with another pointer: 10 +XXX times a pointer is qualified to be dereferenced: 13484 + +XXX max dereference level: 5 +breakdown: + level: 0, occurrence: 0 + level: 1, occurrence: 1642 + level: 2, occurrence: 237 + level: 3, occurrence: 148 + level: 4, occurrence: 45 + level: 5, occurrence: 1 +XXX number of pointers point to pointers: 186 +XXX number of pointers point to scalars: 314 +XXX number of pointers point to structs: 0 +XXX percent of pointers has null in alias set: 31.3 +XXX average alias set size: 1.5 + +XXX times a non-volatile is read: 1761 +XXX times a non-volatile is write: 847 +XXX times a volatile is read: 0 +XXX times read thru a pointer: 0 +XXX times a volatile is write: 0 +XXX times written thru a pointer: 0 +XXX times a volatile is available for access: 0 +XXX percentage of non-volatile access: 100 + +XXX forward jumps: 0 +XXX backward jumps: 10 + +XXX stmts: 154 +XXX max block depth: 5 +breakdown: + depth: 0, occurrence: 24 + depth: 1, occurrence: 26 + depth: 2, occurrence: 22 + depth: 3, occurrence: 27 + depth: 4, occurrence: 21 + depth: 5, occurrence: 34 + +XXX percentage a fresh-made variable is used: 14.7 +XXX percentage an existing variable is used: 85.3 +FYI: the random generator makes assumptions about the integer size. See platform.info for more details. +********************* end of statistics **********************/ + diff --git a/tests/fuzz/15.c.txt b/tests/fuzz/15.c.txt new file mode 100644 index 00000000..42eb1e0f --- /dev/null +++ b/tests/fuzz/15.c.txt @@ -0,0 +1 @@ +checksum = B1ED5468 diff --git a/tests/fuzz/19.c b/tests/fuzz/19.c new file mode 100644 index 00000000..d94318c5 --- /dev/null +++ b/tests/fuzz/19.c @@ -0,0 +1,1408 @@ +/* + * This is a RANDOMLY GENERATED PROGRAM. + * + * Generator: csmith 2.2.0 + * Git version: bf42ffd + * Options: --no-volatiles --no-packed-struct --no-math64 + * Seed: 2524651702 + */ + +#include "csmith.h" + + +static long __undefined; + +/* --- Struct/Union Declarations --- */ +/* --- GLOBAL VARIABLES --- */ +static uint32_t g_2[5][1] = {{0xF1124F01L},{0x1F2C29A3L},{0xF1124F01L},{0x1F2C29A3L},{0xF1124F01L}}; +static int32_t g_3 = 0x3FA75C19L; +static uint32_t g_14[6] = {0xD1A4E665L,0xD1A4E665L,0xD1A4E665L,0xD1A4E665L,0xD1A4E665L,0xD1A4E665L}; +static uint32_t g_15 = 18446744073709551615UL; +static int32_t g_34 = 1L; +static int8_t g_36 = 0x6DL; +static uint8_t g_40[7] = {0xEAL,0xEAL,0xEAL,0xEAL,0xEAL,0xEAL,0xEAL}; +static uint8_t g_44 = 0UL; +static uint8_t *g_43 = &g_44; +static int32_t g_46 = 0x461302D9L; +static int32_t g_51[2][8][3] = {{{0x0D357E8FL,0x604C38DBL,0x0D357E8FL},{0x0D357E8FL,0x349DDA4AL,0x1ADF561FL},{0x0D357E8FL,0x2D584125L,(-4L)},{0x0D357E8FL,0x604C38DBL,0x0D357E8FL},{0x0D357E8FL,0x349DDA4AL,0x1ADF561FL},{0x0D357E8FL,0x2D584125L,(-4L)},{0x0D357E8FL,0x604C38DBL,0x0D357E8FL},{0x0D357E8FL,0x349DDA4AL,0x1ADF561FL}},{{0x0D357E8FL,0x2D584125L,(-4L)},{0x0D357E8FL,0x1ADF561FL,(-10L)},{(-10L),0x0D357E8FL,0xCF8610F1L},{(-10L),(-4L),(-9L)},{(-10L),0x1ADF561FL,(-10L)},{(-10L),0x0D357E8FL,0xCF8610F1L},{(-10L),(-4L),(-9L)},{(-10L),0x1ADF561FL,(-10L)}}}; +static uint32_t g_52 = 0x171C63CCL; +static uint32_t g_56 = 0xFBFBE831L; +static uint32_t *g_55 = &g_56; +static const int8_t * const g_132 = &g_36; +static const int8_t * const *g_131 = &g_132; +static int32_t g_140 = 0L; +static int32_t *g_143 = &g_140; +static uint8_t **g_175 = &g_43; +static uint8_t **g_176 = &g_43; +static uint8_t **g_177 = (void*)0; +static int8_t *g_243[6][2][9] = {{{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36}},{{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36}},{{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36}},{{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36}},{{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36}},{{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36,&g_36}}}; +static int8_t **g_242 = &g_243[5][1][5]; +static int8_t **g_245 = &g_243[5][1][5]; +static uint16_t g_251 = 0x6187L; +static int8_t g_255 = 0xFEL; +static int16_t g_290 = 0xF4DEL; +static int16_t *g_289 = &g_290; +static uint32_t g_294[5] = {0xFDB146E2L,0xFDB146E2L,0xFDB146E2L,0xFDB146E2L,0xFDB146E2L}; +static int32_t g_297[2] = {1L,1L}; +static int32_t *g_312[2][1][6] = {{{(void*)0,(void*)0,&g_51[0][3][1],(void*)0,(void*)0,&g_51[0][3][1]}},{{(void*)0,(void*)0,&g_51[0][3][1],(void*)0,(void*)0,&g_51[0][3][1]}}}; +static uint8_t g_320 = 0xD4L; +static int16_t g_347 = 0x586CL; +static int16_t g_419 = 0xDAAFL; +static uint32_t g_477 = 0x661A1A9FL; +static uint32_t g_705[6] = {1UL,1UL,1UL,1UL,1UL,1UL}; +static uint32_t ** const g_736 = &g_55; +static uint32_t ** const *g_735 = &g_736; +static uint8_t ****g_897 = (void*)0; +static uint8_t ***g_905 = &g_175; +static uint8_t ****g_904[3][6] = {{&g_905,&g_905,&g_905,&g_905,&g_905,&g_905},{&g_905,&g_905,&g_905,&g_905,&g_905,&g_905},{&g_905,&g_905,&g_905,&g_905,&g_905,&g_905}}; +static int32_t **g_961 = &g_312[1][0][4]; +static int32_t ***g_960 = &g_961; +static uint16_t g_969 = 5UL; +static int8_t ***g_1019[7][1][1] = {{{&g_242}},{{&g_242}},{{&g_242}},{{&g_242}},{{&g_242}},{{&g_242}},{{&g_242}}}; +static int8_t ****g_1018 = &g_1019[3][0][0]; +static int32_t g_1055 = (-8L); +static uint32_t g_1099 = 0xAD3B6902L; +static int32_t g_1132 = (-9L); +static int16_t * const *g_1185 = &g_289; +static int16_t * const * const *g_1184 = &g_1185; +static int16_t g_1189 = 0L; +static uint32_t **g_1238 = &g_55; +static uint32_t ***g_1237[8][4][4] = {{{&g_1238,(void*)0,&g_1238,(void*)0},{&g_1238,(void*)0,&g_1238,&g_1238},{(void*)0,&g_1238,&g_1238,(void*)0},{(void*)0,&g_1238,(void*)0,&g_1238}},{{&g_1238,(void*)0,(void*)0,&g_1238},{&g_1238,&g_1238,&g_1238,(void*)0},{&g_1238,&g_1238,&g_1238,(void*)0},{&g_1238,(void*)0,&g_1238,&g_1238}},{{&g_1238,&g_1238,&g_1238,(void*)0},{&g_1238,&g_1238,&g_1238,&g_1238},{&g_1238,(void*)0,(void*)0,&g_1238},{(void*)0,&g_1238,(void*)0,(void*)0}},{{&g_1238,(void*)0,&g_1238,(void*)0},{&g_1238,&g_1238,(void*)0,(void*)0},{(void*)0,(void*)0,&g_1238,&g_1238},{&g_1238,&g_1238,&g_1238,&g_1238}},{{&g_1238,&g_1238,&g_1238,&g_1238},{&g_1238,&g_1238,&g_1238,&g_1238},{&g_1238,&g_1238,&g_1238,&g_1238},{&g_1238,(void*)0,(void*)0,(void*)0}},{{&g_1238,&g_1238,&g_1238,(void*)0},{&g_1238,(void*)0,&g_1238,(void*)0},{(void*)0,&g_1238,(void*)0,&g_1238},{&g_1238,(void*)0,(void*)0,&g_1238}},{{&g_1238,&g_1238,&g_1238,(void*)0},{&g_1238,&g_1238,&g_1238,&g_1238},{&g_1238,(void*)0,&g_1238,(void*)0},{&g_1238,&g_1238,&g_1238,(void*)0}},{{&g_1238,&g_1238,&g_1238,&g_1238},{(void*)0,(void*)0,&g_1238,&g_1238},{(void*)0,&g_1238,&g_1238,(void*)0},{&g_1238,&g_1238,&g_1238,&g_1238}}}; +static uint32_t ***g_1241 = (void*)0; +static uint32_t g_1254[8][1][8] = {{{0x441F7909L,0x441F7909L,0UL,0x5B976413L,18446744073709551610UL,0UL,18446744073709551610UL,0x5B976413L}},{{0x0ECD52E7L,0x5B976413L,0x0ECD52E7L,0xD72EFABCL,0x5B976413L,0x6701CBD7L,0x6701CBD7L,0x5B976413L}},{{0x5B976413L,0x6701CBD7L,0x6701CBD7L,0x5B976413L,0xD72EFABCL,0x0ECD52E7L,0x5B976413L,0x0ECD52E7L}},{{0x5B976413L,18446744073709551610UL,0UL,18446744073709551610UL,0x5B976413L,0UL,0x441F7909L,0x441F7909L}},{{0x0ECD52E7L,18446744073709551610UL,0xD72EFABCL,0xD72EFABCL,18446744073709551610UL,0x0ECD52E7L,0x6701CBD7L,18446744073709551610UL}},{{0x441F7909L,0x6701CBD7L,0xD72EFABCL,0x441F7909L,0xD72EFABCL,0x6701CBD7L,0x441F7909L,0x0ECD52E7L}},{{18446744073709551610UL,0x5B976413L,0UL,0x441F7909L,0x441F7909L,0UL,0x5B976413L,18446744073709551610UL}},{{0x0ECD52E7L,0x441F7909L,0x6701CBD7L,0xD72EFABCL,0x441F7909L,0xD72EFABCL,0x6701CBD7L,0x441F7909L}}}; +static int16_t g_1285 = 0L; +static uint8_t * const **g_1295 = (void*)0; +static uint8_t g_1298 = 0xB8L; +static int16_t g_1333 = 0x34D4L; +static uint32_t g_1334 = 0x1191E655L; +static int32_t g_1509 = 1L; +static uint8_t ***g_1548 = &g_176; +static uint8_t ***g_1549 = (void*)0; +static uint8_t ***g_1550 = (void*)0; +static uint8_t ***g_1551[3][5] = {{&g_176,&g_176,&g_176,&g_176,&g_176},{&g_176,&g_176,&g_176,&g_176,&g_176},{&g_176,&g_176,&g_176,&g_176,&g_176}}; +static uint8_t ***g_1552[10][9] = {{&g_175,&g_177,&g_175,(void*)0,&g_175,&g_175,(void*)0,&g_175,&g_177},{(void*)0,&g_175,&g_175,(void*)0,&g_175,&g_177,&g_176,&g_175,&g_175},{&g_175,&g_175,&g_177,(void*)0,&g_177,&g_175,&g_175,&g_177,&g_175},{&g_176,&g_175,&g_176,(void*)0,&g_177,&g_176,&g_176,&g_176,&g_177},{&g_176,&g_177,&g_177,&g_176,&g_175,&g_176,(void*)0,&g_177,&g_176},{&g_175,&g_177,&g_175,(void*)0,&g_175,&g_175,(void*)0,&g_175,&g_177},{(void*)0,&g_175,&g_175,(void*)0,&g_175,&g_177,&g_176,&g_175,&g_175},{&g_175,&g_175,&g_177,(void*)0,&g_177,&g_175,&g_175,&g_177,&g_175},{&g_176,&g_175,&g_176,(void*)0,&g_177,&g_176,&g_176,&g_176,&g_177},{&g_176,&g_177,&g_177,&g_176,&g_175,&g_176,(void*)0,&g_177,&g_176}}; +static uint8_t **** const g_1547[1][6][2] = {{{&g_1551[1][3],&g_1552[7][4]},{&g_1551[1][3],&g_1551[1][3]},{&g_1552[7][4],&g_1551[1][3]},{&g_1551[1][3],&g_1552[7][4]},{&g_1551[1][3],&g_1551[1][3]},{&g_1552[7][4],&g_1551[1][3]}}}; +static uint8_t **** const *g_1546[5] = {&g_1547[0][2][0],&g_1547[0][2][0],&g_1547[0][2][0],&g_1547[0][2][0],&g_1547[0][2][0]}; +static int8_t ***g_1656 = &g_245; +static uint16_t g_1766 = 0x2A71L; +static const uint32_t g_1776 = 4294967288UL; +static const uint32_t g_1782[6][8][5] = {{{9UL,1UL,0xC7DDDB76L,0x6C0C4151L,0x8031E06CL},{4294967288UL,0x67522ABBL,4294967289UL,9UL,0x6B1862C6L},{4294967289UL,0x035D4646L,0x4BD87A52L,0xF04D3E88L,0x02BA768FL},{0x67522ABBL,1UL,0xFBE5C2AFL,0x09838561L,0x6E51EAD8L},{0x67522ABBL,0x8031E06CL,0xFC56E314L,0x5133D18EL,0xF04D3E88L},{4294967289UL,0xFBE5C2AFL,4294967286UL,4294967295UL,4294967295UL},{4294967288UL,4294967289UL,4294967288UL,0xFC56E314L,0x4BD87A52L},{9UL,0x09838561L,4294967295UL,1UL,3UL}},{{0xD3C5907BL,0x6C0C4151L,4294967289UL,0x8031E06CL,0x035D4646L},{0x6B1862C6L,0x6E51EAD8L,4294967295UL,3UL,0x02BA768FL},{4294967294UL,0xD3C5907BL,4294967288UL,0x67522ABBL,4294967289UL},{0x6C0C4151L,0x8031E06CL,4294967286UL,4294967295UL,0xB9EFEB98L},{8UL,4294967291UL,0xFC56E314L,4294967295UL,0x2B8C1A21L},{4294967291UL,0x6B1862C6L,0xFBE5C2AFL,1UL,0x2B8C1A21L},{9UL,0x1C34F8ADL,0x4BD87A52L,4294967288UL,0xB9EFEB98L},{1UL,4294967288UL,4294967289UL,0xB9EFEB98L,4294967289UL}},{{0xE9241C7AL,0xE9241C7AL,0x6E51EAD8L,1UL,0x09838561L},{4294967288UL,3UL,0x8031E06CL,4294967291UL,0x37358859L},{1UL,4294967295UL,0xD83C2DFAL,1UL,4294967286UL},{0x4478B581L,3UL,0x2B8C1A21L,8UL,0x5A8F52F4L},{0xB9EFEB98L,0xE9241C7AL,0xF04D3E88L,0xC7DDDB76L,8UL},{1UL,1UL,0UL,7UL,0x5133D18EL},{0xF04D3E88L,4294967291UL,0x084A6D3FL,4294967286UL,0x02BA768FL},{0x02BA768FL,0xB3D218BBL,4294967289UL,4294967286UL,0x09838561L}},{{0x2BAF5CEFL,9UL,0xFDF9E1B7L,7UL,0xB3D218BBL},{4294967291UL,4294967295UL,0xC7DDDB76L,0xC7DDDB76L,4294967295UL},{0x37358859L,0x9D243B0BL,4294967295UL,8UL,4294967289UL},{0xFDF9E1B7L,0x02BA768FL,0x9D243B0BL,1UL,0x6B1862C6L},{1UL,0xFBE5C2AFL,0x6B1862C6L,4294967291UL,4294967286UL},{0xFDF9E1B7L,0x2BAF5CEFL,0x084A6D3FL,1UL,0x731D77D9L},{0x37358859L,0x084A6D3FL,0x035D4646L,0xFC56E314L,0x09838561L},{4294967291UL,0xB9EFEB98L,9UL,1UL,0x4478B581L}},{{0x2BAF5CEFL,4294967295UL,4294967291UL,4294967295UL,1UL},{0x02BA768FL,0x8031E06CL,4294967291UL,8UL,0UL},{0xF04D3E88L,0x37358859L,9UL,0x2B8C1A21L,0x6E51EAD8L},{1UL,0xD3C5907BL,0x035D4646L,0xD3C5907BL,1UL},{0xB9EFEB98L,4294967288UL,0x084A6D3FL,4294967286UL,0xE9241C7AL},{0x4478B581L,0x731D77D9L,0x6B1862C6L,4294967295UL,0x09838561L},{1UL,0xFDF9E1B7L,0x9D243B0BL,4294967288UL,0xE9241C7AL},{4294967288UL,4294967295UL,4294967295UL,0x4BD87A52L,1UL}},{{0xE9241C7AL,0xF04D3E88L,0xC7DDDB76L,8UL,0x6E51EAD8L},{0x8031E06CL,0x4478B581L,0xFDF9E1B7L,4294967291UL,0UL},{1UL,7UL,4294967289UL,0x2BAF5CEFL,1UL},{9UL,7UL,0x084A6D3FL,0x5133D18EL,0x4478B581L},{0x731D77D9L,0x4478B581L,0UL,1UL,0x09838561L},{0xFBE5C2AFL,0xF04D3E88L,0xF04D3E88L,0xFBE5C2AFL,0x731D77D9L},{7UL,4294967295UL,0x2B8C1A21L,0xD83C2DFAL,4294967286UL},{0xB3D218BBL,0xFDF9E1B7L,0xD83C2DFAL,8UL,0x6B1862C6L}}}; +static const uint32_t *g_1781 = &g_1782[2][3][4]; +static int8_t g_1857 = 0L; +static const uint8_t *g_1941 = (void*)0; +static const uint8_t ** const g_1940[7] = {&g_1941,&g_1941,&g_1941,&g_1941,&g_1941,&g_1941,&g_1941}; +static const uint8_t ** const *g_1939 = &g_1940[2]; +static const uint8_t ** const **g_1938 = &g_1939; +static const uint8_t ** const ***g_1937 = &g_1938; +static int16_t g_1961 = (-2L); +static const int8_t g_2067 = (-1L); +static const uint32_t ***g_2068[3] = {(void*)0,(void*)0,(void*)0}; +static int8_t g_2147[10] = {0x23L,0x23L,0x23L,0x23L,0x23L,0x23L,0x23L,0x23L,0x23L,0x23L}; +static uint16_t g_2148 = 0x794EL; +static int16_t g_2207 = 0L; + + +/* --- FORWARD DECLARATIONS --- */ +static uint16_t func_1(void); +static int8_t func_10(uint32_t p_11); +static int32_t func_16(int8_t p_17, uint32_t * p_18, uint32_t * p_19, uint16_t p_20, uint32_t p_21); +static uint32_t * func_22(int16_t p_23, uint32_t p_24, uint32_t * p_25); +static int32_t func_62(int32_t * p_63, uint8_t p_64); +static int32_t * func_65(int8_t p_66, uint16_t p_67, uint8_t p_68, int32_t * p_69, uint32_t * p_70); +static uint8_t * func_71(uint32_t p_72, int8_t p_73); +static int32_t * func_94(uint32_t * p_95, int32_t p_96, const int32_t p_97, int32_t p_98, int8_t p_99); +static int8_t func_100(int32_t * p_101, uint8_t p_102, uint8_t p_103, uint32_t p_104); +static int32_t * func_105(uint32_t p_106); + + +/* --- FUNCTIONS --- */ +/* ------------------------------------------ */ +/* + * reads : g_2 g_14 g_15 g_36 g_40 g_43 g_3 g_52 g_46 g_51 g_55 g_56 g_44 g_251 g_143 g_140 g_176 g_705 g_289 g_290 g_297 g_255 g_34 g_131 g_132 g_243 g_347 g_320 g_736 g_294 g_175 g_897 g_905 g_735 g_960 g_969 g_961 g_312 g_1334 g_1132 g_1184 g_1185 g_1099 g_1656 g_1238 g_1548 g_1018 g_1019 g_1254 g_1766 g_1776 g_1857 g_477 g_1298 g_1937 g_1961 g_242 g_1781 g_1782 g_419 g_2068 g_245 g_1938 g_2147 g_2148 g_1333 g_2207 + * writes: g_3 g_14 g_15 g_34 g_36 g_40 g_52 g_51 g_46 g_255 g_297 g_140 g_312 g_294 g_56 g_44 g_347 g_290 g_897 g_904 g_419 g_251 g_969 g_1334 g_1132 g_1298 g_175 g_1099 g_1055 g_477 g_55 g_1766 g_1781 g_960 g_242 g_961 g_705 g_2068 g_2148 g_2207 + */ +static uint16_t func_1(void) +{ /* block id: 0 */ + int32_t l_38 = 0xCA862934L; + int32_t l_1612 = 0xB952CD69L; + int32_t l_1634 = 0x1D6D5307L; + int16_t l_1658[5][6] = {{0x1999L,0L,0x1999L,0x1999L,0L,0x1999L},{0x1999L,0L,0x1999L,0x1999L,0L,0x0361L},{0x0361L,0x1999L,0x0361L,0x0361L,0x1999L,0x0361L},{0x0361L,0x1999L,0x0361L,0x0361L,0x1999L,0x0361L},{0x0361L,0x1999L,0x0361L,0x0361L,0x1999L,0x0361L}}; + uint8_t * const ***l_1712 = &g_1295; + uint8_t * const ****l_1711[9] = {&l_1712,&l_1712,&l_1712,&l_1712,&l_1712,&l_1712,&l_1712,&l_1712,&l_1712}; + uint8_t **l_1725 = &g_43; + int16_t l_1756[10][2] = {{0xB2C0L,(-1L)},{(-1L),0xB2C0L},{(-1L),(-1L)},{0xB2C0L,(-1L)},{(-1L),0xB2C0L},{(-1L),(-1L)},{0xB2C0L,(-1L)},{(-1L),0xB2C0L},{(-1L),(-1L)},{0xB2C0L,(-1L)}}; + int32_t l_1763 = (-8L); + uint32_t *l_1783 = &g_14[1]; + int32_t ***l_1785 = &g_961; + uint32_t *****l_1788 = (void*)0; + uint8_t l_1831 = 0x9CL; + uint8_t *l_1877 = &g_40[0]; + uint32_t l_2046 = 18446744073709551609UL; + int8_t l_2047 = 1L; + uint32_t l_2048 = 2UL; + int32_t l_2056 = 1L; + int32_t l_2058 = 0L; + int32_t l_2072 = 9L; + uint32_t l_2099 = 4UL; + uint32_t l_2116 = 4UL; + uint32_t l_2184 = 0xE4A882E7L; + int16_t **l_2189[6][6][7] = {{{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{(void*)0,&g_289,&g_289,(void*)0,(void*)0,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{(void*)0,&g_289,&g_289,&g_289,(void*)0,&g_289,(void*)0},{&g_289,(void*)0,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,(void*)0,&g_289,(void*)0,&g_289,&g_289,&g_289}},{{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0,(void*)0}},{{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{(void*)0,(void*)0,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,(void*)0,&g_289,&g_289,&g_289},{(void*)0,&g_289,&g_289,&g_289,&g_289,(void*)0,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,(void*)0,&g_289,&g_289,(void*)0}},{{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0,&g_289},{&g_289,(void*)0,(void*)0,(void*)0,(void*)0,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0,&g_289},{&g_289,&g_289,(void*)0,&g_289,(void*)0,&g_289,&g_289}},{{&g_289,&g_289,&g_289,(void*)0,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,(void*)0,(void*)0,&g_289,&g_289,&g_289,&g_289}},{{&g_289,(void*)0,&g_289,&g_289,&g_289,&g_289,&g_289},{&g_289,&g_289,(void*)0,&g_289,&g_289,(void*)0,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{(void*)0,&g_289,&g_289,(void*)0,(void*)0,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289},{(void*)0,&g_289,&g_289,&g_289,(void*)0,&g_289,(void*)0}}}; + int16_t ***l_2188 = &l_2189[0][5][4]; + int16_t ****l_2187[1]; + int i, j, k; + for (i = 0; i < 1; i++) + l_2187[i] = &l_2188; +lbl_2208: + for (g_3 = 0; (g_3 <= 0); g_3 += 1) + { /* block id: 3 */ + uint32_t *l_12 = (void*)0; + uint32_t *l_13[2][9][7] = {{{&g_14[4],&g_14[2],&g_14[1],&g_14[1],&g_14[1],(void*)0,&g_14[4]},{(void*)0,&g_14[1],&g_14[3],&g_14[1],&g_14[1],&g_14[3],&g_14[1]},{&g_14[4],&g_14[2],&g_14[1],&g_14[1],&g_14[1],(void*)0,&g_14[4]},{(void*)0,&g_14[1],&g_14[3],&g_14[1],&g_14[1],&g_14[3],&g_14[1]},{&g_14[4],&g_14[2],&g_14[1],&g_14[1],&g_14[1],(void*)0,&g_14[4]},{(void*)0,&g_14[1],&g_14[3],&g_14[1],&g_14[1],&g_14[3],&g_14[1]},{&g_14[4],&g_14[2],&g_14[1],&g_14[1],&g_14[1],(void*)0,&g_14[4]},{(void*)0,&g_14[1],&g_14[3],&g_14[1],&g_14[1],&g_14[3],&g_14[1]},{&g_14[4],&g_14[2],&g_14[1],&g_14[1],&g_14[1],(void*)0,&g_14[4]}},{{(void*)0,&g_14[1],&g_14[3],&g_14[1],&g_14[1],&g_14[3],&g_14[1]},{&g_14[4],&g_14[2],&g_14[1],&g_14[1],&g_14[1],(void*)0,&g_14[4]},{(void*)0,&g_14[1],&g_14[3],&g_14[1],(void*)0,&g_14[1],&g_14[0]},{&g_14[1],&g_14[3],&g_14[1],(void*)0,&g_14[4],&g_14[1],&g_14[1]},{&g_14[1],&g_14[0],&g_14[1],(void*)0,(void*)0,&g_14[1],&g_14[0]},{&g_14[1],&g_14[3],&g_14[1],(void*)0,&g_14[4],&g_14[1],&g_14[1]},{&g_14[1],&g_14[0],&g_14[1],(void*)0,(void*)0,&g_14[1],&g_14[0]},{&g_14[1],&g_14[3],&g_14[1],(void*)0,&g_14[4],&g_14[1],&g_14[1]},{&g_14[1],&g_14[0],&g_14[1],(void*)0,(void*)0,&g_14[1],&g_14[0]}}}; + int8_t *l_35 = &g_36; + int32_t l_37 = 0x129EC6EAL; + uint8_t *l_39 = &g_40[1]; + uint32_t l_1611 = 1UL; + const int16_t l_1613 = (-7L); + int32_t l_1616 = 0xF7091F80L; + int32_t l_1618 = 0x81A177EAL; + int32_t l_1623 = (-3L); + int8_t ***l_1657 = &g_245; + int i, j, k; + if ((((((safe_mul_func_int8_t_s_s(((safe_div_func_uint8_t_u_u(((safe_mod_func_int8_t_s_s(func_10((((g_15 &= (g_14[4] ^= g_2[1][0])) == func_16(g_2[2][0], func_22((safe_div_func_int8_t_s_s((safe_mul_func_int16_t_s_s(((safe_div_func_int32_t_s_s((safe_rshift_func_uint8_t_u_s((g_34 = 1UL), ((*l_35) ^= 0x4DL))), l_37)) == (((((*l_39) = l_38) , (--(*l_39))) >= l_37) ^ 0UL)), ((void*)0 == g_43))), g_3)), l_38, l_13[1][1][2]), g_55, l_37, g_56)) >= l_37)), l_38)) == 0x3C9EL), l_38)) , 0xBCL), l_1611)) | l_1612) == 1UL) < l_1613) == 0x39F7L)) + { /* block id: 771 */ + int32_t *l_1614 = &g_1055; + if (l_1613) + break; + (**g_960) = l_1614; + if (l_1611) + continue; + } + else + { /* block id: 775 */ + int32_t *l_1615 = &g_51[1][6][2]; + int32_t *l_1617 = &g_297[1]; + int32_t *l_1619 = &l_1616; + int32_t *l_1620 = (void*)0; + int32_t *l_1621 = &l_1618; + int32_t *l_1622 = &g_297[1]; + int32_t *l_1624 = &g_51[0][3][1]; + int32_t *l_1625 = &l_37; + int32_t *l_1626 = (void*)0; + int32_t *l_1627 = &g_1132; + int32_t *l_1628 = &g_297[1]; + int32_t *l_1629 = &l_1618; + int32_t *l_1630[9] = {&g_297[0],&g_297[0],&g_297[0],&g_297[0],&g_297[0],&g_297[0],&g_297[0],&g_297[0],&g_297[0]}; + uint8_t l_1631 = 6UL; + int i; + --l_1631; + return (*l_1617); + } + l_1634 |= 0xB346B708L; + for (g_1298 = 0; (g_1298 <= 0); g_1298 += 1) + { /* block id: 782 */ + uint32_t l_1635 = 0xEF083A2AL; + int32_t l_1644 = 0x4F483357L; + (*g_143) ^= l_1635; + (*g_143) = (safe_mul_func_uint16_t_u_u(((safe_sub_func_int8_t_s_s(((!(l_38 , l_1611)) != (l_1644 &= (safe_lshift_func_int8_t_s_s((safe_add_func_int8_t_s_s(0x2CL, l_1612)), 4)))), (safe_unary_minus_func_uint32_t_u((safe_div_func_int8_t_s_s(((g_320 <= (((l_38 <= (((safe_add_func_int16_t_s_s((safe_sub_func_uint16_t_u_u((l_1618 & (((safe_div_func_uint16_t_u_u((((((safe_rshift_func_int16_t_s_s(0x3853L, l_1635)) >= l_1612) , g_1656) != l_1657) & l_38), 65531UL)) ^ l_1623) && l_1635)), l_1658[1][1])), 0x80FFL)) == 7UL) == (**g_1238))) > 0x43L) || g_14[5])) , 5L), l_1612)))))) > l_1658[1][1]), 0UL)); + } + for (g_1099 = 0; (g_1099 <= 0); g_1099 += 1) + { /* block id: 789 */ + int16_t l_1661 = 0x12BEL; + uint16_t *l_1666[10][9] = {{(void*)0,&g_969,&g_251,&g_969,&g_251,&g_969,&g_969,&g_251,&g_969},{(void*)0,&g_969,(void*)0,(void*)0,(void*)0,&g_969,(void*)0,(void*)0,(void*)0},{&g_969,(void*)0,&g_251,&g_969,&g_251,&g_251,&g_969,&g_251,(void*)0},{&g_969,&g_969,&g_969,(void*)0,&g_969,(void*)0,&g_969,&g_969,&g_969},{&g_251,&g_251,&g_251,&g_969,&g_969,&g_251,&g_251,&g_251,&g_251},{(void*)0,&g_969,(void*)0,&g_969,(void*)0,&g_969,(void*)0,&g_969,(void*)0},{&g_251,(void*)0,&g_251,&g_251,(void*)0,&g_251,&g_251,&g_969,&g_251},{&g_969,&g_969,&g_969,&g_969,&g_969,&g_969,&g_969,&g_969,&g_969},{&g_969,&g_969,&g_969,&g_969,&g_251,&g_969,&g_251,&g_251,(void*)0},{(void*)0,&g_969,(void*)0,&g_969,(void*)0,&g_969,(void*)0,&g_969,(void*)0}}; + int16_t l_1667 = 0xD2A4L; + int32_t l_1680 = 0x06D2A1F8L; + int32_t l_1681 = 0xB17E7D5CL; + int8_t l_1682 = (-5L); + int32_t *l_1683 = &g_1055; + int i, j; + l_37 ^= ((*l_1683) = ((*g_143) = ((safe_add_func_uint32_t_u_u((--(***g_735)), (safe_mul_func_uint8_t_u_u(((l_1681 = (!((g_969 = (l_1667 &= 1UL)) != ((*g_132) != (((((safe_mul_func_int16_t_s_s(((***g_1548) && (safe_div_func_uint8_t_u_u((((safe_sub_func_int16_t_s_s(((safe_add_func_int32_t_s_s((safe_lshift_func_uint16_t_u_u(g_34, ((*g_1018) != (*g_1018)))), (*g_143))) , (((safe_add_func_uint16_t_u_u((l_1680 = ((((l_1618 = ((***g_1184) | ((((**g_1185) ^ l_1661) && l_1661) , l_1661))) < 1L) || 65533UL) | l_1616)), (-2L))) == l_1658[3][5]) != l_1661)), l_1623)) , 0L) | l_1661), l_1661))), l_1634)) <= (*g_143)) , l_38) || (*g_143)) != (***g_1184)))))) , (*g_43)), (***g_1548))))) <= l_1682))); + } + } + for (l_38 = 2; (l_38 <= (-27)); l_38 = safe_sub_func_int8_t_s_s(l_38, 6)) + { /* block id: 803 */ + int32_t l_1692 = 0L; + int32_t l_1702 = 0xA1267D64L; + uint32_t l_1722 = 8UL; + uint8_t * const * const l_1726 = &g_43; + uint32_t *l_1737 = &g_1099; + int8_t *l_1793 = (void*)0; + int32_t *l_1797 = (void*)0; + uint32_t l_1859 = 0x82CF6B6FL; + int8_t l_1899 = 1L; + uint16_t l_1902 = 65534UL; + int8_t ***l_1936[8] = {(void*)0,&g_242,&g_242,(void*)0,&g_242,&g_242,(void*)0,&g_242}; + uint32_t l_1957 = 5UL; + int32_t **l_2005 = &g_143; + uint32_t l_2007 = 18446744073709551615UL; + int32_t l_2050 = (-1L); + int32_t l_2051 = 5L; + int32_t l_2052[8][1]; + const int8_t *l_2066 = &g_2067; + const int8_t **l_2065[10] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + uint32_t l_2071[3][7][7] = {{{0x30CE76AEL,0UL,18446744073709551615UL,1UL,1UL,1UL,0UL},{0xAD0A2372L,0xEA6E9C20L,0UL,0x324BC3A3L,0xF442972AL,0x911E4A42L,0x911E4A42L},{18446744073709551608UL,18446744073709551610UL,0x1262E29EL,18446744073709551610UL,18446744073709551608UL,0x9477AE01L,0xF442972AL},{1UL,5UL,0x30CE76AEL,18446744073709551611UL,0x99881E2AL,0xDA83510BL,18446744073709551615UL},{0xF442972AL,0x911E4A42L,0xFCFF20AAL,0x23F69BAEL,18446744073709551608UL,0x30CE76AEL,0xAD0A2372L},{0x1262E29EL,0UL,18446744073709551615UL,1UL,0x6F0D46CCL,0x1262E29EL,0x7CF12E04L},{18446744073709551615UL,0xF442972AL,0x5F49E352L,5UL,18446744073709551615UL,0UL,0UL}},{{18446744073709551611UL,18446744073709551615UL,0x23F69BAEL,0x30CE76AEL,0UL,18446744073709551615UL,1UL},{0x250C5BC2L,18446744073709551615UL,6UL,0x30CE76AEL,1UL,1UL,0UL},{18446744073709551615UL,0x6F0D46CCL,1UL,5UL,0x911E4A42L,1UL,0x911E4A42L},{1UL,18446744073709551615UL,18446744073709551615UL,1UL,0x9477AE01L,0x23E5CD91L,0x30CE76AEL},{0x2665B0F5L,0UL,1UL,0x23F69BAEL,0xDA83510BL,0x9D1F30D5L,0UL},{18446744073709551611UL,0x5F49E352L,0x84F3CCEFL,0UL,0x9A4CA65DL,18446744073709551610UL,0x30CE76AEL},{6UL,0UL,0x324BC3A3L,0x5F49E352L,1UL,5UL,0x911E4A42L}},{{1UL,18446744073709551608UL,18446744073709551613UL,0xDC003897L,1UL,0UL,0UL},{1UL,18446744073709551615UL,18446744073709551615UL,0x324BC3A3L,18446744073709551608UL,0xCC0F1D77L,1UL},{0x9D1F30D5L,0x7DDAB611L,18446744073709551615UL,0xFCFF20AAL,0UL,0x9D1F30D5L,0UL},{18446744073709551615UL,18446744073709551615UL,18446744073709551613UL,0x7CF12E04L,0UL,0UL,0x7CF12E04L},{0x324BC3A3L,0UL,0x324BC3A3L,0x30CE76AEL,0x7CF12E04L,6UL,0xAD0A2372L},{0x5F49E352L,18446744073709551615UL,0x84F3CCEFL,18446744073709551615UL,18446744073709551614UL,18446744073709551615UL,0UL},{1UL,0UL,1UL,0x27C4E890L,0x911E4A42L,6UL,18446744073709551615UL}}}; + uint16_t l_2191 = 0UL; + uint32_t l_2194 = 0x1CA07694L; + uint8_t *****l_2202 = &g_904[0][3]; + uint8_t ******l_2201 = &l_2202; + uint8_t *l_2205 = &l_1831; + int32_t *l_2206[1][2]; + int i, j, k; + for (i = 0; i < 8; i++) + { + for (j = 0; j < 1; j++) + l_2052[i][j] = 1L; + } + for (i = 0; i < 1; i++) + { + for (j = 0; j < 2; j++) + l_2206[i][j] = &l_2052[2][0]; + } + if (((((0xEC18D826L > 0xC2623D2EL) == (safe_add_func_int32_t_s_s(((void*)0 == (*g_1018)), (*g_143)))) < ((*g_43) |= (((safe_add_func_int8_t_s_s(l_1658[4][2], (**g_131))) == (l_1634 = ((((safe_lshift_func_uint16_t_u_s(g_294[0], 5)) , l_1692) , 0x47L) && 0x07L))) != 0x6DDD7AF3L))) <= l_1692)) + { /* block id: 806 */ + int8_t l_1727 = 0x36L; + uint16_t l_1730 = 0x5E85L; + int32_t l_1758 = 1L; + int32_t l_1760 = 0x8ED80A0BL; + int32_t l_1762 = 0xC5EE06D0L; + int32_t l_1764 = 0x9C30C92FL; + uint8_t l_1773 = 0x04L; + uint32_t l_1795 = 0x25B5191FL; + int32_t *l_1832 = (void*)0; + int32_t l_1850 = 3L; + uint16_t l_1876 = 0xC3DDL; + uint32_t *****l_1891 = (void*)0; + uint16_t l_1901 = 65528UL; + for (g_419 = 0; (g_419 < 27); ++g_419) + { /* block id: 809 */ + int32_t l_1697[6] = {(-8L),(-8L),(-8L),(-8L),(-8L),(-8L)}; + uint16_t *l_1698[10][3] = {{&g_251,&g_251,&g_251},{&g_251,&g_251,&g_251},{&g_251,&g_251,&g_251},{&g_251,&g_969,&g_251},{&g_251,&g_251,&g_251},{&g_251,&g_251,&g_251},{&g_969,&g_251,&g_251},{&g_251,&g_251,&g_251},{&g_251,&g_251,&g_251},{&g_251,&g_969,&g_969}}; + int i, j; + (*g_143) ^= ((**g_736) , l_1612); + l_1634 = (safe_lshift_func_uint16_t_u_s((g_969 = l_1697[1]), 5)); + } + for (g_255 = 0; (g_255 > 7); g_255 = safe_add_func_int16_t_s_s(g_255, 8)) + { /* block id: 816 */ + uint8_t l_1701 = 0xB3L; + uint8_t * const ***l_1709 = (void*)0; + uint8_t * const ****l_1708 = &l_1709; + uint8_t * const *****l_1710[10][10][2] = {{{&l_1708,(void*)0},{&l_1708,&l_1708},{(void*)0,&l_1708},{&l_1708,(void*)0},{&l_1708,&l_1708},{(void*)0,&l_1708},{&l_1708,(void*)0},{&l_1708,&l_1708},{(void*)0,&l_1708},{&l_1708,(void*)0}},{{&l_1708,&l_1708},{(void*)0,&l_1708},{&l_1708,(void*)0},{&l_1708,&l_1708},{(void*)0,&l_1708},{&l_1708,(void*)0},{&l_1708,&l_1708},{(void*)0,&l_1708},{&l_1708,&l_1708},{(void*)0,(void*)0}},{{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0}},{{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708}},{{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0}},{{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0}},{{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708}},{{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0}},{{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0}},{{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708},{(void*)0,(void*)0},{&l_1708,(void*)0},{(void*)0,&l_1708}}}; + int32_t l_1721 = 1L; + uint32_t *l_1728 = &g_477; + int32_t *l_1729[5][7] = {{(void*)0,&l_38,&l_38,&l_38,(void*)0,&l_1692,&l_1692},{&g_34,(void*)0,&l_1612,(void*)0,&g_34,&g_1509,&g_1509},{(void*)0,&l_38,&l_38,&l_38,(void*)0,&l_1692,&l_1692},{&g_34,(void*)0,&l_1612,(void*)0,&g_34,&g_1509,&l_1612},{&l_1692,&l_1692,&g_34,&l_1692,&l_1692,&l_38,&l_38}}; + int8_t *l_1731 = &l_1727; + int32_t l_1739 = 0xD1196770L; + int32_t l_1759 = 0L; + uint16_t *l_1806[2][8] = {{&l_1730,&l_1730,&l_1730,&l_1730,&l_1730,&l_1730,&l_1730,&l_1730},{&l_1730,&l_1730,&l_1730,&l_1730,&l_1730,&l_1730,&l_1730,&l_1730}}; + int32_t *l_1833 = &g_3; + int i, j, k; + l_1702 = l_1701; + if ((safe_lshift_func_uint8_t_u_u((l_38 , 0xE4L), (((safe_mul_func_int8_t_s_s(((*l_1731) = (((safe_unary_minus_func_int8_t_s((&g_1547[0][2][1] != (l_1711[7] = l_1708)))) == (safe_add_func_int8_t_s_s((((**g_736) = (**g_736)) < (((safe_mod_func_uint16_t_u_u(((l_1634 = (((*l_1728) = (safe_mul_func_uint8_t_u_u((((**l_1726) = (((safe_add_func_uint8_t_u_u((l_1721 = l_1701), (l_1722 != (safe_div_func_int32_t_s_s((((l_1725 == l_1726) , 0x32L) > l_1727), (*g_143)))))) , 0UL) <= 0xB756L)) && 0UL), l_1612))) < 0UL)) , g_1132), (**g_1185))) && 0x6EL) | g_1254[7][0][7])), 0xB8L))) >= l_1730)), l_1730)) > 0xF123L) || (*g_43))))) + { /* block id: 825 */ + uint32_t *l_1738 = &g_56; + for (g_477 = (-18); (g_477 >= 4); g_477 = safe_add_func_int32_t_s_s(g_477, 1)) + { /* block id: 828 */ + int8_t l_1736 = 0xE8L; + (*g_143) |= l_1727; + l_1721 = (l_1721 < (l_1739 = ((l_1736 , 0x13L) <= ((l_1738 = l_1737) == ((*g_736) = (*g_736)))))); + if ((*g_143)) + break; + } + } + else + { /* block id: 836 */ + int32_t l_1761 = 0x3F63D84DL; + int32_t l_1784[6] = {0xC54599E7L,0xC54599E7L,0x4344EDEAL,0xC54599E7L,0xC54599E7L,0x4344EDEAL}; + int32_t ***l_1794[9] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + int16_t **l_1796[5][2][9] = {{{&g_289,&g_289,(void*)0,&g_289,&g_289,&g_289,(void*)0,(void*)0,&g_289},{(void*)0,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289}},{{(void*)0,&g_289,&g_289,&g_289,(void*)0,&g_289,(void*)0,&g_289,&g_289},{&g_289,&g_289,(void*)0,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289}},{{&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0,&g_289,(void*)0},{&g_289,(void*)0,(void*)0,(void*)0,&g_289,&g_289,&g_289,(void*)0,&g_289}},{{(void*)0,(void*)0,&g_289,&g_289,&g_289,(void*)0,(void*)0,&g_289,&g_289},{&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0,&g_289,&g_289,&g_289}},{{(void*)0,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289,(void*)0,&g_289},{&g_289,(void*)0,(void*)0,&g_289,&g_289,&g_289,&g_289,&g_289,&g_289}}}; + int i, j, k; + for (g_1132 = 0; (g_1132 >= 0); g_1132 -= 1) + { /* block id: 839 */ + int32_t l_1757 = 0x90288987L; + int32_t l_1765 = 0x82B8DD8AL; + const uint32_t *l_1775 = &g_1776; + const uint32_t **l_1774 = &l_1775; + const uint32_t *l_1778 = (void*)0; + const uint32_t **l_1777 = &l_1778; + const uint32_t *l_1780 = &g_1776; + const uint32_t **l_1779 = &l_1780; + int i, j, k; + l_1784[5] = ((safe_sub_func_int32_t_s_s((safe_mul_func_int8_t_s_s((safe_add_func_uint8_t_u_u((++(**l_1725)), ((((l_1761 = ((safe_mod_func_uint32_t_u_u((safe_lshift_func_uint16_t_u_s(0x6591L, g_1254[(g_1132 + 4)][g_1132][(g_1132 + 2)])), (l_1721 & (((safe_add_func_int16_t_s_s(l_1721, (**g_1185))) , &g_1019[3][0][0]) != &g_1019[6][0][0])))) || ((safe_add_func_uint16_t_u_u(((g_1781 = ((*l_1779) = ((*l_1777) = ((*l_1774) = func_22(((((*g_143) = ((++g_1766) < (((((((safe_add_func_int16_t_s_s(((**g_1238) , (safe_rshift_func_uint8_t_u_s(l_1765, 6))), (**g_1185))) , 0xDFL) == l_1721) | (*g_289)) & l_1739) | l_1764) < 0UL))) , l_1761) , l_1773), l_1762, (**g_735)))))) != l_1783), 0x2B14L)) & 0x69A24093L))) > l_1701) >= 1L) == l_1739))), l_1730)), 0xBDA5626EL)) | l_1701); + (*g_143) = l_1761; + l_1797 = func_105((((g_960 = l_1785) != (((safe_mul_func_uint8_t_u_u((l_1788 != (void*)0), (g_14[2] , ((((+(safe_sub_func_uint8_t_u_u((((***g_905) = (safe_mul_func_int8_t_s_s((**g_131), ((*l_1731) = ((*g_131) != l_1793))))) <= (l_1794[4] != (void*)0)), l_1795))) , (void*)0) == l_1796[1][0][3]) && g_1254[(g_1132 + 4)][g_1132][(g_1132 + 2)])))) >= l_1722) , (void*)0)) < 0xA30C448CL)); + return l_1727; + } + (*g_143) ^= ((safe_mul_func_int8_t_s_s(0xA2L, ((safe_div_func_uint8_t_u_u(((**g_1185) < (7L < l_1701)), (*g_43))) && 0x80504E05L))) > 0UL); + } + (**g_960) = (l_1833 = (l_1832 = ((l_1773 | ((safe_mul_func_uint8_t_u_u(((++g_251) , (((--(**l_1726)) ^ ((safe_mod_func_uint32_t_u_u(0xE9892A02L, 0x6E452460L)) | (0xDA1EL && (!(((safe_div_func_int16_t_s_s((safe_rshift_func_uint16_t_u_u((g_251 = ((((safe_add_func_uint16_t_u_u((safe_mul_func_uint16_t_u_u((g_969++), 0UL)), (g_1334 & (!(((l_1758 ^= (safe_div_func_int32_t_s_s(((+((safe_lshift_func_int8_t_s_s((safe_div_func_int32_t_s_s(0x469EB03BL, ((((safe_mod_func_int32_t_s_s(l_1730, l_1773)) | l_1701) , (**g_1238)) , 4294967295UL))), 7)) != (**g_1185))) ^ 65530UL), 0x7B945D20L))) , l_1721) && l_1758))))) < 0x75L) , l_1773) != 0xD86B841BL)), g_1099)), (**g_1185))) == g_1776) != l_1759))))) , (**g_176))), 0x8EL)) || l_1831)) , (void*)0))); + } + if ((safe_div_func_uint8_t_u_u((~(safe_mod_func_uint8_t_u_u((safe_div_func_int32_t_s_s(((***g_1548) < (l_1634 |= (safe_add_func_int16_t_s_s((-3L), ((safe_mul_func_int8_t_s_s((((~(safe_mod_func_int8_t_s_s((**g_131), (safe_mul_func_uint8_t_u_u((safe_div_func_int32_t_s_s((l_1702 , ((l_1850 == (safe_rshift_func_uint16_t_u_s(1UL, (0x3DCC7414L | ((0x04DDBC4DL && (((((safe_mul_func_uint8_t_u_u(255UL, l_1760)) > (***g_1184)) >= (**g_736)) >= g_1857) == 0xD4CEL)) >= l_1763))))) > g_477)), (-1L))), (*g_132)))))) , (void*)0) != &g_961), (*g_43))) >= (**g_1185)))))), 0x7424D03BL)), l_1850))), (***g_905)))) + { /* block id: 868 */ + uint16_t l_1858 = 0x3EA7L; + (*g_143) ^= (l_1858 = 0x9CFAB74FL); + } + else + { /* block id: 871 */ + int16_t **l_1864 = &g_289; + int16_t ***l_1863[5] = {(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}; + const int8_t *l_1873 = &g_36; + const int8_t **l_1872 = &l_1873; + const int8_t ***l_1871 = &l_1872; + int32_t l_1888 = 0x7ACDB461L; + uint32_t ****l_1893 = &g_1241; + uint32_t **** const *l_1892[1][10] = {{&l_1893,&l_1893,&l_1893,&l_1893,&l_1893,&l_1893,&l_1893,&l_1893,&l_1893,&l_1893}}; + uint8_t **l_1898[8] = {&l_1877,&l_1877,&l_1877,&l_1877,&l_1877,&l_1877,&l_1877,&l_1877}; + int32_t l_1900 = 0x122D3568L; + int8_t l_1931 = 0x34L; + int i, j; + (*g_143) |= l_1859; + for (l_1762 = 1; (l_1762 >= 0); l_1762 -= 1) + { /* block id: 875 */ + uint32_t l_1860[3]; + int16_t **l_1862 = &g_289; + int16_t ***l_1861 = &l_1862; + const int8_t ***l_1875 = &l_1872; + const int8_t ****l_1874 = &l_1875; + int i; + for (i = 0; i < 3; i++) + l_1860[i] = 18446744073709551614UL; + (*g_143) |= ((l_1860[0] != (l_1861 == l_1863[2])) & (safe_mul_func_uint8_t_u_u(((safe_mod_func_int32_t_s_s((+((***g_1184) < (safe_div_func_uint8_t_u_u((l_1871 == ((*l_1874) = (void*)0)), l_1876)))), ((*g_55) = ((g_297[l_1762] = (((**g_736) , l_1877) != (*l_1726))) , (**g_736))))) || 0xE5L), l_1860[2]))); + } + (*g_143) = (((safe_lshift_func_uint16_t_u_u(((safe_sub_func_int8_t_s_s((*g_132), (safe_add_func_int16_t_s_s(0x0DE1L, (safe_sub_func_int16_t_s_s((safe_mod_func_uint16_t_u_u(((l_1888 , (*g_55)) && (g_969 < (g_1766 = (((**l_1725) = (((((l_1891 != l_1892[0][2]) , (safe_mul_func_uint8_t_u_u((safe_mul_func_int16_t_s_s(((l_1888 |= ((l_1898[7] != (void*)0) != 0x581BL)) || l_1634), 8UL)), 0x19L))) , (*g_289)) , l_1899) < 0x06L)) <= 0UL)))), l_1900)), (**g_1185))))))) >= 0x94L), l_1901)) != 4294967295UL) , (*g_143)); + if (l_1902) + { /* block id: 885 */ + int32_t l_1905 = 1L; + for (l_1760 = (-2); (l_1760 < (-23)); l_1760 = safe_sub_func_int32_t_s_s(l_1760, 3)) + { /* block id: 888 */ + (*g_143) ^= l_1905; + if (l_1905) + continue; + } + } + else + { /* block id: 892 */ + uint16_t *l_1908[5][4] = {{&g_1766,&g_1766,&g_969,&l_1901},{(void*)0,&g_1766,&g_1766,(void*)0},{&g_1766,(void*)0,&g_1766,&g_969},{&g_1766,&g_1766,&g_1766,&g_969},{(void*)0,&g_969,&g_969,&g_969}}; + int32_t l_1919 = 0x8D5F8744L; + int i, j; + (*g_143) = (l_1702 ^= ((((safe_sub_func_uint16_t_u_u((g_1766 = (++g_251)), ((((safe_div_func_int32_t_s_s(((++g_969) | (safe_mul_func_uint8_t_u_u(l_1919, (l_1919 != l_1658[2][1])))), l_1756[4][1])) <= ((safe_sub_func_int16_t_s_s((safe_lshift_func_uint8_t_u_s(l_1888, l_1730)), (((safe_lshift_func_int16_t_s_s((safe_rshift_func_uint16_t_u_s((((!(l_1919 , 0x59L)) ^ (l_1900 < l_1900)) >= l_1900), 4)), 14)) , (void*)0) != (void*)0))) <= 0xD049L)) > 0x779C7159L) , g_255))) ^ l_1900) | 1L) <= (***g_905))); + for (g_1298 = (-14); (g_1298 >= 3); g_1298++) + { /* block id: 900 */ + int32_t l_1930 = (-1L); + if (l_1930) + break; + if (l_1931) + continue; + l_1919 &= 0xDF650B0EL; + } + for (g_34 = 0; (g_34 <= 3); g_34 += 1) + { /* block id: 907 */ + return g_36; + } + } + } + } + else + { /* block id: 912 */ + int16_t l_1932 = (-4L); + const uint8_t ** const ***l_1943 = &g_1938; + int8_t **l_1974 = &l_1793; + int32_t l_1990 = (-4L); + int32_t *l_2009[3]; + int16_t **l_2027 = &g_289; + int16_t ***l_2026 = &l_2027; + const int16_t *l_2030 = &g_1285; + const int16_t **l_2029 = &l_2030; + const int16_t ***l_2028[3][5][2] = {{{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029}},{{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029}},{{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029},{&l_2029,&l_2029}}}; + int32_t l_2031[7][5] = {{0x7B32F464L,0x31A52CFCL,(-1L),0x1CB357FAL,(-1L)},{(-1L),(-1L),0xFE12D187L,0x1CB357FAL,(-10L)},{0x31A52CFCL,0x7B32F464L,0x7B32F464L,0x31A52CFCL,(-1L)},{0x31A52CFCL,0x1CB357FAL,0L,0L,0x1CB357FAL},{(-1L),0x7B32F464L,0L,0xFE12D187L,0xFE12D187L},{0x7B32F464L,(-1L),0x7B32F464L,0L,0xFE12D187L},{0x1CB357FAL,0x31A52CFCL,0xFE12D187L,0x31A52CFCL,0x1CB357FAL}}; + int32_t l_2032 = 4L; + int i, j, k; + for (i = 0; i < 3; i++) + l_2009[i] = &g_3; + if (l_1932) + { /* block id: 913 */ + uint16_t l_1966 = 0xAA16L; + uint8_t l_1967 = 9UL; + int32_t l_1989 = 0x49AFD519L; + int32_t **l_2003 = &g_312[1][0][5]; + for (g_347 = 0; (g_347 <= 18); g_347++) + { /* block id: 916 */ + uint8_t l_1935[1][10][2] = {{{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL},{4UL,0x9AL}}}; + int32_t l_1975 = (-9L); + uint8_t l_2006 = 0x8EL; + int i, j, k; + if (l_1935[0][3][1]) + { /* block id: 917 */ + const uint8_t ** const ****l_1942[3][1]; + int i, j; + for (i = 0; i < 3; i++) + { + for (j = 0; j < 1; j++) + l_1942[i][j] = &g_1937; + } + (*g_143) = ((((((void*)0 != l_1936[2]) & (-1L)) , &g_897) != (l_1943 = g_1937)) & (safe_lshift_func_uint16_t_u_s((safe_add_func_int8_t_s_s((*g_132), (0UL <= l_1932))), 4))); + } + else + { /* block id: 920 */ + int32_t *l_1952 = &l_1612; + int32_t l_1960 = 0x13E80650L; + uint16_t *l_1968[9] = {&g_1766,&g_251,&g_1766,&g_1766,&g_251,&g_1766,&g_1766,&g_251,&g_1766}; + int32_t *l_1969 = &g_3; + int32_t ***l_2004[4] = {&l_2003,&l_2003,&l_2003,&l_2003}; + uint32_t *l_2008 = &g_705[2]; + int i; + (*l_1969) ^= ((safe_mul_func_int16_t_s_s((*g_289), (safe_sub_func_uint8_t_u_u(((((*l_1952) = 0x79EFCB11L) , (((0x39L >= ((safe_div_func_int32_t_s_s(((*g_143) = (safe_add_func_int8_t_s_s(l_1957, (g_1857 && (g_251 = (safe_mul_func_uint8_t_u_u((l_1960 | g_1961), ((((safe_mod_func_int32_t_s_s(((safe_lshift_func_uint16_t_u_u(g_1298, l_1960)) == l_1966), l_1967)) && (*g_289)) , (*g_55)) != (*g_55))))))))), l_1960)) && l_1966)) , (***g_1184)) , l_1966)) || (**g_131)), (***g_1548))))) || l_1935[0][6][1]); + l_1990 &= (safe_rshift_func_int16_t_s_u((safe_rshift_func_int8_t_s_s((l_1975 = ((g_320 , ((**g_1018) = (**g_1018))) != l_1974)), 7)), ((l_1935[0][3][1] & (safe_add_func_int16_t_s_s((safe_div_func_int16_t_s_s((((((*l_1969) = ((***g_1184) > ((*l_1969) ^ (l_1989 = (safe_add_func_uint8_t_u_u(((safe_unary_minus_func_uint16_t_u(((((((((safe_lshift_func_int8_t_s_u(((safe_rshift_func_uint8_t_u_u(l_1935[0][6][0], l_1902)) > (((g_1766 = ((l_1967 , (*g_143)) & (*g_143))) , &g_1184) != (void*)0)), l_1935[0][3][1])) , l_1966) , 0x5DL) || 0x87L) <= l_1935[0][3][1]) || (*g_1781)) , &l_1692) == &g_1509))) ^ l_1932), 0xE0L)))))) || 251UL) | 0x46L) > l_1967), 0x3894L)), 0UL))) , g_1782[2][3][4]))); + l_2009[0] = func_105(((*l_2008) |= (safe_mod_func_int8_t_s_s((safe_rshift_func_uint16_t_u_s((g_1766++), ((((**g_1185) || (safe_rshift_func_uint16_t_u_u((((**g_736) = ((((+l_1935[0][3][1]) ^ 0x452888BFL) || ((((+((safe_rshift_func_int16_t_s_u((((l_1763 &= (safe_add_func_uint32_t_u_u((*g_55), ((((((*g_289) = ((*g_143) != ((*l_1969) = (*g_55)))) || 0x3A0FL) , ((((*l_1785) = (*g_960)) != (l_2005 = l_2003)) && l_1989)) , (*l_1969)) < l_1990)))) < 0xC6L) || 0xF854188CL), l_1975)) != l_2006)) <= 6L) , (void*)0) == (void*)0)) , l_2007)) | l_2006), g_251))) || 1L) | 0x7544L))), 4L)))); + } + if (l_1935[0][3][1]) + continue; + } + (*g_143) &= 0xCBD7ED2CL; + } + else + { /* block id: 944 */ + int32_t l_2014 = 0x16460141L; + uint8_t l_2033 = 0x2EL; + uint16_t *l_2039 = &g_251; + int32_t l_2049 = 0L; + int16_t l_2053[3]; + int32_t l_2054 = 0x72FC0805L; + int32_t l_2055 = (-4L); + int32_t l_2057 = 0x441D13AEL; + int32_t l_2059 = 0xB129E460L; + uint32_t l_2060[3][6] = {{1UL,1UL,18446744073709551615UL,1UL,1UL,18446744073709551615UL},{1UL,1UL,18446744073709551615UL,1UL,1UL,18446744073709551615UL},{1UL,1UL,18446744073709551615UL,1UL,1UL,18446744073709551615UL}}; + int i, j; + for (i = 0; i < 3; i++) + l_2053[i] = (-9L); + if (((**l_2005) > ((safe_div_func_uint16_t_u_u(((((**g_736) = (safe_mul_func_int8_t_s_s(0xC9L, l_2014))) & (safe_sub_func_int32_t_s_s((safe_sub_func_uint8_t_u_u((**l_2005), ((safe_mul_func_uint16_t_u_u((((safe_unary_minus_func_int16_t_s(((l_2032 = (l_2014 , (safe_mod_func_int32_t_s_s(0L, (safe_rshift_func_int8_t_s_s(((((((**g_1185) = (l_1658[1][1] == l_2014)) > ((l_2026 = l_2026) == l_2028[1][2][1])) || 1L) < g_1254[4][0][0]) <= g_297[1]), l_2031[3][2])))))) >= 0xFCL))) < (*g_143)) != 65529UL), l_2033)) , l_2014))), 0L))) >= (**l_2005)), (-4L))) || 4L))) + { /* block id: 949 */ + int32_t *l_2036 = (void*)0; + for (g_1298 = 3; (g_1298 < 13); g_1298++) + { /* block id: 952 */ + (*g_961) = l_2036; + (*g_143) = l_2033; + } + } + else + { /* block id: 956 */ + if ((*g_143)) + break; + } + l_2049 ^= ((safe_mod_func_uint16_t_u_u((g_1766 = ((1L ^ (((*l_2039) = ((void*)0 != &g_52)) <= (**g_1185))) , ((((safe_add_func_int16_t_s_s((((((+(safe_mod_func_int32_t_s_s((safe_sub_func_int16_t_s_s(((l_2046 ^ l_2047) >= ((!((l_2048 && (*g_1781)) , (254UL >= 0x4AL))) || 0xC4L)), g_51[0][3][1])), 0xD7857D83L))) , g_419) > g_40[1]) ^ l_2014) | 0x90L), g_1334)) & 0x40A7L) >= 0x889DL) | (**l_2005)))), 0x2C7FL)) != (**g_131)); + l_2060[2][2]--; + l_2059 |= (safe_sub_func_int32_t_s_s(l_2057, (0x662AL ^ (((l_2065[3] = (void*)0) != ((**g_1018) = (**g_1018))) >= ((0x53A4L & ((*l_2039) &= ((&g_736 != (g_2068[0] = g_2068[1])) >= (safe_mul_func_uint8_t_u_u(l_2049, (**g_131)))))) ^ l_2071[1][4][6]))))); + } + } + if (((*g_143) = l_2072)) + { /* block id: 971 */ + uint8_t l_2089 = 0x87L; + int32_t l_2095 = 1L; + const uint16_t l_2097 = 0xBF4DL; + int32_t l_2102[7][4]; + int32_t l_2108 = 0x7BAB6EA1L; + int8_t l_2128 = 0x3DL; + uint32_t *l_2168 = &l_1957; + int32_t l_2182 = 0x479FFEDCL; + int32_t *l_2190[4]; + int i, j; + for (i = 0; i < 7; i++) + { + for (j = 0; j < 4; j++) + l_2102[i][j] = 0x0A83AFD4L; + } + for (i = 0; i < 4; i++) + l_2190[i] = &g_3; + for (l_1692 = 2; (l_1692 >= 0); l_1692 -= 1) + { /* block id: 974 */ + uint32_t l_2085 = 0xB0246361L; + int8_t l_2086 = 0xB9L; + int32_t l_2094 = (-10L); + const uint32_t l_2096[1] = {0xC2A82A10L}; + uint32_t *l_2098 = &l_2071[1][5][2]; + int32_t *l_2100 = &l_1634; + int32_t *l_2101[4]; + uint16_t *l_2179 = &g_2148; + int i, j; + for (i = 0; i < 4; i++) + l_2101[i] = &l_2050; + if ((l_2102[6][0] |= ((*l_2100) &= (safe_mul_func_int8_t_s_s(((safe_div_func_uint8_t_u_u((g_705[2] , (safe_mod_func_int8_t_s_s((((*l_2098) = (safe_lshift_func_uint8_t_u_u((safe_sub_func_int8_t_s_s((((safe_mul_func_int8_t_s_s((l_2085 < l_2086), (g_1782[3][1][1] >= ((((safe_lshift_func_uint8_t_u_s(l_2089, 2)) == (g_705[2] ^ (((safe_mod_func_int16_t_s_s(((***g_1184) = (((((safe_mod_func_int32_t_s_s(((+(l_2095 = (l_2094 = l_2089))) , ((*g_143) = ((*g_143) > l_2085))), (**g_1238))) < (***g_1184)) == l_2089) || l_2096[0]) , 0x2B74L)), l_2089)) == l_2085) , 0x2251L))) != l_2089) || 65535UL)))) <= l_2089) , (-10L)), l_2089)), l_2097))) , l_2099), 0x69L))), l_2089)) <= (*g_55)), (**g_131)))))) + { /* block id: 982 */ + int8_t l_2115 = 1L; + int8_t * const *l_2118 = &g_243[5][0][8]; + int16_t *l_2136 = &l_1658[1][1]; + int16_t **l_2137 = &l_2136; + int32_t l_2146 = 1L; + int32_t ***l_2157 = &g_961; + int32_t ****l_2167 = &g_960; + for (l_1722 = 0; (l_1722 <= 4); l_1722 += 1) + { /* block id: 985 */ + uint16_t *l_2117 = &l_1902; + int16_t *l_2127 = &g_347; + uint32_t l_2135 = 8UL; + int i, j; + l_2095 = (l_2102[6][0] = (((safe_unary_minus_func_uint8_t_u(l_1658[l_1722][(l_1692 + 3)])) != (((((*l_2117) &= (l_1658[l_1692][(l_1722 + 1)] >= (safe_mod_func_uint8_t_u_u((((0L < (((void*)0 != (*g_1656)) , (l_2108 > (safe_add_func_int32_t_s_s(((*l_2100) = ((safe_mod_func_uint32_t_u_u(l_2108, ((safe_mul_func_int8_t_s_s(0xACL, (l_2115 , (**g_175)))) & l_2116))) >= 0x6E903ADFL)), l_2115))))) || (**g_131)) ^ 0UL), l_1658[l_1722][(l_1692 + 3)])))) , (void*)0) != l_2118) & (***g_1184))) || 0xFCE3BADFL)); + (*g_143) = (safe_mod_func_int8_t_s_s(((0xCFL > (safe_rshift_func_uint16_t_u_s((((((*g_1937) == (void*)0) != (*g_143)) && (safe_lshift_func_uint16_t_u_u((((~((*g_289) = (((((safe_lshift_func_uint8_t_u_s(l_2115, 4)) > (-6L)) && ((*l_2127) ^= (*g_289))) , (l_2128 >= (((safe_mod_func_uint16_t_u_u((safe_sub_func_uint8_t_u_u((((*l_2100) = ((safe_add_func_uint8_t_u_u(l_1658[l_1722][(l_1692 + 3)], l_2102[2][1])) ^ l_2135)) < l_2102[0][3]), (**g_175))), l_1658[l_1692][(l_1722 + 1)])) & 3L) , 1L))) >= 1UL))) & l_2108) > 1L), 6))) ^ 0xA1E6L), 14))) <= (*g_132)), (-6L))); + } + (*l_2100) &= (((*l_2137) = l_2136) == (void*)0); + l_2050 &= ((safe_mod_func_int8_t_s_s((l_1634 = (*g_132)), (safe_mod_func_int16_t_s_s((((*g_143) = (*g_143)) > (g_1857 < (l_2058 && (g_2148 |= (((((((void*)0 != &l_2086) == ((***g_735) = (((+(((l_2146 ^= (~(((safe_div_func_int32_t_s_s(0xBFC11C93L, (safe_mod_func_uint32_t_u_u(l_2095, (((*g_289) < 4L) , (*g_1781)))))) ^ 0x95679D65L) >= 0xA1895B12L))) >= (**g_131)) && 4294967293UL)) >= (**g_131)) , g_2147[7]))) , l_2146) <= l_2102[6][0]) , 0xB3BFL) == (-1L)))))), g_705[2])))) == 0x3157L); + if ((*g_143)) + { /* block id: 1003 */ + int32_t ****l_2158 = (void*)0; + int32_t ****l_2159 = &l_2157; + uint16_t *l_2160 = &l_1902; + l_2102[6][0] = (((safe_rshift_func_int16_t_s_u((0L ^ (safe_rshift_func_int8_t_s_s((((*l_2160) = (safe_div_func_int32_t_s_s((safe_mod_func_uint16_t_u_u((((*l_2159) = l_2157) == (void*)0), g_1333)), (*l_2100)))) > ((safe_add_func_int32_t_s_s(0x43A31542L, (safe_rshift_func_uint8_t_u_s((((*l_2136) = ((*g_289) = 0x48A9L)) <= l_2146), (((((((**g_736)--) , &g_960) == l_2167) & l_2089) <= (*g_1781)) < (**g_131)))))) < (*g_143))), 5))), 5)) ^ 0xDFCAL) & 65532UL); + (**g_960) = (***l_2167); + } + else + { /* block id: 1011 */ + int32_t l_2169 = 0xB5AD6469L; + (**g_960) = func_22((*g_289), (*g_1781), l_2168); + (*g_143) = l_2169; + } + } + else + { /* block id: 1015 */ + int32_t **l_2170[5]; + int i; + for (i = 0; i < 5; i++) + l_2170[i] = &l_1797; + l_2100 = ((**l_1785) = (**g_960)); + } + (**g_960) = func_22((safe_div_func_uint16_t_u_u(((((safe_add_func_uint16_t_u_u((l_1692 , g_34), (safe_add_func_uint8_t_u_u(l_2095, 250UL)))) ^ (*g_132)) & ((safe_mod_func_uint32_t_u_u((5UL < (((*l_2179) = ((void*)0 == (**g_1656))) && (safe_mul_func_int16_t_s_s((((l_2182 > 1UL) <= (*g_143)) != (*g_289)), 1UL)))), 0x328F77E6L)) , 1L)) | 1L), g_140)), (***g_735), &l_2048); + for (l_2099 = 0; (l_2099 <= 2); l_2099 += 1) + { /* block id: 1023 */ + int32_t l_2183 = 0x7A6C031CL; + ++l_2184; + l_2102[2][3] = ((*g_143) = (l_2187[0] == &g_1184)); + } + return g_1099; + } + l_2191++; + } + else + { /* block id: 1031 */ + return l_2194; + } + g_2207 |= ((*g_143) = (safe_sub_func_int32_t_s_s(l_2056, (safe_div_func_uint8_t_u_u(((((!(*g_289)) , ((safe_sub_func_int8_t_s_s(((((*l_2201) = &g_904[2][1]) != &g_1547[0][5][0]) & 0x784FL), (safe_sub_func_uint16_t_u_u((l_2205 == (void*)0), g_1132)))) || (0L > (-1L)))) , &g_1019[4][0][0]) != &g_1019[5][0][0]), l_1612))))); + if (l_2050) + goto lbl_2208; + } + return l_1658[1][1]; +} + + +/* ------------------------------------------ */ +/* + * reads : g_290 g_143 g_905 g_1298 + * writes: g_290 g_140 g_175 g_1298 + */ +static int8_t func_10(uint32_t p_11) +{ /* block id: 756 */ + uint32_t l_1605 = 3UL; + uint8_t **l_1608[3][5] = {{&g_43,&g_43,&g_43,&g_43,&g_43},{&g_43,&g_43,&g_43,&g_43,&g_43},{&g_43,&g_43,&g_43,&g_43,&g_43}}; + int i, j; + for (g_290 = 0; (g_290 >= 1); g_290++) + { /* block id: 759 */ + int32_t l_1603 = (-1L); + int32_t *l_1604[10]; + int i; + for (i = 0; i < 10; i++) + l_1604[i] = &g_297[1]; + (*g_143) = (safe_mod_func_int32_t_s_s(l_1603, p_11)); + l_1605++; + if (p_11) + break; + } + (*g_905) = l_1608[2][0]; + for (g_1298 = (-1); (g_1298 == 37); g_1298 = safe_add_func_uint16_t_u_u(g_1298, 9)) + { /* block id: 767 */ + return l_1605; + } + return l_1605; +} + + +/* ------------------------------------------ */ +/* + * reads : g_52 g_43 g_44 g_51 g_251 g_143 g_140 g_176 g_705 g_289 g_290 g_297 g_255 g_55 g_56 g_36 g_34 g_131 g_132 g_243 g_347 g_320 g_736 g_294 g_175 g_897 g_905 g_735 g_960 g_969 g_961 g_312 g_1334 g_1132 g_1184 g_1185 g_1099 g_1298 g_40 + * writes: g_46 g_36 g_255 g_297 g_140 g_312 g_294 g_51 g_34 g_56 g_44 g_347 g_290 g_897 g_904 g_419 g_251 g_969 g_1334 g_1132 g_1298 g_175 + */ +static int32_t func_16(int8_t p_17, uint32_t * p_18, uint32_t * p_19, uint16_t p_20, uint32_t p_21) +{ /* block id: 16 */ + uint32_t l_57 = 0xB31DF952L; + uint32_t *l_58 = &g_56; + int32_t * const l_59[10] = {&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2],&g_51[1][4][2]}; + uint32_t l_74[2][9] = {{0x548DC091L,0x548DC091L,0x548DC091L,0x548DC091L,0x548DC091L,0x548DC091L,0x548DC091L,0x548DC091L,0x548DC091L},{0UL,0x253094EEL,0UL,0x253094EEL,0UL,0x253094EEL,0UL,0x253094EEL,0UL}}; + uint8_t *l_1340[8][7] = {{&g_40[1],&g_40[5],&g_1298,&g_1298,&g_40[5],&g_40[1],&g_40[1]},{&g_40[5],&g_40[1],(void*)0,&g_1298,&g_1298,(void*)0,&g_40[1]},{&g_40[5],&g_40[1],&g_40[1],&g_40[5],&g_1298,&g_1298,&g_40[5]},{&g_40[1],&g_40[1],&g_40[1],&g_1298,&g_40[1],&g_40[1],&g_40[1]},{&g_40[1],&g_40[5],(void*)0,&g_40[5],&g_40[1],(void*)0,&g_1298},{&g_1298,&g_40[1],&g_1298,&g_1298,&g_1298,&g_40[1],&g_1298},{&g_40[1],&g_1298,&g_40[1],&g_1298,&g_1298,&g_1298,&g_40[1]},{&g_1298,&g_40[1],&g_1298,&g_40[1],&g_1298,&g_1298,&g_1298}}; + uint8_t *l_1341 = (void*)0; + uint8_t l_1385 = 0UL; + const int8_t *l_1399 = &g_255; + const int8_t ** const l_1398 = &l_1399; + const int8_t ** const *l_1397 = &l_1398; + int16_t **l_1400 = &g_289; + int8_t l_1404 = 0xDEL; + int16_t l_1460 = 0x14BCL; + uint8_t ** const *l_1553 = &g_175; + int32_t *l_1557[2]; + const uint32_t *l_1564[2]; + const uint32_t **l_1563[9][8][3] = {{{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[0],(void*)0,(void*)0},{&l_1564[1],&l_1564[0],&l_1564[1]},{(void*)0,&l_1564[1],&l_1564[1]},{&l_1564[0],&l_1564[1],(void*)0},{(void*)0,&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]}},{{(void*)0,&l_1564[0],&l_1564[1]},{&l_1564[1],(void*)0,&l_1564[1]},{&l_1564[0],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[0],&l_1564[1]},{&l_1564[1],&l_1564[1],(void*)0},{&l_1564[0],&l_1564[1],&l_1564[1]},{&l_1564[0],&l_1564[1],&l_1564[0]},{&l_1564[0],&l_1564[1],&l_1564[1]}},{{&l_1564[0],&l_1564[1],&l_1564[0]},{&l_1564[0],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[0],&l_1564[0],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{(void*)0,&l_1564[1],&l_1564[0]},{&l_1564[1],&l_1564[1],&l_1564[0]}},{{&l_1564[1],&l_1564[0],&l_1564[0]},{(void*)0,&l_1564[1],&l_1564[0]},{&l_1564[0],&l_1564[1],&l_1564[0]},{(void*)0,&l_1564[1],&l_1564[1]},{&l_1564[1],(void*)0,&l_1564[1]},{&l_1564[0],(void*)0,&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]}},{{&l_1564[1],&l_1564[1],&l_1564[0]},{&l_1564[1],(void*)0,&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[0]},{&l_1564[1],(void*)0,&l_1564[1]},{&l_1564[1],&l_1564[1],(void*)0},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],(void*)0,&l_1564[1]}},{{&l_1564[1],(void*)0,&l_1564[1]},{&l_1564[0],&l_1564[1],&l_1564[1]},{(void*)0,&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[0],(void*)0},{&l_1564[1],&l_1564[1],&l_1564[1]},{(void*)0,&l_1564[1],&l_1564[1]},{&l_1564[0],&l_1564[1],(void*)0}},{{&l_1564[1],&l_1564[0],&l_1564[1]},{&l_1564[1],&l_1564[1],(void*)0},{&l_1564[1],&l_1564[1],&l_1564[0]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]}},{{&l_1564[1],&l_1564[1],&l_1564[0]},{&l_1564[1],&l_1564[0],(void*)0},{&l_1564[1],&l_1564[1],&l_1564[1]},{&l_1564[0],(void*)0,(void*)0},{&l_1564[1],&l_1564[0],&l_1564[1]},{(void*)0,&l_1564[1],&l_1564[0]},{&l_1564[1],&l_1564[1],&l_1564[1]},{(void*)0,&l_1564[1],&l_1564[0]}},{{&l_1564[1],&l_1564[1],&l_1564[0]},{&l_1564[1],&l_1564[1],&l_1564[1]},{(void*)0,&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[0]},{(void*)0,&l_1564[1],&l_1564[1]},{&l_1564[1],&l_1564[1],&l_1564[1]},{(void*)0,&l_1564[0],(void*)0},{(void*)0,(void*)0,&l_1564[1]}}}; + const uint32_t ***l_1562 = &l_1563[2][1][2]; + const uint32_t ****l_1561 = &l_1562; + int32_t l_1574 = (-3L); + int32_t l_1577 = (-2L); + const uint8_t *l_1594 = &g_320; + const uint8_t **l_1593 = &l_1594; + int i, j, k; + for (i = 0; i < 2; i++) + l_1557[i] = &g_1132; + for (i = 0; i < 2; i++) + l_1564[i] = (void*)0; + if (((*g_143) = ((((((*p_18) = l_57) > ((l_58 = &l_57) != ((((l_59[2] != ((safe_rshift_func_int8_t_s_s(g_52, (((void*)0 == p_19) , ((*g_43) , (func_62(func_65((((l_1340[5][0] = func_71(l_74[0][4], p_20)) != l_1341) >= (-1L)), p_17, p_17, p_18, p_19), p_20) & l_1385))))) , (void*)0)) , 5L) == p_21) , (void*)0))) , 1L) | p_21) < p_17))) + { /* block id: 667 */ + int16_t l_1396[4]; + int32_t l_1421 = 7L; + int32_t l_1462 = 0x12662E75L; + int32_t l_1465 = 0x863BF099L; + int32_t l_1467 = 0L; + int32_t l_1470 = 2L; + int32_t l_1477 = 0x4CD2A26BL; + int32_t l_1490[10][2][5] = {{{0L,1L,8L,0x286E9DC0L,0x5DE9A0F1L},{0L,0x8BAB543FL,0x040A2369L,0x8BAB543FL,0L}},{{0x5DE9A0F1L,0x286E9DC0L,8L,1L,0L},{0L,0xF9205F80L,0x3F2E14FAL,0x8BAB543FL,(-1L)}},{{0L,0x286E9DC0L,(-4L),0x286E9DC0L,0L},{(-1L),0x8BAB543FL,0x3F2E14FAL,0xF9205F80L,0L}},{{0L,1L,8L,0x286E9DC0L,0x5DE9A0F1L},{0L,0x8BAB543FL,0x040A2369L,0x8BAB543FL,0L}},{{0x5DE9A0F1L,0x286E9DC0L,8L,1L,0L},{0L,0xF9205F80L,0x3F2E14FAL,0x8BAB543FL,(-1L)}},{{0L,0x286E9DC0L,(-4L),0x286E9DC0L,0L},{(-1L),0x8BAB543FL,0x3F2E14FAL,0xF9205F80L,0L}},{{0L,1L,8L,0x286E9DC0L,0x5DE9A0F1L},{0L,0x8BAB543FL,0x040A2369L,0x8BAB543FL,0L}},{{0x5DE9A0F1L,0x286E9DC0L,8L,1L,0L},{0L,0xF9205F80L,0x3F2E14FAL,0x8BAB543FL,(-1L)}},{{0L,0x286E9DC0L,(-4L),0x286E9DC0L,0L},{(-1L),0x8BAB543FL,0x3F2E14FAL,0xF9205F80L,0L}},{{0L,1L,8L,0x286E9DC0L,0x5DE9A0F1L},{0L,0x8BAB543FL,0x040A2369L,0x8BAB543FL,0L}}}; + uint8_t l_1499 = 0xACL; + const int32_t l_1539[1][3] = {{0L,0L,0L}}; + uint32_t ****l_1575 = &g_1237[6][2][0]; + int32_t **l_1579 = (void*)0; + int i, j, k; + for (i = 0; i < 4; i++) + l_1396[i] = (-1L); + for (g_1298 = 1; (g_1298 <= 5); g_1298 += 1) + { /* block id: 670 */ + int16_t **l_1401 = (void*)0; + uint16_t *l_1402 = &g_969; + int32_t l_1403 = (-1L); + uint32_t ***l_1405 = &g_1238; + uint32_t **l_1406 = &g_55; + uint32_t *l_1422[9]; + uint16_t l_1431 = 3UL; + int32_t l_1432 = 0xD4EEA904L; + int16_t ***l_1449 = &l_1401; + int32_t l_1464 = (-8L); + int32_t l_1468 = (-7L); + int32_t l_1469[8][4] = {{0x419228AFL,0xBFCFCC48L,0x419228AFL,2L},{0x3A8515F3L,0xBFCFCC48L,0x213DF6CAL,0xBFCFCC48L},{0x3A8515F3L,2L,0x419228AFL,0xBFCFCC48L},{0x419228AFL,0xBFCFCC48L,0x419228AFL,2L},{0x3A8515F3L,0xBFCFCC48L,0x213DF6CAL,0xBFCFCC48L},{0x3A8515F3L,2L,0x419228AFL,0xBFCFCC48L},{0x419228AFL,0xBFCFCC48L,0x419228AFL,2L},{0x3A8515F3L,0xBFCFCC48L,0x213DF6CAL,0xBFCFCC48L}}; + int8_t l_1493 = 0L; + int32_t **l_1532 = &g_312[0][0][4]; + int i, j; + for (i = 0; i < 9; i++) + l_1422[i] = &g_1099; + } + } + else + { /* block id: 747 */ + int16_t l_1580 = (-1L); + const uint8_t ***l_1595 = &l_1593; + uint8_t *l_1598[2]; + int i; + for (i = 0; i < 2; i++) + l_1598[i] = &g_1298; + (*g_143) = l_1580; + l_1557[1] = ((safe_lshift_func_int8_t_s_s((!(safe_rshift_func_uint8_t_u_s((l_1580 & (((safe_lshift_func_int16_t_s_u((safe_mod_func_uint8_t_u_u((safe_sub_func_uint16_t_u_u((((g_40[1] != g_34) , ((*l_1595) = l_1593)) == ((*g_905) = &l_1340[5][4])), (safe_sub_func_int32_t_s_s((((void*)0 != l_1598[0]) , ((*g_143) |= p_20)), (((l_1580 ^ l_1580) && p_21) , p_20))))), p_17)), p_20)) && p_17) < p_21)), l_1580))), l_1580)) , (*g_961)); + return l_1580; + } + return p_21; +} + + +/* ------------------------------------------ */ +/* + * reads : g_52 g_46 g_51 + * writes: g_52 g_51 g_36 g_40 + */ +static uint32_t * func_22(int16_t p_23, uint32_t p_24, uint32_t * p_25) +{ /* block id: 10 */ + int32_t *l_45 = &g_46; + int32_t *l_47 = (void*)0; + int32_t *l_48 = &g_46; + int32_t *l_49 = &g_46; + int32_t *l_50[1]; + int i; + for (i = 0; i < 1; i++) + l_50[i] = &g_46; + --g_52; + g_51[0][3][1] &= (*l_48); + for (g_52 = 0; g_52 < 2; g_52 += 1) + { + for (g_36 = 0; g_36 < 8; g_36 += 1) + { + for (p_24 = 0; p_24 < 3; p_24 += 1) + { + g_51[g_52][g_36][p_24] = 0x6F67A21EL; + } + } + } + for (p_24 = 0; p_24 < 7; p_24 += 1) + { + g_40[p_24] = 248UL; + } + return l_50[0]; +} + + +/* ------------------------------------------ */ +/* + * reads : g_143 g_140 + * writes: g_140 + */ +static int32_t func_62(int32_t * p_63, uint8_t p_64) +{ /* block id: 663 */ + uint32_t l_1384 = 4294967295UL; + (*g_143) &= l_1384; + return (*g_143); +} + + +/* ------------------------------------------ */ +/* + * reads : g_143 g_140 g_1132 g_735 g_736 g_55 g_289 g_290 g_56 g_176 g_43 g_1184 g_1185 g_1099 g_44 g_297 g_36 g_51 g_705 g_34 g_131 g_132 g_243 g_347 g_320 g_294 g_175 g_255 g_897 g_905 g_251 g_960 g_969 g_961 g_312 g_1334 + * writes: g_1132 g_44 g_36 g_140 g_312 g_51 g_34 g_56 g_297 g_347 g_290 g_255 g_897 g_904 g_294 g_419 g_251 g_969 g_1334 + */ +static int32_t * func_65(int8_t p_66, uint16_t p_67, uint8_t p_68, int32_t * p_69, uint32_t * p_70) +{ /* block id: 647 */ + int32_t *l_1342 = &g_1132; + int8_t *l_1361 = &g_36; + uint16_t *l_1362[3][5][2] = {{{&g_969,&g_969},{&g_969,&g_969},{&g_969,&g_969},{&g_969,&g_969},{&g_969,&g_969}},{{&g_969,&g_969},{&g_969,&g_969},{&g_969,&g_969},{&g_969,&g_969},{&g_969,&g_969}},{{&g_969,&g_969},{&g_969,&g_969},{&g_969,(void*)0},{&g_969,&g_969},{&g_251,&g_251}}}; + int32_t l_1363[2]; + uint32_t *l_1375[6][5] = {{(void*)0,&g_477,&g_1099,&g_1099,&g_477},{(void*)0,&g_294[0],&g_1099,&g_477,&g_1334},{&g_294[0],&g_1099,&g_1099,(void*)0,&g_1099},{&g_1334,&g_1334,&g_1099,(void*)0,(void*)0},{&g_294[0],(void*)0,(void*)0,(void*)0,(void*)0},{(void*)0,&g_294[2],(void*)0,(void*)0,&g_1334}}; + int32_t l_1376 = 1L; + uint32_t l_1379 = 0xCFCA353CL; + const uint32_t **l_1382 = (void*)0; + const uint32_t ***l_1381 = &l_1382; + const uint32_t ****l_1380[2][1][7] = {{{(void*)0,&l_1381,&l_1381,&l_1381,(void*)0,&l_1381,&l_1381}},{{(void*)0,&l_1381,&l_1381,&l_1381,(void*)0,&l_1381,&l_1381}}}; + const uint32_t ***l_1383 = &l_1382; + int i, j, k; + for (i = 0; i < 2; i++) + l_1363[i] = 0xABF6ADA9L; + (*l_1342) ^= (*g_143); + if (g_140) + goto lbl_1364; + p_69 = func_94((**g_735), (*l_1342), (((((((safe_div_func_int32_t_s_s((safe_mul_func_uint16_t_u_u((safe_rshift_func_int16_t_s_u(p_66, (0xC741L && (((safe_div_func_int8_t_s_s((((safe_mul_func_uint8_t_u_u(0xD3L, (safe_rshift_func_int16_t_s_s((safe_add_func_uint16_t_u_u(((0L > (*g_289)) & (((l_1363[0] = ((p_68 = (safe_mul_func_uint8_t_u_u((((*l_1361) = ((((**g_176) = (safe_mod_func_int16_t_s_s(((((***g_735) , 0x0EL) >= (*l_1342)) || (*g_289)), p_68))) <= 0x01L) < (*l_1342))) , (*l_1342)), p_68))) != 0xDAL)) != p_66) == (*l_1342))), (***g_1184))), 10)))) & 0xF1L) != 249UL), (*l_1342))) != (***g_1184)) > 0x40L)))), (*l_1342))), (*p_70))) , (void*)0) == l_1361) <= g_1099) < (*l_1342)) < (*l_1342)) , (*g_143)), (*l_1342), (*l_1342)); +lbl_1364: + (*g_143) = (+(*l_1342)); + (*g_143) = (1UL == (((safe_rshift_func_int8_t_s_u((safe_lshift_func_int8_t_s_s(((void*)0 != (*g_905)), (3UL != ((safe_rshift_func_int8_t_s_s(((l_1383 = ((((safe_div_func_uint32_t_u_u((p_66 <= (*l_1342)), (l_1376 = (++(*p_70))))) == g_251) && (g_34 <= (p_67 = (((*l_1342) = (safe_sub_func_int16_t_s_s((((((*l_1342) || (-1L)) != (*l_1342)) == l_1379) <= p_67), 0xD1CDL))) & l_1376)))) , (void*)0)) != (void*)0), 0)) != p_68)))), p_66)) ^ 65535UL) || 1UL)); + return p_69; +} + + +/* ------------------------------------------ */ +/* + * reads : g_51 g_44 g_251 g_143 g_140 g_176 g_43 g_705 g_289 g_290 g_297 g_255 g_55 g_56 g_36 g_34 g_131 g_132 g_243 g_347 g_320 g_736 g_294 g_175 g_897 g_905 g_735 g_960 g_969 g_961 g_312 g_1334 + * writes: g_36 g_255 g_297 g_140 g_312 g_294 g_51 g_34 g_56 g_44 g_347 g_290 g_897 g_904 g_419 g_251 g_969 g_1334 + */ +static uint8_t * func_71(uint32_t p_72, int8_t p_73) +{ /* block id: 19 */ + int32_t *l_75 = &g_51[0][3][1]; + int32_t *l_76 = &g_51[0][2][2]; + int32_t *l_77 = &g_51[0][7][1]; + int32_t *l_78 = &g_51[0][3][1]; + int32_t *l_79 = &g_51[0][5][2]; + int32_t *l_80 = &g_51[0][0][0]; + int32_t *l_81 = &g_51[1][3][1]; + int32_t *l_82 = &g_51[1][0][1]; + int32_t *l_83 = &g_51[0][3][1]; + int32_t *l_84 = (void*)0; + int32_t l_85[9][2][7] = {{{(-4L),(-7L),0x7DDA0CFDL,(-8L),0x77CB2DEBL,0x5D6CB7F0L,0L},{0x9A3785E6L,0x69DBBC94L,(-10L),0x74D9FAD1L,(-10L),0x69DBBC94L,0x9A3785E6L}},{{0x5D6CB7F0L,0x6F9888A1L,1L,0x139E91ECL,0xC7048B0AL,0xFEAE78DFL,0x4ABCDCAFL},{(-10L),(-8L),(-1L),3L,0x74D9FAD1L,4L,0x204C5B33L}},{{0x7DDA0CFDL,4L,1L,7L,0x6F9888A1L,7L,1L},{0xB031E64CL,0xB031E64CL,(-10L),1L,0x2DE0ECACL,0x40782372L,0x501D8DD5L}},{{0x6F9888A1L,0x24FAE1B8L,0x7DDA0CFDL,1L,0x4ABCDCAFL,4L,(-7L)},{(-1L),0xEF1A95A0L,0x40782372L,0x53E6AFD1L,0x2DE0ECACL,1L,0x2DE0ECACL}},{{0L,0x4ABCDCAFL,0x4ABCDCAFL,0L,0x6F9888A1L,(-1L),0xE2E886BEL},{0x53E6AFD1L,0x40782372L,0xEF1A95A0L,(-1L),0x74D9FAD1L,0x204C5B33L,1L}},{{1L,0x7DDA0CFDL,0x24FAE1B8L,0x6F9888A1L,0xC7048B0AL,(-4L),0xE2E886BEL},{1L,(-10L),0xB031E64CL,0xB031E64CL,(-10L),1L,0x2DE0ECACL}},{{7L,1L,4L,0x7DDA0CFDL,0x77CB2DEBL,(-1L),(-7L)},{3L,(-1L),(-8L),(-10L),0x53E6AFD1L,0x9A3785E6L,0x501D8DD5L}},{{0x139E91ECL,1L,0x6F9888A1L,0x5D6CB7F0L,0x5D6CB7F0L,0x6F9888A1L,1L},{0x74D9FAD1L,(-10L),0x69DBBC94L,0x9A3785E6L,0x75422B1FL,(-1L),0x204C5B33L}},{{(-8L),0x7DDA0CFDL,(-7L),(-4L),(-1L),0xA96CD894L,0x4ABCDCAFL},{0x69DBBC94L,0x40782372L,0x204C5B33L,0x9A3785E6L,(-8L),(-8L),0x9A3785E6L}}}; + int32_t *l_86 = &l_85[0][1][0]; + int32_t *l_87 = (void*)0; + int32_t *l_88 = &l_85[1][1][4]; + int32_t *l_89 = &g_51[0][3][1]; + int32_t *l_90[3][9] = {{(void*)0,(void*)0,&g_51[0][5][2],(void*)0,(void*)0,&g_51[0][5][2],(void*)0,(void*)0,&g_51[0][5][2]},{&g_3,&g_3,(void*)0,&g_3,&g_3,(void*)0,&g_51[0][3][1],&g_51[0][3][1],&g_3},{(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0,(void*)0}}; + uint8_t l_91[9][7][4] = {{{0x14L,253UL,255UL,0x88L},{0x51L,0x35L,0x0BL,254UL},{0xC0L,255UL,1UL,0x5BL},{253UL,0x8DL,0x88L,0x2BL},{0xD1L,0x2CL,0UL,0x01L},{0x9AL,0xD1L,0x35L,0x80L},{0x16L,0x3AL,0x9AL,0x39L}},{{6UL,1UL,0xF3L,0UL},{0x51L,1UL,0x4FL,1UL},{1UL,0x01L,0x50L,0xE4L},{0x30L,0x9AL,1UL,0UL},{0x93L,0x2CL,0x2CL,0x93L},{255UL,1UL,0xA9L,255UL},{4UL,2UL,0x4CL,0x88L}},{{0x5BL,254UL,0xF3L,0x88L},{0UL,2UL,1UL,255UL},{0xDFL,1UL,0x24L,0x93L},{0x23L,0x2CL,0x41L,0UL},{0xD1L,0x9AL,4UL,0xE4L},{0x16L,0x01L,0x23L,1UL},{0x2CL,1UL,248UL,0UL}},{{0x5BL,1UL,255UL,0x39L},{1UL,0x3AL,0x50L,0x80L},{0x80L,0xD1L,0x16L,0x01L},{0x5EL,0x2CL,1UL,0x2BL},{0xE4L,0x8DL,0xF0L,0x5BL},{4UL,255UL,0x51L,254UL},{0x4CL,0x35L,248UL,0x88L}},{{6UL,253UL,0UL,255UL},{253UL,0xF9L,0x24L,0x4DL},{248UL,6UL,0UL,0x01L},{0x23L,0x9AL,0x88L,5UL},{4UL,0UL,0x9AL,1UL},{0x2CL,0x14L,0xEBL,248UL},{0x4CL,1UL,0x4CL,0x39L}},{{0x14L,0xFDL,254UL,251UL},{0x30L,0x23L,0x16L,0xFDL},{0x4DL,6UL,0x16L,0x93L},{0x30L,0x8DL,254UL,0x4FL},{0x14L,0x30L,0x4CL,0xB0L},{0x4CL,0xB0L,0xEBL,254UL},{0x2CL,2UL,0x9AL,255UL}},{{4UL,1UL,0x88L,0x16L},{0x23L,0UL,0UL,0xFDL},{248UL,0xD1L,0x24L,0x8DL},{0xA2L,0xC0L,0x24L,2UL},{0x6AL,0x80L,0xDFL,4UL},{0xFDL,255UL,0x2CL,253UL},{0x80L,0xD2L,255UL,0UL}},{{0x8DL,0x88L,0x2BL,0x16L},{0xA5L,0xF0L,0x5EL,0UL},{0x39L,0x30L,0xEBL,0UL},{0x04L,1UL,0UL,1UL},{0UL,1UL,0xDFL,4UL},{0x4DL,0xF0L,1UL,0x41L},{255UL,1UL,1UL,1UL}},{{4UL,0x16L,0x16L,0x16L},{1UL,1UL,1UL,0x39L},{255UL,0x2CL,0x35L,0x30L},{0xF0L,0x80L,250UL,0x35L},{0UL,0x80L,0xFDL,0x30L},{0x80L,0x2CL,1UL,0x39L},{1UL,1UL,0x4DL,0x16L}}}; + uint32_t *l_115[8] = {&g_56,&g_56,&g_56,&g_56,&g_56,&g_56,&g_56,&g_56}; + int8_t *l_118 = &g_36; + int8_t **l_119 = &l_118; + int8_t *l_121 = &g_36; + int8_t **l_120 = &l_121; + int8_t **l_122 = (void*)0; + int8_t *l_124 = &g_36; + int8_t **l_123 = &l_124; + int8_t *l_126 = &g_36; + int8_t **l_125 = &l_126; + int8_t *l_127[7][8][4] = {{{&g_36,&g_36,&g_36,&g_36},{(void*)0,&g_36,&g_36,&g_36},{(void*)0,(void*)0,&g_36,&g_36},{(void*)0,(void*)0,(void*)0,(void*)0},{&g_36,&g_36,&g_36,(void*)0},{(void*)0,&g_36,&g_36,(void*)0},{&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,(void*)0}},{{(void*)0,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36},{(void*)0,&g_36,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36}},{{&g_36,&g_36,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36},{&g_36,&g_36,&g_36,(void*)0},{&g_36,&g_36,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36},{(void*)0,&g_36,&g_36,(void*)0},{&g_36,&g_36,&g_36,(void*)0},{&g_36,&g_36,&g_36,&g_36}},{{&g_36,(void*)0,&g_36,(void*)0},{&g_36,&g_36,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36},{(void*)0,(void*)0,&g_36,&g_36},{&g_36,&g_36,(void*)0,&g_36},{&g_36,(void*)0,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36},{&g_36,&g_36,(void*)0,&g_36}},{{(void*)0,&g_36,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36},{(void*)0,&g_36,(void*)0,&g_36},{&g_36,&g_36,&g_36,&g_36},{&g_36,(void*)0,(void*)0,&g_36},{&g_36,(void*)0,(void*)0,(void*)0},{&g_36,&g_36,&g_36,&g_36}},{{&g_36,&g_36,&g_36,&g_36},{(void*)0,&g_36,(void*)0,(void*)0},{&g_36,(void*)0,&g_36,&g_36},{(void*)0,(void*)0,(void*)0,&g_36},{&g_36,&g_36,&g_36,&g_36},{(void*)0,&g_36,(void*)0,&g_36},{(void*)0,&g_36,&g_36,&g_36},{&g_36,(void*)0,(void*)0,&g_36}},{{&g_36,&g_36,(void*)0,&g_36},{&g_36,&g_36,&g_36,&g_36},{(void*)0,(void*)0,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36},{&g_36,&g_36,&g_36,&g_36},{&g_36,(void*)0,&g_36,&g_36},{&g_36,&g_36,&g_36,(void*)0},{&g_36,&g_36,&g_36,&g_36}}}; + int8_t *l_129 = &g_36; + int8_t **l_128 = &l_129; + int8_t *l_130[4][2] = {{(void*)0,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0},{(void*)0,(void*)0}}; + int32_t l_690 = (-1L); + int i, j, k; + ++l_91[2][2][0]; + (*g_961) = func_94(&g_56, ((g_51[1][1][2] >= func_100(func_105(((g_44 ^ ((g_44 , (safe_sub_func_int8_t_s_s((g_36 = (safe_add_func_uint8_t_u_u((safe_sub_func_int8_t_s_s(((*l_86) |= (((~(&g_56 != l_115[6])) , (((((safe_rshift_func_uint16_t_u_u(1UL, 14)) < ((((l_127[6][3][0] = ((*l_125) = ((*l_123) = ((*l_120) = ((*l_119) = l_118))))) == ((*l_128) = &p_73)) ^ 255UL) == p_73)) == 0xCAL) && 8L) ^ 0x2359L)) , p_72)), p_72)), g_51[1][2][0]))), 0xA4L))) == 6UL)) < 0xD5L)), l_690, (*l_79), g_251)) <= 255UL), p_72, (*l_77), p_73); + return (**g_905); +} + + +/* ------------------------------------------ */ +/* + * reads : g_36 g_176 g_43 g_44 g_297 g_143 g_140 g_51 g_705 g_34 g_131 g_132 g_55 g_56 g_243 g_289 g_347 g_320 g_736 g_294 g_175 g_255 g_897 g_905 g_290 g_735 g_251 g_960 g_969 g_961 g_312 g_1334 + * writes: g_36 g_140 g_312 g_51 g_34 g_56 g_297 g_44 g_347 g_290 g_255 g_897 g_904 g_294 g_419 g_251 g_969 g_1334 + */ +static int32_t * func_94(uint32_t * p_95, int32_t p_96, const int32_t p_97, int32_t p_98, int8_t p_99) +{ /* block id: 395 */ + int8_t l_778 = (-5L); + int32_t l_868[8] = {0xC949261DL,0xC949261DL,0xC949261DL,0xC949261DL,0xC949261DL,0xC949261DL,0xC949261DL,0xC949261DL}; + int32_t l_885 = 0L; + int32_t l_891 = 0x3573B375L; + int16_t * const l_916 = &g_419; + uint8_t *** const l_948 = &g_175; + int32_t l_982 = (-1L); + uint32_t *l_983 = &g_294[4]; + int32_t l_984 = 1L; + int8_t l_998 = 0L; + uint8_t ****l_1044[3]; + uint8_t l_1256 = 3UL; + int16_t l_1325[10][7] = {{0x9403L,(-1L),0x5345L,0x2B69L,0x41E0L,0x8199L,0x8199L},{0x640AL,(-1L),0x93F5L,(-1L),0x640AL,0xF19AL,0x93F5L},{(-1L),0x9403L,(-1L),0x5345L,0x2B69L,0x41E0L,0x8199L},{0xD399L,1L,0x6F08L,0xF19AL,0x6F08L,1L,0xD399L},{(-1L),0x5345L,0x8199L,0x2B69L,0x9403L,0x23E0L,(-1L)},{0x640AL,1L,1L,8L,0x640AL,8L,1L},{0x9403L,0x9403L,0x8199L,(-1L),(-1L),0x41E0L,0x5345L},{0x6F08L,(-1L),0x6F08L,8L,0xD399L,(-1L),0xD399L},{0x2B69L,(-1L),(-1L),0x2B69L,(-1L),0x8199L,0x23E0L},{0x640AL,0xF19AL,0x93F5L,0xF19AL,0x640AL,(-1L),0x93F5L}}; + int32_t *l_1339 = &g_51[1][1][1]; + int i, j; + for (i = 0; i < 3; i++) + l_1044[i] = &g_905; + for (g_36 = 0; (g_36 <= (-2)); --g_36) + { /* block id: 398 */ + if (l_778) + break; + } + (*g_143) = ((safe_mod_func_int32_t_s_s((safe_sub_func_uint8_t_u_u(l_778, (**g_176))), (safe_div_func_int16_t_s_s((-1L), (safe_add_func_int16_t_s_s(((void*)0 == &p_95), p_99)))))) , (safe_mul_func_int8_t_s_s(((safe_div_func_uint16_t_u_u((((safe_add_func_int32_t_s_s(p_96, 4294967286UL)) >= 0xB233L) && p_99), g_297[1])) & p_96), 0xFEL))); + for (g_36 = 1; (g_36 >= 0); g_36 -= 1) + { /* block id: 404 */ + int16_t l_806[2]; + int32_t l_814 = (-9L); + uint8_t *l_846[6][2][10] = {{{&g_40[1],&g_44,&g_320,&g_44,(void*)0,(void*)0,(void*)0,(void*)0,&g_320,(void*)0},{&g_40[0],&g_44,(void*)0,&g_40[1],&g_320,&g_40[5],&g_40[5],&g_320,&g_40[1],(void*)0}},{{(void*)0,(void*)0,&g_320,&g_320,&g_40[0],&g_40[3],(void*)0,&g_40[1],&g_44,&g_320},{&g_320,&g_40[1],&g_44,(void*)0,&g_40[1],&g_44,(void*)0,(void*)0,&g_40[6],&g_40[5]}},{{&g_40[5],(void*)0,&g_40[1],&g_40[1],&g_320,&g_320,&g_40[5],&g_40[5],&g_40[5],&g_40[1]},{(void*)0,&g_44,(void*)0,&g_44,&g_40[2],&g_40[5],(void*)0,&g_44,(void*)0,&g_40[1]}},{{(void*)0,&g_44,&g_40[0],(void*)0,&g_40[1],(void*)0,&g_40[0],&g_44,(void*)0,(void*)0},{&g_40[1],&g_40[1],&g_320,&g_44,&g_40[0],(void*)0,&g_44,(void*)0,&g_44,(void*)0}},{{&g_40[0],&g_320,(void*)0,&g_44,&g_40[6],&g_320,(void*)0,&g_40[3],(void*)0,&g_320},{(void*)0,(void*)0,&g_40[5],(void*)0,&g_40[1],&g_40[6],&g_40[1],&g_320,(void*)0,&g_44}},{{&g_40[2],&g_320,&g_320,&g_44,&g_40[3],&g_320,&g_44,&g_40[5],&g_40[5],&g_44},{(void*)0,(void*)0,&g_40[1],&g_40[1],(void*)0,(void*)0,(void*)0,&g_40[0],&g_40[6],(void*)0}}}; + int32_t l_870 = 0x0B9A60E1L; + int32_t l_872 = (-5L); + int32_t l_879 = 0x68AC52C0L; + int32_t l_880 = 1L; + int32_t l_882 = (-3L); + int32_t l_883 = 0x329F4C9FL; + int32_t l_884 = (-2L); + int32_t l_887 = 0x1D6C2448L; + int32_t l_888[9]; + uint8_t ***l_903 = &g_175; + uint8_t ****l_902[5][1] = {{&l_903},{&l_903},{&l_903},{&l_903},{&l_903}}; + int8_t **l_919 = &g_243[1][0][1]; + int i, j, k; + for (i = 0; i < 2; i++) + l_806[i] = 0xDFCAL; + for (i = 0; i < 9; i++) + l_888[i] = 0xAEB8A862L; + for (g_140 = 0; (g_140 <= 1); g_140 += 1) + { /* block id: 407 */ + const uint16_t l_807 = 0UL; + int32_t *l_809 = (void*)0; + int32_t *l_864 = &g_297[1]; + int32_t l_867 = 0xB4D5446DL; + int32_t l_869 = 1L; + int32_t l_871 = 0L; + int32_t l_873 = (-1L); + int8_t l_874 = 1L; + int32_t l_875 = 0x566BCB73L; + int32_t l_876 = 0x640B2514L; + int32_t l_877 = (-10L); + int32_t l_878 = 0L; + int32_t l_881[1][2][1]; + int32_t l_890 = (-10L); + int i, j, k; + for (i = 0; i < 1; i++) + { + for (j = 0; j < 2; j++) + { + for (k = 0; k < 1; k++) + l_881[i][j][k] = (-1L); + } + } + for (p_98 = 0; (p_98 <= 1); p_98 += 1) + { /* block id: 410 */ + uint16_t *l_837[7][2][10] = {{{&g_251,(void*)0,&g_251,(void*)0,&g_251,&g_251,&g_251,(void*)0,&g_251,(void*)0},{(void*)0,&g_251,&g_251,&g_251,(void*)0,&g_251,&g_251,&g_251,&g_251,&g_251}},{{&g_251,&g_251,&g_251,(void*)0,&g_251,&g_251,&g_251,(void*)0,&g_251,&g_251},{(void*)0,&g_251,&g_251,(void*)0,&g_251,&g_251,(void*)0,&g_251,&g_251,&g_251}},{{&g_251,&g_251,(void*)0,&g_251,(void*)0,&g_251,&g_251,&g_251,&g_251,(void*)0},{(void*)0,&g_251,&g_251,(void*)0,&g_251,&g_251,&g_251,(void*)0,&g_251,(void*)0}},{{&g_251,&g_251,&g_251,&g_251,(void*)0,(void*)0,&g_251,&g_251,&g_251,(void*)0},{(void*)0,&g_251,(void*)0,&g_251,&g_251,(void*)0,&g_251,(void*)0,(void*)0,&g_251}},{{&g_251,&g_251,&g_251,(void*)0,&g_251,&g_251,&g_251,&g_251,&g_251,&g_251},{(void*)0,&g_251,&g_251,&g_251,&g_251,&g_251,(void*)0,&g_251,(void*)0,&g_251}},{{&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,(void*)0,&g_251},{&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,(void*)0,&g_251,&g_251,(void*)0}},{{&g_251,&g_251,&g_251,&g_251,&g_251,(void*)0,&g_251,(void*)0,&g_251,&g_251},{&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,&g_251,&g_251}}}; + int32_t l_848 = (-7L); + uint8_t *l_856 = &g_40[0]; + int32_t *l_860 = &l_848; + int i, j, k; + g_312[0][0][5] = (void*)0; + g_51[g_36][(p_98 + 1)][g_140] ^= 0x87124F79L; + for (g_34 = 0; (g_34 <= 1); g_34 += 1) + { /* block id: 415 */ + uint32_t l_805[5]; + int32_t *l_808 = &g_297[1]; + int i, j, k; + for (i = 0; i < 5; i++) + l_805[i] = 0UL; + (*l_808) ^= (((safe_mod_func_int32_t_s_s((!(~((g_51[g_36][g_140][g_36] != (g_705[p_98] && ((*g_55) |= ((g_705[(g_34 + 3)] <= ((safe_add_func_int16_t_s_s(g_705[(g_34 + 3)], (safe_sub_func_int32_t_s_s((2UL != ((safe_sub_func_int8_t_s_s(p_98, p_97)) , (safe_mul_func_int16_t_s_s((safe_add_func_int8_t_s_s((((g_51[0][3][1] < l_778) || l_805[0]) > (*g_143)), (**g_131))), l_806[0])))), l_778)))) > 0x76L)) & g_34)))) | l_807))), p_96)) > l_778) ^ p_99); + l_809 = &p_98; + } + for (p_96 = 0; (p_96 <= 1); p_96 += 1) + { /* block id: 422 */ + uint8_t l_847 = 1UL; + int i, j, k; + if (g_51[p_98][(g_36 + 5)][g_140]) + break; + l_814 = ((safe_mul_func_uint16_t_u_u(0x9540L, 65535UL)) <= (++(*g_43))); + for (g_347 = 4; (g_347 >= 0); g_347 -= 1) + { /* block id: 428 */ + int8_t *l_851 = &g_255; + int32_t *l_859 = &g_297[1]; + int i, j, k; + l_848 = (safe_rshift_func_int16_t_s_s((-1L), ((safe_mod_func_uint32_t_u_u(((g_51[g_140][(g_140 + 5)][g_140] = (safe_sub_func_int8_t_s_s((((safe_div_func_uint32_t_u_u(g_51[g_140][(g_36 + 2)][(g_140 + 1)], 2L)) <= (safe_unary_minus_func_uint32_t_u((safe_sub_func_int8_t_s_s((((safe_rshift_func_int8_t_s_s(((safe_add_func_int8_t_s_s((p_98 ^ (safe_add_func_int16_t_s_s((safe_sub_func_int16_t_s_s((safe_mul_func_uint8_t_u_u((((~(safe_unary_minus_func_int8_t_s((((((&g_251 == l_837[2][0][1]) ^ ((-1L) == ((*g_289) = (safe_lshift_func_uint16_t_u_s((l_814 = ((safe_lshift_func_int16_t_s_u(g_51[g_140][(g_36 + 2)][(g_140 + 1)], 13)) >= (safe_sub_func_uint8_t_u_u(((safe_div_func_int8_t_s_s((((g_243[(g_36 + 1)][g_36][(p_96 + 3)] == l_846[0][1][8]) == 0xC75DL) <= g_51[g_140][(g_36 + 2)][(g_140 + 1)]), g_51[p_98][(g_36 + 5)][g_140])) | p_99), 255UL)))), p_98))))) > l_847) , l_778) < 0x4EDBL)))) | g_347) != l_778), (*g_132))), g_51[p_98][(g_36 + 5)][g_140])), 0x4155L))), (*g_43))) <= (-4L)), 4)) < g_320) <= p_97), 0x7DL))))) | 0xE6F3L), p_96))) && (**g_736)), 1UL)) | 0x59L))); + if (p_97) + break; + (*l_859) ^= ((*p_95) && (((safe_div_func_int8_t_s_s(((*l_851) = (g_294[0] >= 0x74B3L)), ((**g_175) = (**g_176)))) , (safe_sub_func_uint8_t_u_u(((!(l_814 = (safe_mod_func_int8_t_s_s(((*l_851) ^= (l_856 == (void*)0)), (p_99 = (safe_lshift_func_int16_t_s_u(g_51[g_140][(g_140 + 5)][g_140], 2))))))) > g_51[g_36][(p_98 + 1)][g_140]), l_778))) , 0UL)); + l_860 = &l_814; + } + for (g_56 = 0; (g_56 <= 1); g_56 += 1) + { /* block id: 444 */ + int32_t **l_861 = &l_809; + (*l_861) = &g_51[0][3][1]; + if (p_99) + break; + } + } + } + (*l_864) = (((l_806[0] , (safe_lshift_func_uint8_t_u_u((p_97 ^ 0UL), 2))) & (~1UL)) == (**g_736)); + for (p_98 = 1; (p_98 >= 0); p_98 -= 1) + { /* block id: 453 */ + int32_t *l_865 = &l_814; + int32_t *l_866[5]; + int16_t l_886[3]; + int32_t l_889 = 0xF193AD92L; + uint32_t l_892 = 4294967295UL; + uint16_t *l_920 = &g_251; + uint32_t l_931 = 4UL; + const uint8_t *l_951[4]; + const uint8_t **l_950 = &l_951[3]; + const uint8_t *** const l_949 = &l_950; + int32_t ***l_962[9] = {&g_961,&g_961,&g_961,&g_961,&g_961,&g_961,&g_961,&g_961,&g_961}; + int i; + for (i = 0; i < 5; i++) + l_866[i] = (void*)0; + for (i = 0; i < 3; i++) + l_886[i] = 0x4E3AL; + for (i = 0; i < 4; i++) + l_951[i] = (void*)0; + l_892--; + for (l_877 = 4; (l_877 >= 0); l_877 -= 1) + { /* block id: 457 */ + uint8_t *****l_898 = (void*)0; + uint8_t *****l_899 = (void*)0; + uint8_t *****l_900 = (void*)0; + uint8_t *****l_901 = (void*)0; + int32_t l_929 = 0x9F81C2E6L; + int32_t l_930[6]; + uint32_t l_954 = 0UL; + int i, j, k; + for (i = 0; i < 6; i++) + l_930[i] = 0xF1E80E14L; + if ((safe_rshift_func_uint16_t_u_s((&g_736 == &g_736), (((g_294[g_140] != g_294[p_98]) && (((1UL != (((g_897 = g_897) != (g_904[0][3] = l_902[0][0])) != ((*g_289) = (((g_294[(g_140 + 1)] = ((safe_mod_func_int16_t_s_s(((**g_131) , (((p_97 || l_882) != 0x37DD31F2L) | 0L)), p_97)) || (*g_143))) ^ (*l_865)) , 1L)))) == (***g_905)) , (*g_289))) ^ (-7L))))) + { /* block id: 462 */ + uint16_t l_921 = 1UL; + int32_t l_922 = 0xB991C690L; + l_922 &= (safe_rshift_func_int8_t_s_u((((safe_div_func_uint8_t_u_u((((l_921 = (((((safe_lshift_func_uint8_t_u_u((1UL != (((safe_rshift_func_uint8_t_u_s((((void*)0 == l_916) == 0xDFCCF46BL), (((((*l_864) | ((p_99 = ((l_920 = (((l_868[1] , l_919) != &g_243[(p_98 + 3)][g_36][(p_98 + 6)]) , (void*)0)) == (void*)0)) <= g_294[(g_140 + 1)])) & 3UL) <= (***g_735)) || (**g_736)))) <= (***g_905)) > g_294[(g_140 + 1)])), p_98)) == (*g_289)) < g_51[0][3][1]) | p_98) , (**g_175))) < 0x64L) < l_814), l_888[1])) , (-4L)) , l_868[6]), 1)); + } + else + { /* block id: 467 */ + uint8_t l_923 = 0xE8L; + int32_t l_926 = (-9L); + int32_t l_927 = 8L; + int32_t l_928 = (-1L); + --l_923; + if (p_96) + continue; + l_931++; + } + (*l_864) = (safe_sub_func_uint8_t_u_u((((*l_865) = (((safe_div_func_uint8_t_u_u(((safe_mod_func_uint16_t_u_u(0xDC88L, (safe_rshift_func_int16_t_s_s(((0UL ^ (-6L)) > p_97), ((safe_add_func_uint16_t_u_u(l_868[6], (safe_add_func_int16_t_s_s((safe_rshift_func_uint8_t_u_s((l_948 == l_949), ((safe_sub_func_int16_t_s_s((l_954 > ((&g_289 != (void*)0) & g_140)), 0x0045L)) > 0UL))), 0xB58DL)))) < (*g_289)))))) < (***g_735)), l_868[6])) != p_98) | p_99)) & (*g_55)), 0x4AL)); + (*l_864) &= 0xD1CAA0FBL; + } + for (l_778 = 1; (l_778 >= 0); l_778 -= 1) + { /* block id: 478 */ + int16_t *l_959 = &l_806[1]; + int32_t l_965 = (-8L); + int8_t *l_966 = &g_255; + uint16_t *l_967 = &g_251; + uint16_t *l_968 = &g_969; + int i, j, k; + (*l_864) = (p_96 |= l_888[6]); + p_96 = (((6UL <= ((safe_mod_func_int8_t_s_s((g_251 , (((*g_289) <= (safe_mod_func_int16_t_s_s(((*l_959) &= ((*l_916) = 0x3137L)), (((g_960 != l_962[4]) , ((*l_968) &= ((*l_967) = ((((safe_add_func_uint16_t_u_u(0xEADCL, ((((((*l_966) &= (l_965 == l_879)) == 0xA5L) , p_96) >= p_96) ^ (*p_95)))) , 5UL) & (*g_143)) , p_99)))) , (*g_289))))) ^ (**g_176))), 3L)) == (*g_55))) && (**g_131)) <= p_97); + } + } + } + if (l_868[6]) + break; + } + if ((p_98 = (safe_mod_func_int16_t_s_s((*g_289), (safe_add_func_uint32_t_u_u(((l_984 = (0x4C7D768FL <= ((*l_983) ^= (safe_mul_func_int8_t_s_s(((**g_736) || (l_982 &= ((p_98 == (safe_sub_func_uint32_t_u_u((((l_948 == l_948) | (safe_lshift_func_int8_t_s_s((0x454BL <= l_868[3]), 0))) ^ ((safe_lshift_func_uint8_t_u_s((!255UL), 0)) <= l_885)), (*p_95)))) || (*g_55)))), 0x15L))))) & l_778), (*p_95))))))) + { /* block id: 496 */ + uint8_t ***l_993 = &g_175; + int16_t l_999 = 0x1B88L; + int8_t *** const *l_1034 = &g_1019[1][0][0]; + int32_t *l_1046 = &l_982; + int32_t l_1048[1][2][7] = {{{0xEA46108CL,0xEA46108CL,0xEA46108CL,0xEA46108CL,0xEA46108CL,0xEA46108CL,0xEA46108CL},{(-1L),(-1L),(-1L),(-1L),(-1L),(-1L),(-1L)}}}; + uint32_t l_1093[3]; + uint16_t l_1131 = 0xE112L; + int16_t **l_1135[6][2][5] = {{{&g_289,&g_289,&g_289,&g_289,(void*)0},{&g_289,&g_289,&g_289,&g_289,&g_289}},{{&g_289,(void*)0,&g_289,(void*)0,&g_289},{&g_289,&g_289,&g_289,(void*)0,(void*)0}},{{&g_289,(void*)0,(void*)0,&g_289,&g_289},{&g_289,(void*)0,(void*)0,&g_289,(void*)0}},{{(void*)0,&g_289,&g_289,&g_289,&g_289},{(void*)0,&g_289,(void*)0,&g_289,&g_289}},{{&g_289,&g_289,&g_289,&g_289,(void*)0},{&g_289,&g_289,&g_289,&g_289,&g_289}},{{&g_289,&g_289,&g_289,(void*)0,(void*)0},{&g_289,(void*)0,(void*)0,(void*)0,(void*)0}}}; + int32_t l_1180 = 0L; + uint8_t l_1276[9]; + int32_t *l_1294 = &g_1132; + int32_t *l_1320 = &g_51[0][3][1]; + int32_t *l_1321 = &g_140; + int32_t *l_1322 = &g_297[1]; + int32_t *l_1323 = &l_1048[0][1][0]; + int32_t *l_1324[1]; + int16_t l_1326 = 0x2195L; + int32_t l_1327 = 0x947976B8L; + uint16_t l_1328 = 0x24D6L; + int i, j, k; + for (i = 0; i < 3; i++) + l_1093[i] = 1UL; + for (i = 0; i < 9; i++) + l_1276[i] = 255UL; + for (i = 0; i < 1; i++) + l_1324[i] = &l_1048[0][0][6]; + for (g_44 = 0; (g_44 <= 6); g_44 += 1) + { /* block id: 499 */ + uint8_t ***l_994 = &g_175; + int8_t l_997 = 0xA6L; + int8_t ***l_1017 = &g_245; + int8_t ****l_1016 = &l_1017; + int32_t l_1050 = 0xF31EAA3DL; + int32_t l_1051 = 0x0917F34DL; + int32_t l_1056 = 0x36E77B1BL; + int32_t l_1057 = 0x4D998F65L; + int8_t l_1113 = 0x9DL; + uint32_t l_1114[6]; + int32_t l_1168 = 0xF8E5B00AL; + int32_t l_1170 = 0x729BDDB8L; + int32_t l_1171 = 1L; + int32_t l_1172 = (-1L); + int32_t l_1173 = 0L; + int32_t l_1176[5][7][6] = {{{0xBDCB05A3L,0L,0xCD8737B6L,0L,0xBDCB05A3L,0xC7DD3347L},{0L,0xBDCB05A3L,0xC7DD3347L,0xC7DD3347L,0xBDCB05A3L,0L},{(-6L),0L,0xF426EDDCL,0xBDCB05A3L,0xF426EDDCL,0L},{0xF426EDDCL,(-6L),0xC7DD3347L,0xCD8737B6L,0xCD8737B6L,0xCD8737B6L},{0xA0CC386BL,0xA0CC386BL,0xF426EDDCL,0xC7DD3347L,0L,0xC7DD3347L},{0xBDCB05A3L,0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL},{(-6L),0xBDCB05A3L,0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L}},{{0xC7DD3347L,(-6L),0xF426EDDCL,(-6L),0xC7DD3347L,0xCD8737B6L},{(-6L),0xC7DD3347L,0xCD8737B6L,0xCD8737B6L,0xC7DD3347L,(-6L)},{0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L,0xA0CC386BL,(-6L)},{0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL,0xCD8737B6L},{0xA0CC386BL,0xA0CC386BL,0xF426EDDCL,0xC7DD3347L,0L,0xC7DD3347L},{0xBDCB05A3L,0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL},{(-6L),0xBDCB05A3L,0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L}},{{0xC7DD3347L,(-6L),0xF426EDDCL,(-6L),0xC7DD3347L,0xCD8737B6L},{(-6L),0xC7DD3347L,0xCD8737B6L,0xCD8737B6L,0xC7DD3347L,(-6L)},{0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L,0xA0CC386BL,(-6L)},{0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL,0xCD8737B6L},{0xA0CC386BL,0xA0CC386BL,0xF426EDDCL,0xC7DD3347L,0L,0xC7DD3347L},{0xBDCB05A3L,0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL},{(-6L),0xBDCB05A3L,0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L}},{{0xC7DD3347L,(-6L),0xF426EDDCL,(-6L),0xC7DD3347L,0xCD8737B6L},{(-6L),0xC7DD3347L,0xCD8737B6L,0xCD8737B6L,0xC7DD3347L,(-6L)},{0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L,0xA0CC386BL,(-6L)},{0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL,0xCD8737B6L},{0xA0CC386BL,0xA0CC386BL,0xF426EDDCL,0xC7DD3347L,0L,0xC7DD3347L},{0xBDCB05A3L,0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL},{(-6L),0xBDCB05A3L,0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L}},{{0xC7DD3347L,(-6L),0xF426EDDCL,(-6L),0xC7DD3347L,0xCD8737B6L},{(-6L),0xC7DD3347L,0xCD8737B6L,0xCD8737B6L,0xC7DD3347L,(-6L)},{0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L,0xA0CC386BL,(-6L)},{0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL,0xCD8737B6L},{0xA0CC386BL,0xA0CC386BL,0xF426EDDCL,0xC7DD3347L,0L,0xC7DD3347L},{0xBDCB05A3L,0xA0CC386BL,0xBDCB05A3L,0xCD8737B6L,0xF426EDDCL,0xF426EDDCL},{(-6L),0xBDCB05A3L,0xBDCB05A3L,(-6L),0xA0CC386BL,0xC7DD3347L}}}; + uint32_t l_1319 = 0x3CC17454L; + int i, j, k; + for (i = 0; i < 6; i++) + l_1114[i] = 1UL; + } + --l_1328; + (*g_143) ^= ((*g_960) == (void*)0); + return (**g_960); + } + else + { /* block id: 635 */ + int32_t *l_1331 = &g_51[0][1][1]; + int32_t *l_1332[6] = {&g_1055,&g_1055,&g_1055,&g_1055,&g_1055,&g_1055}; + int i; + ++g_1334; + for (g_347 = 0; (g_347 == 26); g_347 = safe_add_func_uint16_t_u_u(g_347, 7)) + { /* block id: 639 */ + return (*g_961); + } + } + return l_1339; +} + + +/* ------------------------------------------ */ +/* + * reads : g_143 g_140 g_176 g_43 g_44 g_705 g_289 g_290 g_297 g_255 g_55 g_56 + * writes: g_255 g_297 g_140 g_312 g_294 + */ +static int8_t func_100(int32_t * p_101, uint8_t p_102, uint8_t p_103, uint32_t p_104) +{ /* block id: 323 */ + int8_t ***l_692 = (void*)0; + int8_t ****l_691 = &l_692; + int32_t l_697 = 0xB23966F9L; + int32_t l_704 = 0x17C47AB5L; + int32_t l_712 = 0x92F85846L; + uint32_t l_724 = 1UL; + uint32_t l_754 = 0x40901257L; + uint32_t l_755[9][7] = {{0x3F92B650L,0x3F92B650L,0x59DA734BL,0x3F92B650L,0x3F92B650L,0x59DA734BL,0x3F92B650L},{0x1D3867C8L,4294967286UL,4294967295UL,5UL,4294967295UL,4294967286UL,0x1D3867C8L},{0xB66E3024L,0x3F92B650L,0xB66E3024L,0xB66E3024L,0x3F92B650L,0xB66E3024L,0xB66E3024L},{0x1D3867C8L,5UL,0x67201704L,5UL,0x1D3867C8L,4294967295UL,0x1D3867C8L},{0x3F92B650L,0xB66E3024L,0xB66E3024L,0x3F92B650L,0xB66E3024L,0xB66E3024L,0x3F92B650L},{4294967295UL,5UL,4294967295UL,4294967286UL,0x1D3867C8L,4294967286UL,4294967295UL},{0x3F92B650L,0x3F92B650L,0x59DA734BL,0x3F92B650L,0x3F92B650L,0x59DA734BL,0x3F92B650L},{0x1D3867C8L,4294967286UL,4294967295UL,5UL,4294967295UL,4294967286UL,0x1D3867C8L},{0xB66E3024L,0x3F92B650L,0xB66E3024L,0xB66E3024L,0x3F92B650L,0xB66E3024L,0xB66E3024L}}; + int i, j; + if (((l_691 == &l_692) < (safe_mod_func_int16_t_s_s(((safe_mul_func_int16_t_s_s(((l_697 & (0UL != ((l_697 & ((0L ^ 0UL) <= (safe_mod_func_int32_t_s_s((*g_143), (safe_mod_func_uint8_t_u_u((safe_mul_func_uint8_t_u_u(((l_704 = (p_102 > l_697)) & (**g_176)), 0xD2L)), l_697)))))) && (-1L)))) , g_705[2]), (*g_289))) && l_697), (*g_289))))) + { /* block id: 325 */ + int16_t l_715 = (-7L); + int8_t *l_716 = &g_255; + int8_t **l_717 = (void*)0; + (*g_143) ^= (safe_div_func_int8_t_s_s(((((safe_lshift_func_int8_t_s_u(((((0x7466BED0L && ((safe_rshift_func_int8_t_s_s(l_712, ((0x6627434EL > (safe_mod_func_int16_t_s_s(l_715, 0xA37DL))) == ((((~g_297[1]) & p_102) , ((*p_101) = (p_104 < ((*l_716) ^= l_715)))) > (*g_55))))) && p_102)) , l_704) >= 0x8C828013L) , 0x19L), 6)) > l_715) , l_717) == &l_716), 1UL)); + return p_102; + } + else + { /* block id: 330 */ + int32_t **l_718 = &g_312[1][0][5]; + uint32_t *l_766 = &l_755[0][2]; + (*l_718) = p_101; + for (p_103 = 25; (p_103 != 48); ++p_103) + { /* block id: 334 */ + int8_t l_723[9][8][3] = {{{0x6BL,0L,0xCAL},{0xF4L,0xB1L,0x8BL},{0L,0L,0x53L},{0xBFL,0L,0x76L},{0xBFL,0x39L,0x1BL},{0L,1L,0xDFL},{0xF4L,0xBFL,0x1BL},{0x6BL,0x2AL,0x76L}},{{1L,0x2AL,0x53L},{1L,0xBFL,0x8BL},{0xA4L,1L,0xCAL},{1L,0x39L,0x10L},{1L,0L,0x10L},{0x6BL,0L,0xCAL},{0xF4L,0xB1L,0x8BL},{0L,0L,0x53L}},{{0xBFL,0L,0x76L},{0xBFL,0x39L,0x1BL},{0L,1L,0xDFL},{0xF4L,0xBFL,0x1BL},{0x6BL,0x2AL,0x76L},{1L,0x2AL,0x53L},{1L,0xBFL,0x8BL},{0xA4L,1L,0xCAL}},{{1L,0x39L,0x10L},{1L,0L,0x10L},{0x6BL,0L,0xCAL},{0xF4L,0xB1L,0x8BL},{0L,0L,0x53L},{0xBFL,0L,0x76L},{0xBFL,0x39L,0x1BL},{0L,1L,0xDFL}},{{0xF4L,0xBFL,0x1BL},{0x6BL,0x2AL,0x76L},{1L,0x2AL,0x53L},{1L,0xBFL,0x8BL},{0xA4L,1L,0xCAL},{1L,0x39L,0x10L},{1L,0L,0x10L},{0x6BL,0L,0xCAL}},{{0xF4L,0xB1L,0x8BL},{0L,0L,0x53L},{0x6FL,9L,0x6CL},{0x6FL,0xE5L,0L},{(-1L),0L,1L},{(-9L),0x6FL,0L},{0xE9L,1L,0x6CL},{0xC4L,1L,0xBFL}},{{0L,0x6FL,1L},{1L,0L,0xA4L},{0L,0xE5L,0xB1L},{0xC4L,9L,0xB1L},{0xE9L,(-1L),0xA4L},{(-9L),0x19L,1L},{(-1L),(-1L),0xBFL},{0x6FL,9L,0x6CL}},{{0x6FL,0xE5L,0L},{(-1L),0L,1L},{(-9L),0x6FL,0L},{0xE9L,1L,0x6CL},{0xC4L,1L,0xBFL},{0L,0x6FL,1L},{1L,0L,0xA4L},{0L,0xE5L,0xB1L}},{{0xC4L,9L,0xB1L},{0xE9L,(-1L),0xA4L},{(-9L),0x19L,1L},{(-1L),(-1L),0xBFL},{0x6FL,9L,0x6CL},{0x6FL,0xE5L,0L},{(-1L),0L,1L},{(-9L),0x6FL,0L}}}; + int8_t ***l_761[10] = {&g_245,&g_245,&g_245,&g_245,&g_245,&g_245,&g_245,&g_245,&g_245,&g_245}; + int i, j, k; + } + for (l_704 = 0; l_704 < 5; l_704 += 1) + { + g_294[l_704] = 1UL; + } + } + (*g_143) = (safe_div_func_int32_t_s_s((*g_143), l_704)); + return l_697; +} + + +/* ------------------------------------------ */ +/* + * reads : + * writes: + */ +static int32_t * func_105(uint32_t p_106) +{ /* block id: 29 */ + int8_t *l_134 = &g_36; + int8_t ** const l_133 = &l_134; + int32_t l_156 = 0xE85A3F02L; + uint32_t l_166 = 0x5E662131L; + uint8_t **l_172 = &g_43; + uint8_t **l_174[2][7] = {{&g_43,&g_43,&g_43,&g_43,&g_43,&g_43,&g_43},{&g_43,&g_43,&g_43,&g_43,&g_43,&g_43,&g_43}}; + uint8_t ***l_173[2][9] = {{(void*)0,&l_172,(void*)0,&l_172,(void*)0,&l_172,(void*)0,&l_172,(void*)0},{(void*)0,(void*)0,&l_174[1][0],&l_174[1][0],(void*)0,(void*)0,&l_174[1][0],&l_174[1][0],(void*)0}}; + int32_t *l_211[6] = {&g_3,&g_3,&g_3,&g_3,&g_3,&g_3}; + int32_t l_418 = 0xBEDB2E7EL; + int32_t l_582 = 8L; + int16_t l_587[5][7][2] = {{{0x5323L,1L},{0xDA62L,0xA377L},{0xD174L,0xDA62L},{0x959BL,0x0DAEL},{0x959BL,0xDA62L},{0xD174L,0xA377L},{0xDA62L,1L}},{{0x5323L,(-1L)},{0xA377L,0x9B9BL},{0x9B9BL,0x9B9BL},{0xA377L,(-1L)},{0x5323L,1L},{0xDA62L,0xA377L},{0xD174L,0xDA62L}},{{0x959BL,0x0DAEL},{0x959BL,0xDA62L},{0xD174L,0xA377L},{0xDA62L,1L},{0x5323L,(-1L)},{0xA377L,0x9B9BL},{0x9B9BL,0x9B9BL}},{{0xA377L,(-1L)},{0x5323L,1L},{0xDA62L,0xA377L},{0xD174L,0xDA62L},{0x959BL,0x0DAEL},{(-1L),0x0DAEL},{0x5323L,0x9B9BL}},{{0x0DAEL,0xD174L},{0x959BL,0xA377L},{0x9B9BL,(-7L)},{(-7L),(-7L)},{0x9B9BL,0xA377L},{0x959BL,0xD174L},{0x0DAEL,0x9B9BL}}}; + uint32_t l_614 = 4294967286UL; + int i, j, k; + return &g_297[1]; +} + + + + +/* ---------------------------------------- */ +int main (int argc, char* argv[]) +{ + int i, j, k; + int print_hash_value = 0; + if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; + platform_main_begin(); + crc32_gentab(); + func_1(); + for (i = 0; i < 5; i++) + { + for (j = 0; j < 1; j++) + { + transparent_crc(g_2[i][j], "g_2[i][j]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d]\n", i, j); + + } + } + transparent_crc(g_3, "g_3", print_hash_value); + for (i = 0; i < 6; i++) + { + transparent_crc(g_14[i], "g_14[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_15, "g_15", print_hash_value); + transparent_crc(g_34, "g_34", print_hash_value); + transparent_crc(g_36, "g_36", print_hash_value); + for (i = 0; i < 7; i++) + { + transparent_crc(g_40[i], "g_40[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_44, "g_44", print_hash_value); + transparent_crc(g_46, "g_46", print_hash_value); + for (i = 0; i < 2; i++) + { + for (j = 0; j < 8; j++) + { + for (k = 0; k < 3; k++) + { + transparent_crc(g_51[i][j][k], "g_51[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_52, "g_52", print_hash_value); + transparent_crc(g_56, "g_56", print_hash_value); + transparent_crc(g_140, "g_140", print_hash_value); + transparent_crc(g_251, "g_251", print_hash_value); + transparent_crc(g_255, "g_255", print_hash_value); + transparent_crc(g_290, "g_290", print_hash_value); + for (i = 0; i < 5; i++) + { + transparent_crc(g_294[i], "g_294[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + for (i = 0; i < 2; i++) + { + transparent_crc(g_297[i], "g_297[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_320, "g_320", print_hash_value); + transparent_crc(g_347, "g_347", print_hash_value); + transparent_crc(g_419, "g_419", print_hash_value); + transparent_crc(g_477, "g_477", print_hash_value); + for (i = 0; i < 6; i++) + { + transparent_crc(g_705[i], "g_705[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_969, "g_969", print_hash_value); + transparent_crc(g_1055, "g_1055", print_hash_value); + transparent_crc(g_1099, "g_1099", print_hash_value); + transparent_crc(g_1132, "g_1132", print_hash_value); + transparent_crc(g_1189, "g_1189", print_hash_value); + for (i = 0; i < 8; i++) + { + for (j = 0; j < 1; j++) + { + for (k = 0; k < 8; k++) + { + transparent_crc(g_1254[i][j][k], "g_1254[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_1285, "g_1285", print_hash_value); + transparent_crc(g_1298, "g_1298", print_hash_value); + transparent_crc(g_1333, "g_1333", print_hash_value); + transparent_crc(g_1334, "g_1334", print_hash_value); + transparent_crc(g_1509, "g_1509", print_hash_value); + transparent_crc(g_1766, "g_1766", print_hash_value); + transparent_crc(g_1776, "g_1776", print_hash_value); + for (i = 0; i < 6; i++) + { + for (j = 0; j < 8; j++) + { + for (k = 0; k < 5; k++) + { + transparent_crc(g_1782[i][j][k], "g_1782[i][j][k]", print_hash_value); + if (print_hash_value) printf("index = [%d][%d][%d]\n", i, j, k); + + } + } + } + transparent_crc(g_1857, "g_1857", print_hash_value); + transparent_crc(g_1961, "g_1961", print_hash_value); + transparent_crc(g_2067, "g_2067", print_hash_value); + for (i = 0; i < 10; i++) + { + transparent_crc(g_2147[i], "g_2147[i]", print_hash_value); + if (print_hash_value) printf("index = [%d]\n", i); + + } + transparent_crc(g_2148, "g_2148", print_hash_value); + transparent_crc(g_2207, "g_2207", print_hash_value); + platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); + return 0; +} + +/************************ statistics ************************* +XXX max struct depth: 0 +breakdown: + depth: 0, occurrence: 652 +XXX total union variables: 0 + +XXX non-zero bitfields defined in structs: 0 +XXX zero bitfields defined in structs: 0 +XXX const bitfields defined in structs: 0 +XXX volatile bitfields defined in structs: 0 +XXX structs with bitfields in the program: 0 +breakdown: +XXX full-bitfields structs in the program: 0 +breakdown: +XXX times a bitfields struct's address is taken: 0 +XXX times a bitfields struct on LHS: 0 +XXX times a bitfields struct on RHS: 0 +XXX times a single bitfield on LHS: 0 +XXX times a single bitfield on RHS: 0 + +XXX max expression depth: 41 +breakdown: + depth: 1, occurrence: 169 + depth: 2, occurrence: 42 + depth: 3, occurrence: 3 + depth: 4, occurrence: 2 + depth: 6, occurrence: 1 + depth: 7, occurrence: 1 + depth: 8, occurrence: 1 + depth: 10, occurrence: 1 + depth: 13, occurrence: 1 + depth: 14, occurrence: 1 + depth: 15, occurrence: 1 + depth: 16, occurrence: 3 + depth: 19, occurrence: 1 + depth: 20, occurrence: 1 + depth: 21, occurrence: 4 + depth: 22, occurrence: 2 + depth: 23, occurrence: 2 + depth: 24, occurrence: 2 + depth: 25, occurrence: 1 + depth: 26, occurrence: 2 + depth: 27, occurrence: 3 + depth: 28, occurrence: 4 + depth: 30, occurrence: 1 + depth: 31, occurrence: 1 + depth: 33, occurrence: 1 + depth: 35, occurrence: 2 + depth: 36, occurrence: 2 + depth: 39, occurrence: 4 + depth: 41, occurrence: 2 + +XXX total number of pointers: 428 + +XXX times a variable address is taken: 1238 +XXX times a pointer is dereferenced on RHS: 347 +breakdown: + depth: 1, occurrence: 232 + depth: 2, occurrence: 83 + depth: 3, occurrence: 32 +XXX times a pointer is dereferenced on LHS: 261 +breakdown: + depth: 1, occurrence: 220 + depth: 2, occurrence: 32 + depth: 3, occurrence: 9 +XXX times a pointer is compared with null: 37 +XXX times a pointer is compared with address of another variable: 12 +XXX times a pointer is compared with another pointer: 17 +XXX times a pointer is qualified to be dereferenced: 9414 + +XXX max dereference level: 5 +breakdown: + level: 0, occurrence: 0 + level: 1, occurrence: 1507 + level: 2, occurrence: 661 + level: 3, occurrence: 292 + level: 4, occurrence: 45 + level: 5, occurrence: 6 +XXX number of pointers point to pointers: 210 +XXX number of pointers point to scalars: 218 +XXX number of pointers point to structs: 0 +XXX percent of pointers has null in alias set: 29.2 +XXX average alias set size: 1.54 + +XXX times a non-volatile is read: 2082 +XXX times a non-volatile is write: 921 +XXX times a volatile is read: 0 +XXX times read thru a pointer: 0 +XXX times a volatile is write: 0 +XXX times written thru a pointer: 0 +XXX times a volatile is available for access: 0 +XXX percentage of non-volatile access: 100 + +XXX forward jumps: 1 +XXX backward jumps: 7 + +XXX stmts: 175 +XXX max block depth: 5 +breakdown: + depth: 0, occurrence: 34 + depth: 1, occurrence: 30 + depth: 2, occurrence: 19 + depth: 3, occurrence: 27 + depth: 4, occurrence: 30 + depth: 5, occurrence: 35 + +XXX percentage a fresh-made variable is used: 16.5 +XXX percentage an existing variable is used: 83.5 +********************* end of statistics **********************/ + diff --git a/tests/fuzz/19.c.txt b/tests/fuzz/19.c.txt new file mode 100644 index 00000000..5fac330b --- /dev/null +++ b/tests/fuzz/19.c.txt @@ -0,0 +1 @@ +checksum = 150DAD10 diff --git a/tests/fuzz/csmith_driver.py b/tests/fuzz/csmith_driver.py index ad5a7021..09f1c249 100755 --- a/tests/fuzz/csmith_driver.py +++ b/tests/fuzz/csmith_driver.py @@ -35,7 +35,13 @@ notes = { 'invalid': 0, 'unaligned': 0, 'embug': 0 } fails = 0 while 1: - opts = '-O' + str(random.randint(0, 3)) + if random.random() < 0.666: + opts = '-O' + str(random.randint(0, 3)) + else: + if random.random() < 0.5: + opts = '-Os' + else: + opts = '-Oz' print 'opt level:', opts print 'Tried %d, notes: %s' % (tried, notes) @@ -60,13 +66,13 @@ while 1: print '2) Compile natively' shared.try_delete(filename) try: - shared.check_execute([COMP, opts, fullname, '-o', filename + '1'] + CSMITH_CFLAGS + ['-w']) # + shared.EMSDK_OPTS + shared.check_execute([COMP, '-m32', opts, fullname, '-o', filename + '1'] + CSMITH_CFLAGS + ['-w']) # + shared.EMSDK_OPTS except Exception, e: print 'Failed to compile natively using clang' notes['invalid'] += 1 continue - shared.check_execute([COMP, opts, '-emit-llvm', '-c', '-Xclang', '-triple=i386-pc-linux-gnu', fullname, '-o', filename + '.bc'] + CSMITH_CFLAGS + shared.EMSDK_OPTS) + shared.check_execute([COMP, '-m32', opts, '-emit-llvm', '-c', fullname, '-o', filename + '.bc'] + CSMITH_CFLAGS + shared.EMSDK_OPTS) shared.check_execute([shared.path_from_root('tools', 'nativize_llvm.py'), filename + '.bc']) shutil.move(filename + '.bc.run', filename + '2') shared.check_execute([COMP, fullname, '-o', filename + '3'] + CSMITH_CFLAGS) @@ -115,7 +121,7 @@ while 1: print "EMSCRIPTEN BUG" notes['embug'] += 1 fails += 1 - shutil.copyfile(fullname, 'newfail%d%s' % (fails, suffix)) + shutil.copyfile(fullname, 'newfail%d%s%s' % (fails, opts.replace('-', '_'), suffix)) continue #if not ok: # try: # finally, try with safe heap. if that is triggered, this is nonportable code almost certainly @@ -132,7 +138,7 @@ while 1: # This is ok. Try in secondary JS engine too if opts != '-O0' and engine2 and normal: try: - js2 = shared.run_js(filename + '.js', stderr=PIPE, engine=engine2, full_output=True, check_timeout=True) + js2 = shared.run_js(filename + '.js', stderr=PIPE, engine=engine2 + ['-w'], full_output=True, check_timeout=True) except: print 'failed to run in secondary', js2 break diff --git a/tests/fuzz/test.sh b/tests/fuzz/test.sh index 7e6b8966..90d6b1a4 100755 --- a/tests/fuzz/test.sh +++ b/tests/fuzz/test.sh @@ -4,26 +4,26 @@ echo "builds" rm *.out *.bc *.js -gcc $@ -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null -/home/alon/Dev/fastcomp/build/Release/bin/clang $@ -I/home/alon/Dev/csmith/runtime -o n2.out &> /dev/null -/home/alon/Dev/fastcomp/build/Release/bin/clang $@ -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc &> o -~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null -~/Dev/emscripten/emcc $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null -~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null -EMCC_FAST_COMPILER=1 ~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null -EMCC_FAST_COMPILER=1 ~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null +gcc $@ -m32 -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null +/home/alon/Dev/fastcomp/build/Release/bin/clang $@ -m32 -I/home/alon/Dev/csmith/runtime -o n2.out &> /dev/null +/home/alon/Dev/fastcomp/build/Release/bin/clang $@ -m32 -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc &> o +#EMCC_FAST_COMPILER=0 ~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null +#EMCC_FAST_COMPILER=0~/Dev/emscripten/emcc $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null +#EMCC_FAST_COMPILER=0~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null +~/Dev/emscripten/emcc $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null +~/Dev/emscripten/emcc $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null echo "run n1" ./n1.out &> n1 echo "run n2" ./n2.out &> n2 echo "run bc" /home/alon/Dev/fastcomp/build/Release/bin/lli bc.bc &> bc -echo "run js" -mozjs js.out.js &> js -echo "run ua" -mozjs ua.out.js &> ua -echo "run sh" -mozjs sh.out.js &> sh +#echo "run js" +#mozjs js.out.js &> js +#echo "run ua" +#mozjs ua.out.js &> ua +#echo "run sh" +#mozjs sh.out.js &> sh echo "run fc" mozjs fc.out.js &> fc echo "run fc-sh" @@ -32,16 +32,16 @@ echo "n/n" diff n1 n2 echo "n/bc" diff n1 bc -echo "n/js" -diff n1 js | grep -v warning -echo "n/js-ua" -diff n1 ua | grep -v warning -echo "n/js-sh" -diff n1 sh | grep -v warning -echo "js/fc" -diff fc js | grep -v warning -echo "js/fc-sh" -diff fc-sh js | grep -v warning +#echo "n/js" +#diff n1 js | grep -v warning +#echo "n/js-ua" +#diff n1 ua | grep -v warning +#echo "n/js-sh" +#diff n1 sh | grep -v warning +#echo "js/fc" +#diff fc js | grep -v warning +#echo "js/fc-sh" +#diff fc-sh js | grep -v warning echo "native/fc" grep -v warning fc > fclean diff n1 fclean | grep -v warning diff --git a/tests/fuzz/testpp.sh b/tests/fuzz/testpp.sh index 8e9f4185..49378645 100755 --- a/tests/fuzz/testpp.sh +++ b/tests/fuzz/testpp.sh @@ -4,26 +4,26 @@ echo "builds" rm *.out *.bc *.js -g++ $@ -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null -/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -I/home/alon/Dev/csmith/runtime -o n2.out &> /dev/null -/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc &> o -~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null -~/Dev/emscripten/em++ $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null -~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null -EMCC_FAST_COMPILER=1 ~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null -EMCC_FAST_COMPILER=1 ~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null +g++ $@ -m32 -I/home/alon/Dev/csmith/runtime -o n1.out &> /dev/null +/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -m32 -I/home/alon/Dev/csmith/runtime -o n2.out &> /dev/null +/home/alon/Dev/fastcomp/build/Release/bin/clang++ $@ -m32 -I/home/alon/Dev/csmith/runtime -emit-llvm -c -o bc.bc &> o +#EMCC_FAST_COMPILER=0 ~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o js.out.js &> /dev/null +#EMCC_FAST_COMPILER=0~/Dev/emscripten/em++ $@ -s UNALIGNED_MEMORY=1 -I/home/alon/Dev/csmith/runtime -o ua.out.js &> /dev/null +#EMCC_FAST_COMPILER=0~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o sh.out.js &> /dev/null +~/Dev/emscripten/em++ $@ -I/home/alon/Dev/csmith/runtime -o fc.out.js &> /dev/null +~/Dev/emscripten/em++ $@ -s SAFE_HEAP=1 -I/home/alon/Dev/csmith/runtime -o fc-sh.out.js &> /dev/null echo "run n1" ./n1.out &> n1 echo "run n2" ./n2.out &> n2 echo "run bc" /home/alon/Dev/fastcomp/build/Release/bin/lli bc.bc &> bc -echo "run js" -mozjs js.out.js &> js -echo "run ua" -mozjs ua.out.js &> ua -echo "run sh" -mozjs sh.out.js &> sh +#echo "run js" +#mozjs js.out.js &> js +#echo "run ua" +#mozjs ua.out.js &> ua +#echo "run sh" +#mozjs sh.out.js &> sh echo "run fc" mozjs fc.out.js &> fc echo "run fc-sh" @@ -32,16 +32,16 @@ echo "n/n" diff n1 n2 echo "n/bc" diff n1 bc -echo "n/js" -diff n1 js | grep -v warning -echo "n/js-ua" -diff n1 ua | grep -v warning -echo "n/js-sh" -diff n1 sh | grep -v warning -echo "js/fc" -diff fc js | grep -v warning -echo "js/fc-sh" -diff fc-sh js | grep -v warning +#echo "n/js" +#diff n1 js | grep -v warning +#echo "n/js-ua" +#diff n1 ua | grep -v warning +#echo "n/js-sh" +#diff n1 sh | grep -v warning +#echo "js/fc" +#diff fc js | grep -v warning +#echo "js/fc-sh" +#diff fc-sh js | grep -v warning echo "native/fc" grep -v warning fc > fclean diff n1 fclean | grep -v warning diff --git a/tests/gl_matrix_identity.c b/tests/gl_matrix_identity.c index 9f990a77..8ca7d0cb 100644 --- a/tests/gl_matrix_identity.c +++ b/tests/gl_matrix_identity.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -38,7 +38,7 @@ void verify() { for (int x = 0; x < width*height*4; x++) { if (x % 4 != 3) sum += x * data[x]; } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ int result = sum; REPORT_RESULT(); #endif @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) verify(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(1500); #endif diff --git a/tests/gl_ps.c b/tests/gl_ps.c index 4fa79922..d9f3b079 100644 --- a/tests/gl_ps.c +++ b/tests/gl_ps.c @@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -219,7 +219,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/gl_ps_packed.c b/tests/gl_ps_packed.c index 9ab99cb8..be139cd9 100644 --- a/tests/gl_ps_packed.c +++ b/tests/gl_ps_packed.c @@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -104,7 +104,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -216,7 +216,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/gl_ps_strides.c b/tests/gl_ps_strides.c index d88f5d0b..1ff28c94 100644 --- a/tests/gl_ps_strides.c +++ b/tests/gl_ps_strides.c @@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -227,7 +227,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/gl_renderers.c b/tests/gl_renderers.c index 0a8e6e78..ca6e828e 100644 --- a/tests/gl_renderers.c +++ b/tests/gl_renderers.c @@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 0 #endif @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -180,7 +180,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/gl_stride.c b/tests/gl_stride.c index c254ad5a..d6cf1fd2 100644 --- a/tests/gl_stride.c +++ b/tests/gl_stride.c @@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 0 #endif @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/gl_vertex_buffer.c b/tests/gl_vertex_buffer.c index 6b695462..73c30d48 100644 --- a/tests/gl_vertex_buffer.c +++ b/tests/gl_vertex_buffer.c @@ -22,7 +22,7 @@ REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 0 #endif @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -184,7 +184,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/gl_vertex_buffer_pre.c b/tests/gl_vertex_buffer_pre.c index 84b76569..fb967d11 100644 --- a/tests/gl_vertex_buffer_pre.c +++ b/tests/gl_vertex_buffer_pre.c @@ -22,7 +22,7 @@ REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 0 #endif @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/glbegin_points.c b/tests/glbegin_points.c index 9128a4f5..ae061bb2 100644 --- a/tests/glbegin_points.c +++ b/tests/glbegin_points.c @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#if !defined(__EMSCRIPTEN__) // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/glgettexenv.c b/tests/glgettexenv.c index a051a690..54bf2af8 100644 --- a/tests/glgettexenv.c +++ b/tests/glgettexenv.c @@ -12,7 +12,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif diff --git a/tests/hello_world.ll b/tests/hello_world.ll index 19f84851..7090b732 100644 --- a/tests/hello_world.ll +++ b/tests/hello_world.ll @@ -1,17 +1,16 @@ ; ModuleID = 'tests/hello_world.bc' -target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32" -target triple = "le32-unknown-nacl" +target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:128-n32-S128" +target triple = "asmjs-unknown-emscripten" -@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 ; [#uses=1 type=[15 x i8]*] +@.str = private unnamed_addr constant [15 x i8] c"hello, world!\0A\00", align 1 -; [#uses=0] define i32 @main() { entry: - %retval = alloca i32, align 4 ; [#uses=1 type=i32*] + %retval = alloca i32, align 4 store i32 0, i32* %retval - %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ; [#uses=0 type=i32] + %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8]* @.str, i32 0, i32 0)) ret i32 1 } -; [#uses=1] declare i32 @printf(i8*, ...) + diff --git a/tests/hello_world_gles.c b/tests/hello_world_gles.c index 78595a49..f05cf052 100644 --- a/tests/hello_world_gles.c +++ b/tests/hello_world_gles.c @@ -547,6 +547,10 @@ gears_draw(void) draw_gear(gear3, transform, -3.1, 4.2, -2 * angle - 25.0, blue); glutSwapBuffers(); + +#ifdef LONGTEST + glutPostRedisplay(); // check for issues with not throttling calls +#endif } /** @@ -621,6 +625,14 @@ gears_idle(void) fps); tRate0 = t; frames = 0; +#ifdef LONGTEST + static runs = 0; + runs++; + if (runs == 4) { + int result = fps; + REPORT_RESULT(); + } +#endif } } diff --git a/tests/mem_init.cpp b/tests/mem_init.cpp new file mode 100644 index 00000000..e642bfc9 --- /dev/null +++ b/tests/mem_init.cpp @@ -0,0 +1,24 @@ +#include <stdio.h> +#include <emscripten.h> + +extern "C" { + +int noted = 0; + +void EMSCRIPTEN_KEEPALIVE note(int n) { + EM_ASM_({ Module.print([$0, $1]) }, n, noted); + noted = noted | n; + EM_ASM_({ Module.print(['noted is now', $0]) }, noted); + if (noted == 3) { + int result = noted; + REPORT_RESULT(); + } +} + +} + +int main() { + EM_ASM( myJSCallback() ); // calls a global JS func + return 0; +} + diff --git a/tests/module/test_stdin.c b/tests/module/test_stdin.c index 319c686c..2772fcf0 100644 --- a/tests/module/test_stdin.c +++ b/tests/module/test_stdin.c @@ -3,7 +3,7 @@ #include <stdlib.h> #include <stdio.h> #include <unistd.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -48,7 +48,7 @@ int main(int argc, char const *argv[]) // should exit out after calling main_loop once. main_loop(); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 60, 0); #else while (1) main_loop(); sleep(1); diff --git a/tests/nbody-java/native_java_lang_String.c b/tests/nbody-java/native_java_lang_String.c index 5ccf21df..c55e5412 100644 --- a/tests/nbody-java/native_java_lang_String.c +++ b/tests/nbody-java/native_java_lang_String.c @@ -10,7 +10,7 @@ JAVA_INT java_lang_String_toLowerCaseImpl___int(JAVA_OBJECT me, JAVA_INT n1) { //XMLVM_BEGIN_NATIVE[java_lang_String_toLowerCaseImpl___int] -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ return tolower(n1); #else return towlower(n1); @@ -21,7 +21,7 @@ JAVA_INT java_lang_String_toLowerCaseImpl___int(JAVA_OBJECT me, JAVA_INT n1) JAVA_INT java_lang_String_toUpperCaseImpl___int(JAVA_OBJECT me, JAVA_INT n1) { //XMLVM_BEGIN_NATIVE[java_lang_String_toUpperCaseImpl___int] -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ return toupper(n1); #else return towupper(n1); diff --git a/tests/nbody-java/native_java_lang_System.c b/tests/nbody-java/native_java_lang_System.c index 861781ca..201f8beb 100644 --- a/tests/nbody-java/native_java_lang_System.c +++ b/tests/nbody-java/native_java_lang_System.c @@ -97,7 +97,7 @@ JAVA_OBJECT java_lang_System_getEncoding___int(JAVA_INT n1) { //XMLVM_BEGIN_NATIVE[java_lang_System_getEncoding___int] //Get charset from the OS -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ return xmlvm_create_java_string("UTF-8"); #else char charset[CHARSETBUFF]; diff --git a/tests/nbody-java/xmlvm.c b/tests/nbody-java/xmlvm.c index 35e04d16..dedf1bc6 100644 --- a/tests/nbody-java/xmlvm.c +++ b/tests/nbody-java/xmlvm.c @@ -102,7 +102,7 @@ void xmlvm_init() xmlvm_clear_constant_pool_cache(); #ifndef XMLVM_NO_GC -#ifndef EMSCRIPTEN +#ifndef __EMSCRIPTEN__ GC_finalize_on_demand = 1; GC_java_finalization = 1; java_lang_Thread* finalizerThread = (java_lang_Thread*) org_xmlvm_runtime_FinalizerNotifier_startFinalizerThread__(); @@ -115,7 +115,7 @@ void xmlvm_init() void xmlvm_destroy(java_lang_Thread* mainThread) { -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ return; // Let the JS engine handle clean up #endif diff --git a/tests/nbody-java/xmlvm.h b/tests/nbody-java/xmlvm.h index 0d931565..04f645db 100644 --- a/tests/nbody-java/xmlvm.h +++ b/tests/nbody-java/xmlvm.h @@ -22,7 +22,7 @@ #ifndef __XMLVM_H__ #define __XMLVM_H__ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ // Workaround definitions for Emscripten // TODO: Determine if different solution is needed diff --git a/tests/openal_buffers.c b/tests/openal_buffers.c index 31104a33..df6d8e3f 100644 --- a/tests/openal_buffers.c +++ b/tests/openal_buffers.c @@ -1,7 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <assert.h> -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #include <AL/al.h> #include <AL/alc.h> @@ -68,7 +68,7 @@ void iter() { // Exit once we've processed the entire clip. if (offset >= size) { -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ int result = 0; REPORT_RESULT(); #endif @@ -87,7 +87,7 @@ int main(int argc, char* argv[]) { // // Read in the audio sample. // -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ FILE* fp = fopen("the_entertainer.wav", "rb"); #else FILE* fp = fopen("sounds/the_entertainer.wav", "rb"); @@ -176,7 +176,7 @@ int main(int argc, char* argv[]) { // // Cycle and refill the buffers until we're done. // -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(iter, 0, 0); #else while (1) { diff --git a/tests/openal_playback.cpp b/tests/openal_playback.cpp index 6a8dae38..46c4f8a3 100644 --- a/tests/openal_playback.cpp +++ b/tests/openal_playback.cpp @@ -5,7 +5,7 @@ #include <assert.h> #include <stdint.h> #include <unistd.h> -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -25,7 +25,7 @@ void playSource(void* arg) alGetSourcei(source, AL_SOURCE_STATE, &state); assert(state == AL_STOPPED); -#ifdef EMSCRIPTEN +#ifdef REPORT_RESULT int result = 1; REPORT_RESULT(); #endif @@ -63,7 +63,7 @@ int main() { alGenBuffers(1, buffers); -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ FILE* source = fopen("audio.wav", "rb"); #else FILE* source = fopen("sounds/audio.wav", "rb"); @@ -146,7 +146,7 @@ int main() { alGetSourcei(sources[0], AL_SOURCE_STATE, &state); assert(state == AL_PLAYING); -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_async_call(playSource, reinterpret_cast<void*>(sources[0]), 700); #else usleep(700000); diff --git a/tests/perspective.c b/tests/perspective.c index 72f4c50f..77998557 100644 --- a/tests/perspective.c +++ b/tests/perspective.c @@ -8,7 +8,7 @@ #include <SDL/SDL.h> -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <GL/gl.h> #include <GL/glu.h> #include "emscripten.h" @@ -19,7 +19,7 @@ #include <stdio.h> #include <stdlib.h> -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #define emColor4ubv(x) #else #define emColor4ubv(x) glColor4ubv(x) @@ -392,7 +392,7 @@ int main( int argc, char* argv[] ) */ one_iter(); // just one for testing purposes -#ifndef EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(2000); #endif diff --git a/tests/poppler/utils/pdftoppm.cc b/tests/poppler/utils/pdftoppm.cc index 4df0f5d8..a6865cc6 100644 --- a/tests/poppler/utils/pdftoppm.cc +++ b/tests/poppler/utils/pdftoppm.cc @@ -183,7 +183,7 @@ static void savePageSlice(PDFDoc *doc, bitmap->writePNMFile(ppmFile); } } else { -#if EMSCRIPTEN // XXX EMSCRIPTEN: avoid writing to stdout, better for benchmarking +#ifdef __EMSCRIPTEN__ // XXX EMSCRIPTEN: avoid writing to stdout, better for benchmarking printf("avoiding writing to stdout\n"); #else diff --git a/tests/python/python.le32.bc b/tests/python/python.asmjs-unknown-emscripten.bc Binary files differindex 2a6bc77c..fe848c20 100644 --- a/tests/python/python.le32.bc +++ b/tests/python/python.asmjs-unknown-emscripten.bc diff --git a/tests/runner.py b/tests/runner.py index 501299c7..87f8a036 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -27,6 +27,19 @@ sys.path += [path_from_root(''), path_from_root('third_party/websockify')] import tools.shared from tools.shared import * +# Utils + +def nonfastcomp(test): + try: + old_fastcomp = os.environ.get('EMCC_FAST_COMPILER') + os.environ['EMCC_FAST_COMPILER'] = '0' + test() + finally: + if old_fastcomp is None: + del os.environ['EMCC_FAST_COMPILER'] + else: + os.environ['EMCC_FAST_COMPILER'] = old_fastcomp + # Sanity check for config try: @@ -36,10 +49,7 @@ except: # Core test runner class, shared between normal tests and benchmarks checked_sanity = False -if os.environ.get('EMCC_FAST_COMPILER') == '1': - test_modes = ['default', 'asm1', 'asm2', 'asm3', 'asm2f', 'asm2g'] -else: - test_modes = ['default', 'o1', 'o2', 'asm1', 'asm2', 'asm3', 'asm2f', 'asm2g', 'asm2x86', 's_0_0', 's_0_1'] +test_modes = ['default', 'asm1', 'asm2', 'asm3', 'asm2f', 'asm2g', 'slow2', 'slow2asm', 's_0_0', 's_0_1'] test_index = 0 class RunnerCore(unittest.TestCase): @@ -244,7 +254,7 @@ process(sys.argv[1]) if 'uccessfully compiled asm.js code' in err and 'asm.js link error' not in err: print >> sys.stderr, "[was asm.js'ified]" elif 'asm.js' in err: # if no asm.js error, then not an odin build - raise Exception("did NOT asm.js'ify") + raise Exception("did NOT asm.js'ify: " + err) err = '\n'.join(filter(lambda line: 'uccessfully compiled asm.js code' not in line, err.split('\n'))) return err @@ -342,7 +352,7 @@ process(sys.argv[1]) build_dir = self.get_build_dir() output_dir = self.get_dir() - cache_name = name + str(Building.COMPILER_TEST_OPTS) + cache_name_extra + (self.env.get('EMCC_LLVM_TARGET') or '') + cache_name = name + str(Building.COMPILER_TEST_OPTS) + cache_name_extra + (self.env.get('EMCC_LLVM_TARGET') or '_') + (self.env.get('EMCC_FAST_COMPILER') or '_') valid_chars = "_%s%s" % (string.ascii_letters, string.digits) cache_name = ''.join([(c if c in valid_chars else '_') for c in cache_name]) @@ -573,7 +583,7 @@ class BrowserCore(RunnerCore): def with_report_result(self, code): return r''' - #if EMSCRIPTEN + #ifdef __EMSCRIPTEN__ #include <emscripten.h> #define REPORT_RESULT_INTERNAL(sync) \ char output[1000]; \ @@ -769,23 +779,20 @@ A recommended order is: (the main test suite) other - tests separate from the main suite browser - runs pages in a web browser + interactive - runs interactive browser tests that need human verification, and could not be automated sockets - runs websocket networking tests benchmark - run before and after each set of changes before pushing to master, verify no regressions -There are also commands to run specific subsets of the test suite: - - browser.audio - runs audio tests in a web browser (requires human verification) - To run one of those parts, do something like python tests/runner.py sanity To run a specific set of tests, you can do things like - python tests/runner.py o1 + python tests/runner.py asm2 -(that runs the o1 (-O1) tests). You can run individual tests with +(that runs the asm2 (asm.js, -O2) tests). You can run individual tests with python tests/runner.py test_hello_world diff --git a/tests/s3tc.c b/tests/s3tc.c index 5f7bee83..ca575ffc 100644 --- a/tests/s3tc.c +++ b/tests/s3tc.c @@ -143,7 +143,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(1500); #endif diff --git a/tests/s3tc_crunch.c b/tests/s3tc_crunch.c index c2606c8f..ae5e1228 100644 --- a/tests/s3tc_crunch.c +++ b/tests/s3tc_crunch.c @@ -195,7 +195,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(1500); #endif diff --git a/tests/sdl_alloctext.c b/tests/sdl_alloctext.c index 173be348..b7e9e6cf 100644 --- a/tests/sdl_alloctext.c +++ b/tests/sdl_alloctext.c @@ -25,7 +25,7 @@ int main() SDL_FreeSurface(text); } -#if __EMSCRIPTEN__ +#ifdef __EMSCRIPTEN__ result = 1; REPORT_RESULT(); #endif diff --git a/tests/sdl_audio_beep.cpp b/tests/sdl_audio_beep.cpp index 95a5a7e8..82001e8a 100644 --- a/tests/sdl_audio_beep.cpp +++ b/tests/sdl_audio_beep.cpp @@ -9,7 +9,7 @@ #define M_PI 3.14159265358979323846f #endif -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include "emscripten/emscripten.h" #endif @@ -170,7 +170,7 @@ void nextTest(void *unused = 0) { ++s; if (s >= NUM_ELEMS(sdlAudioFormats)) { printf("All tests done. Quit.\n"); -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_cancel_main_loop(); #ifdef REPORT_RESULT int result = 1; @@ -204,7 +204,7 @@ void update() { if (size == 0 && beep) { delete beep; beep = 0; -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_async_call(nextTest, 0, 1500); #else SDL_Delay(1500); @@ -233,7 +233,7 @@ int main(int argc, char** argv) { nextTest(); -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(update, 60, 0); #else while(beep) { diff --git a/tests/sdl_audio_mix_channels.c b/tests/sdl_audio_mix_channels.c index dd91d594..73d21963 100644 --- a/tests/sdl_audio_mix_channels.c +++ b/tests/sdl_audio_mix_channels.c @@ -42,7 +42,7 @@ int main(int argc, char **argv) { int lastChannel = loadAndPlay(); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ int result = (lastChannel == -1); REPORT_RESULT(); #endif diff --git a/tests/sdl_canvas.c b/tests/sdl_canvas.c index cab48985..4420d73e 100644 --- a/tests/sdl_canvas.c +++ b/tests/sdl_canvas.c @@ -6,7 +6,7 @@ int main(int argc, char **argv) { -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ // include GL stuff, to check that we can compile hybrid 2d/GL apps extern void glBegin(int mode); extern void glBindBuffer(int target, int buffer); diff --git a/tests/sdl_canvas_size.c b/tests/sdl_canvas_size.c index 923a9014..0d184823 100644 --- a/tests/sdl_canvas_size.c +++ b/tests/sdl_canvas_size.c @@ -30,7 +30,7 @@ REDISTRIBUTION OF THIS SOFTWARE. #include <string.h> #include <assert.h> -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); // *new* -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ // Test 1: Check that initializing video mode with size (0,0) will use the size from the <canvas> element. screen = SDL_SetVideoMode( 0, 0, 16, SDL_OPENGL ); // *changed* @@ -177,7 +177,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/sdl_canvas_twice.c b/tests/sdl_canvas_twice.c index 28a7a01c..ba62846b 100644 --- a/tests/sdl_canvas_twice.c +++ b/tests/sdl_canvas_twice.c @@ -1,6 +1,6 @@ #include <SDL/SDL.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif diff --git a/tests/sdl_fog_density.c b/tests/sdl_fog_density.c index cab6a4d2..46d4a8a1 100644 --- a/tests/sdl_fog_density.c +++ b/tests/sdl_fog_density.c @@ -165,7 +165,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(30000); #endif diff --git a/tests/sdl_fog_exp2.c b/tests/sdl_fog_exp2.c index dba0c708..f813cede 100644 --- a/tests/sdl_fog_exp2.c +++ b/tests/sdl_fog_exp2.c @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#if !defined(__EMSCRIPTEN__) // Wait for 3 seconds to give us a chance to see the image SDL_Delay(30000); #endif diff --git a/tests/sdl_fog_linear.c b/tests/sdl_fog_linear.c index f0805650..d7107914 100644 --- a/tests/sdl_fog_linear.c +++ b/tests/sdl_fog_linear.c @@ -167,7 +167,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(30000); #endif diff --git a/tests/sdl_fog_negative.c b/tests/sdl_fog_negative.c index 1ede63a7..f99467bb 100644 --- a/tests/sdl_fog_negative.c +++ b/tests/sdl_fog_negative.c @@ -164,7 +164,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(30000); #endif diff --git a/tests/sdl_fog_simple.c b/tests/sdl_fog_simple.c index 6c052bf5..269b7432 100644 --- a/tests/sdl_fog_simple.c +++ b/tests/sdl_fog_simple.c @@ -167,7 +167,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(30000); #endif diff --git a/tests/sdl_free_screen.cpp b/tests/sdl_free_screen.cpp new file mode 100644 index 00000000..01a849c5 --- /dev/null +++ b/tests/sdl_free_screen.cpp @@ -0,0 +1,29 @@ +#include <stdio.h> +#include <SDL/SDL.h> + + +extern "C" int main(int argc, char** argv) { + + SDL_Init(SDL_INIT_VIDEO); + SDL_Surface *screen = SDL_SetVideoMode(256, 256, 32, SDL_SWSURFACE); + printf("freeing screen...\n"); + SDL_FreeSurface(screen); + printf("recreating...\n"); + screen = SDL_SetVideoMode(256, 256, 32, SDL_SWSURFACE); + printf("seems ok!\n"); + + if (SDL_MUSTLOCK(screen)) SDL_LockSurface(screen); + for (int i = 0; i < 256; i++) { + for (int j = 0; j < 256; j++) { + // alpha component is actually ignored, since this is to the screen + *((Uint32*)screen->pixels + i * 256 + j) = SDL_MapRGBA(screen->format, i, j, 255-i, (i+j) % 255); + } + } + if (SDL_MUSTLOCK(screen)) SDL_UnlockSurface(screen); + SDL_Flip(screen); + + SDL_Quit(); + + return 0; +} + diff --git a/tests/sdl_gfx_primitives.c b/tests/sdl_gfx_primitives.c index db0c6181..dbf9849c 100644 --- a/tests/sdl_gfx_primitives.c +++ b/tests/sdl_gfx_primitives.c @@ -1,7 +1,7 @@ #include "SDL/SDL.h" #include "SDL/SDL_gfxPrimitives.h" -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include "emscripten.h" #endif @@ -31,7 +31,7 @@ int main(int argc, char **argv) { SDL_UpdateRect(screen, 0, 0, 0, 0); -#ifndef EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Event evt; SDL_SaveBMP(screen, "native_output.bmp"); while (1) { diff --git a/tests/sdl_headless.c b/tests/sdl_headless.c index 349c5e26..e1836777 100644 --- a/tests/sdl_headless.c +++ b/tests/sdl_headless.c @@ -6,7 +6,7 @@ int main(int argc, char **argv) { -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ // include GL stuff, to check that we can compile hybrid 2d/GL apps extern void glBegin(int mode); extern void glBindBuffer(int target, int buffer); @@ -57,9 +57,6 @@ int main(int argc, char **argv) { printf("done.\n"); - int result = sum > 3000 && sum < 5000; // varies a little on different browsers, font differences? - REPORT_RESULT(); - return 0; } diff --git a/tests/sdl_ogl.c b/tests/sdl_ogl.c index e7071dcd..78efd7e0 100644 --- a/tests/sdl_ogl.c +++ b/tests/sdl_ogl.c @@ -157,7 +157,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/sdl_ogl_defaultMatrixMode.c b/tests/sdl_ogl_defaultMatrixMode.c index eec2a831..6044f1ab 100644 --- a/tests/sdl_ogl_defaultMatrixMode.c +++ b/tests/sdl_ogl_defaultMatrixMode.c @@ -158,7 +158,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/sdl_ogl_p.c b/tests/sdl_ogl_p.c index 1889d926..2607f35c 100644 --- a/tests/sdl_ogl_p.c +++ b/tests/sdl_ogl_p.c @@ -150,7 +150,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/sdl_ogl_proc_alias.c b/tests/sdl_ogl_proc_alias.c index c96da81b..4c251f83 100644 --- a/tests/sdl_ogl_proc_alias.c +++ b/tests/sdl_ogl_proc_alias.c @@ -166,7 +166,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/sdl_rotozoom.c b/tests/sdl_rotozoom.c index 2c0d35df..cc0ee224 100644 --- a/tests/sdl_rotozoom.c +++ b/tests/sdl_rotozoom.c @@ -2,7 +2,7 @@ #include "SDL/SDL_image.h" #include "SDL/SDL_rotozoom.h" -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include "emscripten.h" #endif @@ -45,7 +45,7 @@ int main(int argc, char **argv) { mainloop(); -#ifndef EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Event evt; SDL_SaveBMP(screen, "native_output.bmp"); while (1) { diff --git a/tests/sdl_swsurface.c b/tests/sdl_swsurface.c index 93141857..c859dbc7 100644 --- a/tests/sdl_swsurface.c +++ b/tests/sdl_swsurface.c @@ -12,7 +12,7 @@ int main(int argc, char** argv) { SDL_Quit(); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ int result = 1; REPORT_RESULT(); #endif diff --git a/tests/sdl_touch.c b/tests/sdl_touch.c new file mode 100644 index 00000000..dc315c58 --- /dev/null +++ b/tests/sdl_touch.c @@ -0,0 +1,81 @@ +#include <stdio.h> +#include <SDL/SDL.h> +#include <SDL/SDL_ttf.h> +#include <assert.h> +#include <emscripten.h> + +int result = 1; + +static char *TouchFingerTypeToString(int type) { + if (type == SDL_FINGERMOTION) return "SDL_FINGERMOTION"; + if (type == SDL_FINGERDOWN) return "SDL_FINGERDOWN"; + if (type == SDL_FINGERUP) return "SDL_FINGERUP"; + return "UNKNOWN"; +} + +int got_down = 0; +int got_move = 0; +int got_up = 0; + +void progress() { + if (!got_down) printf("Hold down a finger to generate a touch down event.\n"); + else if (!got_move) printf("Drag a finger to generate a touch move event.\n"); + else if (!got_up) printf("Release a finger to generate a touch up event.\n"); + else + { + int result = 0; +#ifdef REPORT_RESULT + REPORT_RESULT(); +#endif + } +} + +void loop() { + SDL_Event event; + while (SDL_PollEvent(&event)) { + switch(event.type) { + case SDL_FINGERMOTION: + case SDL_FINGERDOWN: + case SDL_FINGERUP: { + SDL_TouchFingerEvent *t = (SDL_TouchFingerEvent*)&event; + printf("type: %s, timestamp: %u, touchId: %llu, fingerId: %llu, x: %f, y: %f, dx: %f, dy: %f, pressure: %f\n", + TouchFingerTypeToString(event.type), t->timestamp, t->touchId, t->fingerId, t->x, t->y, t->dx, t->dy, t->pressure); + + if (t->timestamp != 0 && t->x >= 0.f && t->x <= 1.f && t->y >= 0.f && t->y <= 1.f && t->pressure >= 0.f && t->pressure <= 1.f) { + if (event.type == SDL_FINGERDOWN) { got_down = 1; progress(); } + if (event.type == SDL_FINGERMOTION) { got_move = 1; progress(); } + if (event.type == SDL_FINGERDOWN) { got_up = 1; progress(); } + } + break; + } + } + } +} + +int main() { + SDL_Init(SDL_INIT_VIDEO); + SDL_Surface *screen = SDL_SetVideoMode(600, 450, 32, SDL_HWSURFACE); + + progress(); + +#ifdef AUTOMATE_SUCCESS + EM_ASM( + function sendEvent(type, data) { + var event = document.createEvent('Event'); + event.initEvent(type, true, true); + for(var d in data) event[d] = data[d]; + Module['canvas'].dispatchEvent(event); + } + // Pass test coordinates in canvas element coordinate frame. + var x = Module['canvas'].getBoundingClientRect().left; + var y = Module['canvas'].getBoundingClientRect().top; + sendEvent('touchstart', { touches: [ { pageX: x+300, pageY: y+225, deviceID: 1, identifier: 1, force: 1 } ] }); + sendEvent('touchmove', { touches: [ { pageX: x+400, pageY: y+225, deviceID: 1, identifier: 1, force: 1 } ] }); + sendEvent('touchend', { changedTouches: [ { pageX: x+400, pageY: y+225, deviceID: 1, identifier: 1, force: 1 } ] }); + ); +#endif + + emscripten_set_main_loop(loop, 0, 0); + + return 0; +} diff --git a/tests/sdl_wm_togglefullscreen.c b/tests/sdl_wm_togglefullscreen.c new file mode 100644 index 00000000..c76ced76 --- /dev/null +++ b/tests/sdl_wm_togglefullscreen.c @@ -0,0 +1,78 @@ +#include <stdio.h> +#include <SDL/SDL.h> +#include <SDL/SDL_ttf.h> +#include <assert.h> +#include <emscripten.h> + +int result = 1; + +SDL_Surface *screen = 0; + +int inFullscreen = 0; + +int wasFullscreen = 0; + +void render() { + int width, height, isfs; + emscripten_get_canvas_size(&width, &height, &isfs); + SDL_Rect rect = { 0, 0, width, height }; + SDL_FillRect(screen, &rect, 0xff00ffff); +} + +void mainloop() { + render(); + SDL_Event event; + int isInFullscreen = EM_ASM_INT_V(return !!(document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement)); + if (isInFullscreen && !wasFullscreen) { + printf("Successfully transitioned to fullscreen mode!\n"); + wasFullscreen = isInFullscreen; + } + + if (wasFullscreen && !isInFullscreen) { + printf("Exited fullscreen. Test succeeded.\n"); + result = 1; +#ifdef REPORT_RESULT + REPORT_RESULT(); +#endif + wasFullscreen = isInFullscreen; + emscripten_cancel_main_loop(); + return; + } + + int haveEvent = SDL_PollEvent(&event); + if (haveEvent) { + switch(event.type) { + case SDL_MOUSEBUTTONDOWN: { + SDL_WM_ToggleFullScreen(screen); + inFullscreen = 1 - inFullscreen; + if (inFullscreen == 0) { + result = wasFullscreen; + if (result) { + printf("Exited fullscreen. Test succeeded.\n"); + } else { + printf("Exited fullscreen. Test failed, fullscreen transition did not happen!\n"); + } +#ifdef REPORT_RESULT + REPORT_RESULT(); +#endif + emscripten_cancel_main_loop(); + return; + } else { + printf("Entering fullscreen...\n"); + } + break; + } + } + } +} + +int main() { + SDL_Init(SDL_INIT_VIDEO); + screen = SDL_SetVideoMode(600, 450, 32, SDL_HWSURFACE); + + printf("You should see a yellow canvas.\n"); + printf("Click on the canvas to enter full screen, and then click on the canvas again to finish the test.\n"); + printf("When in full screen, you should see the whole screen filled yellow, and after exiting, the yellow canvas should be restored in the window.\n"); + emscripten_set_main_loop(mainloop, 0, 0); + return 0; +} diff --git a/tests/sdlglshader.c b/tests/sdlglshader.c index 9cd80097..d629ca94 100644 --- a/tests/sdlglshader.c +++ b/tests/sdlglshader.c @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ SDL_Delay(3000); #endif diff --git a/tests/sockets/p2p/.gitignore b/tests/sockets/p2p/.gitignore new file mode 100644 index 00000000..065a4ac0 --- /dev/null +++ b/tests/sockets/p2p/.gitignore @@ -0,0 +1,2 @@ +node_modules +ssl diff --git a/tests/sockets/p2p/broker/p2p-broker.js b/tests/sockets/p2p/broker/p2p-broker.js new file mode 100644 index 00000000..028eb25b --- /dev/null +++ b/tests/sockets/p2p/broker/p2p-broker.js @@ -0,0 +1,231 @@ +var crypto = require('crypto'); +var fs = require('fs'); +var https = require('https'); + +var SSL_KEY = 'ssl/ssl.key'; +var SSL_CERT = 'ssl/ssl-unified.crt'; +var PORT = 8080; + +var sslSupported = false; +if(fs.existsSync(SSL_KEY) && fs.existsSync(SSL_CERT) && fs.statSync(SSL_KEY).isFile() && fs.statSync(SSL_CERT).isFile()) { + sslSupported = true; +} + +function handler(req, res) { + res.writeHead(200); + res.end("p2p"); +}; + +var app, port; +if(sslSupported) { + var sslopts = { + key: fs.readFileSync(SSL_KEY), + cert: fs.readFileSync(SSL_CERT) + }; + sslopts.agent = new https.Agent(sslopts); + app = require('https').createServer(sslopts, handler); + port = 8081; + console.info('ssl mode enabled'); +} else { + app = require('http').createServer(handler); + port = 8080; + console.info('ssl mode disabled'); +} +console.info('listening on port', port); + +var io = require('socket.io').listen(app, { + 'log level': 2 +}); + +app.listen(port); + +var jsMime = { + type: 'application/javascript', + encoding: 'utf8', + gzip: true +}; + +io.static.add('/p2p-client.js', { + mime: jsMime, + file: 'client/p2p-client.js' +}); + +/* +io.static.add('/p2p-client.min.js', { + mime: jsMime, + file: 'client/p2p-client.min.js' +}); +*/ + +function mkguid() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); + return v.toString(16); + }).toUpperCase(); +}; + +var peers = {}; +var hosts = {}; + +var E = { + OK: 'ok' + , NOROUTE: 'no such route' + , ISNOTHOST: 'peer is not a host' +}; + +function Peer(socket) { + this.socket = socket; + this.host = null; +}; + +function Host(options) { + this.route = options['route']; + this.url = options['url']; + this.listed = (undefined !== options['listed']) ? options['listed'] : false; + this.metadata = options['metadata'] || {}; + this.ctime = Date.now(); + this.mtime = Date.now(); +}; +Host.prototype.update = function update(options) { + this.url = options['url']; + this.listed = (undefined !== options['listed']) ? options['listed'] : false; + this.metadata = options['metadata'] || {}; + this.mtime = Date.now(); +}; + +io.of('/peer').on('connection', function(socket) { + var route = crypto.createHash('md5').update(socket['id']).digest('hex'); + socket.emit('route', route); + + socket.on('disconnect', function() { + if(hosts[route]) { + var host = hosts[route]; + changeList('remove', host); + } + delete hosts[route]; + delete peers[route]; + }); + + socket.on('send', function(message, callback) { + var to = message['to']; + + if(!peers.hasOwnProperty(to)) { + callback({'error': E.NOROUTE}); + return; + } + + var from = route; + var data = message['data']; + peers[to].emit('receive', { + 'from': from, + 'data': data + }); + }); + + socket.on('listen', function(options, callback) { + options['route'] = route; + if(hosts.hasOwnProperty(route)) { + hosts[route].update(options); + changeList('update', hosts[route]); + } else { + hosts[route] = new Host(options); + changeList('append', hosts[route]); + } + + callback(); + }); + + socket.on('ignore', function(message, callback) { + if(!hosts.hasOwnProperty(route)) { + callback({'error': E.ISNOTHOST}); + return; + } + + var host = hosts[route]; + delete hosts[route]; + + changeList('remove', host); + + callback(); + }); + + peers[route] = socket; +}); + +function Filter(socket, options) { + this.options = options || {}; + this.socket = socket; +}; +Filter.prototype.test = function test(host) { + var filter = this.options; + var result; + + if(filter['url'] && typeof host['url'] === 'string') { + try { + result = host['url'].match(filter['url']); + if(!result) + return true; + } catch(e) { + return true; + } + } + + if(filter['metadata'] && host['metadata']) { + var metadataFilter = filter['metadata']; + var metadataHost = host['metadata']; + + if(metadataFilter['name'] && typeof metadataHost['name'] === 'string') { + try { + result = metadataHost['name'].match(metadataFilter['name']); + if(!result) + return true; + } catch(e) { + return true; + } + } + } + + return false; +}; + +var lists = {}; + +function changeList(operation, host) { + var clients = Object.keys(lists); + clients.forEach(function(client) { + var filter = lists[client]; + if(!host['listed']) + return; + if(!filter.test(host)) { + var data = operation === 'remove' ? host['route'] : host; + filter.socket.emit(operation, data); + } + }); +}; + +io.of('/list').on('connection', function(socket) { + var id = socket['id']; + + socket.on('disconnect', function() { + delete lists[id]; + }); + + socket.on('list', function(options) { + var filter = new Filter(socket, options); + + var result = []; + + var hostIds = Object.keys(hosts); + hostIds.forEach(function(hostId) { + var host = hosts[hostId]; + if(!host['listed']) + return; + if(!filter.test(host)) + result.push(host); + }); + + lists[id] = filter; + + socket.emit('truncate', result); + }); +}); diff --git a/tests/sockets/p2p/client/p2p-client.js b/tests/sockets/p2p/client/p2p-client.js new file mode 100644 index 00000000..2c660210 --- /dev/null +++ b/tests/sockets/p2p/client/p2p-client.js @@ -0,0 +1,4485 @@ + +;(function(define, global) { 'use strict'; +define(['module'], function(module) { + + /*! Socket.IO.js build:0.9.11, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed + Modified to work in-line; Removed Flash transport code */ + var io = ('undefined' === typeof module ? {} : module.exports); + (function() { + + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, global) { + + /** + * IO namespace. + * + * @namespace + */ + + var io = exports; + + /** + * Socket.IO version + * + * @api public + */ + + io.version = '0.9.11'; + + /** + * Protocol implemented. + * + * @api public + */ + + io.protocol = 1; + + /** + * Available transports, these will be populated with the available transports + * + * @api public + */ + + io.transports = []; + + /** + * Keep track of jsonp callbacks. + * + * @api private + */ + + io.j = []; + + /** + * Keep track of our io.Sockets + * + * @api private + */ + io.sockets = {}; + + + /** + * Manages connections to hosts. + * + * @param {String} uri + * @Param {Boolean} force creation of new socket (defaults to false) + * @api public + */ + + io.connect = function (host, details) { + var uri = io.util.parseUri(host) + , uuri + , socket; + + if (global && global.location) { + uri.protocol = uri.protocol || global.location.protocol.slice(0, -1); + uri.host = uri.host || (global.document + ? global.document.domain : global.location.hostname); + uri.port = uri.port || global.location.port; + } + + uuri = io.util.uniqueUri(uri); + + var options = { + host: uri.host + , secure: 'https' == uri.protocol + , port: uri.port || ('https' == uri.protocol ? 443 : 80) + , query: uri.query || '' + }; + + io.util.merge(options, details); + + if (options['force new connection'] || !io.sockets[uuri]) { + socket = new io.Socket(options); + } + + if (!options['force new connection'] && socket) { + io.sockets[uuri] = socket; + } + + socket = socket || io.sockets[uuri]; + + // if path is different from '' or / + return socket.of(uri.path.length > 1 ? uri.path : ''); + }; + + })('object' === typeof module ? module.exports : (io = {}), global); + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, global) { + + /** + * Utilities namespace. + * + * @namespace + */ + + var util = exports.util = {}; + + /** + * Parses an URI + * + * @author Steven Levithan <stevenlevithan.com> (MIT license) + * @api public + */ + + var re = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/; + + var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', + 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', + 'anchor']; + + util.parseUri = function (str) { + var m = re.exec(str || '') + , uri = {} + , i = 14; + + while (i--) { + uri[parts[i]] = m[i] || ''; + } + + return uri; + }; + + /** + * Produces a unique url that identifies a Socket.IO connection. + * + * @param {Object} uri + * @api public + */ + + util.uniqueUri = function (uri) { + var protocol = uri.protocol + , host = uri.host + , port = uri.port; + + if ('document' in global) { + host = host || document.domain; + port = port || (protocol == 'https' + && document.location.protocol !== 'https:' ? 443 : document.location.port); + } else { + host = host || 'localhost'; + + if (!port && protocol == 'https') { + port = 443; + } + } + + return (protocol || 'http') + '://' + host + ':' + (port || 80); + }; + + /** + * Mergest 2 query strings in to once unique query string + * + * @param {String} base + * @param {String} addition + * @api public + */ + + util.query = function (base, addition) { + var query = util.chunkQuery(base || '') + , components = []; + + util.merge(query, util.chunkQuery(addition || '')); + for (var part in query) { + if (query.hasOwnProperty(part)) { + components.push(part + '=' + query[part]); + } + } + + return components.length ? '?' + components.join('&') : ''; + }; + + /** + * Transforms a querystring in to an object + * + * @param {String} qs + * @api public + */ + + util.chunkQuery = function (qs) { + var query = {} + , params = qs.split('&') + , i = 0 + , l = params.length + , kv; + + for (; i < l; ++i) { + kv = params[i].split('='); + if (kv[0]) { + query[kv[0]] = kv[1]; + } + } + + return query; + }; + + /** + * Executes the given function when the page is loaded. + * + * io.util.load(function () { console.log('page loaded'); }); + * + * @param {Function} fn + * @api public + */ + + var pageLoaded = false; + + util.load = function (fn) { + if ('document' in global && document.readyState === 'complete' || pageLoaded) { + return fn(); + } + + util.on(global, 'load', fn, false); + }; + + /** + * Adds an event. + * + * @api private + */ + + util.on = function (element, event, fn, capture) { + if (element.attachEvent) { + element.attachEvent('on' + event, fn); + } else if (element.addEventListener) { + element.addEventListener(event, fn, capture); + } + }; + + /** + * Generates the correct `XMLHttpRequest` for regular and cross domain requests. + * + * @param {Boolean} [xdomain] Create a request that can be used cross domain. + * @returns {XMLHttpRequest|false} If we can create a XMLHttpRequest. + * @api private + */ + + util.request = function (xdomain) { + + if (xdomain && 'undefined' != typeof XDomainRequest && !util.ua.hasCORS) { + return new XDomainRequest(); + } + + if ('undefined' != typeof XMLHttpRequest && (!xdomain || util.ua.hasCORS)) { + return new XMLHttpRequest(); + } + + if (!xdomain) { + try { + return new window[(['Active'].concat('Object').join('X'))]('Microsoft.XMLHTTP'); + } catch(e) { } + } + + return null; + }; + + /** + * XHR based transport constructor. + * + * @constructor + * @api public + */ + + /** + * Change the internal pageLoaded value. + */ + + if ('undefined' != typeof window) { + util.load(function () { + pageLoaded = true; + }); + } + + /** + * Defers a function to ensure a spinner is not displayed by the browser + * + * @param {Function} fn + * @api public + */ + + util.defer = function (fn) { + if (!util.ua.webkit || 'undefined' != typeof importScripts) { + return fn(); + } + + util.load(function () { + setTimeout(fn, 100); + }); + }; + + /** + * Merges two objects. + * + * @api public + */ + + util.merge = function merge (target, additional, deep, lastseen) { + var seen = lastseen || [] + , depth = typeof deep == 'undefined' ? 2 : deep + , prop; + + for (prop in additional) { + if (additional.hasOwnProperty(prop) && util.indexOf(seen, prop) < 0) { + if (typeof target[prop] !== 'object' || !depth) { + target[prop] = additional[prop]; + seen.push(additional[prop]); + } else { + util.merge(target[prop], additional[prop], depth - 1, seen); + } + } + } + + return target; + }; + + /** + * Merges prototypes from objects + * + * @api public + */ + + util.mixin = function (ctor, ctor2) { + util.merge(ctor.prototype, ctor2.prototype); + }; + + /** + * Shortcut for prototypical and static inheritance. + * + * @api private + */ + + util.inherit = function (ctor, ctor2) { + function f() {}; + f.prototype = ctor2.prototype; + ctor.prototype = new f; + }; + + /** + * Checks if the given object is an Array. + * + * io.util.isArray([]); // true + * io.util.isArray({}); // false + * + * @param Object obj + * @api public + */ + + util.isArray = Array.isArray || function (obj) { + return Object.prototype.toString.call(obj) === '[object Array]'; + }; + + /** + * Intersects values of two arrays into a third + * + * @api public + */ + + util.intersect = function (arr, arr2) { + var ret = [] + , longest = arr.length > arr2.length ? arr : arr2 + , shortest = arr.length > arr2.length ? arr2 : arr; + + for (var i = 0, l = shortest.length; i < l; i++) { + if (~util.indexOf(longest, shortest[i])) + ret.push(shortest[i]); + } + + return ret; + }; + + /** + * Array indexOf compatibility. + * + * @see bit.ly/a5Dxa2 + * @api public + */ + + util.indexOf = function (arr, o, i) { + + for (var j = arr.length, i = i < 0 ? i + j < 0 ? 0 : i + j : i || 0; + i < j && arr[i] !== o; i++) {} + + return j <= i ? -1 : i; + }; + + /** + * Converts enumerables to array. + * + * @api public + */ + + util.toArray = function (enu) { + var arr = []; + + for (var i = 0, l = enu.length; i < l; i++) + arr.push(enu[i]); + + return arr; + }; + + /** + * UA / engines detection namespace. + * + * @namespace + */ + + util.ua = {}; + + /** + * Whether the UA supports CORS for XHR. + * + * @api public + */ + + util.ua.hasCORS = 'undefined' != typeof XMLHttpRequest && (function () { + try { + var a = new XMLHttpRequest(); + } catch (e) { + return false; + } + + return a.withCredentials != undefined; + })(); + + /** + * Detect webkit. + * + * @api public + */ + + util.ua.webkit = 'undefined' != typeof navigator + && /webkit/i.test(navigator.userAgent); + + /** + * Detect iPad/iPhone/iPod. + * + * @api public + */ + + util.ua.iDevice = 'undefined' != typeof navigator + && /iPad|iPhone|iPod/i.test(navigator.userAgent); + + })('undefined' != typeof io ? io : module.exports, global); + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io) { + + /** + * Expose constructor. + */ + + exports.EventEmitter = EventEmitter; + + /** + * Event emitter constructor. + * + * @api public. + */ + + function EventEmitter () {}; + + /** + * Adds a listener + * + * @api public + */ + + EventEmitter.prototype.on = function (name, fn) { + if (!this.$events) { + this.$events = {}; + } + + if (!this.$events[name]) { + this.$events[name] = fn; + } else if (io.util.isArray(this.$events[name])) { + this.$events[name].push(fn); + } else { + this.$events[name] = [this.$events[name], fn]; + } + + return this; + }; + + EventEmitter.prototype.addListener = EventEmitter.prototype.on; + + /** + * Adds a volatile listener. + * + * @api public + */ + + EventEmitter.prototype.once = function (name, fn) { + var self = this; + + function on () { + self.removeListener(name, on); + fn.apply(this, arguments); + }; + + on.listener = fn; + this.on(name, on); + + return this; + }; + + /** + * Removes a listener. + * + * @api public + */ + + EventEmitter.prototype.removeListener = function (name, fn) { + if (this.$events && this.$events[name]) { + var list = this.$events[name]; + + if (io.util.isArray(list)) { + var pos = -1; + + for (var i = 0, l = list.length; i < l; i++) { + if (list[i] === fn || (list[i].listener && list[i].listener === fn)) { + pos = i; + break; + } + } + + if (pos < 0) { + return this; + } + + list.splice(pos, 1); + + if (!list.length) { + delete this.$events[name]; + } + } else if (list === fn || (list.listener && list.listener === fn)) { + delete this.$events[name]; + } + } + + return this; + }; + + /** + * Removes all listeners for an event. + * + * @api public + */ + + EventEmitter.prototype.removeAllListeners = function (name) { + if (name === undefined) { + this.$events = {}; + return this; + } + + if (this.$events && this.$events[name]) { + this.$events[name] = null; + } + + return this; + }; + + /** + * Gets all listeners for a certain event. + * + * @api publci + */ + + EventEmitter.prototype.listeners = function (name) { + if (!this.$events) { + this.$events = {}; + } + + if (!this.$events[name]) { + this.$events[name] = []; + } + + if (!io.util.isArray(this.$events[name])) { + this.$events[name] = [this.$events[name]]; + } + + return this.$events[name]; + }; + + /** + * Emits an event. + * + * @api public + */ + + EventEmitter.prototype.emit = function (name) { + if (!this.$events) { + return false; + } + + var handler = this.$events[name]; + + if (!handler) { + return false; + } + + var args = Array.prototype.slice.call(arguments, 1); + + if ('function' == typeof handler) { + handler.apply(this, args); + } else if (io.util.isArray(handler)) { + var listeners = handler.slice(); + + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i].apply(this, args); + } + } else { + return false; + } + + return true; + }; + + })( + 'undefined' != typeof io ? io : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + ); + + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + /** + * Based on JSON2 (http://www.JSON.org/js.html). + */ + + (function (exports, nativeJSON) { + "use strict"; + + // use native JSON if it's available + if (nativeJSON && nativeJSON.parse){ + return exports.JSON = { + parse: nativeJSON.parse + , stringify: nativeJSON.stringify + }; + } + + var JSON = exports.JSON = {}; + + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + function date(d, key) { + return isFinite(d.valueOf()) ? + d.getUTCFullYear() + '-' + + f(d.getUTCMonth() + 1) + '-' + + f(d.getUTCDate()) + 'T' + + f(d.getUTCHours()) + ':' + + f(d.getUTCMinutes()) + ':' + + f(d.getUTCSeconds()) + 'Z' : null; + }; + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + + function quote(string) { + + // If the string contains no control characters, no quote characters, and no + // backslash characters, then we can safely slap some quotes around it. + // Otherwise we must also replace the offending characters with safe escape + // sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' ? c : + '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } + + + function str(key, holder) { + + // Produce a string from holder[key]. + + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + + // If the value has a toJSON method, call it to obtain a replacement value. + + if (value instanceof Date) { + value = date(key); + } + + // If we were called with a replacer function, then call the replacer to + // obtain a replacement value. + + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + + // What happens next depends on the value's type. + + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + + // JSON numbers must be finite. Encode non-finite numbers as null. + + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + + // If the value is a boolean or null, convert it to a string. Note: + // typeof null does not produce 'null'. The case is included here in + // the remote chance that this gets fixed someday. + + return String(value); + + // If the type is 'object', we might be dealing with an object or an array or + // null. + + case 'object': + + // Due to a specification blunder in ECMAScript, typeof null is 'object', + // so watch out for that case. + + if (!value) { + return 'null'; + } + + // Make an array to hold the partial results of stringifying this object value. + + gap += indent; + partial = []; + + // Is the value an array? + + if (Object.prototype.toString.apply(value) === '[object Array]') { + + // The value is an array. Stringify every element. Use null as a placeholder + // for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + + // Join all of the elements together, separated with commas, and wrap them in + // brackets. + + v = partial.length === 0 ? '[]' : gap ? + '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : + '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + + // If the replacer is an array, use it to select the members to be stringified. + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + if (typeof rep[i] === 'string') { + k = rep[i]; + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + + // Otherwise, iterate through all of the keys in the object. + + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + + // Join all of the member texts together, separated with commas, + // and wrap them in braces. + + v = partial.length === 0 ? '{}' : gap ? + '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : + '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + + // If the JSON object does not yet have a stringify method, give it one. + + JSON.stringify = function (value, replacer, space) { + + // The stringify method takes a value and an optional replacer, and an optional + // space parameter, and returns a JSON text. The replacer can be a function + // that can replace values, or an array of strings that will select the keys. + // A default replacer method can be provided. Use of the space parameter can + // produce text that is more easily readable. + + var i; + gap = ''; + indent = ''; + + // If the space parameter is a number, make an indent string containing that + // many spaces. + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + + // If the space parameter is a string, it will be used as the indent string. + + } else if (typeof space === 'string') { + indent = space; + } + + // If there is a replacer, it must be a function or an array. + // Otherwise, throw an error. + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + + // Make a fake root object containing our value under the key of ''. + // Return the result of stringifying the value. + + return str('', {'': value}); + }; + + // If the JSON object does not yet have a parse method, give it one. + + JSON.parse = function (text, reviver) { + // The parse method takes a text and an optional reviver function, and returns + // a JavaScript value if the text is a valid JSON text. + + var j; + + function walk(holder, key) { + + // The walk method is used to recursively walk the resulting structure so + // that modifications can be made. + + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + + // Parsing happens in four stages. In the first stage, we replace certain + // Unicode characters with escape sequences. JavaScript handles many characters + // incorrectly, either silently deleting them, or treating them as line endings. + + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + + // In the second stage, we run the text against regular expressions that look + // for non-JSON patterns. We are especially concerned with '()' and 'new' + // because they can cause invocation, and '=' because it can cause mutation. + // But just to be safe, we want to reject all unexpected forms. + + // We split the second stage into 4 regexp operations in order to work around + // crippling inefficiencies in IE's and Safari's regexp engines. First we + // replace the JSON backslash pairs with '@' (a non-JSON character). Second, we + // replace all simple value tokens with ']' characters. Third, we delete all + // open brackets that follow a colon or comma or that begin the text. Finally, + // we look to see that the remaining characters are only whitespace or ']' or + // ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/ + .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + + // In the third stage we use the eval function to compile the text into a + // JavaScript structure. The '{' operator is subject to a syntactic ambiguity + // in JavaScript: it can begin a block or an object literal. We wrap the text + // in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + + // In the optional fourth stage, we recursively walk the new structure, passing + // each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' ? + walk({'': j}, '') : j; + } + + // If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + }; + + })( + 'undefined' != typeof io ? io : module.exports + , typeof JSON !== 'undefined' ? JSON : undefined + ); + + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io) { + + /** + * Parser namespace. + * + * @namespace + */ + + var parser = exports.parser = {}; + + /** + * Packet types. + */ + + var packets = parser.packets = [ + 'disconnect' + , 'connect' + , 'heartbeat' + , 'message' + , 'json' + , 'event' + , 'ack' + , 'error' + , 'noop' + ]; + + /** + * Errors reasons. + */ + + var reasons = parser.reasons = [ + 'transport not supported' + , 'client not handshaken' + , 'unauthorized' + ]; + + /** + * Errors advice. + */ + + var advice = parser.advice = [ + 'reconnect' + ]; + + /** + * Shortcuts. + */ + + var JSON = io.JSON + , indexOf = io.util.indexOf; + + /** + * Encodes a packet. + * + * @api private + */ + + parser.encodePacket = function (packet) { + var type = indexOf(packets, packet.type) + , id = packet.id || '' + , endpoint = packet.endpoint || '' + , ack = packet.ack + , data = null; + + switch (packet.type) { + case 'error': + var reason = packet.reason ? indexOf(reasons, packet.reason) : '' + , adv = packet.advice ? indexOf(advice, packet.advice) : ''; + + if (reason !== '' || adv !== '') + data = reason + (adv !== '' ? ('+' + adv) : ''); + + break; + + case 'message': + if (packet.data !== '') + data = packet.data; + break; + + case 'event': + var ev = { name: packet.name }; + + if (packet.args && packet.args.length) { + ev.args = packet.args; + } + + data = JSON.stringify(ev); + break; + + case 'json': + data = JSON.stringify(packet.data); + break; + + case 'connect': + if (packet.qs) + data = packet.qs; + break; + + case 'ack': + data = packet.ackId + + (packet.args && packet.args.length + ? '+' + JSON.stringify(packet.args) : ''); + break; + } + + // construct packet with required fragments + var encoded = [ + type + , id + (ack == 'data' ? '+' : '') + , endpoint + ]; + + // data fragment is optional + if (data !== null && data !== undefined) + encoded.push(data); + + return encoded.join(':'); + }; + + /** + * Encodes multiple messages (payload). + * + * @param {Array} messages + * @api private + */ + + parser.encodePayload = function (packets) { + var decoded = ''; + + if (packets.length == 1) + return packets[0]; + + for (var i = 0, l = packets.length; i < l; i++) { + var packet = packets[i]; + decoded += '\ufffd' + packet.length + '\ufffd' + packets[i]; + } + + return decoded; + }; + + /** + * Decodes a packet + * + * @api private + */ + + var regexp = /([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/; + + parser.decodePacket = function (data) { + var pieces = data.match(regexp); + + if (!pieces) return {}; + + var id = pieces[2] || '' + , data = pieces[5] || '' + , packet = { + type: packets[pieces[1]] + , endpoint: pieces[4] || '' + }; + + // whether we need to acknowledge the packet + if (id) { + packet.id = id; + if (pieces[3]) + packet.ack = 'data'; + else + packet.ack = true; + } + + // handle different packet types + switch (packet.type) { + case 'error': + var pieces = data.split('+'); + packet.reason = reasons[pieces[0]] || ''; + packet.advice = advice[pieces[1]] || ''; + break; + + case 'message': + packet.data = data || ''; + break; + + case 'event': + try { + var opts = JSON.parse(data); + packet.name = opts.name; + packet.args = opts.args; + } catch (e) { } + + packet.args = packet.args || []; + break; + + case 'json': + try { + packet.data = JSON.parse(data); + } catch (e) { } + break; + + case 'connect': + packet.qs = data || ''; + break; + + case 'ack': + var pieces = data.match(/^([0-9]+)(\+)?(.*)/); + if (pieces) { + packet.ackId = pieces[1]; + packet.args = []; + + if (pieces[3]) { + try { + packet.args = pieces[3] ? JSON.parse(pieces[3]) : []; + } catch (e) { } + } + } + break; + + case 'disconnect': + case 'heartbeat': + break; + }; + + return packet; + }; + + /** + * Decodes data payload. Detects multiple messages + * + * @return {Array} messages + * @api public + */ + + parser.decodePayload = function (data) { + // IE doesn't like data[i] for unicode chars, charAt works fine + if (data.charAt(0) == '\ufffd') { + var ret = []; + + for (var i = 1, length = ''; i < data.length; i++) { + if (data.charAt(i) == '\ufffd') { + ret.push(parser.decodePacket(data.substr(i + 1).substr(0, length))); + i += Number(length) + 1; + length = ''; + } else { + length += data.charAt(i); + } + } + + return ret; + } else { + return [parser.decodePacket(data)]; + } + }; + + })( + 'undefined' != typeof io ? io : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + ); + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io) { + + /** + * Expose constructor. + */ + + exports.Transport = Transport; + + /** + * This is the transport template for all supported transport methods. + * + * @constructor + * @api public + */ + + function Transport (socket, sessid) { + this.socket = socket; + this.sessid = sessid; + }; + + /** + * Apply EventEmitter mixin. + */ + + io.util.mixin(Transport, io.EventEmitter); + + + /** + * Indicates whether heartbeats is enabled for this transport + * + * @api private + */ + + Transport.prototype.heartbeats = function () { + return true; + }; + + /** + * Handles the response from the server. When a new response is received + * it will automatically update the timeout, decode the message and + * forwards the response to the onMessage function for further processing. + * + * @param {String} data Response from the server. + * @api private + */ + + Transport.prototype.onData = function (data) { + this.clearCloseTimeout(); + + // If the connection in currently open (or in a reopening state) reset the close + // timeout since we have just received data. This check is necessary so + // that we don't reset the timeout on an explicitly disconnected connection. + if (this.socket.connected || this.socket.connecting || this.socket.reconnecting) { + this.setCloseTimeout(); + } + + if (data !== '') { + // todo: we should only do decodePayload for xhr transports + var msgs = io.parser.decodePayload(data); + + if (msgs && msgs.length) { + for (var i = 0, l = msgs.length; i < l; i++) { + this.onPacket(msgs[i]); + } + } + } + + return this; + }; + + /** + * Handles packets. + * + * @api private + */ + + Transport.prototype.onPacket = function (packet) { + this.socket.setHeartbeatTimeout(); + + if (packet.type == 'heartbeat') { + return this.onHeartbeat(); + } + + if (packet.type == 'connect' && packet.endpoint == '') { + this.onConnect(); + } + + if (packet.type == 'error' && packet.advice == 'reconnect') { + this.isOpen = false; + } + + this.socket.onPacket(packet); + + return this; + }; + + /** + * Sets close timeout + * + * @api private + */ + + Transport.prototype.setCloseTimeout = function () { + if (!this.closeTimeout) { + var self = this; + + this.closeTimeout = setTimeout(function () { + self.onDisconnect(); + }, this.socket.closeTimeout); + } + }; + + /** + * Called when transport disconnects. + * + * @api private + */ + + Transport.prototype.onDisconnect = function () { + if (this.isOpen) this.close(); + this.clearTimeouts(); + this.socket.onDisconnect(); + return this; + }; + + /** + * Called when transport connects + * + * @api private + */ + + Transport.prototype.onConnect = function () { + this.socket.onConnect(); + return this; + }; + + /** + * Clears close timeout + * + * @api private + */ + + Transport.prototype.clearCloseTimeout = function () { + if (this.closeTimeout) { + clearTimeout(this.closeTimeout); + this.closeTimeout = null; + } + }; + + /** + * Clear timeouts + * + * @api private + */ + + Transport.prototype.clearTimeouts = function () { + this.clearCloseTimeout(); + + if (this.reopenTimeout) { + clearTimeout(this.reopenTimeout); + } + }; + + /** + * Sends a packet + * + * @param {Object} packet object. + * @api private + */ + + Transport.prototype.packet = function (packet) { + this.send(io.parser.encodePacket(packet)); + }; + + /** + * Send the received heartbeat message back to server. So the server + * knows we are still connected. + * + * @param {String} heartbeat Heartbeat response from the server. + * @api private + */ + + Transport.prototype.onHeartbeat = function (heartbeat) { + this.packet({ type: 'heartbeat' }); + }; + + /** + * Called when the transport opens. + * + * @api private + */ + + Transport.prototype.onOpen = function () { + this.isOpen = true; + this.clearCloseTimeout(); + this.socket.onOpen(); + }; + + /** + * Notifies the base when the connection with the Socket.IO server + * has been disconnected. + * + * @api private + */ + + Transport.prototype.onClose = function () { + var self = this; + + /* FIXME: reopen delay causing a infinit loop + this.reopenTimeout = setTimeout(function () { + self.open(); + }, this.socket.options['reopen delay']);*/ + + this.isOpen = false; + this.socket.onClose(); + this.onDisconnect(); + }; + + /** + * Generates a connection url based on the Socket.IO URL Protocol. + * See <https://github.com/learnboost/socket.io-node/> for more details. + * + * @returns {String} Connection url + * @api private + */ + + Transport.prototype.prepareUrl = function () { + var options = this.socket.options; + + return this.scheme() + '://' + + options.host + ':' + options.port + '/' + + options.resource + '/' + io.protocol + + '/' + this.name + '/' + this.sessid; + }; + + /** + * Checks if the transport is ready to start a connection. + * + * @param {Socket} socket The socket instance that needs a transport + * @param {Function} fn The callback + * @api private + */ + + Transport.prototype.ready = function (socket, fn) { + fn.call(this); + }; + })( + 'undefined' != typeof io ? io : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + ); + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io, global) { + + /** + * Expose constructor. + */ + + exports.Socket = Socket; + + /** + * Create a new `Socket.IO client` which can establish a persistent + * connection with a Socket.IO enabled server. + * + * @api public + */ + + function Socket (options) { + this.options = { + port: 80 + , secure: false + , document: 'document' in global ? document : false + , resource: 'socket.io' + , transports: io.transports + , 'connect timeout': 10000 + , 'try multiple transports': true + , 'reconnect': true + , 'reconnection delay': 500 + , 'reconnection limit': Infinity + , 'reopen delay': 3000 + , 'max reconnection attempts': 10 + , 'sync disconnect on unload': false + , 'auto connect': true + , 'flash policy port': 10843 + , 'manualFlush': false + }; + + io.util.merge(this.options, options); + + this.connected = false; + this.open = false; + this.connecting = false; + this.reconnecting = false; + this.namespaces = {}; + this.buffer = []; + this.doBuffer = false; + + if (this.options['sync disconnect on unload'] && + (!this.isXDomain() || io.util.ua.hasCORS)) { + var self = this; + io.util.on(global, 'beforeunload', function () { + self.disconnectSync(); + }, false); + } + + if (this.options['auto connect']) { + this.connect(); + } + }; + + /** + * Apply EventEmitter mixin. + */ + + io.util.mixin(Socket, io.EventEmitter); + + /** + * Returns a namespace listener/emitter for this socket + * + * @api public + */ + + Socket.prototype.of = function (name) { + if (!this.namespaces[name]) { + this.namespaces[name] = new io.SocketNamespace(this, name); + + if (name !== '') { + this.namespaces[name].packet({ type: 'connect' }); + } + } + + return this.namespaces[name]; + }; + + /** + * Emits the given event to the Socket and all namespaces + * + * @api private + */ + + Socket.prototype.publish = function () { + this.emit.apply(this, arguments); + + var nsp; + + for (var i in this.namespaces) { + if (this.namespaces.hasOwnProperty(i)) { + nsp = this.of(i); + nsp.$emit.apply(nsp, arguments); + } + } + }; + + /** + * Performs the handshake + * + * @api private + */ + + function empty () { }; + + Socket.prototype.handshake = function (fn) { + var self = this + , options = this.options; + + function complete (data) { + if (data instanceof Error) { + self.connecting = false; + self.onError(data.message); + } else { + fn.apply(null, data.split(':')); + } + }; + + var url = [ + 'http' + (options.secure ? 's' : '') + ':/' + , options.host + ':' + options.port + , options.resource + , io.protocol + , io.util.query(this.options.query, 't=' + +new Date) + ].join('/'); + + if (this.isXDomain() && !io.util.ua.hasCORS) { + var insertAt = document.getElementsByTagName('script')[0] + , script = document.createElement('script'); + + script.src = url + '&jsonp=' + io.j.length; + insertAt.parentNode.insertBefore(script, insertAt); + + io.j.push(function (data) { + complete(data); + script.parentNode.removeChild(script); + }); + } else { + var xhr = io.util.request(); + + xhr.open('GET', url, true); + if (this.isXDomain()) { + xhr.withCredentials = true; + } + xhr.onreadystatechange = function () { + if (xhr.readyState == 4) { + xhr.onreadystatechange = empty; + + if (xhr.status == 200) { + complete(xhr.responseText); + } else if (xhr.status == 403) { + self.onError(xhr.responseText); + } else { + self.connecting = false; + !self.reconnecting && self.onError(xhr.responseText); + } + } + }; + xhr.send(null); + } + }; + + /** + * Find an available transport based on the options supplied in the constructor. + * + * @api private + */ + + Socket.prototype.getTransport = function (override) { + var transports = override || this.transports, match; + + for (var i = 0, transport; transport = transports[i]; i++) { + if (io.Transport[transport] + && io.Transport[transport].check(this) + && (!this.isXDomain() || io.Transport[transport].xdomainCheck(this))) { + return new io.Transport[transport](this, this.sessionid); + } + } + + return null; + }; + + /** + * Connects to the server. + * + * @param {Function} [fn] Callback. + * @returns {io.Socket} + * @api public + */ + + Socket.prototype.connect = function (fn) { + if (this.connecting) { + return this; + } + + var self = this; + self.connecting = true; + + this.handshake(function (sid, heartbeat, close, transports) { + self.sessionid = sid; + self.closeTimeout = close * 1000; + self.heartbeatTimeout = heartbeat * 1000; + if(!self.transports) + self.transports = self.origTransports = (transports ? io.util.intersect( + transports.split(',') + , self.options.transports + ) : self.options.transports); + + self.setHeartbeatTimeout(); + + function connect (transports){ + if (self.transport) self.transport.clearTimeouts(); + + self.transport = self.getTransport(transports); + if (!self.transport) return self.publish('connect_failed'); + + // once the transport is ready + self.transport.ready(self, function () { + self.connecting = true; + self.publish('connecting', self.transport.name); + self.transport.open(); + + if (self.options['connect timeout']) { + self.connectTimeoutTimer = setTimeout(function () { + if (!self.connected) { + self.connecting = false; + + if (self.options['try multiple transports']) { + var remaining = self.transports; + + while (remaining.length > 0 && remaining.splice(0,1)[0] != + self.transport.name) {} + + if (remaining.length){ + connect(remaining); + } else { + self.publish('connect_failed'); + } + } + } + }, self.options['connect timeout']); + } + }); + } + + connect(self.transports); + + self.once('connect', function (){ + clearTimeout(self.connectTimeoutTimer); + + fn && typeof fn == 'function' && fn(); + }); + }); + + return this; + }; + + /** + * Clears and sets a new heartbeat timeout using the value given by the + * server during the handshake. + * + * @api private + */ + + Socket.prototype.setHeartbeatTimeout = function () { + clearTimeout(this.heartbeatTimeoutTimer); + if(this.transport && !this.transport.heartbeats()) return; + + var self = this; + this.heartbeatTimeoutTimer = setTimeout(function () { + self.transport.onClose(); + }, this.heartbeatTimeout); + }; + + /** + * Sends a message. + * + * @param {Object} data packet. + * @returns {io.Socket} + * @api public + */ + + Socket.prototype.packet = function (data) { + if (this.connected && !this.doBuffer) { + this.transport.packet(data); + } else { + this.buffer.push(data); + } + + return this; + }; + + /** + * Sets buffer state + * + * @api private + */ + + Socket.prototype.setBuffer = function (v) { + this.doBuffer = v; + + if (!v && this.connected && this.buffer.length) { + if (!this.options['manualFlush']) { + this.flushBuffer(); + } + } + }; + + /** + * Flushes the buffer data over the wire. + * To be invoked manually when 'manualFlush' is set to true. + * + * @api public + */ + + Socket.prototype.flushBuffer = function() { + this.transport.payload(this.buffer); + this.buffer = []; + }; + + + /** + * Disconnect the established connect. + * + * @returns {io.Socket} + * @api public + */ + + Socket.prototype.disconnect = function () { + if (this.connected || this.connecting) { + if (this.open) { + this.of('').packet({ type: 'disconnect' }); + } + + // handle disconnection immediately + this.onDisconnect('booted'); + } + + return this; + }; + + /** + * Disconnects the socket with a sync XHR. + * + * @api private + */ + + Socket.prototype.disconnectSync = function () { + // ensure disconnection + var xhr = io.util.request(); + var uri = [ + 'http' + (this.options.secure ? 's' : '') + ':/' + , this.options.host + ':' + this.options.port + , this.options.resource + , io.protocol + , '' + , this.sessionid + ].join('/') + '/?disconnect=1'; + + xhr.open('GET', uri, false); + xhr.send(null); + + // handle disconnection immediately + this.onDisconnect('booted'); + }; + + /** + * Check if we need to use cross domain enabled transports. Cross domain would + * be a different port or different domain name. + * + * @returns {Boolean} + * @api private + */ + + Socket.prototype.isXDomain = function () { + + var port = global.location.port || + ('https:' == global.location.protocol ? 443 : 80); + + return this.options.host !== global.location.hostname + || this.options.port != port; + }; + + /** + * Called upon handshake. + * + * @api private + */ + + Socket.prototype.onConnect = function () { + if (!this.connected) { + this.connected = true; + this.connecting = false; + if (!this.doBuffer) { + // make sure to flush the buffer + this.setBuffer(false); + } + this.emit('connect'); + } + }; + + /** + * Called when the transport opens + * + * @api private + */ + + Socket.prototype.onOpen = function () { + this.open = true; + }; + + /** + * Called when the transport closes. + * + * @api private + */ + + Socket.prototype.onClose = function () { + this.open = false; + clearTimeout(this.heartbeatTimeoutTimer); + }; + + /** + * Called when the transport first opens a connection + * + * @param text + */ + + Socket.prototype.onPacket = function (packet) { + this.of(packet.endpoint).onPacket(packet); + }; + + /** + * Handles an error. + * + * @api private + */ + + Socket.prototype.onError = function (err) { + if (err && err.advice) { + if (err.advice === 'reconnect' && (this.connected || this.connecting)) { + this.disconnect(); + if (this.options.reconnect) { + this.reconnect(); + } + } + } + + this.publish('error', err && err.reason ? err.reason : err); + }; + + /** + * Called when the transport disconnects. + * + * @api private + */ + + Socket.prototype.onDisconnect = function (reason) { + var wasConnected = this.connected + , wasConnecting = this.connecting; + + this.connected = false; + this.connecting = false; + this.open = false; + + if (wasConnected || wasConnecting) { + this.transport.close(); + this.transport.clearTimeouts(); + if (wasConnected) { + this.publish('disconnect', reason); + + if ('booted' != reason && this.options.reconnect && !this.reconnecting) { + this.reconnect(); + } + } + } + }; + + /** + * Called upon reconnection. + * + * @api private + */ + + Socket.prototype.reconnect = function () { + this.reconnecting = true; + this.reconnectionAttempts = 0; + this.reconnectionDelay = this.options['reconnection delay']; + + var self = this + , maxAttempts = this.options['max reconnection attempts'] + , tryMultiple = this.options['try multiple transports'] + , limit = this.options['reconnection limit']; + + function reset () { + if (self.connected) { + for (var i in self.namespaces) { + if (self.namespaces.hasOwnProperty(i) && '' !== i) { + self.namespaces[i].packet({ type: 'connect' }); + } + } + self.publish('reconnect', self.transport.name, self.reconnectionAttempts); + } + + clearTimeout(self.reconnectionTimer); + + self.removeListener('connect_failed', maybeReconnect); + self.removeListener('connect', maybeReconnect); + + self.reconnecting = false; + + delete self.reconnectionAttempts; + delete self.reconnectionDelay; + delete self.reconnectionTimer; + delete self.redoTransports; + + self.options['try multiple transports'] = tryMultiple; + }; + + function maybeReconnect () { + if (!self.reconnecting) { + return; + } + + if (self.connected) { + return reset(); + }; + + if (self.connecting && self.reconnecting) { + return self.reconnectionTimer = setTimeout(maybeReconnect, 1000); + } + + if (self.reconnectionAttempts++ >= maxAttempts) { + if (!self.redoTransports) { + self.on('connect_failed', maybeReconnect); + self.options['try multiple transports'] = true; + self.transports = self.origTransports; + self.transport = self.getTransport(); + self.redoTransports = true; + self.connect(); + } else { + self.publish('reconnect_failed'); + reset(); + } + } else { + if (self.reconnectionDelay < limit) { + self.reconnectionDelay *= 2; // exponential back off + } + + self.connect(); + self.publish('reconnecting', self.reconnectionDelay, self.reconnectionAttempts); + self.reconnectionTimer = setTimeout(maybeReconnect, self.reconnectionDelay); + } + }; + + this.options['try multiple transports'] = false; + this.reconnectionTimer = setTimeout(maybeReconnect, this.reconnectionDelay); + + this.on('connect', maybeReconnect); + }; + + })( + 'undefined' != typeof io ? io : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + , global + ); + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io) { + + /** + * Expose constructor. + */ + + exports.SocketNamespace = SocketNamespace; + + /** + * Socket namespace constructor. + * + * @constructor + * @api public + */ + + function SocketNamespace (socket, name) { + this.socket = socket; + this.name = name || ''; + this.flags = {}; + this.json = new Flag(this, 'json'); + this.ackPackets = 0; + this.acks = {}; + }; + + /** + * Apply EventEmitter mixin. + */ + + io.util.mixin(SocketNamespace, io.EventEmitter); + + /** + * Copies emit since we override it + * + * @api private + */ + + SocketNamespace.prototype.$emit = io.EventEmitter.prototype.emit; + + /** + * Creates a new namespace, by proxying the request to the socket. This + * allows us to use the synax as we do on the server. + * + * @api public + */ + + SocketNamespace.prototype.of = function () { + return this.socket.of.apply(this.socket, arguments); + }; + + /** + * Sends a packet. + * + * @api private + */ + + SocketNamespace.prototype.packet = function (packet) { + packet.endpoint = this.name; + this.socket.packet(packet); + this.flags = {}; + return this; + }; + + /** + * Sends a message + * + * @api public + */ + + SocketNamespace.prototype.send = function (data, fn) { + var packet = { + type: this.flags.json ? 'json' : 'message' + , data: data + }; + + if ('function' == typeof fn) { + packet.id = ++this.ackPackets; + packet.ack = true; + this.acks[packet.id] = fn; + } + + return this.packet(packet); + }; + + /** + * Emits an event + * + * @api public + */ + + SocketNamespace.prototype.emit = function (name) { + var args = Array.prototype.slice.call(arguments, 1) + , lastArg = args[args.length - 1] + , packet = { + type: 'event' + , name: name + }; + + if ('function' == typeof lastArg) { + packet.id = ++this.ackPackets; + packet.ack = 'data'; + this.acks[packet.id] = lastArg; + args = args.slice(0, args.length - 1); + } + + packet.args = args; + + return this.packet(packet); + }; + + /** + * Disconnects the namespace + * + * @api private + */ + + SocketNamespace.prototype.disconnect = function () { + if (this.name === '') { + this.socket.disconnect(); + } else { + this.packet({ type: 'disconnect' }); + this.$emit('disconnect'); + } + + return this; + }; + + /** + * Handles a packet + * + * @api private + */ + + SocketNamespace.prototype.onPacket = function (packet) { + var self = this; + + function ack () { + self.packet({ + type: 'ack' + , args: io.util.toArray(arguments) + , ackId: packet.id + }); + }; + + switch (packet.type) { + case 'connect': + this.$emit('connect'); + break; + + case 'disconnect': + if (this.name === '') { + this.socket.onDisconnect(packet.reason || 'booted'); + } else { + this.$emit('disconnect', packet.reason); + } + break; + + case 'message': + case 'json': + var params = ['message', packet.data]; + + if (packet.ack == 'data') { + params.push(ack); + } else if (packet.ack) { + this.packet({ type: 'ack', ackId: packet.id }); + } + + this.$emit.apply(this, params); + break; + + case 'event': + var params = [packet.name].concat(packet.args); + + if (packet.ack == 'data') + params.push(ack); + + this.$emit.apply(this, params); + break; + + case 'ack': + if (this.acks[packet.ackId]) { + this.acks[packet.ackId].apply(this, packet.args); + delete this.acks[packet.ackId]; + } + break; + + case 'error': + if (packet.advice){ + this.socket.onError(packet); + } else { + if (packet.reason == 'unauthorized') { + this.$emit('connect_failed', packet.reason); + } else { + this.$emit('error', packet.reason); + } + } + break; + } + }; + + /** + * Flag interface. + * + * @api private + */ + + function Flag (nsp, name) { + this.namespace = nsp; + this.name = name; + }; + + /** + * Send a message + * + * @api public + */ + + Flag.prototype.send = function () { + this.namespace.flags[this.name] = true; + this.namespace.send.apply(this.namespace, arguments); + }; + + /** + * Emit an event + * + * @api public + */ + + Flag.prototype.emit = function () { + this.namespace.flags[this.name] = true; + this.namespace.emit.apply(this.namespace, arguments); + }; + + })( + 'undefined' != typeof io ? io : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + ); + + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io, global) { + + /** + * Expose constructor. + */ + + exports.websocket = WS; + + /** + * The WebSocket transport uses the HTML5 WebSocket API to establish an + * persistent connection with the Socket.IO server. This transport will also + * be inherited by the FlashSocket fallback as it provides a API compatible + * polyfill for the WebSockets. + * + * @constructor + * @extends {io.Transport} + * @api public + */ + + function WS (socket) { + io.Transport.apply(this, arguments); + }; + + /** + * Inherits from Transport. + */ + + io.util.inherit(WS, io.Transport); + + /** + * Transport name + * + * @api public + */ + + WS.prototype.name = 'websocket'; + + /** + * Initializes a new `WebSocket` connection with the Socket.IO server. We attach + * all the appropriate listeners to handle the responses from the server. + * + * @returns {Transport} + * @api public + */ + + WS.prototype.open = function () { + var query = io.util.query(this.socket.options.query) + , self = this + , Socket + + + if (!Socket) { + Socket = global.MozWebSocket || global.WebSocket; + } + + this.websocket = new Socket(this.prepareUrl() + query); + + this.websocket.onopen = function () { + self.onOpen(); + self.socket.setBuffer(false); + }; + this.websocket.onmessage = function (ev) { + self.onData(ev.data); + }; + this.websocket.onclose = function () { + self.onClose(); + self.socket.setBuffer(true); + }; + this.websocket.onerror = function (e) { + self.onError(e); + }; + + return this; + }; + + /** + * Send a message to the Socket.IO server. The message will automatically be + * encoded in the correct message format. + * + * @returns {Transport} + * @api public + */ + + // Do to a bug in the current IDevices browser, we need to wrap the send in a + // setTimeout, when they resume from sleeping the browser will crash if + // we don't allow the browser time to detect the socket has been closed + if (io.util.ua.iDevice) { + WS.prototype.send = function (data) { + var self = this; + setTimeout(function() { + self.websocket.send(data); + },0); + return this; + }; + } else { + WS.prototype.send = function (data) { + this.websocket.send(data); + return this; + }; + } + + /** + * Payload + * + * @api private + */ + + WS.prototype.payload = function (arr) { + for (var i = 0, l = arr.length; i < l; i++) { + this.packet(arr[i]); + } + return this; + }; + + /** + * Disconnect the established `WebSocket` connection. + * + * @returns {Transport} + * @api public + */ + + WS.prototype.close = function () { + this.websocket.close(); + return this; + }; + + /** + * Handle the errors that `WebSocket` might be giving when we + * are attempting to connect or send messages. + * + * @param {Error} e The error. + * @api private + */ + + WS.prototype.onError = function (e) { + this.socket.onError(e); + }; + + /** + * Returns the appropriate scheme for the URI generation. + * + * @api private + */ + WS.prototype.scheme = function () { + return this.socket.options.secure ? 'wss' : 'ws'; + }; + + /** + * Checks if the browser has support for native `WebSockets` and that + * it's not the polyfill created for the FlashSocket transport. + * + * @return {Boolean} + * @api public + */ + + WS.check = function () { + return ('WebSocket' in global && !('__addTask' in WebSocket)) + || 'MozWebSocket' in global; + }; + + /** + * Check if the `WebSocket` transport support cross domain communications. + * + * @returns {Boolean} + * @api public + */ + + WS.xdomainCheck = function () { + return true; + }; + + /** + * Add the transport to your public io.transports array. + * + * @api private + */ + + io.transports.push('websocket'); + + })( + 'undefined' != typeof io ? io.Transport : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + , global + ); + + // Copyright: Hiroshi Ichikawa <http://gimite.net/en/> + // License: New BSD License + // Reference: http://dev.w3.org/html5/websockets/ + // Reference: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol + + (function() { + + if ('undefined' == typeof window || window.WebSocket) return; + + var console = window.console; + if (!console || !console.log || !console.error) { + console = {log: function(){ }, error: function(){ }}; + } + + if (!swfobject.hasFlashPlayerVersion("10.0.0")) { + console.error("Flash Player >= 10.0.0 is required."); + return; + } + if (location.protocol == "file:") { + console.error( + "WARNING: web-socket-js doesn't work in file:///... URL " + + "unless you set Flash Security Settings properly. " + + "Open the page via Web server i.e. http://..."); + } + + /** + * This class represents a faux web socket. + * @param {string} url + * @param {array or string} protocols + * @param {string} proxyHost + * @param {int} proxyPort + * @param {string} headers + */ + WebSocket = function(url, protocols, proxyHost, proxyPort, headers) { + var self = this; + self.__id = WebSocket.__nextId++; + WebSocket.__instances[self.__id] = self; + self.readyState = WebSocket.CONNECTING; + self.bufferedAmount = 0; + self.__events = {}; + if (!protocols) { + protocols = []; + } else if (typeof protocols == "string") { + protocols = [protocols]; + } + // Uses setTimeout() to make sure __createFlash() runs after the caller sets ws.onopen etc. + // Otherwise, when onopen fires immediately, onopen is called before it is set. + setTimeout(function() { + WebSocket.__addTask(function() { + WebSocket.__flash.create( + self.__id, url, protocols, proxyHost || null, proxyPort || 0, headers || null); + }); + }, 0); + }; + + /** + * Send data to the web socket. + * @param {string} data The data to send to the socket. + * @return {boolean} True for success, false for failure. + */ + WebSocket.prototype.send = function(data) { + if (this.readyState == WebSocket.CONNECTING) { + throw "INVALID_STATE_ERR: Web Socket connection has not been established"; + } + // We use encodeURIComponent() here, because FABridge doesn't work if + // the argument includes some characters. We don't use escape() here + // because of this: + // https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Functions#escape_and_unescape_Functions + // But it looks decodeURIComponent(encodeURIComponent(s)) doesn't + // preserve all Unicode characters either e.g. "\uffff" in Firefox. + // Note by wtritch: Hopefully this will not be necessary using ExternalInterface. Will require + // additional testing. + var result = WebSocket.__flash.send(this.__id, encodeURIComponent(data)); + if (result < 0) { // success + return true; + } else { + this.bufferedAmount += result; + return false; + } + }; + + /** + * Close this web socket gracefully. + */ + WebSocket.prototype.close = function() { + if (this.readyState == WebSocket.CLOSED || this.readyState == WebSocket.CLOSING) { + return; + } + this.readyState = WebSocket.CLOSING; + WebSocket.__flash.close(this.__id); + }; + + /** + * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>} + * + * @param {string} type + * @param {function} listener + * @param {boolean} useCapture + * @return void + */ + WebSocket.prototype.addEventListener = function(type, listener, useCapture) { + if (!(type in this.__events)) { + this.__events[type] = []; + } + this.__events[type].push(listener); + }; + + /** + * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>} + * + * @param {string} type + * @param {function} listener + * @param {boolean} useCapture + * @return void + */ + WebSocket.prototype.removeEventListener = function(type, listener, useCapture) { + if (!(type in this.__events)) return; + var events = this.__events[type]; + for (var i = events.length - 1; i >= 0; --i) { + if (events[i] === listener) { + events.splice(i, 1); + break; + } + } + }; + + /** + * Implementation of {@link <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-registration">DOM 2 EventTarget Interface</a>} + * + * @param {Event} event + * @return void + */ + WebSocket.prototype.dispatchEvent = function(event) { + var events = this.__events[event.type] || []; + for (var i = 0; i < events.length; ++i) { + events[i](event); + } + var handler = this["on" + event.type]; + if (handler) handler(event); + }; + + /** + * Handles an event from Flash. + * @param {Object} flashEvent + */ + WebSocket.prototype.__handleEvent = function(flashEvent) { + if ("readyState" in flashEvent) { + this.readyState = flashEvent.readyState; + } + if ("protocol" in flashEvent) { + this.protocol = flashEvent.protocol; + } + + var jsEvent; + if (flashEvent.type == "open" || flashEvent.type == "error") { + jsEvent = this.__createSimpleEvent(flashEvent.type); + } else if (flashEvent.type == "close") { + // TODO implement jsEvent.wasClean + jsEvent = this.__createSimpleEvent("close"); + } else if (flashEvent.type == "message") { + var data = decodeURIComponent(flashEvent.message); + jsEvent = this.__createMessageEvent("message", data); + } else { + throw "unknown event type: " + flashEvent.type; + } + + this.dispatchEvent(jsEvent); + }; + + WebSocket.prototype.__createSimpleEvent = function(type) { + if (document.createEvent && window.Event) { + var event = document.createEvent("Event"); + event.initEvent(type, false, false); + return event; + } else { + return {type: type, bubbles: false, cancelable: false}; + } + }; + + WebSocket.prototype.__createMessageEvent = function(type, data) { + if (document.createEvent && window.MessageEvent && !window.opera) { + var event = document.createEvent("MessageEvent"); + event.initMessageEvent("message", false, false, data, null, null, window, null); + return event; + } else { + // IE and Opera, the latter one truncates the data parameter after any 0x00 bytes. + return {type: type, data: data, bubbles: false, cancelable: false}; + } + }; + + /** + * Define the WebSocket readyState enumeration. + */ + WebSocket.CONNECTING = 0; + WebSocket.OPEN = 1; + WebSocket.CLOSING = 2; + WebSocket.CLOSED = 3; + + WebSocket.__flash = null; + WebSocket.__instances = {}; + WebSocket.__tasks = []; + WebSocket.__nextId = 0; + + /** + * Load a new flash security policy file. + * @param {string} url + */ + WebSocket.loadFlashPolicyFile = function(url){ + WebSocket.__addTask(function() { + WebSocket.__flash.loadManualPolicyFile(url); + }); + }; + + /** + * Loads WebSocketMain.swf and creates WebSocketMain object in Flash. + */ + WebSocket.__initialize = function() { + if (WebSocket.__flash) return; + + if (WebSocket.__swfLocation) { + // For backword compatibility. + window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation; + } + if (!window.WEB_SOCKET_SWF_LOCATION) { + console.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf"); + return; + } + var container = document.createElement("div"); + container.id = "webSocketContainer"; + // Hides Flash box. We cannot use display: none or visibility: hidden because it prevents + // Flash from loading at least in IE. So we move it out of the screen at (-100, -100). + // But this even doesn't work with Flash Lite (e.g. in Droid Incredible). So with Flash + // Lite, we put it at (0, 0). This shows 1x1 box visible at left-top corner but this is + // the best we can do as far as we know now. + container.style.position = "absolute"; + if (WebSocket.__isFlashLite()) { + container.style.left = "0px"; + container.style.top = "0px"; + } else { + container.style.left = "-100px"; + container.style.top = "-100px"; + } + var holder = document.createElement("div"); + holder.id = "webSocketFlash"; + container.appendChild(holder); + document.body.appendChild(container); + // See this article for hasPriority: + // http://help.adobe.com/en_US/as3/mobile/WS4bebcd66a74275c36cfb8137124318eebc6-7ffd.html + swfobject.embedSWF( + WEB_SOCKET_SWF_LOCATION, + "webSocketFlash", + "1" /* width */, + "1" /* height */, + "10.0.0" /* SWF version */, + null, + null, + {hasPriority: true, swliveconnect : true, allowScriptAccess: "always"}, + null, + function(e) { + if (!e.success) { + console.error("[WebSocket] swfobject.embedSWF failed"); + } + }); + }; + + /** + * Called by Flash to notify JS that it's fully loaded and ready + * for communication. + */ + WebSocket.__onFlashInitialized = function() { + // We need to set a timeout here to avoid round-trip calls + // to flash during the initialization process. + setTimeout(function() { + WebSocket.__flash = document.getElementById("webSocketFlash"); + WebSocket.__flash.setCallerUrl(location.href); + WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG); + for (var i = 0; i < WebSocket.__tasks.length; ++i) { + WebSocket.__tasks[i](); + } + WebSocket.__tasks = []; + }, 0); + }; + + /** + * Called by Flash to notify WebSockets events are fired. + */ + WebSocket.__onFlashEvent = function() { + setTimeout(function() { + try { + // Gets events using receiveEvents() instead of getting it from event object + // of Flash event. This is to make sure to keep message order. + // It seems sometimes Flash events don't arrive in the same order as they are sent. + var events = WebSocket.__flash.receiveEvents(); + for (var i = 0; i < events.length; ++i) { + WebSocket.__instances[events[i].webSocketId].__handleEvent(events[i]); + } + } catch (e) { + console.error(e); + } + }, 0); + return true; + }; + + // Called by Flash. + WebSocket.__log = function(message) { + console.log(decodeURIComponent(message)); + }; + + // Called by Flash. + WebSocket.__error = function(message) { + console.error(decodeURIComponent(message)); + }; + + WebSocket.__addTask = function(task) { + if (WebSocket.__flash) { + task(); + } else { + WebSocket.__tasks.push(task); + } + }; + + /** + * Test if the browser is running flash lite. + * @return {boolean} True if flash lite is running, false otherwise. + */ + WebSocket.__isFlashLite = function() { + if (!window.navigator || !window.navigator.mimeTypes) { + return false; + } + var mimeType = window.navigator.mimeTypes["application/x-shockwave-flash"]; + if (!mimeType || !mimeType.enabledPlugin || !mimeType.enabledPlugin.filename) { + return false; + } + return mimeType.enabledPlugin.filename.match(/flashlite/i) ? true : false; + }; + + if (!window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION) { + if (window.addEventListener) { + window.addEventListener("load", function(){ + WebSocket.__initialize(); + }, false); + } else { + window.attachEvent("onload", function(){ + WebSocket.__initialize(); + }); + } + } + + })(); + + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io, global) { + + /** + * Expose constructor. + * + * @api public + */ + + exports.XHR = XHR; + + /** + * XHR constructor + * + * @costructor + * @api public + */ + + function XHR (socket) { + if (!socket) return; + + io.Transport.apply(this, arguments); + this.sendBuffer = []; + }; + + /** + * Inherits from Transport. + */ + + io.util.inherit(XHR, io.Transport); + + /** + * Establish a connection + * + * @returns {Transport} + * @api public + */ + + XHR.prototype.open = function () { + this.socket.setBuffer(false); + this.onOpen(); + this.get(); + + // we need to make sure the request succeeds since we have no indication + // whether the request opened or not until it succeeded. + this.setCloseTimeout(); + + return this; + }; + + /** + * Check if we need to send data to the Socket.IO server, if we have data in our + * buffer we encode it and forward it to the `post` method. + * + * @api private + */ + + XHR.prototype.payload = function (payload) { + var msgs = []; + + for (var i = 0, l = payload.length; i < l; i++) { + msgs.push(io.parser.encodePacket(payload[i])); + } + + this.send(io.parser.encodePayload(msgs)); + }; + + /** + * Send data to the Socket.IO server. + * + * @param data The message + * @returns {Transport} + * @api public + */ + + XHR.prototype.send = function (data) { + this.post(data); + return this; + }; + + /** + * Posts a encoded message to the Socket.IO server. + * + * @param {String} data A encoded message. + * @api private + */ + + function empty () { }; + + XHR.prototype.post = function (data) { + var self = this; + this.socket.setBuffer(true); + + function stateChange () { + if (this.readyState == 4) { + this.onreadystatechange = empty; + self.posting = false; + + if (this.status == 200){ + self.socket.setBuffer(false); + } else { + self.onClose(); + } + } + } + + function onload () { + this.onload = empty; + self.socket.setBuffer(false); + }; + + this.sendXHR = this.request('POST'); + + if (global.XDomainRequest && this.sendXHR instanceof XDomainRequest) { + this.sendXHR.onload = this.sendXHR.onerror = onload; + } else { + this.sendXHR.onreadystatechange = stateChange; + } + + this.sendXHR.send(data); + }; + + /** + * Disconnects the established `XHR` connection. + * + * @returns {Transport} + * @api public + */ + + XHR.prototype.close = function () { + this.onClose(); + return this; + }; + + /** + * Generates a configured XHR request + * + * @param {String} url The url that needs to be requested. + * @param {String} method The method the request should use. + * @returns {XMLHttpRequest} + * @api private + */ + + XHR.prototype.request = function (method) { + var req = io.util.request(this.socket.isXDomain()) + , query = io.util.query(this.socket.options.query, 't=' + +new Date); + + req.open(method || 'GET', this.prepareUrl() + query, true); + + if (method == 'POST') { + try { + if (req.setRequestHeader) { + req.setRequestHeader('Content-type', 'text/plain;charset=UTF-8'); + } else { + // XDomainRequest + req.contentType = 'text/plain'; + } + } catch (e) {} + } + + return req; + }; + + /** + * Returns the scheme to use for the transport URLs. + * + * @api private + */ + + XHR.prototype.scheme = function () { + return this.socket.options.secure ? 'https' : 'http'; + }; + + /** + * Check if the XHR transports are supported + * + * @param {Boolean} xdomain Check if we support cross domain requests. + * @returns {Boolean} + * @api public + */ + + XHR.check = function (socket, xdomain) { + try { + var request = io.util.request(xdomain), + usesXDomReq = (global.XDomainRequest && request instanceof XDomainRequest), + socketProtocol = (socket && socket.options && socket.options.secure ? 'https:' : 'http:'), + isXProtocol = (global.location && socketProtocol != global.location.protocol); + if (request && !(usesXDomReq && isXProtocol)) { + return true; + } + } catch(e) {} + + return false; + }; + + /** + * Check if the XHR transport supports cross domain requests. + * + * @returns {Boolean} + * @api public + */ + + XHR.xdomainCheck = function (socket) { + return XHR.check(socket, true); + }; + + })( + 'undefined' != typeof io ? io.Transport : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + , global + ); + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io) { + + /** + * Expose constructor. + */ + + exports.htmlfile = HTMLFile; + + /** + * The HTMLFile transport creates a `forever iframe` based transport + * for Internet Explorer. Regular forever iframe implementations will + * continuously trigger the browsers buzy indicators. If the forever iframe + * is created inside a `htmlfile` these indicators will not be trigged. + * + * @constructor + * @extends {io.Transport.XHR} + * @api public + */ + + function HTMLFile (socket) { + io.Transport.XHR.apply(this, arguments); + }; + + /** + * Inherits from XHR transport. + */ + + io.util.inherit(HTMLFile, io.Transport.XHR); + + /** + * Transport name + * + * @api public + */ + + HTMLFile.prototype.name = 'htmlfile'; + + /** + * Creates a new Ac...eX `htmlfile` with a forever loading iframe + * that can be used to listen to messages. Inside the generated + * `htmlfile` a reference will be made to the HTMLFile transport. + * + * @api private + */ + + HTMLFile.prototype.get = function () { + this.doc = new window[(['Active'].concat('Object').join('X'))]('htmlfile'); + this.doc.open(); + this.doc.write('<html></html>'); + this.doc.close(); + this.doc.parentWindow.s = this; + + var iframeC = this.doc.createElement('div'); + iframeC.className = 'socketio'; + + this.doc.body.appendChild(iframeC); + this.iframe = this.doc.createElement('iframe'); + + iframeC.appendChild(this.iframe); + + var self = this + , query = io.util.query(this.socket.options.query, 't='+ +new Date); + + this.iframe.src = this.prepareUrl() + query; + + io.util.on(window, 'unload', function () { + self.destroy(); + }); + }; + + /** + * The Socket.IO server will write script tags inside the forever + * iframe, this function will be used as callback for the incoming + * information. + * + * @param {String} data The message + * @param {document} doc Reference to the context + * @api private + */ + + HTMLFile.prototype._ = function (data, doc) { + this.onData(data); + try { + var script = doc.getElementsByTagName('script')[0]; + script.parentNode.removeChild(script); + } catch (e) { } + }; + + /** + * Destroy the established connection, iframe and `htmlfile`. + * And calls the `CollectGarbage` function of Internet Explorer + * to release the memory. + * + * @api private + */ + + HTMLFile.prototype.destroy = function () { + if (this.iframe){ + try { + this.iframe.src = 'about:blank'; + } catch(e){} + + this.doc = null; + this.iframe.parentNode.removeChild(this.iframe); + this.iframe = null; + + CollectGarbage(); + } + }; + + /** + * Disconnects the established connection. + * + * @returns {Transport} Chaining. + * @api public + */ + + HTMLFile.prototype.close = function () { + this.destroy(); + return io.Transport.XHR.prototype.close.call(this); + }; + + /** + * Checks if the browser supports this transport. The browser + * must have an `Ac...eXObject` implementation. + * + * @return {Boolean} + * @api public + */ + + HTMLFile.check = function (socket) { + if (typeof window != "undefined" && (['Active'].concat('Object').join('X')) in window){ + try { + var a = new window[(['Active'].concat('Object').join('X'))]('htmlfile'); + return a && io.Transport.XHR.check(socket); + } catch(e){} + } + return false; + }; + + /** + * Check if cross domain requests are supported. + * + * @returns {Boolean} + * @api public + */ + + HTMLFile.xdomainCheck = function () { + // we can probably do handling for sub-domains, we should + // test that it's cross domain but a subdomain here + return false; + }; + + /** + * Add the transport to your public io.transports array. + * + * @api private + */ + + io.transports.push('htmlfile'); + + })( + 'undefined' != typeof io ? io.Transport : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + ); + + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io, global) { + + /** + * Expose constructor. + */ + + exports['xhr-polling'] = XHRPolling; + + /** + * The XHR-polling transport uses long polling XHR requests to create a + * "persistent" connection with the server. + * + * @constructor + * @api public + */ + + function XHRPolling () { + io.Transport.XHR.apply(this, arguments); + }; + + /** + * Inherits from XHR transport. + */ + + io.util.inherit(XHRPolling, io.Transport.XHR); + + /** + * Merge the properties from XHR transport + */ + + io.util.merge(XHRPolling, io.Transport.XHR); + + /** + * Transport name + * + * @api public + */ + + XHRPolling.prototype.name = 'xhr-polling'; + + /** + * Indicates whether heartbeats is enabled for this transport + * + * @api private + */ + + XHRPolling.prototype.heartbeats = function () { + return false; + }; + + /** + * Establish a connection, for iPhone and Android this will be done once the page + * is loaded. + * + * @returns {Transport} Chaining. + * @api public + */ + + XHRPolling.prototype.open = function () { + var self = this; + + io.Transport.XHR.prototype.open.call(self); + return false; + }; + + /** + * Starts a XHR request to wait for incoming messages. + * + * @api private + */ + + function empty () {}; + + XHRPolling.prototype.get = function () { + if (!this.isOpen) return; + + var self = this; + + function stateChange () { + if (this.readyState == 4) { + this.onreadystatechange = empty; + + if (this.status == 200) { + self.onData(this.responseText); + self.get(); + } else { + self.onClose(); + } + } + }; + + function onload () { + this.onload = empty; + this.onerror = empty; + self.retryCounter = 1; + self.onData(this.responseText); + self.get(); + }; + + function onerror () { + self.retryCounter ++; + if(!self.retryCounter || self.retryCounter > 3) { + self.onClose(); + } else { + self.get(); + } + }; + + this.xhr = this.request(); + + if (global.XDomainRequest && this.xhr instanceof XDomainRequest) { + this.xhr.onload = onload; + this.xhr.onerror = onerror; + } else { + this.xhr.onreadystatechange = stateChange; + } + + this.xhr.send(null); + }; + + /** + * Handle the unclean close behavior. + * + * @api private + */ + + XHRPolling.prototype.onClose = function () { + io.Transport.XHR.prototype.onClose.call(this); + + if (this.xhr) { + this.xhr.onreadystatechange = this.xhr.onload = this.xhr.onerror = empty; + try { + this.xhr.abort(); + } catch(e){} + this.xhr = null; + } + }; + + /** + * Webkit based browsers show a infinit spinner when you start a XHR request + * before the browsers onload event is called so we need to defer opening of + * the transport until the onload event is called. Wrapping the cb in our + * defer method solve this. + * + * @param {Socket} socket The socket instance that needs a transport + * @param {Function} fn The callback + * @api private + */ + + XHRPolling.prototype.ready = function (socket, fn) { + var self = this; + + io.util.defer(function () { + fn.call(self); + }); + }; + + /** + * Add the transport to your public io.transports array. + * + * @api private + */ + + io.transports.push('xhr-polling'); + + })( + 'undefined' != typeof io ? io.Transport : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + , global + ); + + /** + * socket.io + * Copyright(c) 2011 LearnBoost <dev@learnboost.com> + * MIT Licensed + */ + + (function (exports, io, global) { + /** + * There is a way to hide the loading indicator in Firefox. If you create and + * remove a iframe it will stop showing the current loading indicator. + * Unfortunately we can't feature detect that and UA sniffing is evil. + * + * @api private + */ + + var indicator = global.document && "MozAppearance" in + global.document.documentElement.style; + + /** + * Expose constructor. + */ + + exports['jsonp-polling'] = JSONPPolling; + + /** + * The JSONP transport creates an persistent connection by dynamically + * inserting a script tag in the page. This script tag will receive the + * information of the Socket.IO server. When new information is received + * it creates a new script tag for the new data stream. + * + * @constructor + * @extends {io.Transport.xhr-polling} + * @api public + */ + + function JSONPPolling (socket) { + io.Transport['xhr-polling'].apply(this, arguments); + + this.index = io.j.length; + + var self = this; + + io.j.push(function (msg) { + self._(msg); + }); + }; + + /** + * Inherits from XHR polling transport. + */ + + io.util.inherit(JSONPPolling, io.Transport['xhr-polling']); + + /** + * Transport name + * + * @api public + */ + + JSONPPolling.prototype.name = 'jsonp-polling'; + + /** + * Posts a encoded message to the Socket.IO server using an iframe. + * The iframe is used because script tags can create POST based requests. + * The iframe is positioned outside of the view so the user does not + * notice it's existence. + * + * @param {String} data A encoded message. + * @api private + */ + + JSONPPolling.prototype.post = function (data) { + var self = this + , query = io.util.query( + this.socket.options.query + , 't='+ (+new Date) + '&i=' + this.index + ); + + if (!this.form) { + var form = document.createElement('form') + , area = document.createElement('textarea') + , id = this.iframeId = 'socketio_iframe_' + this.index + , iframe; + + form.className = 'socketio'; + form.style.position = 'absolute'; + form.style.top = '0px'; + form.style.left = '0px'; + form.style.display = 'none'; + form.target = id; + form.method = 'POST'; + form.setAttribute('accept-charset', 'utf-8'); + area.name = 'd'; + form.appendChild(area); + document.body.appendChild(form); + + this.form = form; + this.area = area; + } + + this.form.action = this.prepareUrl() + query; + + function complete () { + initIframe(); + self.socket.setBuffer(false); + }; + + function initIframe () { + if (self.iframe) { + self.form.removeChild(self.iframe); + } + + try { + // ie6 dynamic iframes with target="" support (thanks Chris Lambacher) + iframe = document.createElement('<iframe name="'+ self.iframeId +'">'); + } catch (e) { + iframe = document.createElement('iframe'); + iframe.name = self.iframeId; + } + + iframe.id = self.iframeId; + + self.form.appendChild(iframe); + self.iframe = iframe; + }; + + initIframe(); + + // we temporarily stringify until we figure out how to prevent + // browsers from turning `\n` into `\r\n` in form inputs + this.area.value = io.JSON.stringify(data); + + try { + this.form.submit(); + } catch(e) {} + + if (this.iframe.attachEvent) { + iframe.onreadystatechange = function () { + if (self.iframe.readyState == 'complete') { + complete(); + } + }; + } else { + this.iframe.onload = complete; + } + + this.socket.setBuffer(true); + }; + + /** + * Creates a new JSONP poll that can be used to listen + * for messages from the Socket.IO server. + * + * @api private + */ + + JSONPPolling.prototype.get = function () { + var self = this + , script = document.createElement('script') + , query = io.util.query( + this.socket.options.query + , 't='+ (+new Date) + '&i=' + this.index + ); + + if (this.script) { + this.script.parentNode.removeChild(this.script); + this.script = null; + } + + script.async = true; + script.src = this.prepareUrl() + query; + script.onerror = function () { + self.onClose(); + }; + + var insertAt = document.getElementsByTagName('script')[0]; + insertAt.parentNode.insertBefore(script, insertAt); + this.script = script; + + if (indicator) { + setTimeout(function () { + var iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + document.body.removeChild(iframe); + }, 100); + } + }; + + /** + * Callback function for the incoming message stream from the Socket.IO server. + * + * @param {String} data The message + * @api private + */ + + JSONPPolling.prototype._ = function (msg) { + this.onData(msg); + if (this.isOpen) { + this.get(); + } + return this; + }; + + /** + * The indicator hack only works after onload + * + * @param {Socket} socket The socket instance that needs a transport + * @param {Function} fn The callback + * @api private + */ + + JSONPPolling.prototype.ready = function (socket, fn) { + var self = this; + if (!indicator) return fn.call(this); + + io.util.load(function () { + fn.call(self); + }); + }; + + /** + * Checks if browser supports this transport. + * + * @return {Boolean} + * @api public + */ + + JSONPPolling.check = function () { + return 'document' in global; + }; + + /** + * Check if cross domain requests are supported + * + * @returns {Boolean} + * @api public + */ + + JSONPPolling.xdomainCheck = function () { + return true; + }; + + /** + * Add the transport to your public io.transports array. + * + * @api private + */ + + io.transports.push('jsonp-polling'); + + })( + 'undefined' != typeof io ? io.Transport : module.exports + , 'undefined' != typeof io ? io : module.parent.exports + , global + ); + + if (typeof define === "function" && define.amd) { + define([], function () { return io; }); + } + })(); + + /* Notes + * + * - Continue using prefixed names for now. + * + */ + + var webrtcSupported = true; + + var RTCPeerConnection; + if(window.mozRTCPeerConnection) + RTCPeerConnection = window.mozRTCPeerConnection; + else if(window.webkitRTCPeerConnection) + RTCPeerConnection = window.webkitRTCPeerConnection; + else if(window.RTCPeerConnection) + RTCPeerConnection = window.RTCPeerConnection + else + webrtcSupported = false; + + var RTCSessionDescription; + if(window.mozRTCSessionDescription) + RTCSessionDescription = window.mozRTCSessionDescription; + else if(window.webkitRTCSessionDescription) + RTCSessionDescription = window.webkitRTCSessionDescription; + else if(window.RTCSessionDescription) + RTCSessionDescription = window.RTCSessionDescription + else + webrtcSupported = false; + + var RTCIceCandidate; + if(window.mozRTCIceCandidate) + RTCIceCandidate = window.mozRTCIceCandidate; + else if(window.webkitRTCIceCandidate) + RTCIceCandidate = window.webkitRTCIceCandidate; + else if(window.RTCIceCandidate) + RTCIceCandidate = window.RTCIceCandidate; + else + webrtcSupported = false; + + var getUserMedia; + if(!navigator.getUserMedia) { + if(navigator.mozGetUserMedia) + getUserMedia = navigator.mozGetUserMedia.bind(navigator); + else if(navigator.webkitGetUserMedia) + getUserMedia = navigator.webkitGetUserMedia.bind(navigator); + else + webrtcSupported = false; + } else { + getUserMedia = navigator.getUserMedia.bind(navigator); + } + + // FIXME: browser detection is gross, but I don't see another way to do this + var RTCConnectProtocol; + if(window.mozRTCPeerConnection) { + RTCConnectProtocol = mozRTCConnectProtocol; + } else if(window.webkitRTCPeerConnection) { + RTCConnectProtocol = webkitRTCConnectProtocol; + } else { + webrtcSupported = false; + } + + function callback(object, method, args) { + if(!Array.isArray(args)) + args = [args]; + if(method in object && 'function' === typeof object[method]) { + object[method].apply(object, args); + } + }; + + function fail(object, method, error) { + if (!(error instanceof Error)) + error = new Error(error); + callback(object, method, [error]); + }; + + function defer(queue, object, method, args) { + if(queue) { + queue.push([object, method, args]); + return true; + } else { + return false; + } + }; + + function processDeferredQueue(queue) { + while(queue.length) { + var deferred = queue.shift(); + callback(deferred[0], deferred[1], deferred[2]); + } + }; + + var ONE_SECOND = 1000; // milliseconds + var DEFAULT_CONNECTION_TIMEOUT = 10 * ONE_SECOND; + var DEFAULT_PING_TIMEOUT = 1 * ONE_SECOND; + var RELIABLE_CHANNEL_OPTIONS = { + reliable: false + }; + var UNRELIABLE_CHANNEL_OPTIONS = { + outOfOrderAllowed: true, + maxRetransmitNum: 0, + reliable: false + }; + + function PendingConnectionAbortError(message) { + this.name = "PendingConnectionAbortError"; + this.message = (message || ""); + }; + PendingConnectionAbortError.prototype = Error.prototype; + + function ConnectionFailedError(message) { + this.name = "ConnectionFailedError"; + this.message = (message || ""); + }; + ConnectionFailedError.prototype = Error.prototype; + + var E = { + PendingConnectionAbortError: PendingConnectionAbortError, + ConnectionFailedError: ConnectionFailedError + }; + + function WebSocketBroker(brokerUrl) { + this.brokerUrl = brokerUrl; + this.state = WebSocketBroker.OFFLINE; + + this.onstatechange = null; + this.onreceive = null; + this.onerror = null; + + this.socket = null; + this.route = null; + }; + + // States + WebSocketBroker.OFFLINE = 0x01; + WebSocketBroker.CONNECTING = 0x02; + WebSocketBroker.CONNECTED = 0x04; + // Flags + WebSocketBroker.ROUTED = 0x10; + WebSocketBroker.LISTENING = 0x20; + + WebSocketBroker.prototype.setState = function setState(state, clearFlags) { + var clear = clearFlags ? 0x00 : 0xF0; + this.state &= clear >>> 0; + this.state |= state >>> 0; + callback(this, 'onstatechange', [this.state, (state | (clear & 0x0)) >>> 0]); + }; + WebSocketBroker.prototype.setFlag = function setFlag(flag) { + this.state = (this.state | flag) >>> 0; + callback(this, 'onstatechange', [this.state, flag]) + }; + WebSocketBroker.prototype.clearFlag = function clearFlag(flag) { + flag = (~flag) >>> 0; + this.state = (this.state & flag) >>> 0; + callback(this, 'onstatechange', [this.state, flag]) + }; + WebSocketBroker.prototype.checkState = function checkState(mask) { + return !!(this.state & mask); + }; + WebSocketBroker.prototype.connect = function connect() { + var that = this; + var socket = io.connect(this.brokerUrl + '/peer', { + 'sync disconnect on unload': true // partially fixes 'interrupted while page loading' warning + }); + + socket.on('connecting', function onconnecting() { + that.setState(WebSocketBroker.CONNECTING, true); + }); + + socket.on('connect', function onconnect() { + that.setState(WebSocketBroker.CONNECTED, true); + }); + + socket.on('connect_failed', function onconnect_failed() { + that.setState(WebSocketBroker.OFFLINE, true); + }); + + socket.on('route', function onroute(route) { + that.route = route; + that.setFlag(WebSocketBroker.ROUTED); + }); + + socket.on('disconnect', function ondisconnect() { + that.setState(WebSocketBroker.OFFLINE, true); + }); + + socket.on('error', function onerror(error) { + console.error(error); + fail(that, 'onerror', error); + }); + + socket.on('receive', function onreceive(message) { + var from = message['from']; + var data = message['data']; + callback(that, 'onreceive', [from, data]); + }); + + this.socket = socket; + }; + WebSocketBroker.prototype.disconnect = function disconnect() { + if(this.checkState(WebSocketBroker.CONNECTED)) { + this.socket.disconnect(); + this.setState(WebSocketBroker.OFFLINE, true); + return true; + } else { + return false; + } + }; + WebSocketBroker.prototype.listen = function listen(options) { + var that = this; + if(this.checkState(WebSocketBroker.CONNECTED)) { + this.socket.emit('listen', options, function onresponse(response) { + if(response && response['error']) { + var error = new Error(response['error']); + fail(that, 'onerror', error); + } else { + that.setFlag(WebSocketBroker.LISTENING); + } + }); + } + }; + WebSocketBroker.prototype.ignore = function ignore() { + var that = this; + if(this.checkState(WebSocketBroker.CONNECTED)) { + this.socket.emit('ignore', null, function onresponse(response) { + if(response && response['error']) { + var error = new Error(response['error']); + fail(that, 'onerror', error) + } else { + that.clearFlag(WebSocketBroker.LISTENING); + } + }); + } + }; + WebSocketBroker.prototype.send = function send(to, message) { + var that = this; + if(this.checkState(WebSocketBroker.CONNECTED)) { + this.socket.emit('send', {'to': to, 'data': message}, function onresponse(response) { + if(response && response['error']) { + var error = new Error(response['error']); + fail(that, 'onerror', error) + } + }); + }; + }; + + var dataChannels = { + 'reliable': 'RELIABLE', + 'unreliable': 'UNRELIABLE', + '@control': 'RELIABLE' + }; + var nextDataConnectionPort = 1; + function CommonRTCConnectProtocol() { + // FIXME: these timeouts should be configurable + this.connectionTimeout = 10 * ONE_SECOND; + this.pingTimeout = 1 * ONE_SECOND; + }; + CommonRTCConnectProtocol.prototype.process = function process(message) { + var that = this; + + var type = message['type']; + switch(type) { + case 'ice': + var candidate = JSON.parse(message['candidate']); + if(candidate) + this.handleIce(candidate); + break; + + case 'offer': + that.ports.remote = message['port']; + var offer = { + 'type': 'offer', + 'sdp': message['description'] + }; + this.handleOffer(offer); + break; + + case 'answer': + that.ports.remote = message['port']; + var answer = { + 'type': 'answer', + 'sdp': message['description'] + }; + this.handleAnswer(answer); + break; + + case 'abort': + this.handleAbort(); + break; + + default: + fail(this, 'onerror', 'unknown message'); + } + }; + CommonRTCConnectProtocol.prototype.handleAbort = function handleAbort() { + fail(this, 'onerror', new Error(E.RTCConnectProtocolAbort)); + }; + CommonRTCConnectProtocol.prototype.initialize = function initialize(cb) { + var that = this; + + if(this.peerConnection) + return cb(); + + // FIXME: peer connection servers should be configurable + this.peerConnection = new RTCPeerConnection(this.connectionServers, this.connectionOptions); + this.peerConnection.onicecandidate = function(event) { + var message = { + 'type': 'ice', + 'candidate': JSON.stringify(event.candidate) + }; + callback(that, 'onmessage', message); + }; + this.peerConnection.onaddstream = function(event) { + that.streams['remote'] = event.stream; + }; + this.peerConnection.onstatechange = function(event) { + console.log(event.target.readyState); + }; + + function createStream(useFake) { + useFake = (!useVideo && !useAudio) ? true : useFake; + var useVideo = !!that.options['video']; + var useAudio = !!that.options['audio']; + var mediaOptions = { + video: useVideo, + audio: (!useVideo && !useAudio) ? true : useAudio, + fake: useFake + }; + getUserMedia(mediaOptions, + function(stream) { + that.peerConnection.addStream(stream); + that.streams['local'] = stream; + cb(); + }, + function(error) { + console.error('!', error); + if(!useFake) + createStream(true); + else + fail(that, 'onerror', error); + } + ); + } + + createStream(); + }; + CommonRTCConnectProtocol.prototype.handleIce = function handleIce(candidate) { + var that = this; + + function setIce() { + if(!that.peerConnection.remoteDescription) { + return + } + that.peerConnection.addIceCandidate(new RTCIceCandidate(candidate), + function(error) { + fail(that, 'onerror', error); + } + ); + }; + + this.initialize(setIce); + }; + CommonRTCConnectProtocol.prototype.initiate = function initiate() { + var that = this; + this.initiator = true; + + function createDataChannels() { + var labels = Object.keys(dataChannels); + labels.forEach(function(label) { + var channelOptions = that.channelOptions[dataChannels[label]]; + var channel = that._pending[label] = that.peerConnection.createDataChannel(label, channelOptions); + channel.binaryType = that.options['binaryType']; + channel.onopen = function() { + that.channels[label] = channel; + delete that._pending[label]; + if(Object.keys(that.channels).length === labels.length) { + that.complete = true; + callback(that, 'oncomplete', []); + } + }; + channel.onerror = function(error) { + console.error(error); + fail(that, 'onerror', error); + }; + }); + createOffer(); + }; + + function createOffer() { + that.peerConnection.createOffer(setLocal, + function(error) { + fail(that, 'onerror', error); + } + ); + }; + + function setLocal(description) { + that.peerConnection.setLocalDescription(new RTCSessionDescription(description), complete, + function(error) { + fail(that, 'onerror', error); + } + ); + + function complete() { + var message = { + 'type': 'offer', + 'description': description['sdp'], + 'port': that.ports.local + }; + callback(that, 'onmessage', message); + }; + }; + + this.initialize(createDataChannels); + }; + CommonRTCConnectProtocol.prototype.handleOffer = function handleOffer(offer) { + var that = this; + + function handleDataChannels() { + var labels = Object.keys(dataChannels); + that.peerConnection.ondatachannel = function(event) { + var channel = event.channel; + var label = channel.label; + that._pending[label] = channel; + channel.binaryType = that.options['binaryType']; + channel.onopen = function() { + that.channels[label] = channel; + delete that._pending[label]; + if(Object.keys(that.channels).length === labels.length) { + that.complete = true; + callback(that, 'oncomplete', []); + } + }; + channel.onerror = function(error) { + console.error(error); + fail(that, 'onerror', error); + }; + }; + setRemote(); + }; + + function setRemote() { + that.peerConnection.setRemoteDescription(new RTCSessionDescription(offer), createAnswer, + function(error) { + fail(that, 'onerror', error); + } + ); + }; + + function createAnswer() { + that.peerConnection.createAnswer(setLocal, + function(error) { + fail(that, 'onerror', error); + } + ); + }; + + function setLocal(description) { + that.peerConnection.setLocalDescription(new RTCSessionDescription(description), complete, + function(error) { + fail(that, 'onerror', error); + } + ); + + function complete() { + var message = { + 'type': 'answer', + 'description': description['sdp'], + 'port': that.ports.local + }; + callback(that, 'onmessage', message); + }; + }; + + this.initialize(handleDataChannels); + }; + CommonRTCConnectProtocol.prototype.handleAnswer = function handleAnswer(answer) { + var that = this; + + function setRemote() { + that.peerConnection.setRemoteDescription(new RTCSessionDescription(answer), complete, + function(error) { + fail(that, 'onerror', error); + } + ); + }; + + function complete() { + }; + + this.initialize(setRemote); + }; + + function mozRTCConnectProtocol(options) { + this.options = options; + this.onmessage = null; + this.oncomplete = null; + this.onerror = null; + + this.complete = false; + this.ports = { + local: nextDataConnectionPort ++, + remote: null + }; + this.streams = { + local: null, + remote: null + }; + this.initiator = false; + + this.peerConnection = null; + this.channels = {}; + this._pending = {}; + this.connectionServers = null; + this.connectionOptions = null; + this.channelOptions = { + RELIABLE: { + // defaults + }, + UNRELIABLE: { + outOfOrderAllowed: true, + maxRetransmitNum: 0 + } + }; + }; + mozRTCConnectProtocol.prototype = new CommonRTCConnectProtocol(); + mozRTCConnectProtocol.prototype.constructor = mozRTCConnectProtocol; + + function webkitRTCConnectProtocol(options) { + this.options = options; + this.onmessage = null; + this.oncomplete = null; + this.onerror = null; + + this.complete = false; + this.ports = { + local: nextDataConnectionPort ++, + remote: null + }; + this.streams = { + local: null, + remote: null + }; + this.initiator = false; + + this.peerConnection = null; + this.channels = {}; + this._pending = {}; + this.connectionServers = {iceServers:[{url:'stun:23.21.150.121'}]}; + this.connectionOptions = { + 'optional': [{ 'RtpDataChannels': true }] + }; + this.channelOptions = { + RELIABLE: { + // FIXME: reliable channels do not work in chrome yet + reliable: false + }, + UNRELIABLE: { + reliable: false + } + }; + }; + webkitRTCConnectProtocol.prototype = new CommonRTCConnectProtocol(); + webkitRTCConnectProtocol.prototype.constructor = webkitRTCConnectProtocol; + + // FIXME: this could use a cleanup + var nextConnectionId = 1; + function Connection(options, peerConnection, streams, channels) { + var that = this; + this.id = nextConnectionId ++; + this.streams = streams; + this.connected = false; + this.messageFlag = false; + + this.onmessage = null; + this.ondisconnect = null; + this.onerror = null; + + this.peerConnection = peerConnection; + + // DataChannels + this.channels = channels; + + this.connectionTimer = null; + this.pingTimer = null; + + function handleConnectionTimerExpired() { + if(!that.connected) + return + this.connectionTimer = null; + if(false === that.messageFlag) { + that.channels['@control'].send('ping'); + this.pingTimer = window.setTimeout(handlePingTimerExpired, options['pingTimeout']); + } else { + that.messageFlag = false; + this.connectionTimer = window.setTimeout(handleConnectionTimerExpired, options['connectionTimeout']); + } + }; + function handlePingTimerExpired() { + if(!that.connected) + return + this.pingTimer = null; + if(false === that.messageFlag) { + that.connected = false; + that.close(); + } else { + that.messageFlag = false; + this.connectionTimer = window.setTimeout(handleConnectionTimerExpired, options['connectionTimeout']); + } + }; + + Object.keys(this.channels).forEach(function(label) { + var channel = that.channels[label]; + if(label.match('^@')) // check for internal channels + return; + + channel.onmessage = function onmessage(message) { + that.messageFlag = true; + callback(that, 'onmessage', [label, message]); + }; + }); + this.channels['@control'].onmessage = function onmessage(message) { + that.messageFlag = true; + if(that.connected) { + var data = message.data; + if('ping' === data) { + that.channels['@control'].send('pong'); + } else if('pong' === data) { + // ok + } else if('quit' === data) { + that.close(); + } + } + }; + + this.connected = true; + this.connectionTimer = window.setTimeout(handleConnectionTimerExpired, options['connectionTimeout']); + }; + Connection.prototype.close = function close() { + console.log('close connection'); + if(this.connected) { + this.channels['@control'].send('quit'); + } + this.connected = false; + this.peerConnection.close(); + if(this.connectionTimer) { + window.clearInterval(this.connectionTimer); + this.connectionTimer = null; + } + if(this.pingTimer) { + window.clearInterval(this.pingTimer); + this.pingTimer = null; + } + this.peerConnection = null; + callback(this, 'ondisconnect', []); + }; + Connection.prototype.send = function send(label, message) { + this.channels[label].send(message); + }; + + function PendingConnection(route, incoming) { + this.route = route; + this.incoming = incoming; + this.proceed = true; + }; + PendingConnection.prototype.accept = function accept() { + this.proceed = true; + }; + PendingConnection.prototype.reject = function reject() { + this.proceed = false; + }; + + function Peer(brokerUrl, options) { + if(!webrtcSupported) + throw new Error("WebRTC not supported"); + + var that = this; + this.brokerUrl = brokerUrl; + this.options = options = options || {}; + options['binaryType'] = options['binaryType'] || 'arraybuffer'; + options['connectionTimeout'] = options['connectionTimeout'] || 10 * ONE_SECOND; + options['pingTimeout'] = options['pingTimeout'] || 1 * ONE_SECOND; + + this.onconnection = null; + this.onpending = null; + this.onroute = null; + this.onerror = null; + + this.broker = new WebSocketBroker(brokerUrl); + this.broker.onerror = function(error) { + fail(that, 'onerror', error); + }; + this.pending = {}; + + this.queues = { + connected: [], + listening: [] + }; + + this.broker.onstatechange = function onstatechange(state, mask) { + if(that.queues.connected.length && that.broker.checkState(WebSocketBroker.ROUTED)) { + processDeferredQueue(that.queues.connected); + if(that.queues.listening.length && that.broker.checkState(WebSocketBroker.LISTENING)) { + processDeferredQueue(that.queues.listening); + } + } + if(mask & WebSocketBroker.ROUTED) { + callback(that, 'onroute', that.broker.route); + } + }; + + this.broker.onreceive = function onreceive(from, message) { + var handshake; + if(!that.pending.hasOwnProperty(from)) { + if(!that.broker.checkState(WebSocketBroker.LISTENING)) { + return; + } + + var pendingConnection = new PendingConnection(from, /*incoming*/ true); + callback(that, 'onpending', [pendingConnection]); + if(!pendingConnection['proceed']) + return; + + var handshake = that.pending[from] = new RTCConnectProtocol(that.options); + handshake.oncomplete = function() { + var connection = new Connection(that.options, handshake.peerConnection, handshake.streams, handshake.channels); + connection['route'] = from; + delete that.pending[from]; + callback(that, 'onconnection', [connection]); + }; + handshake.onmessage = function(message) { + that.broker.send(from, message); + }; + handshake.onerror = function(error) { + delete that.pending[from]; + callback(that, 'onerror', [error]); + }; + } else { + handshake = that.pending[from]; + } + handshake.process(message); + }; + + this.broker.connect(); + }; + Peer.prototype.listen = function listen(options) { + if(!this.broker.checkState(WebSocketBroker.ROUTED)) + return defer(this.queues.connected, this, 'listen', [options]); + + options = options || {}; + options['url'] = options['url'] || window.location.toString(); + options['listed'] = (undefined !== options['listed']) ? options['listed'] : true; + options['metadata'] = options['metadata'] || {}; + + this.broker.listen(options); + }; + Peer.prototype.ignore = function ignore() { + throw new Error('not implemented'); + }; + Peer.prototype.connect = function connect(route) { + if(!this.broker.checkState(WebSocketBroker.ROUTED)) + return defer(this.queues.connected, this, 'connect', [route]); + + var that = this; + + if(this.pending.hasOwnProperty(route)) + throw new Error('already connecting to this host'); // FIXME: we can handle this better + + var pendingConnection = new PendingConnection(route, /*incoming*/ false); + callback(that, 'onpending', [pendingConnection]); + if(!pendingConnection['proceed']) + return; + + var handshake = this.pending[route] = new RTCConnectProtocol(this.options); + handshake.oncomplete = function() { + var connection = new Connection(this.options, handshake.peerConnection, handshake.streams, handshake.channels); + connection['route'] = route; + delete that.pending[route]; + callback(that, 'onconnection', [connection]); + }; + handshake.onmessage = function(message) { + that.broker.send(route, message); + }; + handshake.onerror = function(error) { + delete that.pending[route]; + fail(that, 'onerror', error); + }; + + handshake.initiate(); + }; + Peer.prototype.close = function close() { + this.broker.disconnect(); + }; + Peer.E = E; + + return Peer; + +}); +})(typeof define == 'function' && define.amd +? define +: function (deps, factory) { typeof exports === 'object' +? (module.exports = factory()) +: (this.Peer = factory()); +}, +// Boilerplate for AMD, Node, and browser global +this +);
\ No newline at end of file diff --git a/tests/sockets/p2p/package.json b/tests/sockets/p2p/package.json new file mode 100644 index 00000000..e94eef45 --- /dev/null +++ b/tests/sockets/p2p/package.json @@ -0,0 +1,17 @@ +{ + "name": "p2p", + "version": "0.0.1-21", + "private": true, + "scripts": { + "start": "node broker/p2p-broker.js" + }, + "dependencies": { + "lodash": "~1.0.1", + "socket.io": "~0.9.13" + }, + "engines": { + "node": "0.8.x", + "npm": "1.1.x" + }, + "subdomain": "wrtcb" +} diff --git a/tests/sockets/test_enet_client.c b/tests/sockets/test_enet_client.c index afcdcae8..b422e70c 100644 --- a/tests/sockets/test_enet_client.c +++ b/tests/sockets/test_enet_client.c @@ -1,14 +1,14 @@ #include <stdio.h> #include <string.h> #include <enet/enet.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif ENetHost * host; void main_loop() { -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ static int counter = 0; counter++; if (counter == 100) { @@ -34,7 +34,7 @@ void main_loop() { event.channelID); int result = strcmp("packetfoo", event.packet->data); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ REPORT_RESULT(); #else exit(EXIT_SUCCESS); @@ -92,7 +92,7 @@ int main (int argc, char ** argv) exit (EXIT_FAILURE); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #if USE_IFRAME emscripten_run_script("console.log('adding iframe');" "var iframe = document.createElement('iframe');" @@ -104,7 +104,7 @@ int main (int argc, char ** argv) #endif #endif -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 3, 1); #else while (1) main_loop(); diff --git a/tests/sockets/test_enet_server.c b/tests/sockets/test_enet_server.c index 9a4518ac..30d86a99 100644 --- a/tests/sockets/test_enet_server.c +++ b/tests/sockets/test_enet_server.c @@ -4,7 +4,7 @@ #include <string.h> #include <enet/enet.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -29,12 +29,12 @@ void send_msg(ENetPeer *peer) { void main_loop() { static int counter = 0; -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ counter++; #endif if (counter == 100) { printf("stop!\n"); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_cancel_main_loop(); #endif return; @@ -101,7 +101,7 @@ int main (int argc, char ** argv) exit (EXIT_FAILURE); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 3, 1); #else while (1) main_loop(); diff --git a/tests/sockets/test_getaddrinfo.c b/tests/sockets/test_getaddrinfo.c index 1f912c69..85610473 100644 --- a/tests/sockets/test_getaddrinfo.c +++ b/tests/sockets/test_getaddrinfo.c @@ -6,7 +6,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif diff --git a/tests/sockets/test_gethostbyname.c b/tests/sockets/test_gethostbyname.c index 459c6b98..c0e11efb 100644 --- a/tests/sockets/test_gethostbyname.c +++ b/tests/sockets/test_gethostbyname.c @@ -7,7 +7,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif diff --git a/tests/sockets/test_getnameinfo.c b/tests/sockets/test_getnameinfo.c index c3fec6b4..dd4a0419 100644 --- a/tests/sockets/test_getnameinfo.c +++ b/tests/sockets/test_getnameinfo.c @@ -6,7 +6,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -98,4 +98,4 @@ int main() { puts("success"); return EXIT_SUCCESS; -}
\ No newline at end of file +} diff --git a/tests/sockets/test_sockets_echo_client.c b/tests/sockets/test_sockets_echo_client.c index 684d767f..58d005c4 100644 --- a/tests/sockets/test_sockets_echo_client.c +++ b/tests/sockets/test_sockets_echo_client.c @@ -10,7 +10,7 @@ #include <fcntl.h> #include <sys/ioctl.h> #include <assert.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -42,7 +42,7 @@ void finish(int result) { close(server.fd); server.fd = 0; } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ REPORT_RESULT(); #endif exit(result); @@ -160,7 +160,7 @@ int main() { finish(EXIT_FAILURE); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 0, 0); #else while (1) main_loop(); diff --git a/tests/sockets/test_sockets_echo_server.c b/tests/sockets/test_sockets_echo_server.c index b24472e8..55898add 100644 --- a/tests/sockets/test_sockets_echo_server.c +++ b/tests/sockets/test_sockets_echo_server.c @@ -11,7 +11,7 @@ #include <sys/ioctl.h> #include <sys/types.h> #include <sys/socket.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -186,7 +186,7 @@ int main() { } #endif -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 60, 0); #else while (1) main_loop(); diff --git a/tests/sockets/test_sockets_partial_client.c b/tests/sockets/test_sockets_partial_client.c index 61084b17..2d930516 100644 --- a/tests/sockets/test_sockets_partial_client.c +++ b/tests/sockets/test_sockets_partial_client.c @@ -10,7 +10,7 @@ #include <unistd.h> #include <sys/ioctl.h> #include <assert.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -19,7 +19,7 @@ int sum = 0; void finish(int result) { close(sockfd); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ REPORT_RESULT(); #endif exit(result); @@ -108,7 +108,7 @@ int main() { finish(EXIT_FAILURE); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(iter, 0, 0); #else while (1) iter(); diff --git a/tests/sockets/test_sockets_partial_server.c b/tests/sockets/test_sockets_partial_server.c index f740c307..5c3621a0 100644 --- a/tests/sockets/test_sockets_partial_server.c +++ b/tests/sockets/test_sockets_partial_server.c @@ -11,7 +11,7 @@ #include <sys/ioctl.h> #include <sys/types.h> #include <sys/socket.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -124,7 +124,7 @@ int main() { exit(EXIT_FAILURE); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(iter, 60, 0); #else while (1) iter(); diff --git a/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c b/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c index e69c3ac0..28a81cd9 100644 --- a/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c +++ b/tests/sockets/test_sockets_select_server_closes_connection_client_rw.c @@ -10,7 +10,7 @@ #include <fcntl.h> #include <sys/ioctl.h> #include <assert.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -24,7 +24,7 @@ msg_t writemsg; void finish(int result) { close(sockfd); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ REPORT_RESULT(); #endif exit(result); @@ -216,7 +216,7 @@ int main() { finish(EXIT_FAILURE); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 0, 0); #else while (1) main_loop(); diff --git a/tests/sockets/test_sockets_select_server_down_client.c b/tests/sockets/test_sockets_select_server_down_client.c index 2765a879..5b050870 100644 --- a/tests/sockets/test_sockets_select_server_down_client.c +++ b/tests/sockets/test_sockets_select_server_down_client.c @@ -10,7 +10,7 @@ #include <fcntl.h> #include <sys/ioctl.h> #include <assert.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -20,7 +20,7 @@ int sockfd = -1; void finish(int result) { close(sockfd); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ REPORT_RESULT(); #endif exit(result); @@ -87,7 +87,7 @@ int main() { finish(EXIT_FAILURE); } -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(iter, 0, 0); #else while (1) iter(); diff --git a/tests/sockets/test_sockets_select_server_down_server.c b/tests/sockets/test_sockets_select_server_down_server.c index 012932cf..07c5c847 100644 --- a/tests/sockets/test_sockets_select_server_down_server.c +++ b/tests/sockets/test_sockets_select_server_down_server.c @@ -10,7 +10,7 @@ #include <sys/ioctl.h> #include <sys/types.h> #include <sys/socket.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -47,7 +47,7 @@ int main() { close(serverfd); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(main_loop, 60, 0); #else while (1) main_loop(); sleep(1); diff --git a/tests/sockets/webrtc_host.c b/tests/sockets/webrtc_host.c index 866c875c..38adb0f2 100644 --- a/tests/sockets/webrtc_host.c +++ b/tests/sockets/webrtc_host.c @@ -9,7 +9,7 @@ #include <unistd.h> #include <sys/ioctl.h> #include <assert.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -22,7 +22,7 @@ char buf[BUFLEN]; char expected[] = "emscripten"; struct sockaddr_in si_host, si_peer; -struct iovec iov[1]; +struct iovec iov[1]; struct msghdr hdr; int done = 0; @@ -37,8 +37,11 @@ void iter() { shutdown(sock, SHUT_RDWR); close(sock); -#if EMSCRIPTEN - int result = 1; +#ifdef __EMSCRIPTEN__ + if(strlen((char*)hdr.msg_iov[0].iov_base) == strlen(expected) && + 0 == strncmp((char*)hdr.msg_iov[0].iov_base, expected, strlen(expected))) { + result = 1; + } REPORT_RESULT(); exit(EXIT_SUCCESS); emscripten_cancel_main_loop(); @@ -68,10 +71,10 @@ int main(void) perror("cannot bind host socket"); exit(EXIT_FAILURE); } - + iov[0].iov_base = buf; iov[0].iov_len = sizeof(buf); - + memset (&hdr, 0, sizeof (struct msghdr)); hdr.msg_name = &si_peer; @@ -79,7 +82,7 @@ int main(void) hdr.msg_iov = iov; hdr.msg_iovlen = 1; -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(iter, 0, 0); #else while (!done) iter(); diff --git a/tests/sockets/webrtc_peer.c b/tests/sockets/webrtc_peer.c index dd44e93e..7b5f3a8a 100644 --- a/tests/sockets/webrtc_peer.c +++ b/tests/sockets/webrtc_peer.c @@ -9,7 +9,7 @@ #include <unistd.h> #include <sys/ioctl.h> #include <assert.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -46,7 +46,7 @@ void iter() { } int main(void) -{ +{ memset(&si_host, 0, sizeof(struct sockaddr_in)); si_host.sin_family = AF_INET; @@ -63,7 +63,7 @@ int main(void) iov[0].iov_base = buf; iov[0].iov_len = sizeof(buf); - + memset (&hdr, 0, sizeof (struct msghdr)); hdr.msg_name = &si_host; @@ -71,7 +71,7 @@ int main(void) hdr.msg_iov = iov; hdr.msg_iovlen = 1; -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ emscripten_set_main_loop(iter, 0, 0); #else while (!done) iter(); diff --git a/tests/sqlite/benchmark.c b/tests/sqlite/benchmark.c index de800742..04dc150a 100644 --- a/tests/sqlite/benchmark.c +++ b/tests/sqlite/benchmark.c @@ -1,5 +1,6 @@ #include <time.h> #include <stdio.h> +#include <stdlib.h> #include <sqlite3.h> #include <emscripten.h> diff --git a/tests/sqlite/sqlite3.c b/tests/sqlite/sqlite3.c index bcbb7cdd..2d7c7725 100644 --- a/tests/sqlite/sqlite3.c +++ b/tests/sqlite/sqlite3.c @@ -38132,9 +38132,6 @@ static int writeJournalHdr(Pager *pPager){ u32 nHeader = (u32)pPager->pageSize;/* Size of buffer pointed to by zHeader */ u32 nWrite; /* Bytes of header sector written */ int ii; /* Loop counter */ -#ifdef EMSCRIPTEN - u8 temp[4]; -#endif assert( isOpen(pPager->jfd) ); /* Journal file must be open. */ @@ -38185,12 +38182,7 @@ static int writeJournalHdr(Pager *pPager){ } /* The random check-hash initialiser */ -#ifdef EMSCRIPTEN - sqlite3_randomness(sizeof(pPager->cksumInit), temp); - pPager->cksumInit = temp[0] + (((u32)temp[1]) << 8) + (((u32)temp[2]) << 16) + (((u32)temp[3]) << 24); -#else sqlite3_randomness(sizeof(pPager->cksumInit), &pPager->cksumInit); -#endif put32bits(&zHeader[sizeof(aJournalMagic)+4], pPager->cksumInit); /* The initial database size */ put32bits(&zHeader[sizeof(aJournalMagic)+8], pPager->dbOrigSize); @@ -52942,12 +52934,7 @@ static void dropCell(MemPage *pPage, int idx, int sz, int *pRC){ endPtr = &data[pPage->cellOffset + 2*pPage->nCell - 2]; assert( (SQLITE_PTR_TO_INT(ptr)&1)==0 ); /* ptr is always 2-byte aligned */ while( ptr<endPtr ){ -#ifdef EMSCRIPTEN - ptr[0] = ptr[2]; - ptr[1] = ptr[3]; -#else *(u16*)ptr = *(u16*)&ptr[2]; -#endif ptr += 2; } pPage->nCell--; @@ -53043,12 +53030,7 @@ static void insertCell( endPtr = &data[ins]; assert( (SQLITE_PTR_TO_INT(ptr)&1)==0 ); /* ptr is always 2-byte aligned */ while( ptr>endPtr ){ -#ifdef EMSCRIPTEN - ptr[0] = ptr[-2]; - ptr[1] = ptr[-1]; -#else *(u16*)ptr = *(u16*)&ptr[-2]; -#endif ptr -= 2; } put2byte(&data[ins], idx); diff --git a/tests/stat/test_mknod.c b/tests/stat/test_mknod.c index 361b2315..262c8a5f 100644 --- a/tests/stat/test_mknod.c +++ b/tests/stat/test_mknod.c @@ -32,7 +32,7 @@ void test() { // than a FIFO. so, the tests are disabled when running // natively as they'd be utterly inconsistent. // -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ // mknod a folder err = mknod("mknod-folder", S_IFDIR | 0777, 0); diff --git a/tests/stat/test_stat.c b/tests/stat/test_stat.c index f59fb3c3..e14ebdc5 100644 --- a/tests/stat/test_stat.c +++ b/tests/stat/test_stat.c @@ -55,7 +55,7 @@ void test() { assert(s.st_atime == 1200000000); assert(s.st_mtime == 1200000000); assert(s.st_ctime); -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); assert(s.st_blocks == 1); #endif @@ -73,7 +73,7 @@ void test() { assert(s.st_atime == 1200000000); assert(s.st_mtime == 1200000000); assert(s.st_ctime); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); assert(s.st_blocks == 1); #endif @@ -91,7 +91,7 @@ void test() { assert(s.st_atime == 1200000000); assert(s.st_mtime == 1200000000); assert(s.st_ctime); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); assert(s.st_blocks == 1); #endif @@ -112,7 +112,7 @@ void test() { assert(s.st_atime); assert(s.st_mtime); assert(s.st_ctime); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); assert(s.st_blocks == 0); #endif @@ -130,7 +130,7 @@ void test() { assert(s.st_atime == 1200000000); assert(s.st_mtime == 1200000000); assert(s.st_ctime); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); assert(s.st_blocks == 1); #endif @@ -148,7 +148,7 @@ void test() { assert(s.st_atime != 1200000000); // should NOT match the utime call we did for dir/file assert(s.st_mtime != 1200000000); assert(s.st_ctime); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ assert(s.st_blksize == 4096); assert(s.st_blocks == 1); #endif diff --git a/tests/test_benchmark.py b/tests/test_benchmark.py index 023ac1e2..735f0feb 100644 --- a/tests/test_benchmark.py +++ b/tests/test_benchmark.py @@ -20,9 +20,10 @@ class Benchmarker: def __init__(self, name): self.name = name - def bench(self, args, output_parser=None): + def bench(self, args, output_parser=None, reps=TEST_REPS): self.times = [] - for i in range(TEST_REPS): + self.reps = reps + for i in range(reps): start = time.time() output = self.run(args) if not output_parser: @@ -41,7 +42,7 @@ class Benchmarker: sorted_times.sort() median = sum(sorted_times[len(sorted_times)/2 - 1:len(sorted_times)/2 + 1])/2 - print ' %10s: mean: %4.3f (+-%4.3f) secs median: %4.3f range: %4.3f-%4.3f (noise: %4.3f%%) (%d runs)' % (self.name, mean, std, median, min(self.times), max(self.times), 100*std/mean, TEST_REPS), + print ' %10s: mean: %4.3f (+-%4.3f) secs median: %4.3f range: %4.3f-%4.3f (noise: %4.3f%%) (%d runs)' % (self.name, mean, std, median, min(self.times), max(self.times), 100*std/mean, self.reps), if baseline: mean_baseline = sum(baseline.times)/len(baseline.times) @@ -110,8 +111,7 @@ process(sys.argv[1]) '-O3', '-s', 'DOUBLE_MODE=0', '-s', 'PRECISE_I64_MATH=0', '--memory-init-file', '0', '--js-transform', 'python hardcode.py', '-s', 'TOTAL_MEMORY=128*1024*1024', - #'--closure', '1', - #'-g2', + #'-profiling', '-o', final] + shared_args + emcc_args + self.extra_args, stdout=PIPE, stderr=PIPE, env=self.env).communicate() assert os.path.exists(final), 'Failed to compile file: ' + output[0] self.filename = final @@ -130,11 +130,11 @@ try: #NativeBenchmarker('clang-3.4', os.path.join(LLVM_3_4, 'clang'), os.path.join(LLVM_3_4, 'clang++')), #NativeBenchmarker('gcc', 'gcc', 'g++'), JSBenchmarker('sm-f32', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2']), + #JSBenchmarker('sm-f32-si', SPIDERMONKEY_ENGINE, ['-profiling', '-s', 'PRECISE_F32=2', '-s', 'SIMPLIFY_IFS=1']), #JSBenchmarker('sm-f32-aggro', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2', '-s', 'AGGRESSIVE_VARIABLE_ELIMINATION=1']), #JSBenchmarker('sm-f32-3.2', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_2 }), #JSBenchmarker('sm-f32-3.3', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_3 }), #JSBenchmarker('sm-f32-3.4', SPIDERMONKEY_ENGINE, ['-s', 'PRECISE_F32=2'], env={ 'LLVM': LLVM_3_4 }), - #JSBenchmarker('sm-fc', SPIDERMONKEY_ENGINE, env={ 'EMCC_FAST_COMPILER': '1' }), #JSBenchmarker('sm-noasm', SPIDERMONKEY_ENGINE + ['--no-asmjs']), #JSBenchmarker('sm-noasm-f32', SPIDERMONKEY_ENGINE + ['--no-asmjs'], ['-s', 'PRECISE_F32=2']), #JSBenchmarker('v8', V8_ENGINE) @@ -193,7 +193,7 @@ class benchmark(RunnerCore): print for b in benchmarkers: b.build(self, filename, args, shared_args, emcc_args, native_args, native_exec, lib_builder) - b.bench(args, output_parser) + b.bench(args, output_parser, reps) b.display(benchmarkers[0]) def test_primes(self): @@ -362,6 +362,51 @@ class benchmark(RunnerCore): ''' self.do_benchmark('copy', src, 'sum:') + def test_ifs(self): + src = r''' + #include <stdio.h> + #include <stdlib.h> + + volatile int x = 0; + + __attribute__ ((noinline)) int calc() { + return (x++) & 16384; + } + + int main(int argc, char *argv[]) { + int arg = argc > 1 ? argv[1][0] - '0' : 3; + switch(arg) { + case 0: return 0; break; + case 1: arg = 75; break; + case 2: arg = 625; break; + case 3: arg = 1250; break; + case 4: arg = 5*1250; break; + case 5: arg = 10*1250; break; + default: printf("error: %d\\n", arg); return -1; + } + + int sum = 0; + + for (int j = 0; j < 27000; j++) { + for (int i = 0; i < arg; i++) { + if (calc() && calc()) { + sum += 17; + } else { + sum += 19; + } + if (calc() || calc()) { + sum += 23; + } + } + } + + printf("ok\n"); + + return sum; + } + ''' + self.do_benchmark('ifs', src, 'ok', reps=TEST_REPS*5) + def test_fannkuch(self): src = open(path_from_root('tests', 'fannkuch.cpp'), 'r').read().replace( 'int n = argc > 1 ? atoi(argv[1]) : 0;', diff --git a/tests/test_browser.py b/tests/test_browser.py index c1d1caab..c06f11ac 100644 --- a/tests/test_browser.py +++ b/tests/test_browser.py @@ -1,5 +1,5 @@ import BaseHTTPServer, multiprocessing, os, shutil, subprocess, unittest, zlib, webbrowser, time, shlex -from runner import BrowserCore, path_from_root +from runner import BrowserCore, path_from_root, nonfastcomp from tools.shared import * # User can specify an environment variable EMSCRIPTEN_BROWSER to force the browser test suite to @@ -51,23 +51,6 @@ def test_chunked_synchronous_xhr_server(support_byte_ranges, chunkSize, data, ch httpd.handle_request() class browser(BrowserCore): - @staticmethod - def audio(): - print - print 'Running the browser audio tests. Make sure to listen to hear the correct results!' - print - audio_test_cases = [ - 'test_sdl_audio', - 'test_sdl_audio_mix_channels', - 'test_sdl_audio_mix', - 'test_sdl_audio_quickload', - 'test_sdl_audio_beeps', - 'test_openal_playback', - 'test_openal_buffers', - 'test_freealut' - ] - return unittest.TestSuite(map(browser, audio_test_cases)) - @classmethod def setUpClass(self): super(browser, self).setUpClass() @@ -120,8 +103,6 @@ If manually bisecting: ''' def test_emscripten_log(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('fastcomp uses asm, where call stacks are sometimes less clear') - src = os.path.join(self.get_dir(), 'src.cpp') open(src, 'w').write(self.with_report_result(open(path_from_root('tests', 'emscripten_log', 'emscripten_log.cpp')).read())) @@ -143,191 +124,193 @@ If manually bisecting: os.chdir(cwd) def test_split(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('no --split in fastcomp, deprecated') + def nfc(): + # test HTML generation. + self.reftest(path_from_root('tests', 'htmltest.png')) + output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '--split', '100', '--pre-js', 'reftest.js']).communicate() + assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file' + assert os.path.exists(os.path.join(self.get_dir(), 'something_functions.js')), 'must be functions js file' + assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file' - # test HTML generation. - self.reftest(path_from_root('tests', 'htmltest.png')) - output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '--split', '100', '--pre-js', 'reftest.js']).communicate() - assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file' - assert os.path.exists(os.path.join(self.get_dir(), 'something_functions.js')), 'must be functions js file' - assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file' - - open(os.path.join(self.get_dir(), 'something.html'), 'w').write(''' - - <!doctype html> - <html lang="en-us"> - <head> - <meta charset="utf-8"> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <title>Emscripten-Generated Code</title> - <style> - .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; } - canvas.emscripten { border: 1px solid black; } - textarea.emscripten { font-family: monospace; width: 80%; } - div.emscripten { text-align: center; } - </style> - </head> - <body> - <hr/> - <div class="emscripten" id="status">Downloading...</div> - <div class="emscripten"> - <progress value="0" max="100" id="progress" hidden=1></progress> - </div> - <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> - <hr/> - <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div> - <hr/> - <textarea class="emscripten" id="output" rows="8"></textarea> - <hr> - <script type='text/javascript'> - // connect to canvas - var Module = { - preRun: [], - postRun: [], - print: (function() { - var element = document.getElementById('output'); - element.value = ''; // clear browser cache - return function(text) { - // These replacements are necessary if you render to raw HTML - //text = text.replace(/&/g, "&"); - //text = text.replace(/</g, "<"); - //text = text.replace(/>/g, ">"); - //text = text.replace('\\n', '<br>', 'g'); - element.value += text + "\\n"; - element.scrollTop = element.scrollHeight; // focus on bottom - }; - })(), - printErr: function(text) { - if (0) { // XXX disabled for safety typeof dump == 'function') { - dump(text + '\\n'); // fast, straight to the real console - } else { - console.log(text); - } - }, - canvas: document.getElementById('canvas'), - setStatus: function(text) { - if (Module.setStatus.interval) clearInterval(Module.setStatus.interval); - var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); - var statusElement = document.getElementById('status'); - var progressElement = document.getElementById('progress'); - if (m) { - text = m[1]; - progressElement.value = parseInt(m[2])*100; - progressElement.max = parseInt(m[4])*100; - progressElement.hidden = false; - } else { - progressElement.value = null; - progressElement.max = null; - progressElement.hidden = true; + open(os.path.join(self.get_dir(), 'something.html'), 'w').write(''' + + <!doctype html> + <html lang="en-us"> + <head> + <meta charset="utf-8"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Emscripten-Generated Code</title> + <style> + .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; } + canvas.emscripten { border: 1px solid black; } + textarea.emscripten { font-family: monospace; width: 80%; } + div.emscripten { text-align: center; } + </style> + </head> + <body> + <hr/> + <div class="emscripten" id="status">Downloading...</div> + <div class="emscripten"> + <progress value="0" max="100" id="progress" hidden=1></progress> + </div> + <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> + <hr/> + <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div> + <hr/> + <textarea class="emscripten" id="output" rows="8"></textarea> + <hr> + <script type='text/javascript'> + // connect to canvas + var Module = { + preRun: [], + postRun: [], + print: (function() { + var element = document.getElementById('output'); + element.value = ''; // clear browser cache + return function(text) { + // These replacements are necessary if you render to raw HTML + //text = text.replace(/&/g, "&"); + //text = text.replace(/</g, "<"); + //text = text.replace(/>/g, ">"); + //text = text.replace('\\n', '<br>', 'g'); + element.value += text + "\\n"; + element.scrollTop = element.scrollHeight; // focus on bottom + }; + })(), + printErr: function(text) { + if (0) { // XXX disabled for safety typeof dump == 'function') { + dump(text + '\\n'); // fast, straight to the real console + } else { + console.log(text); + } + }, + canvas: document.getElementById('canvas'), + setStatus: function(text) { + if (Module.setStatus.interval) clearInterval(Module.setStatus.interval); + var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); + var statusElement = document.getElementById('status'); + var progressElement = document.getElementById('progress'); + if (m) { + text = m[1]; + progressElement.value = parseInt(m[2])*100; + progressElement.max = parseInt(m[4])*100; + progressElement.hidden = false; + } else { + progressElement.value = null; + progressElement.max = null; + progressElement.hidden = true; + } + statusElement.innerHTML = text; + }, + totalDependencies: 0, + monitorRunDependencies: function(left) { + this.totalDependencies = Math.max(this.totalDependencies, left); + Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); } - statusElement.innerHTML = text; - }, - totalDependencies: 0, - monitorRunDependencies: function(left) { - this.totalDependencies = Math.max(this.totalDependencies, left); - Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); - } - }; - Module.setStatus('Downloading...'); - </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + ''' - </body> - </html> - ''') + }; + Module.setStatus('Downloading...'); + </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + ''' + </body> + </html> + ''') - self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0') + self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0') + + nonfastcomp(nfc) def test_split_in_source_filenames(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('no --split in fastcomp, deprecated') - - self.reftest(path_from_root('tests', 'htmltest.png')) - output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '-g', '--split', '100', '--pre-js', 'reftest.js']).communicate() - assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file' - assert os.path.exists(os.path.join(self.get_dir(), 'something', 'hello_world_sdl.cpp.js')), 'must be functions js file' - assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file' - - open(os.path.join(self.get_dir(), 'something.html'), 'w').write(''' - - <!doctype html> - <html lang="en-us"> - <head> - <meta charset="utf-8"> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <title>Emscripten-Generated Code</title> - <style> - .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; } - canvas.emscripten { border: 1px solid black; } - textarea.emscripten { font-family: monospace; width: 80%; } - div.emscripten { text-align: center; } - </style> - </head> - <body> - <hr/> - <div class="emscripten" id="status">Downloading...</div> - <div class="emscripten"> - <progress value="0" max="100" id="progress" hidden=1></progress> - </div> - <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> - <hr/> - <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div> - <hr/> - <textarea class="emscripten" id="output" rows="8"></textarea> - <hr> - <script type='text/javascript'> - // connect to canvas - var Module = { - preRun: [], - postRun: [], - print: (function() { - var element = document.getElementById('output'); - element.value = ''; // clear browser cache - return function(text) { - // These replacements are necessary if you render to raw HTML - //text = text.replace(/&/g, "&"); - //text = text.replace(/</g, "<"); - //text = text.replace(/>/g, ">"); - //text = text.replace('\\n', '<br>', 'g'); - element.value += text + "\\n"; - element.scrollTop = element.scrollHeight; // focus on bottom - }; - })(), - printErr: function(text) { - if (0) { // XXX disabled for safety typeof dump == 'function') { - dump(text + '\\n'); // fast, straight to the real console - } else { - console.log(text); - } - }, - canvas: document.getElementById('canvas'), - setStatus: function(text) { - if (Module.setStatus.interval) clearInterval(Module.setStatus.interval); - var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); - var statusElement = document.getElementById('status'); - var progressElement = document.getElementById('progress'); - if (m) { - text = m[1]; - progressElement.value = parseInt(m[2])*100; - progressElement.max = parseInt(m[4])*100; - progressElement.hidden = false; - } else { - progressElement.value = null; - progressElement.max = null; - progressElement.hidden = true; + def nfc(): + self.reftest(path_from_root('tests', 'htmltest.png')) + output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '-g', '--split', '100', '--pre-js', 'reftest.js']).communicate() + assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be main js file' + assert os.path.exists(os.path.join(self.get_dir(), 'something', 'hello_world_sdl.cpp.js')), 'must be functions js file' + assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be js include file' + + open(os.path.join(self.get_dir(), 'something.html'), 'w').write(''' + + <!doctype html> + <html lang="en-us"> + <head> + <meta charset="utf-8"> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <title>Emscripten-Generated Code</title> + <style> + .emscripten { padding-right: 0; margin-left: auto; margin-right: auto; display: block; } + canvas.emscripten { border: 1px solid black; } + textarea.emscripten { font-family: monospace; width: 80%; } + div.emscripten { text-align: center; } + </style> + </head> + <body> + <hr/> + <div class="emscripten" id="status">Downloading...</div> + <div class="emscripten"> + <progress value="0" max="100" id="progress" hidden=1></progress> + </div> + <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> + <hr/> + <div class="emscripten"><input type="button" value="fullscreen" onclick="Module.requestFullScreen()"></div> + <hr/> + <textarea class="emscripten" id="output" rows="8"></textarea> + <hr> + <script type='text/javascript'> + // connect to canvas + var Module = { + preRun: [], + postRun: [], + print: (function() { + var element = document.getElementById('output'); + element.value = ''; // clear browser cache + return function(text) { + // These replacements are necessary if you render to raw HTML + //text = text.replace(/&/g, "&"); + //text = text.replace(/</g, "<"); + //text = text.replace(/>/g, ">"); + //text = text.replace('\\n', '<br>', 'g'); + element.value += text + "\\n"; + element.scrollTop = element.scrollHeight; // focus on bottom + }; + })(), + printErr: function(text) { + if (0) { // XXX disabled for safety typeof dump == 'function') { + dump(text + '\\n'); // fast, straight to the real console + } else { + console.log(text); + } + }, + canvas: document.getElementById('canvas'), + setStatus: function(text) { + if (Module.setStatus.interval) clearInterval(Module.setStatus.interval); + var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/); + var statusElement = document.getElementById('status'); + var progressElement = document.getElementById('progress'); + if (m) { + text = m[1]; + progressElement.value = parseInt(m[2])*100; + progressElement.max = parseInt(m[4])*100; + progressElement.hidden = false; + } else { + progressElement.value = null; + progressElement.max = null; + progressElement.hidden = true; + } + statusElement.innerHTML = text; + }, + totalDependencies: 0, + monitorRunDependencies: function(left) { + this.totalDependencies = Math.max(this.totalDependencies, left); + Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); } - statusElement.innerHTML = text; - }, - totalDependencies: 0, - monitorRunDependencies: function(left) { - this.totalDependencies = Math.max(this.totalDependencies, left); - Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.'); - } - }; - Module.setStatus('Downloading...'); - </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + ''' - </body> - </html> - ''') + }; + Module.setStatus('Downloading...'); + </script>''' + open(os.path.join(self.get_dir(), 'something.include.html')).read() + ''' + </body> + </html> + ''') - self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0') + self.run_browser('something.html', 'You should see "hello, world!" and a colored cube.', '/report_result?0') + + nonfastcomp(nfc) def test_compression(self): open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(self.with_report_result(r''' @@ -732,9 +715,9 @@ If manually bisecting: self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1']) # some extra coverage self.clear() - self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1', '-s', '-O0', '-s', 'SAFE_HEAP=1']) + self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1', '-O0', '-s', 'SAFE_HEAP=1']) self.clear() - self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1', '-s', '-O2', '-s', 'SAFE_HEAP=1']) + self.btest('sdl_canvas.c', expected='1', args=['-s', 'LEGACY_GL_EMULATION=1', '-O2', '-s', 'SAFE_HEAP=1']) def test_sdl_canvas_proxy(self): def post(): @@ -1130,47 +1113,6 @@ keydown(100);keyup(100); // trigger the end ''') self.btest('sdl_pumpevents.c', expected='7', args=['--pre-js', 'pre.js']) - def test_sdl_audio(self): - shutil.copyfile(path_from_root('tests', 'sounds', 'alarmvictory_1.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) - shutil.copyfile(path_from_root('tests', 'sounds', 'alarmcreatemiltaryfoot_1.wav'), os.path.join(self.get_dir(), 'sound2.wav')) - shutil.copyfile(path_from_root('tests', 'sounds', 'noise.ogg'), os.path.join(self.get_dir(), 'noise.ogg')) - shutil.copyfile(path_from_root('tests', 'sounds', 'the_entertainer.ogg'), os.path.join(self.get_dir(), 'the_entertainer.ogg')) - open(os.path.join(self.get_dir(), 'bad.ogg'), 'w').write('I claim to be audio, but am lying') - open(os.path.join(self.get_dir(), 'sdl_audio.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio.c')).read())) - - # use closure to check for a possible bug with closure minifying away newer Audio() attributes - Popen([PYTHON, EMCC, '-O2', '--closure', '1', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio.c'), '--preload-file', 'sound.ogg', '--preload-file', 'sound2.wav', '--embed-file', 'the_entertainer.ogg', '--preload-file', 'noise.ogg', '--preload-file', 'bad.ogg', '-o', 'page.html', '-s', 'EXPORTED_FUNCTIONS=["_main", "_play", "_play2"]']).communicate() - self.run_browser('page.html', '', '/report_result?1') - - def test_sdl_audio_mix_channels(self): - shutil.copyfile(path_from_root('tests', 'sounds', 'noise.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) - open(os.path.join(self.get_dir(), 'sdl_audio_mix_channels.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_mix_channels.c')).read())) - - Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_mix_channels.c'), '--preload-file', 'sound.ogg', '-o', 'page.html']).communicate() - self.run_browser('page.html', '', '/report_result?1') - - def test_sdl_audio_mix(self): - shutil.copyfile(path_from_root('tests', 'sounds', 'pluck.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) - shutil.copyfile(path_from_root('tests', 'sounds', 'the_entertainer.ogg'), os.path.join(self.get_dir(), 'music.ogg')) - shutil.copyfile(path_from_root('tests', 'sounds', 'noise.ogg'), os.path.join(self.get_dir(), 'noise.ogg')) - open(os.path.join(self.get_dir(), 'sdl_audio_mix.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_mix.c')).read())) - - Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_mix.c'), '--preload-file', 'sound.ogg', '--preload-file', 'music.ogg', '--preload-file', 'noise.ogg', '-o', 'page.html']).communicate() - self.run_browser('page.html', '', '/report_result?1') - - def test_sdl_audio_quickload(self): - open(os.path.join(self.get_dir(), 'sdl_audio_quickload.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_quickload.c')).read())) - - Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_quickload.c'), '-o', 'page.html', '-s', 'EXPORTED_FUNCTIONS=["_main", "_play"]']).communicate() - self.run_browser('page.html', '', '/report_result?1') - - def test_sdl_audio_beeps(self): - open(os.path.join(self.get_dir(), 'sdl_audio_beep.cpp'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_beep.cpp')).read())) - - # use closure to check for a possible bug with closure minifying away newer Audio() attributes - Popen([PYTHON, EMCC, '-O2', '--closure', '1', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_beep.cpp'), '-s', 'DISABLE_EXCEPTION_CATCHING=0', '-o', 'page.html']).communicate() - self.run_browser('page.html', '', '/report_result?1') - def test_sdl_canvas_size(self): self.btest('sdl_canvas_size.c', reference='screenshot-gray-purple.png', reference_slack=1, args=['-O2', '--minify', '0', '--shell-file', path_from_root('tests', 'sdl_canvas_size.html'), '--preload-file', path_from_root('tests', 'screenshot.png') + '@/', '-s', 'LEGACY_GL_EMULATION=1'], @@ -1236,17 +1178,6 @@ keydown(100);keyup(100); // trigger the end args=['--preload-file', 'screenshot.png', '-s', 'LEGACY_GL_EMULATION=1'], message='You should see an image with fog.') - def test_openal_playback(self): - shutil.copyfile(path_from_root('tests', 'sounds', 'audio.wav'), os.path.join(self.get_dir(), 'audio.wav')) - open(os.path.join(self.get_dir(), 'openal_playback.cpp'), 'w').write(self.with_report_result(open(path_from_root('tests', 'openal_playback.cpp')).read())) - - Popen([PYTHON, EMCC, '-O2', os.path.join(self.get_dir(), 'openal_playback.cpp'), '--preload-file', 'audio.wav', '-o', 'page.html']).communicate() - self.run_browser('page.html', '', '/report_result?1') - - def test_openal_buffers(self): - shutil.copyfile(path_from_root('tests', 'sounds', 'the_entertainer.wav'), os.path.join(self.get_dir(), 'the_entertainer.wav')) - self.btest('openal_buffers.c', '0', args=['--preload-file', 'the_entertainer.wav'],) - def test_glfw(self): self.btest('glfw.c', '1', args=['-s', 'LEGACY_GL_EMULATION=1']) @@ -1262,19 +1193,6 @@ keydown(100);keyup(100); // trigger the end Popen([PYTHON, EMCC, '-O2', os.path.join(self.get_dir(), 'test_egl_width_height.c'), '-o', 'page.html']).communicate() self.run_browser('page.html', 'Should print "(300, 150)" -- the size of the canvas in pixels', '/report_result?1') - def get_freealut_library(self): - if WINDOWS and Building.which('cmake'): - return self.get_library('freealut', os.path.join('hello_world.bc'), configure=['cmake', '.'], configure_args=['-DBUILD_TESTS=ON']) - else: - return self.get_library('freealut', os.path.join('examples', '.libs', 'hello_world.bc'), make_args=['EXEEXT=.bc']) - - def test_freealut(self): - programs = self.get_freealut_library() - for program in programs: - assert os.path.exists(program) - Popen([PYTHON, EMCC, '-O2', program, '-o', 'page.html']).communicate() - self.run_browser('page.html', 'You should hear "Hello World!"') - def test_worker(self): # Test running in a web worker open('file.dat', 'w').write('data for worker') @@ -1386,6 +1304,9 @@ keydown(100);keyup(100); // trigger the end args=['-DHAVE_BUILTIN_SINCOS'], outfile='something.html', message='You should see animating gears.') + def test_glgears_long(self): + self.btest('hello_world_gles.c', expected=map(str, range(30, 1000)), args=['-DHAVE_BUILTIN_SINCOS', '-DLONGTEST']) + def test_glgears_animation(self): es2_suffix = ['', '_full', '_full_944'] for full_es2 in [0, 1, 2]: @@ -1495,11 +1416,6 @@ keydown(100);keyup(100); // trigger the end def test_sdl_resize(self): self.btest('sdl_resize.c', '1') - def test_gc(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('flaky in fastcomp and also non-fastcomp -O1, timing issues') - - self.btest('browser_gc.cpp', '1') - def test_glshaderinfo(self): self.btest('glshaderinfo.cpp', '1') @@ -1671,6 +1587,9 @@ void *getBindBuffer() { def test_sdl_surface_refcount(self): self.btest('sdl_surface_refcount.c', expected='1') + def test_sdl_free_screen(self): + self.btest('sdl_free_screen.cpp', reference='htmltest.png') + def test_glbegin_points(self): shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png')) self.btest('glbegin_points.c', reference='glbegin_points.png', args=['--preload-file', 'screenshot.png', '-s', 'LEGACY_GL_EMULATION=1']) @@ -1706,7 +1625,7 @@ void *getBindBuffer() { self.btest('s3tc_crunch.c', reference='s3tc_crunch.png', reference_slack=11, args=['--pre-js', 'asset_a.js', '--pre-js', 'asset_b.js', '-s', 'LEGACY_GL_EMULATION=1']) def test_aniso(self): - if SPIDERMONKEY_ENGINE in JS_ENGINES and os.environ.get('EMCC_FAST_COMPILER') != '1': + if SPIDERMONKEY_ENGINE in JS_ENGINES: # asm.js-ification check Popen([PYTHON, EMCC, path_from_root('tests', 'aniso.c'), '-O2', '-g2', '-s', 'LEGACY_GL_EMULATION=1']).communicate() Settings.ASM_JS = 1 @@ -1754,6 +1673,23 @@ void *getBindBuffer() { for mem in [0, 1]: self.btest('pre_run_deps.cpp', expected='10', args=['--pre-js', 'pre.js', '--memory-init-file', str(mem)]) + def test_mem_init(self): + open(os.path.join(self.get_dir(), 'pre.js'), 'w').write(''' + function myJSCallback() { // called from main() + Module._note(1); + } + Module.preRun = function() { + addOnPreMain(function() { + Module._note(2); + }); + }; + ''') + open(os.path.join(self.get_dir(), 'post.js'), 'w').write(''' + Module._note(4); // this happens too early! and is overwritten when the mem init arrives + ''') + + self.btest('mem_init.cpp', expected='3', args=['--pre-js', 'pre.js', '--post-js', 'post.js', '--memory-init-file', '1']) + def test_worker_api(self): Popen([PYTHON, EMCC, path_from_root('tests', 'worker_api_worker.cpp'), '-o', 'worker.js', '-s', 'BUILD_AS_WORKER=1', '-s', 'EXPORTED_FUNCTIONS=["_one"]']).communicate() self.btest('worker_api_main.cpp', expected='566') @@ -1762,14 +1698,18 @@ void *getBindBuffer() { Popen([PYTHON, EMCC, path_from_root('tests', 'worker_api_2_worker.cpp'), '-o', 'worker.js', '-s', 'BUILD_AS_WORKER=1', '-O2', '--minify', '0', '-s', 'EXPORTED_FUNCTIONS=["_one", "_two", "_three", "_four"]']).communicate() self.btest('worker_api_2_main.cpp', args=['-O2', '--minify', '0'], expected='11') + def test_worker_api_3(self): + Popen([PYTHON, EMCC, path_from_root('tests', 'worker_api_3_worker.cpp'), '-o', 'worker.js', '-s', 'BUILD_AS_WORKER=1', '-s', 'EXPORTED_FUNCTIONS=["_one"]']).communicate() + self.btest('worker_api_3_main.cpp', expected='5') + def test_emscripten_async_wget2(self): self.btest('http.cpp', expected='0', args=['-I' + path_from_root('tests')]) def test_module(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') - - Popen([PYTHON, EMCC, path_from_root('tests', 'browser_module.cpp'), '-o', 'module.js', '-O2', '-s', 'SIDE_MODULE=1', '-s', 'DLOPEN_SUPPORT=1', '-s', 'EXPORTED_FUNCTIONS=["_one", "_two"]']).communicate() - self.btest('browser_main.cpp', args=['-O2', '-s', 'MAIN_MODULE=1', '-s', 'DLOPEN_SUPPORT=1'], expected='8') + def nfc(): + Popen([PYTHON, EMCC, path_from_root('tests', 'browser_module.cpp'), '-o', 'module.js', '-O2', '-s', 'SIDE_MODULE=1', '-s', 'DLOPEN_SUPPORT=1', '-s', 'EXPORTED_FUNCTIONS=["_one", "_two"]']).communicate() + self.btest('browser_main.cpp', args=['-O2', '-s', 'MAIN_MODULE=1', '-s', 'DLOPEN_SUPPORT=1'], expected='8') + nonfastcomp(nfc) def test_mmap_file(self): open(self.in_dir('data.dat'), 'w').write('data from the file ' + ('.' * 9000)) @@ -1849,7 +1789,19 @@ Module["preRun"].push(function () { self.btest('doublestart.c', args=['--pre-js', 'pre.js', '-o', 'test.html'], expected='1') def test_html5(self): - self.btest(path_from_root('tests', 'test_html5.c'), expected='0') + for opts in [[], ['-O2', '-g1', '--closure', '1']]: + print opts + self.btest(path_from_root('tests', 'test_html5.c'), args=opts, expected='0') + + def test_sdl_touch(self): + for opts in [[], ['-O2', '-g1', '--closure', '1']]: + print opts + self.btest(path_from_root('tests', 'sdl_touch.c'), args=opts + ['-DAUTOMATE_SUCCESS=1'], expected='0') + + def test_html5_mouse(self): + for opts in [[], ['-O2', '-g1', '--closure', '1']]: + print opts + self.btest(path_from_root('tests', 'test_html5_mouse.c'), args=opts + ['-DAUTOMATE_SUCCESS=1'], expected='0') def test_codemods(self): for opt_level in [0, 2]: diff --git a/tests/test_core.py b/tests/test_core.py index c4bfcfa3..b5024309 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -6,7 +6,7 @@ from tools.shared import * from runner import RunnerCore, path_from_root, checked_sanity, test_modes, get_bullet_library class T(RunnerCore): # Short name, to make it more fun to use manually on the commandline - def is_le32(self): + def is_emscripten_abi(self): return not ('i386-pc-linux-gnu' in COMPILER_OPTS or self.env.get('EMCC_LLVM_TARGET') == 'i386-pc-linux-gnu') def test_hello_world(self): @@ -504,41 +504,62 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run(open(path_from_root('tests', 'sha1.c')).read(), 'SHA1=15dd99a1991e0b3826fede3deffc1feba42278e6') + def test_asmjs_unknown_emscripten(self): + if self.emcc_args == None: return self.skip('needs emcc') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for asmjs-unknown-emscripten target test') + if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('fastcomp needed for asmjs-unknonw-emscripten target') + self.do_run(open(path_from_root('tests', 'asmjs-unknown-emscripten.c')).read(), '') + def test_cube2md5(self): if self.emcc_args == None: return self.skip('needs emcc') - if not self.is_le32(): return self.skip('le32 needed for accurate math') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math') self.emcc_args += ['--embed-file', 'cube2md5.txt'] shutil.copyfile(path_from_root('tests', 'cube2md5.txt'), os.path.join(self.get_dir(), 'cube2md5.txt')) self.do_run(open(path_from_root('tests', 'cube2md5.cpp')).read(), open(path_from_root('tests', 'cube2md5.ok')).read()) def test_cube2hash(self): - try: - old_chunk_size = os.environ.get('EMSCRIPT_MAX_CHUNK_SIZE') or '' - os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = '1' # test splitting out each function to a chunk in emscripten.py (21 functions here) - - # A good test of i64 math - if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2 C-style memory aliasing') - self.do_run('', 'Usage: hashstring <seed>', - libraries=self.get_library('cube2hash', ['cube2hash.bc'], configure=None), - includes=[path_from_root('tests', 'cube2hash')]) - - for text, output in [('fleefl', '892BDB6FD3F62E863D63DA55851700FDE3ACF30204798CE9'), - ('fleefl2', 'AA2CC5F96FC9D540CA24FDAF1F71E2942753DB83E8A81B61'), - ('64bitisslow', '64D8470573635EC354FEE7B7F87C566FCAF1EFB491041670')]: - self.do_run('', 'hash value: ' + output, [text], no_build=True) - finally: - os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = old_chunk_size - - assert 'asm1' in test_modes - if self.run_name == 'asm1' and not os.environ.get('EMCC_FAST_COMPILER'): - assert Settings.RELOOP - generated = open('src.cpp.o.js').read() - main = generated[generated.find('function _main'):] - main = main[:main.find('\n}')] - num_vars = 0 - for v in re.findall('var [^;]+;', main): - num_vars += v.count(',') + 1 - assert num_vars == 10, 'no variable elimination should have been run, but seeing %d' % num_vars + # extra testing for various codegen modes + for x86 in [0, 1] if self.run_name == 'asm2' else [0]: + print 'x86', x86 + try: + old_x86 = os.environ.get('EMCC_LLVM_TARGET') or '' + if x86: + os.environ['EMCC_LLVM_TARGET'] = "i386-pc-linux-gnu" + try: + old_fastcomp = os.environ.get('EMCC_FAST_COMPILER') or '' + if x86: + os.environ['EMCC_FAST_COMPILER'] = "0" + try: + old_chunk_size = os.environ.get('EMSCRIPT_MAX_CHUNK_SIZE') or '' + + for chunk_size in ['1', old_chunk_size]: # test splitting out each function to a chunk in emscripten.py (21 functions here) + print ' chunks', chunk_size + os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = chunk_size + + # A good test of i64 math + if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2 C-style memory aliasing') + self.do_run('', 'Usage: hashstring <seed>', + libraries=self.get_library('cube2hash', ['cube2hash.bc'], configure=None, cache_name_extra=str(x86)), + includes=[path_from_root('tests', 'cube2hash')]) + + for text, output in [('fleefl', '892BDB6FD3F62E863D63DA55851700FDE3ACF30204798CE9'), + ('fleefl2', 'AA2CC5F96FC9D540CA24FDAF1F71E2942753DB83E8A81B61'), + ('64bitisslow', '64D8470573635EC354FEE7B7F87C566FCAF1EFB491041670')]: + self.do_run('', 'hash value: ' + output, [text], no_build=True) + finally: + os.environ['EMSCRIPT_MAX_CHUNK_SIZE'] = old_chunk_size + finally: + if x86: + if old_fastcomp: + os.environ['EMCC_FAST_COMPILER'] = old_fastcomp + else: + del os.environ['EMCC_FAST_COMPILER'] + finally: + if x86: + if old_x86: + os.environ['EMCC_LLVM_TARGET'] = old_x86 + else: + del os.environ['EMCC_LLVM_TARGET'] def test_unaligned(self): if Settings.QUANTUM_SIZE == 1: return self.skip('No meaning to unaligned addresses in q1') @@ -574,7 +595,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co # TODO: A version of this with int64s as well - if self.is_le32(): + if self.is_emscripten_abi(): return self.skip('LLVM marks the reads of s as fully aligned, making this test invalid') else: self.do_run(src, '*12 : 1 : 12\n328157500735811.0,23,416012775903557.0,99\n') @@ -654,7 +675,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co } ''' - if self.is_le32(): + if self.is_emscripten_abi(): self.do_run(src, '''16,32 0,8,8,8 16,24,24,24 @@ -836,7 +857,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co def test_math_lgamma(self): if self.emcc_args is None: return self.skip('requires emcc') - if not self.is_le32(): return self.skip('le32 needed for accurate math') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math') test_path = path_from_root('tests', 'math', 'lgamma') src, output = (test_path + s for s in ('.in', '.out')) @@ -951,7 +972,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co for named in (0, 1): print named - if os.environ.get('EMCC_FAST_COMPILER') == '1' and named: continue # no named globals in fastcomp + if os.environ.get('EMCC_FAST_COMPILER') != '0' and named: continue # no named globals in fastcomp Settings.NAMED_GLOBALS = named self.do_run_from_file(src, output, ['wowie', 'too', '74']) @@ -967,6 +988,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) def test_strndup(self): + if self.run_name.startswith('s_'): return self.skip('musl libc strndup() assumes that C strings can be loaded via i16 and i32 loads.') test_path = path_from_root('tests', 'core', 'test_strndup') src, output = (test_path + s for s in ('.in', '.out')) @@ -1138,7 +1160,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) def test_longjmp_repeat(self): - if os.environ.get('EMCC_FAST_COMPILER') != '1': Settings.MAX_SETJMPS = 1 # todo: do this more strict thing in fastcomp too + if os.environ.get('EMCC_FAST_COMPILER') == '0': Settings.MAX_SETJMPS = 1 # todo: do this more strict thing in fastcomp too test_path = path_from_root('tests', 'core', 'test_longjmp_repeat') src, output = (test_path + s for s in ('.in', '.out')) self.do_run_from_file(src, output) @@ -1162,7 +1184,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co self.do_run_from_file(src, output) def test_setjmp_many(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp: make MAX_SETJMPS take effect') + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp: make MAX_SETJMPS take effect') src = r''' #include <stdio.h> @@ -1860,7 +1882,7 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co # Compressed memory. Note that sizeof() does give the fat sizes, however! self.do_run(src, '*0,0,0,1,2,3,4,5*\n*1,0,0*\n*0*\n0:1,1\n1:1,1\n2:1,1\n*12,20,5*') else: - if self.is_le32(): + if self.is_emscripten_abi(): self.do_run(src, '*0,0,0,4,8,16,20,24*\n*1,0,0*\n*0*\n0:1,1\n1:1,1\n2:1,1\n*16,24,24*') else: self.do_run(src, '*0,0,0,4,8,12,16,20*\n*1,0,0*\n*0*\n0:1,1\n1:1,1\n2:1,1\n*12,20,20*') @@ -1917,7 +1939,7 @@ def process(filename): def test_emscripten_get_now(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('requires ta2') - if self.run_name == 'o2': + if self.run_name == 'slow2asm': self.emcc_args += ['--closure', '1'] # Use closure here for some additional coverage self.do_run(open(path_from_root('tests', 'emscripten_get_now.cpp')).read(), 'Timer resolution is good.') @@ -1929,8 +1951,8 @@ def process(filename): self.do_run(open(src).read(), open(output).read().replace('waka', EMSCRIPTEN_VERSION)) def test_inlinejs(self): - if not self.is_le32(): return self.skip('le32 needed for inline js') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('fastcomp only supports EM_ASM') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('fastcomp only supports EM_ASM') test_path = path_from_root('tests', 'core', 'test_inlinejs') src, output = (test_path + s for s in ('.in', '.out')) @@ -1942,8 +1964,8 @@ def process(filename): for i in range(1, 5): assert ('comment%d' % i) in out def test_inlinejs2(self): - if not self.is_le32(): return self.skip('le32 needed for inline js') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('fastcomp only supports EM_ASM') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('fastcomp only supports EM_ASM') test_path = path_from_root('tests', 'core', 'test_inlinejs2') src, output = (test_path + s for s in ('.in', '.out')) @@ -2131,7 +2153,7 @@ def process(filename): def test_varargs(self): if Settings.QUANTUM_SIZE == 1: return self.skip('FIXME: Add support for this') - if not self.is_le32(): return self.skip('we do not support all varargs stuff without le32') + if not self.is_emscripten_abi(): return self.skip('we do not support all varargs stuff without asmjs-unknown-emscripten') test_path = path_from_root('tests', 'core', 'test_varargs') src, output = (test_path + s for s in ('.in', '.out')) @@ -2140,7 +2162,7 @@ def process(filename): def test_varargs_byval(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('FIXME: Add support for this') - if self.is_le32(): return self.skip('clang cannot compile this code with that target yet') + if self.is_emscripten_abi(): return self.skip('clang cannot compile this code with that target yet') src = r''' #include <stdio.h> @@ -2749,7 +2771,7 @@ The current type of b is: 9 self.do_run(main, 'supp: 54,2\nmain: 56\nsupp see: 543\nmain see: 76\nok.') def can_dlfcn(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': + if os.environ.get('EMCC_FAST_COMPILER') != '0': self.skip('todo in fastcomp') return False @@ -2764,8 +2786,8 @@ The current type of b is: 9 else: Settings.NAMED_GLOBALS = 1 - if not self.is_le32(): - self.skip('need le32 for dlfcn support') + if not self.is_emscripten_abi(): + self.skip('need asmjs-unknown-emscripten for dlfcn support') return False else: return True @@ -2961,7 +2983,7 @@ def process(filename): output_nicerizer=lambda x, err: x.replace('\n', '*'), post_build=self.dlfcn_post_build) - if Settings.ASM_JS and os.path.exists(SPIDERMONKEY_ENGINE[0]): + if Settings.ASM_JS and SPIDERMONKEY_ENGINE and os.path.exists(SPIDERMONKEY_ENGINE[0]): out = run_js('liblib.so', engine=SPIDERMONKEY_ENGINE, full_output=True, stderr=STDOUT) if 'asm' in out: self.validate_asmjs(out) @@ -3171,7 +3193,7 @@ def process(filename): def test_dlfcn_self(self): if Settings.USE_TYPED_ARRAYS == 1: return self.skip('Does not work with USE_TYPED_ARRAYS=1') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp') Settings.DLOPEN_SUPPORT = 1 def post(filename): @@ -3602,7 +3624,7 @@ int main() def test_strtod(self): if self.emcc_args is None: return self.skip('needs emcc for libc') - if not self.is_le32(): return self.skip('le32 needed for accurate math') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math') src = r''' #include <stdio.h> @@ -3745,6 +3767,7 @@ int main() self.do_run_from_file(src, output) def test_strstr(self): + if self.run_name.startswith('s_'): return self.skip('musl libc strstr() assumes that C strings can be loaded via i16 and i32 loads.') test_path = path_from_root('tests', 'core', 'test_strstr') src, output = (test_path + s for s in ('.in', '.out')) @@ -3758,7 +3781,7 @@ int main() def test_sscanf(self): if self.emcc_args is None: return self.skip('needs emcc for libc') - if not self.is_le32(): return self.skip('le32 needed for accurate math') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for accurate math') test_path = path_from_root('tests', 'core', 'test_sscanf') src, output = (test_path + s for s in ('.in', '.out')) @@ -3967,7 +3990,9 @@ def process(filename): return 0; } ''' - self.do_run(src, ('got: 35\ngot: 45\ngot: 25\ngot: 15\nisatty? 0,0,1\n', 'isatty? 0,0,1\ngot: 35\ngot: 45\ngot: 25\ngot: 15\n'), post_build=post) + def clean(out, err): + return '\n'.join(filter(lambda line: 'warning' not in line, (out + err).split('\n'))) + self.do_run(src, ('got: 35\ngot: 45\ngot: 25\ngot: 15\nisatty? 0,0,1\n', 'isatty? 0,0,1\ngot: 35\ngot: 45\ngot: 25\ngot: 15\n'), post_build=post, output_nicerizer=clean) def test_mount(self): src = open(path_from_root('tests', 'fs', 'test_mount.c'), 'r').read() @@ -4046,10 +4071,36 @@ def process(filename): self.emcc_args += ['--embed-file', 'three_numbers.txt'] self.do_run(src, 'match = 3\nx = -1.0, y = 0.1, z = -0.1\n') + def test_fileno(self): + if self.emcc_args is None: return self.skip('requires emcc') + open(os.path.join(self.get_dir(), 'empty.txt'), 'w').write('') + src = r''' + #include <stdio.h> + #include <unistd.h> + int main() + { + FILE* fp = fopen("empty.txt", "r"); + if (fp) { + printf("%d\n", fp); + printf("%d\n", fileno(fp)); + printf("%d\n", fileno((FILE*)42)); // nonexistent stream + } else { + printf("failed to open empty.txt\n"); + } + return 0; + } + ''' + self.emcc_args += ['--embed-file', 'empty.txt'] + self.do_run(src, '4\n3\n-1\n') + def test_readdir(self): src = open(path_from_root('tests', 'dirent', 'test_readdir.c'), 'r').read() self.do_run(src, 'success', force_c=True) + def test_readdir_empty(self): + src = open(path_from_root('tests', 'dirent', 'test_readdir_empty.c'), 'r').read() + self.do_run(src, 'success', force_c=True) + def test_stat(self): src = open(path_from_root('tests', 'stat', 'test_stat.c'), 'r').read() self.do_run(src, 'success', force_c=True) @@ -4140,7 +4191,7 @@ def process(filename): def test_utf32(self): if self.emcc_args is None: return self.skip('need libc for wcslen()') - if not self.is_le32(): return self.skip('this test uses inline js, which requires le32') + if not self.is_emscripten_abi(): return self.skip('this test uses inline js, which requires asmjs-unknown-emscripten') self.do_run(open(path_from_root('tests', 'utf32.cpp')).read(), 'OK.') self.do_run(open(path_from_root('tests', 'utf32.cpp')).read(), 'OK.', args=['-fshort-wchar']) @@ -4197,13 +4248,13 @@ def process(filename): def test_fs_nodefs_rw(self): if self.emcc_args is None: return self.skip('requires emcc') - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') src = open(path_from_root('tests', 'fs', 'test_nodefs_rw.c'), 'r').read() self.do_run(src, 'success', force_c=True, js_engines=[NODE_JS]) def test_unistd_access(self): self.clear() - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') for fs in ['MEMFS', 'NODEFS']: src = open(path_from_root('tests', 'unistd', 'access.c'), 'r').read() expected = open(path_from_root('tests', 'unistd', 'access.out'), 'r').read() @@ -4211,7 +4262,7 @@ def process(filename): self.do_run(src, expected, js_engines=[NODE_JS]) def test_unistd_curdir(self): - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') src = open(path_from_root('tests', 'unistd', 'curdir.c'), 'r').read() expected = open(path_from_root('tests', 'unistd', 'curdir.out'), 'r').read() self.do_run(src, expected) @@ -4227,6 +4278,7 @@ def process(filename): self.do_run(src, expected, extra_emscripten_args=['-H', 'libc/unistd.h']) def test_unistd_ttyname(self): + if self.run_name.startswith('s_'): return self.skip('musl libc strstr() assumes that C strings can be loaded via i16 and i32 loads.') src = open(path_from_root('tests', 'unistd', 'ttyname.c'), 'r').read() self.do_run(src, 'success', force_c=True) @@ -4242,7 +4294,7 @@ def process(filename): def test_unistd_truncate(self): self.clear() - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') for fs in ['MEMFS', 'NODEFS']: src = open(path_from_root('tests', 'unistd', 'truncate.c'), 'r').read() expected = open(path_from_root('tests', 'unistd', 'truncate.out'), 'r').read() @@ -4271,7 +4323,7 @@ def process(filename): def test_unistd_unlink(self): self.clear() if self.emcc_args is None: return self.skip('requires emcc') - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') for fs in ['MEMFS', 'NODEFS']: src = open(path_from_root('tests', 'unistd', 'unlink.c'), 'r').read() Building.COMPILER_TEST_OPTS += ['-D' + fs] @@ -4279,7 +4331,7 @@ def process(filename): def test_unistd_links(self): self.clear() - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') for fs in ['MEMFS', 'NODEFS']: if WINDOWS and fs == 'NODEFS': print >> sys.stderr, 'Skipping NODEFS part of this test for test_unistd_links on Windows, since it would require administrative privileges.' @@ -4299,7 +4351,7 @@ def process(filename): def test_unistd_io(self): self.clear() - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') if self.run_name == 'o2': return self.skip('non-asm optimized builds can fail with inline js') if self.emcc_args is None: return self.skip('requires emcc') for fs in ['MEMFS', 'NODEFS']: @@ -4310,7 +4362,7 @@ def process(filename): def test_unistd_misc(self): if self.emcc_args is None: return self.skip('requires emcc') - if not self.is_le32(): return self.skip('le32 needed for inline js') + if not self.is_emscripten_abi(): return self.skip('asmjs-unknown-emscripten needed for inline js') for fs in ['MEMFS', 'NODEFS']: src = open(path_from_root('tests', 'unistd', 'misc.c'), 'r').read() expected = open(path_from_root('tests', 'unistd', 'misc.out'), 'r').read() @@ -4368,7 +4420,14 @@ PORT: 3979 def test_atomic(self): test_path = path_from_root('tests', 'core', 'test_atomic') src, output = (test_path + s for s in ('.in', '.out')) + self.do_run_from_file(src, output) + def test_atomic_cxx(self): + if self.emcc_args is None: return self.skip('needs emcc') + if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('needs fastcomp') + test_path = path_from_root('tests', 'core', 'test_atomic_cxx') + src, output = (test_path + s for s in ('.cpp', '.txt')) + Building.COMPILER_TEST_OPTS += ['-std=c++11'] self.do_run_from_file(src, output) def test_phiundef(self): @@ -4497,13 +4556,58 @@ PORT: 3979 ''' self.do_run(src, 'value\narray_item1\narray_item2\narray_item3\n3\n3.00\n2.20\nJansson: Node with ID `0` not found. Context has `10` nodes.\n0\nJansson: No JSON context.\njansson!') + def test_constglobalunion(self): + if self.emcc_args is None: return self.skip('needs emcc') + self.emcc_args += ['-s', 'EXPORT_ALL=1'] + + self.do_run(r''' +#include <stdio.h> + +struct one_const { + long a; +}; + +struct two_consts { + long a; + long b; +}; + +union some_consts { + struct one_const one; + struct two_consts two; +}; + +union some_consts my_consts = {{ + 1 +}}; + +struct one_const addr_of_my_consts = { + (long)(&my_consts) +}; + +int main(void) { + printf("%li\n", !!addr_of_my_consts.a); + return 0; +} + ''', '1') + ### 'Medium' tests def test_fannkuch(self): + try: + if self.run_name == 'slow2' or self.run_name == 'slow2asm': + old_target = os.environ.get('EMCC_LLVM_TARGET') or '' + os.environ['EMCC_LLVM_TARGET'] = "asmjs-unknown-emscripten" # testing for asm-emscripten target on non-fastcomp results = [ (1,0), (2,1), (3,2), (4,4), (5,7), (6,10), (7, 16), (8,22) ] for i, j in results: src = open(path_from_root('tests', 'fannkuch.cpp'), 'r').read() self.do_run(src, 'Pfannkuchen(%d) = %d.' % (i,j), [str(i)], no_build=i>1) + finally: + if self.run_name == 'slow2' or self.run_name == 'slow2asm': + if old_target: + os.environ['EMCC_LLVM_TARGET'] = old_target + else: + del os.environ['EMCC_LLVM_TARGET'] def test_raytrace(self): if self.emcc_args is None: return self.skip('requires emcc') @@ -4673,25 +4777,6 @@ return malloc(size); main = main[:main.find('\n}')] assert main.count('\n') <= 7, ('must not emit too many postSets: %d' % main.count('\n')) + ' : ' + main - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('fastcomp always aliases pointers') - - assert 'asm2g' in test_modes - if self.run_name == 'asm2g': - results = {} - original = open('src.cpp.o.js').read() - results[Settings.ALIASING_FUNCTION_POINTERS] = len(original) - Settings.ALIASING_FUNCTION_POINTERS = 1 - Settings.ALIASING_FUNCTION_POINTERS - self.do_run(path_from_root('tests', 'cubescript'), '*\nTemp is 33\n9\n5\nhello, everyone\n*', main_file='command.cpp') - final = open('src.cpp.o.js').read() - results[Settings.ALIASING_FUNCTION_POINTERS] = len(final) - open('original.js', 'w').write(original) - print results - assert results[1] < 0.99*results[0] - assert ' & 3]()' in original, 'small function table exists' - assert ' & 3]()' not in final, 'small function table does not exist' - assert ' & 255]()' not in original, 'big function table does not exist' - assert ' & 255]()' in final, 'big function table exists' - def test_simd(self): if Settings.USE_TYPED_ARRAYS != 2: return self.skip('needs ta2') if Settings.ASM_JS: Settings.ASM_JS = 2 # does not validate @@ -4721,7 +4806,7 @@ return malloc(size); self.do_run_from_file(src, output) def test_gcc_unmangler(self): - if os.environ.get('EMCC_FAST_COMPILER') != '1': Settings.NAMED_GLOBALS = 1 # test coverage for this; fastcomp never names globals + if os.environ.get('EMCC_FAST_COMPILER') == '0': Settings.NAMED_GLOBALS = 1 # test coverage for this; fastcomp never names globals Building.COMPILER_TEST_OPTS += ['-I' + path_from_root('third_party'), '-Wno-warn-absolute-paths'] @@ -4820,7 +4905,7 @@ def process(filename): def test_sqlite(self): # gcc -O3 -I/home/alon/Dev/emscripten/tests/sqlite -ldl src.c if self.emcc_args is None: return self.skip('Very slow without ta2, and we would also need to include dlmalloc manually without emcc') - if not self.is_le32(): return self.skip('fails on x86 due to a legalization issue on llvm 3.3') + if not self.is_emscripten_abi(): return self.skip('fails on x86 due to a legalization issue on llvm 3.3') if Settings.QUANTUM_SIZE == 1: return self.skip('TODO FIXME') self.banned_js_engines = [NODE_JS] # OOM in older node @@ -4876,12 +4961,16 @@ def process(filename): Settings.SAFE_HEAP_LINES = ['btVoronoiSimplexSolver.h:40', 'btVoronoiSimplexSolver.h:41', 'btVoronoiSimplexSolver.h:42', 'btVoronoiSimplexSolver.h:43'] + asserts = Settings.ASSERTIONS + for use_cmake in [False, True]: # If false, use a configure script to configure Bullet build. print 'cmake', use_cmake # Windows cannot run configure sh scripts. if WINDOWS and not use_cmake: continue + Settings.ASSERTIONS = 2 if use_cmake else asserts # extra testing for ASSERTIONS == 2 + def test(): self.do_run(open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(), [open(path_from_root('tests', 'bullet', 'output.txt'), 'r').read(), # different roundings @@ -4892,7 +4981,7 @@ def process(filename): test() assert 'asm2g' in test_modes - if self.run_name == 'asm2g' and not use_cmake and os.environ.get('EMCC_FAST_COMPILER') != '1': + if self.run_name == 'asm2g' and not use_cmake and os.environ.get('EMCC_FAST_COMPILER') == '0': # Test forced alignment print >> sys.stderr, 'testing FORCE_ALIGNED_MEMORY' old = open('src.cpp.o.js').read() @@ -5087,12 +5176,12 @@ def process(filename): def test_python(self): if self.emcc_args is None: return self.skip('requires emcc') if Settings.QUANTUM_SIZE == 1: return self.skip('TODO: make this work') - if not self.is_le32(): return self.skip('fails on non-le32') # FIXME + if not self.is_emscripten_abi(): return self.skip('fails on not asmjs-unknown-emscripten') # FIXME #Settings.EXPORTED_FUNCTIONS += ['_PyRun_SimpleStringFlags'] # for the demo - if self.is_le32(): - bitcode = path_from_root('tests', 'python', 'python.le32.bc') + if self.is_emscripten_abi(): + bitcode = path_from_root('tests', 'python', 'python.asmjs-unknown-emscripten.bc') else: bitcode = path_from_root('tests', 'python', 'python.small.bc') @@ -5125,12 +5214,13 @@ def process(filename): for name in glob.glob(path_from_root('tests', 'cases', '*.ll')): shortname = name.replace('.ll', '') if '' not in shortname: continue - if os.environ.get('EMCC_FAST_COMPILER') == '1' and os.path.basename(shortname) in [ - 'structparam', 'extendedprecision', 'issue_39', 'emptystruct', 'phinonexist', 'quotedlabel', 'oob_ta2', 'phientryimplicit', 'phiself', 'invokebitcast', 'funcptr', # invalid ir + if os.environ.get('EMCC_FAST_COMPILER') != '0' and os.path.basename(shortname) in [ + 'aliasbitcast', 'structparam', 'extendedprecision', 'issue_39', 'phinonexist', 'oob_ta2', 'phiself', 'invokebitcast', # invalid ir 'structphiparam', 'callwithstructural_ta2', 'callwithstructural64_ta2', 'structinparam', # pnacl limitations in ExpandStructRegs '2xi40', # pnacl limitations in ExpandGetElementPtr 'quoted', # current fastcomp limitations FIXME - 'sillyfuncast2', 'sillybitcast', 'atomicrmw_unaligned' # TODO XXX + 'atomicrmw_unaligned', # TODO XXX + 'emptyasm_aue' # we don't support inline asm ]: continue if '_ta2' in shortname and not Settings.USE_TYPED_ARRAYS == 2: print self.skip('case "%s" only relevant for ta2' % shortname) @@ -5138,10 +5228,10 @@ def process(filename): if '_noasm' in shortname and Settings.ASM_JS: print self.skip('case "%s" not relevant for asm.js' % shortname) continue - if '_le32' in shortname and not self.is_le32(): - print self.skip('case "%s" not relevant for non-le32 target' % shortname) + if '_eua' in shortname and not self.is_emscripten_abi(): + print self.skip('case "%s" not relevant for not asmjs-unknown-emscripten target' % shortname) continue - if '_fastcomp' in shortname and not os.environ.get('EMCC_FAST_COMPILER') == '1': + if '_fastcomp' in shortname and not os.environ.get('EMCC_FAST_COMPILER') != '0': print self.skip('case "%s" not relevant for non-fastcomp' % shortname) continue self.emcc_args = emcc_args @@ -5180,7 +5270,12 @@ def process(filename): for name in glob.glob(path_from_root('tests', 'fuzz', '*.c')) + glob.glob(path_from_root('tests', 'fuzz', '*.cpp')): #if os.path.basename(name) != '4.c': continue if 'newfail' in name: continue - if os.path.basename(name) == '18.cpp' and not os.environ.get('EMCC_FAST_COMPILER') == '1': continue # works only in fastcomp + if os.environ.get('EMCC_FAST_COMPILER') == '0' and os.path.basename(name) in [ + '18.cpp', '15.c' + ]: continue # works only in fastcomp + if x == 'lto' and self.run_name == 'default' and os.path.basename(name) in [ + '19.c' + ]: continue # LLVM LTO bug print name self.do_run(open(path_from_root('tests', 'fuzz', name)).read(), @@ -5420,7 +5515,7 @@ def process(filename): def test_asm_pgo(self): if not Settings.ASM_JS: return self.skip('this is a test for PGO for asm (NB: not *in* asm)') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp') src = open(path_from_root('tests', 'hello_libcxx.cpp')).read() output = 'hello, world!' @@ -5540,7 +5635,7 @@ def process(filename): def test_embind(self): if self.emcc_args is None: return self.skip('requires emcc') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp') Building.COMPILER_TEST_OPTS += ['--bind'] src = r''' @@ -5563,7 +5658,7 @@ def process(filename): def test_embind_2(self): if self.emcc_args is None: return self.skip('requires emcc') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp') Building.COMPILER_TEST_OPTS += ['--bind', '--post-js', 'post.js'] open('post.js', 'w').write(''' Module.print('lerp ' + Module.lerp(1, 2, 0.66) + '.'); @@ -5637,8 +5732,6 @@ def process(filename): # Way 2: use CppHeaderParser - Settings.RUNTIME_TYPE_INFO = 1 - header = ''' #include <stdio.h> @@ -5878,7 +5971,25 @@ def process(filename): ''' self.do_run(src, '|hello|43|world|41|', post_build=post) + def test_webidl(self): + if self.emcc_args is None: return self.skip('requires emcc') + + output = Popen([PYTHON, path_from_root('tools', 'webidl_binder.py'), + path_from_root('tests', 'webidl', 'test.idl'), + 'glue']).communicate()[0] + assert os.path.exists('glue.cpp') + assert os.path.exists('glue.js') + + self.emcc_args += ['--post-js', 'glue.js', + '--post-js', path_from_root('tests', 'webidl', 'post.js')] + shutil.copyfile(path_from_root('tests', 'webidl', 'test.h'), self.in_dir('test.h')) + shutil.copyfile(path_from_root('tests', 'webidl', 'test.cpp'), self.in_dir('test.cpp')) + src = open('test.cpp').read() + self.do_run(src, open(path_from_root('tests', 'webidl', 'output.txt')).read()) + def test_typeinfo(self): + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('fastcomp does not support RUNTIME_TYPE_INFO') + if self.emcc_args is not None and self.emcc_args != []: return self.skip('full LLVM opts optimize out all the code that uses the type') Settings.RUNTIME_TYPE_INFO = 1 @@ -6104,7 +6215,7 @@ def process(filename): # can do an apples-to-apples comparison by compiling with the same file name shutil.move(out_filename, no_maps_filename) with open(no_maps_filename) as f: no_maps_file = f.read() - no_maps_file = re.sub(' *//@.*$', '', no_maps_file, flags=re.MULTILINE) + no_maps_file = re.sub(' *//[@#].*$', '', no_maps_file, flags=re.MULTILINE) Building.COMPILER_TEST_OPTS.append('-g4') def build_and_check(): @@ -6117,7 +6228,7 @@ def process(filename): # this is worth checking because the parser AST swaps strings for token # objects when generating source maps, so we want to make sure the # optimizer can deal with both types. - out_file = re.sub(' *//@.*$', '', out_file, flags=re.MULTILINE) + out_file = re.sub(' *//[@#].*$', '', out_file, flags=re.MULTILINE) def clean(code): code = re.sub(r'\n+[ \n]*\n+', '\n', code) code = code.replace('{\n}', '{}') @@ -6397,7 +6508,7 @@ def process(filename): def test_minmax(self): if self.emcc_args == None: return self.skip('needs emcc') - if os.environ.get('EMCC_FAST_COMPILER') != '1': return self.skip('this test will not pass in the old compiler') + if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('this test will not pass in the old compiler') self.do_run(open(path_from_root('tests', 'test_minmax.c')).read(), 'NAN != NAN\nSuccess!') def test_locale(self): @@ -6460,6 +6571,7 @@ def make_run(fullname, name=-1, compiler=-1, embetter=0, quantum_size=0, return # TODO: Move much of these to a init() function in shared.py, and reuse that + Settings.ASM_JS = 0 Settings.USE_TYPED_ARRAYS = typed_arrays Settings.INVOKE_RUN = 1 Settings.RELOOP = 0 # we only do them in the "o2" pass @@ -6487,27 +6599,19 @@ def make_run(fullname, name=-1, compiler=-1, embetter=0, quantum_size=0, return TT -# Make one run with the defaults -default = make_run("default", compiler=CLANG, emcc_args=[] if os.environ.get('EMCC_FAST_COMPILER') != '1' else ['-s', 'ASM_JS=1']) - -# Make one run with -O1, with safe heap -o1 = make_run("o1", compiler=CLANG, emcc_args=["-O1", "-s", "ASM_JS=0", "-s", "SAFE_HEAP=1"]) - -# Make one run with -O2, but without closure (we enable closure in specific tests, otherwise on everything it is too slow) -o2 = make_run("o2", compiler=CLANG, emcc_args=["-O2", "-s", "ASM_JS=0", "-s", "JS_CHUNK_SIZE=1024"]) - -# asm.js +# Main test modes +default = make_run("default", compiler=CLANG, emcc_args=[]) asm1 = make_run("asm1", compiler=CLANG, emcc_args=["-O1"]) asm2 = make_run("asm2", compiler=CLANG, emcc_args=["-O2"]) asm3 = make_run("asm3", compiler=CLANG, emcc_args=["-O3"]) asm2f = make_run("asm2f", compiler=CLANG, emcc_args=["-O2", "-s", "PRECISE_F32=1"]) -if os.environ.get('EMCC_FAST_COMPILER') == '1': - asm2g = make_run("asm2g", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "ASSERTIONS=1", "--memory-init-file", "1", "-s", "SAFE_HEAP=1"]) -else: - asm2g = make_run("asm2g", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "ASSERTIONS=1", "--memory-init-file", "1", "-s", "CHECK_HEAP_ALIGN=1"]) -asm2x86 = make_run("asm2x86", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "CHECK_HEAP_ALIGN=1"], env={"EMCC_LLVM_TARGET": "i386-pc-linux-gnu"}) +asm2g = make_run("asm2g", compiler=CLANG, emcc_args=["-O2", "-g", "-s", "ASSERTIONS=1", "--memory-init-file", "1", "-s", "SAFE_HEAP=1"]) + +# Legacy test modes - +slow2 = make_run("slow2", compiler=CLANG, emcc_args=["-O2", "-s", "ASM_JS=0"], env={"EMCC_FAST_COMPILER": "0"}) +slow2asm = make_run("slow2asm", compiler=CLANG, emcc_args=["-O2"], env={"EMCC_FAST_COMPILER": "0"}) -# Make custom runs with various options +# Legacy test modes - very old for compiler, quantum, embetter, typed_arrays in [ (CLANG, 4, 0, 0), (CLANG, 4, 1, 1), @@ -6515,6 +6619,6 @@ for compiler, quantum, embetter, typed_arrays in [ fullname = 's_0_%d%s%s' % ( embetter, '' if quantum == 4 else '_q' + str(quantum), '' if typed_arrays in [0, 1] else '_t' + str(typed_arrays) ) - locals()[fullname] = make_run(fullname, fullname, compiler, embetter, quantum, typed_arrays) + locals()[fullname] = make_run(fullname, fullname, compiler, embetter, quantum, typed_arrays, env={"EMCC_FAST_COMPILER": "0"}) del T # T is just a shape for the specific subclasses, we don't test it itself diff --git a/tests/test_float_literals.cpp b/tests/test_float_literals.cpp index fdae2764..2920fbd1 100644 --- a/tests/test_float_literals.cpp +++ b/tests/test_float_literals.cpp @@ -4,7 +4,7 @@ #include <stdio.h> #include <stdlib.h> -#if defined(_MSC_VER) || defined(EMSCRIPTEN) +#if defined(_MSC_VER) || defined(__EMSCRIPTEN__) #define FLOAT_NAN ((float)std::numeric_limits<float>::quiet_NaN()) #define FLOAT_INF ((float)std::numeric_limits<float>::infinity()) #else @@ -12,7 +12,7 @@ #define FLOAT_INF ((float)INFINITY) #endif -#if defined(_MSC_VER) || defined(EMSCRIPTEN) +#if defined(_MSC_VER) || defined(__EMSCRIPTEN__) #define DOUBLE_NAN ((double)std::numeric_limits<double>::quiet_NaN()) #define DOUBLE_INF ((double)std::numeric_limits<double>::infinity()) #else diff --git a/tests/test_html5.c b/tests/test_html5.c index 77ddea98..fec46035 100644 --- a/tests/test_html5.c +++ b/tests/test_html5.c @@ -145,8 +145,8 @@ EM_BOOL orientationchange_callback(int eventType, const EmscriptenOrientationCha EM_BOOL fullscreenchange_callback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData) { - printf("%s, isFullscreen: %d, fullscreenEnabled: %d, fs element nodeName: \"%s\", fs element id: \"%s\"\n", - emscripten_event_type_to_string(eventType), e->isFullscreen, e->fullscreenEnabled, e->nodeName, e->id); + printf("%s, isFullscreen: %d, fullscreenEnabled: %d, fs element nodeName: \"%s\", fs element id: \"%s\". New size: %dx%d pixels. Screen size: %dx%d pixels.\n", + emscripten_event_type_to_string(eventType), e->isFullscreen, e->fullscreenEnabled, e->nodeName, e->id, e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); return 0; } diff --git a/tests/test_html5_fullscreen.c b/tests/test_html5_fullscreen.c new file mode 100644 index 00000000..54b834bd --- /dev/null +++ b/tests/test_html5_fullscreen.c @@ -0,0 +1,126 @@ +#include <stdio.h> +#include <emscripten.h> +#include <string.h> +#include <emscripten/html5.h> + +void report_result(int result) +{ + if (result == 0) { + printf("Test successful!\n"); + } else { + printf("Test failed!\n"); + } +#ifdef REPORT_RESULT + REPORT_RESULT(); +#endif +} + +static inline const char *emscripten_event_type_to_string(int eventType) { + const char *events[] = { "(invalid)", "(none)", "keypress", "keydown", "keyup", "click", "mousedown", "mouseup", "dblclick", "mousemove", "wheel", "resize", + "scroll", "blur", "focus", "focusin", "focusout", "deviceorientation", "devicemotion", "orientationchange", "fullscreenchange", "pointerlockchange", + "visibilitychange", "touchstart", "touchend", "touchmove", "touchcancel", "gamepadconnected", "gamepaddisconnected", "beforeunload", + "batterychargingchange", "batterylevelchange", "webglcontextlost", "webglcontextrestored", "(invalid)" }; + ++eventType; + if (eventType < 0) eventType = 0; + if (eventType >= sizeof(events)/sizeof(events[0])) eventType = sizeof(events)/sizeof(events[0])-1; + return events[eventType]; +} + +const char *emscripten_result_to_string(EMSCRIPTEN_RESULT result) { + if (result == EMSCRIPTEN_RESULT_SUCCESS) return "EMSCRIPTEN_RESULT_SUCCESS"; + if (result == EMSCRIPTEN_RESULT_DEFERRED) return "EMSCRIPTEN_RESULT_DEFERRED"; + if (result == EMSCRIPTEN_RESULT_NOT_SUPPORTED) return "EMSCRIPTEN_RESULT_NOT_SUPPORTED"; + if (result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED) return "EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED"; + if (result == EMSCRIPTEN_RESULT_INVALID_TARGET) return "EMSCRIPTEN_RESULT_INVALID_TARGET"; + if (result == EMSCRIPTEN_RESULT_UNKNOWN_TARGET) return "EMSCRIPTEN_RESULT_UNKNOWN_TARGET"; + if (result == EMSCRIPTEN_RESULT_INVALID_PARAM) return "EMSCRIPTEN_RESULT_INVALID_PARAM"; + if (result == EMSCRIPTEN_RESULT_FAILED) return "EMSCRIPTEN_RESULT_FAILED"; + if (result == EMSCRIPTEN_RESULT_NO_DATA) return "EMSCRIPTEN_RESULT_NO_DATA"; + return "Unknown EMSCRIPTEN_RESULT!"; +} + +#define TEST_RESULT(x) if (ret != EMSCRIPTEN_RESULT_SUCCESS) printf("%s returned %s.\n", #x, emscripten_result_to_string(ret)); + +// The event handler functions can return 1 to suppress the event and disable the default action. That calls event.preventDefault(); +// Returning 0 signals that the event was not consumed by the code, and will allow the event to pass on and bubble up normally. +EM_BOOL key_callback(int eventType, const EmscriptenKeyboardEvent *e, void *userData) +{ + if (eventType == EMSCRIPTEN_EVENT_KEYPRESS && (!strcmp(e->key, "f") || e->which == 102)) { + EmscriptenFullscreenChangeEvent fsce; + EMSCRIPTEN_RESULT ret = emscripten_get_fullscreen_status(&fsce); + TEST_RESULT(emscripten_get_fullscreen_status); + if (!fsce.isFullscreen) { + printf("Requesting fullscreen..\n"); + ret = emscripten_request_fullscreen(0, 1); + TEST_RESULT(emscripten_request_fullscreen); + } else { + printf("Exiting fullscreen..\n"); + ret = emscripten_exit_fullscreen(); + TEST_RESULT(emscripten_exit_fullscreen); + ret = emscripten_get_fullscreen_status(&fsce); + TEST_RESULT(emscripten_get_fullscreen_status); + if (fsce.isFullscreen) { + fprintf(stderr, "Fullscreen exit did not work!\n"); + } + } + } + + return 0; +} + +int callCount = 0; + +EM_BOOL fullscreenchange_callback(int eventType, const EmscriptenFullscreenChangeEvent *e, void *userData) +{ + printf("%s, isFullscreen: %d, fullscreenEnabled: %d, fs element nodeName: \"%s\", fs element id: \"%s\". New size: %dx%d pixels. Screen size: %dx%d pixels.\n", + emscripten_event_type_to_string(eventType), e->isFullscreen, e->fullscreenEnabled, e->nodeName, e->id, e->elementWidth, e->elementHeight, e->screenWidth, e->screenHeight); + + ++callCount; + if (callCount == 1) { // Transitioned to fullscreen. + if (!e->isFullscreen) { + report_result(1); + } + } else if (callCount == 2) { // Transitioned to windowed, we must be back to the default pixel size 300x150. + if (e->isFullscreen || e->elementWidth != 300 || e->elementHeight != 150) { + report_result(1); + } else { + report_result(0); + } + } + return 0; +} + +EM_BOOL mouse_callback(int eventType, const EmscriptenMouseEvent *e, void *userData) +{ + return 0; +} + +int main() +{ + EMSCRIPTEN_RESULT ret = emscripten_set_keypress_callback(0, 0, 1, key_callback); + TEST_RESULT(emscripten_set_keypress_callback); + + ret = emscripten_set_fullscreenchange_callback(0, 0, 1, fullscreenchange_callback); + TEST_RESULT(emscripten_set_fullscreenchange_callback); + + // For Internet Explorer, fullscreen and pointer lock requests cannot be run + // from inside keyboard event handlers. Therefore we must register a callback to + // mouse events (any other than mousedown) to activate deferred fullscreen/pointerlock + // requests to occur for IE. The callback itself can be a no-op. + ret = emscripten_set_click_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_click_callback); + ret = emscripten_set_mousedown_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_mousedown_callback); + ret = emscripten_set_mouseup_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_mouseup_callback); + ret = emscripten_set_dblclick_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_dblclick_callback); + + printf("To finish this test, press f to enter fullscreen mode, and then exit it.\n"); + printf("On IE, press a mouse key over the canvas after pressing f to activate the fullscreen request event.\n"); + + /* For the events to function, one must either call emscripten_set_main_loop or enable Module.noExitRuntime by some other means. + Otherwise the application will exit after leaving main(), and the atexit handlers will clean up all event hooks (by design). */ + EM_ASM(Module['noExitRuntime'] = true); + return 0; +} diff --git a/tests/test_html5_mouse.c b/tests/test_html5_mouse.c new file mode 100644 index 00000000..f087a62b --- /dev/null +++ b/tests/test_html5_mouse.c @@ -0,0 +1,159 @@ +#include <stdio.h> +#include <emscripten.h> +#include <string.h> +#include <emscripten/html5.h> + +void report_result(int result) +{ + if (result == 0) { + printf("Test successful!\n"); + } else { + printf("Test failed!\n"); + } +#ifdef REPORT_RESULT + REPORT_RESULT(); +#endif +} + +static inline const char *emscripten_event_type_to_string(int eventType) { + const char *events[] = { "(invalid)", "(none)", "keypress", "keydown", "keyup", "click", "mousedown", "mouseup", "dblclick", "mousemove", "wheel", "resize", + "scroll", "blur", "focus", "focusin", "focusout", "deviceorientation", "devicemotion", "orientationchange", "fullscreenchange", "pointerlockchange", + "visibilitychange", "touchstart", "touchend", "touchmove", "touchcancel", "gamepadconnected", "gamepaddisconnected", "beforeunload", + "batterychargingchange", "batterylevelchange", "webglcontextlost", "webglcontextrestored", "(invalid)" }; + ++eventType; + if (eventType < 0) eventType = 0; + if (eventType >= sizeof(events)/sizeof(events[0])) eventType = sizeof(events)/sizeof(events[0])-1; + return events[eventType]; +} + +const char *emscripten_result_to_string(EMSCRIPTEN_RESULT result) { + if (result == EMSCRIPTEN_RESULT_SUCCESS) return "EMSCRIPTEN_RESULT_SUCCESS"; + if (result == EMSCRIPTEN_RESULT_DEFERRED) return "EMSCRIPTEN_RESULT_DEFERRED"; + if (result == EMSCRIPTEN_RESULT_NOT_SUPPORTED) return "EMSCRIPTEN_RESULT_NOT_SUPPORTED"; + if (result == EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED) return "EMSCRIPTEN_RESULT_FAILED_NOT_DEFERRED"; + if (result == EMSCRIPTEN_RESULT_INVALID_TARGET) return "EMSCRIPTEN_RESULT_INVALID_TARGET"; + if (result == EMSCRIPTEN_RESULT_UNKNOWN_TARGET) return "EMSCRIPTEN_RESULT_UNKNOWN_TARGET"; + if (result == EMSCRIPTEN_RESULT_INVALID_PARAM) return "EMSCRIPTEN_RESULT_INVALID_PARAM"; + if (result == EMSCRIPTEN_RESULT_FAILED) return "EMSCRIPTEN_RESULT_FAILED"; + if (result == EMSCRIPTEN_RESULT_NO_DATA) return "EMSCRIPTEN_RESULT_NO_DATA"; + return "Unknown EMSCRIPTEN_RESULT!"; +} + +#define TEST_RESULT(x) if (ret != EMSCRIPTEN_RESULT_SUCCESS) printf("%s returned %s.\n", #x, emscripten_result_to_string(ret)); + +int gotClick = 0; +int gotMouseDown = 0; +int gotMouseUp = 0; +int gotDblClick = 0; +int gotMouseMove = 0; +int gotWheel = 0; + +void instruction() +{ + if (!gotClick) { printf("Please click on the canvas.\n"); return; } + if (!gotMouseDown) { printf("Please click on the canvas.\n"); return; } + if (!gotMouseUp) { printf("Please click on the canvas.\n"); return; } + if (!gotDblClick) { printf("Please double-click on the canvas.\n"); return; } + if (!gotMouseMove) { printf("Please move the mouse on the canvas.\n"); return; } + if (!gotWheel) { printf("Please scroll the mouse wheel.\n"); return; } + + if (gotClick && gotMouseDown && gotMouseUp && gotDblClick && gotMouseMove && gotWheel) report_result(0); +} + +EM_BOOL mouse_callback(int eventType, const EmscriptenMouseEvent *e, void *userData) +{ + printf("%s, screen: (%ld,%ld), client: (%ld,%ld),%s%s%s%s button: %hu, buttons: %hu, movement: (%ld,%ld), canvas: (%ld,%ld)\n", + emscripten_event_type_to_string(eventType), e->screenX, e->screenY, e->clientX, e->clientY, + e->ctrlKey ? " CTRL" : "", e->shiftKey ? " SHIFT" : "", e->altKey ? " ALT" : "", e->metaKey ? " META" : "", + e->button, e->buttons, e->movementX, e->movementY, e->canvasX, e->canvasY); + + if (e->screenX != 0 && e->screenY != 0 && e->clientX != 0 && e->clientY != 0 && e->canvasX != 0 && e->canvasY != 0) + { + if (e->buttons != 0) + { + if (eventType == EMSCRIPTEN_EVENT_CLICK) gotClick = 1; + if (eventType == EMSCRIPTEN_EVENT_MOUSEDOWN) gotMouseDown = 1; + if (eventType == EMSCRIPTEN_EVENT_DBLCLICK) gotDblClick = 1; + } + if (eventType == EMSCRIPTEN_EVENT_MOUSEUP) gotMouseUp = 1; + if (eventType == EMSCRIPTEN_EVENT_MOUSEMOVE && (e->movementX != 0 || e->movementY != 0)) gotMouseMove = 1; + } + + if (eventType == EMSCRIPTEN_EVENT_CLICK && e->screenX == -500000) + { + printf("ERROR! Received an event to a callback that should have been unregistered!\n"); + gotClick = 0; + report_result(1); + } + + instruction(); + return 0; +} + +EM_BOOL wheel_callback(int eventType, const EmscriptenWheelEvent *e, void *userData) +{ + printf("%s, screen: (%ld,%ld), client: (%ld,%ld),%s%s%s%s button: %hu, buttons: %hu, canvas: (%ld,%ld), delta:(%g,%g,%g), deltaMode:%lu\n", + emscripten_event_type_to_string(eventType), e->mouse.screenX, e->mouse.screenY, e->mouse.clientX, e->mouse.clientY, + e->mouse.ctrlKey ? " CTRL" : "", e->mouse.shiftKey ? " SHIFT" : "", e->mouse.altKey ? " ALT" : "", e->mouse.metaKey ? " META" : "", + e->mouse.button, e->mouse.buttons, e->mouse.canvasX, e->mouse.canvasY, + (float)e->deltaX, (float)e->deltaY, (float)e->deltaZ, e->deltaMode); + + if (e->deltaY > 0.f || e->deltaY < 0.f) + gotWheel = 1; + + instruction(); + return 0; +} + +int main() +{ + EMSCRIPTEN_RESULT ret = emscripten_set_click_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_click_callback); + ret = emscripten_set_mousedown_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_mousedown_callback); + ret = emscripten_set_mouseup_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_mouseup_callback); + ret = emscripten_set_dblclick_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_dblclick_callback); + ret = emscripten_set_mousemove_callback(0, 0, 1, mouse_callback); + TEST_RESULT(emscripten_set_mousemove_callback); + + ret = emscripten_set_wheel_callback(0, 0, 1, wheel_callback); + TEST_RESULT(emscripten_set_wheel_callback); + +#ifdef AUTOMATE_SUCCESS + EM_ASM( + function sendEvent(type, data) { + var event = document.createEvent('Event'); + event.initEvent(type, true, true); + for(var d in data) event[d] = data[d]; + window.dispatchEvent(event); + } + sendEvent('click', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 1 }); + ); + // Test that unregistering a callback works. Clicks should no longer be received. + ret = emscripten_set_click_callback(0, 0, 1, 0); + TEST_RESULT(emscripten_set_click_callback); + + EM_ASM( + function sendEvent(type, data) { + var event = document.createEvent('Event'); + event.initEvent(type, true, true); + for(var d in data) event[d] = data[d]; + window.dispatchEvent(event); + } + sendEvent('click', { screenX: -500000, screenY: -500000, clientX: -500000, clientY: -500000, button: 0, buttons: 1 }); // Send a dummy event that should not be received. + sendEvent('mousedown', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 1 }); + sendEvent('mouseup', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 0 }); + sendEvent('dblclick', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 1 }); + sendEvent('mousemove', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 0, movementX: 1, movementY: 1 }); + sendEvent('wheel', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 0, deltaX: 1, deltaY: 1, deltaZ: 1, deltaMode: 1 }); + sendEvent('mousewheel', { screenX: 1, screenY: 1, clientX: 1, clientY: 1, button: 0, buttons: 0, wheelDeltaX: 1, wheelDeltaY: 1 }); + ); +#endif + + /* For the events to function, one must either call emscripten_set_main_loop or enable Module.noExitRuntime by some other means. + Otherwise the application will exit after leaving main(), and the atexit handlers will clean up all event hooks (by design). */ + EM_ASM(Module['noExitRuntime'] = true); + return 0; +} diff --git a/tests/test_interactive.py b/tests/test_interactive.py new file mode 100644 index 00000000..aa1d96af --- /dev/null +++ b/tests/test_interactive.py @@ -0,0 +1,97 @@ +import BaseHTTPServer, multiprocessing, os, shutil, subprocess, unittest, zlib, webbrowser, time, shlex +from runner import BrowserCore, path_from_root, nonfastcomp +from tools.shared import * + +# User can specify an environment variable EMSCRIPTEN_BROWSER to force the browser test suite to +# run using another browser command line than the default system browser. +emscripten_browser = os.environ.get('EMSCRIPTEN_BROWSER') +if emscripten_browser: + cmd = shlex.split(emscripten_browser) + def run_in_other_browser(url): + Popen(cmd + [url]) + webbrowser.open_new = run_in_other_browser + +class interactive(BrowserCore): + @classmethod + def setUpClass(self): + super(interactive, self).setUpClass() + print + print 'Running the browser tests. Make sure the browser allows popups from localhost.' + print + + def test_html5_fullscreen(self): + self.btest(path_from_root('tests', 'test_html5_fullscreen.c'), expected='0') + + def test_html5_mouse(self): + self.btest(path_from_root('tests', 'test_html5_mouse.c'), expected='0') + + def test_sdl_touch(self): + self.btest(path_from_root('tests', 'sdl_touch.c'), args=['-O2', '-g1', '--closure', '1'], expected='0') + + def test_sdl_wm_togglefullscreen(self): + self.btest('sdl_wm_togglefullscreen.c', expected='1', args=['-s', 'NO_EXIT_RUNTIME=1']) + + def test_sdl_audio(self): + shutil.copyfile(path_from_root('tests', 'sounds', 'alarmvictory_1.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) + shutil.copyfile(path_from_root('tests', 'sounds', 'alarmcreatemiltaryfoot_1.wav'), os.path.join(self.get_dir(), 'sound2.wav')) + shutil.copyfile(path_from_root('tests', 'sounds', 'noise.ogg'), os.path.join(self.get_dir(), 'noise.ogg')) + shutil.copyfile(path_from_root('tests', 'sounds', 'the_entertainer.ogg'), os.path.join(self.get_dir(), 'the_entertainer.ogg')) + open(os.path.join(self.get_dir(), 'bad.ogg'), 'w').write('I claim to be audio, but am lying') + open(os.path.join(self.get_dir(), 'sdl_audio.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio.c')).read())) + + # use closure to check for a possible bug with closure minifying away newer Audio() attributes + Popen([PYTHON, EMCC, '-O2', '--closure', '1', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio.c'), '--preload-file', 'sound.ogg', '--preload-file', 'sound2.wav', '--embed-file', 'the_entertainer.ogg', '--preload-file', 'noise.ogg', '--preload-file', 'bad.ogg', '-o', 'page.html', '-s', 'EXPORTED_FUNCTIONS=["_main", "_play", "_play2"]']).communicate() + self.run_browser('page.html', '', '/report_result?1') + + def test_sdl_audio_mix_channels(self): + shutil.copyfile(path_from_root('tests', 'sounds', 'noise.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) + open(os.path.join(self.get_dir(), 'sdl_audio_mix_channels.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_mix_channels.c')).read())) + + Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_mix_channels.c'), '--preload-file', 'sound.ogg', '-o', 'page.html']).communicate() + self.run_browser('page.html', '', '/report_result?1') + + def test_sdl_audio_mix(self): + shutil.copyfile(path_from_root('tests', 'sounds', 'pluck.ogg'), os.path.join(self.get_dir(), 'sound.ogg')) + shutil.copyfile(path_from_root('tests', 'sounds', 'the_entertainer.ogg'), os.path.join(self.get_dir(), 'music.ogg')) + shutil.copyfile(path_from_root('tests', 'sounds', 'noise.ogg'), os.path.join(self.get_dir(), 'noise.ogg')) + open(os.path.join(self.get_dir(), 'sdl_audio_mix.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_mix.c')).read())) + + Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_mix.c'), '--preload-file', 'sound.ogg', '--preload-file', 'music.ogg', '--preload-file', 'noise.ogg', '-o', 'page.html']).communicate() + self.run_browser('page.html', '', '/report_result?1') + + def test_sdl_audio_quickload(self): + open(os.path.join(self.get_dir(), 'sdl_audio_quickload.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_quickload.c')).read())) + + Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_quickload.c'), '-o', 'page.html', '-s', 'EXPORTED_FUNCTIONS=["_main", "_play"]']).communicate() + self.run_browser('page.html', '', '/report_result?1') + + def test_sdl_audio_beeps(self): + open(os.path.join(self.get_dir(), 'sdl_audio_beep.cpp'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_beep.cpp')).read())) + + # use closure to check for a possible bug with closure minifying away newer Audio() attributes + Popen([PYTHON, EMCC, '-O2', '--closure', '1', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_beep.cpp'), '-s', 'DISABLE_EXCEPTION_CATCHING=0', '-o', 'page.html']).communicate() + self.run_browser('page.html', '', '/report_result?1') + + def test_openal_playback(self): + shutil.copyfile(path_from_root('tests', 'sounds', 'audio.wav'), os.path.join(self.get_dir(), 'audio.wav')) + open(os.path.join(self.get_dir(), 'openal_playback.cpp'), 'w').write(self.with_report_result(open(path_from_root('tests', 'openal_playback.cpp')).read())) + + Popen([PYTHON, EMCC, '-O2', os.path.join(self.get_dir(), 'openal_playback.cpp'), '--preload-file', 'audio.wav', '-o', 'page.html']).communicate() + self.run_browser('page.html', '', '/report_result?1') + + def test_openal_buffers(self): + shutil.copyfile(path_from_root('tests', 'sounds', 'the_entertainer.wav'), os.path.join(self.get_dir(), 'the_entertainer.wav')) + self.btest('openal_buffers.c', '0', args=['--preload-file', 'the_entertainer.wav'],) + + def get_freealut_library(self): + if WINDOWS and Building.which('cmake'): + return self.get_library('freealut', os.path.join('hello_world.bc'), configure=['cmake', '.'], configure_args=['-DBUILD_TESTS=ON']) + else: + return self.get_library('freealut', os.path.join('examples', '.libs', 'hello_world.bc'), make_args=['EXEEXT=.bc']) + + def test_freealut(self): + programs = self.get_freealut_library() + for program in programs: + assert os.path.exists(program) + Popen([PYTHON, EMCC, '-O2', program, '-o', 'page.html']).communicate() + self.run_browser('page.html', 'You should hear "Hello World!"') diff --git a/tests/test_other.py b/tests/test_other.py index b4abf275..cdea493a 100644 --- a/tests/test_other.py +++ b/tests/test_other.py @@ -1,7 +1,7 @@ import multiprocessing, os, re, shutil, subprocess, sys import tools.shared from tools.shared import * -from runner import RunnerCore, path_from_root, get_bullet_library +from runner import RunnerCore, path_from_root, get_bullet_library, nonfastcomp class other(RunnerCore): def get_zlib_library(self): @@ -19,7 +19,7 @@ class other(RunnerCore): output = Popen([PYTHON, compiler, '--version'], stdout=PIPE, stderr=PIPE).communicate() output = output[0].replace('\r', '') self.assertContained('''emcc (Emscripten GCC-like replacement)''', output) - self.assertContained('''Copyright (C) 2013 the Emscripten authors (see AUTHORS.txt) + self.assertContained('''Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt) This is free and open source software under the MIT license. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ''', output) @@ -65,6 +65,7 @@ Options that are modified or new in %s include: # emcc src.cpp -c and emcc src.cpp -o src.[o|bc] ==> should give a .bc file # regression check: -o js should create "js", with bitcode content for args in [['-c'], ['-o', 'src.o'], ['-o', 'src.bc'], ['-o', 'src.so'], ['-o', 'js']]: + print '-c stuff', args target = args[1] if len(args) == 2 else 'hello_world.o' self.clear() Popen([PYTHON, compiler, path_from_root('tests', 'hello_world' + suffix)] + args, stdout=PIPE, stderr=PIPE).communicate() @@ -114,8 +115,6 @@ Options that are modified or new in %s include: os.chdir(self.get_dir()) self.clear() - # dlmalloc. dlmalloc is special in that it is the only part of libc that is (1) hard to write well, and - # very speed-sensitive. So we do not implement it in JS in library.js, instead we compile it from source for source, has_malloc in [('hello_world' + suffix, False), ('hello_malloc.cpp', True)]: print source, has_malloc self.clear() @@ -193,9 +192,9 @@ Options that are modified or new in %s include: (['-O2', '-g1'], lambda generated: 'var b = 0' in generated and not 'function _main' in generated, 'compress is cancelled by -g1'), (['-O2', '-g2'], lambda generated: ('var b = 0' in generated or 'var i1 = 0' in generated) and 'function _main' in generated, 'minify is cancelled by -g2'), (['-O2', '-g3'], lambda generated: 'var b=0' not in generated and 'var b = 0' not in generated and 'function _main' in generated, 'registerize is cancelled by -g3'), + (['-O2', '-profiling'], lambda generated: ('var b = 0' in generated or 'var i1 = 0' in generated) and 'function _main' in generated, 'similar to -g2'), #(['-O2', '-g4'], lambda generated: 'var b=0' not in generated and 'var b = 0' not in generated and 'function _main' in generated, 'same as -g3 for now'), (['-s', 'INLINING_LIMIT=0'], lambda generated: 'function _dump' in generated, 'no inlining without opts'), - (['-Os', '--llvm-lto', '1', '-s', 'ASM_JS=0', '-g2'], lambda generated: 'function _dump' in generated, '-Os disables inlining'), (['-s', 'USE_TYPED_ARRAYS=0'], lambda generated: 'new Int32Array' not in generated, 'disable typed arrays'), (['-s', 'USE_TYPED_ARRAYS=1'], lambda generated: 'IHEAPU = ' in generated, 'typed arrays 1 selected'), ([], lambda generated: 'Module["_dump"]' not in generated, 'dump is not exported by default'), @@ -207,7 +206,7 @@ Options that are modified or new in %s include: ]: print params, text self.clear() - if os.environ.get('EMCC_FAST_COMPILER') == '1' and ['disable typed arrays', 'typed arrays 1 selected']: continue + if os.environ.get('EMCC_FAST_COMPILER') != '0' and ['disable typed arrays', 'typed arrays 1 selected']: continue output = Popen([PYTHON, compiler, path_from_root('tests', 'hello_world_loop.cpp'), '-o', 'a.out.js'] + params, stdout=PIPE, stderr=PIPE).communicate() assert len(output[0]) == 0, output[0] assert os.path.exists('a.out.js'), '\n'.join(output) @@ -277,6 +276,9 @@ f.close() # TODO: test normal project linking, static and dynamic: get_library should not need to be told what to link! # TODO: deprecate llvm optimizations, dlmalloc, etc. in emscripten.py. + def test_emcc_nonfastcomp(self): + nonfastcomp(self.test_emcc) + def test_cmake(self): # Test all supported generators. if WINDOWS: @@ -451,48 +453,48 @@ f.close() self.assertContained('hello, world!', run_js(os.path.join(self.get_dir(), 'a.out.js'))) def test_unaligned_memory(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') - - open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r''' - #include <stdio.h> - #include <stdarg.h> + def test(): + open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r''' + #include <stdio.h> + #include <stdarg.h> - typedef unsigned char Bit8u; - typedef unsigned short Bit16u; - typedef unsigned int Bit32u; + typedef unsigned char Bit8u; + typedef unsigned short Bit16u; + typedef unsigned int Bit32u; - int main() - { - va_list argp; - va_arg(argp, char *); // check for compilation error, #1705 + int main() + { + va_list argp; + va_arg(argp, char *); // check for compilation error, #1705 - Bit8u data[4] = {0x01,0x23,0x45,0x67}; + Bit8u data[4] = {0x01,0x23,0x45,0x67}; - printf("data: %x\n", *(Bit32u*)data); - printf("data[0,1] 16bit: %x\n", *(Bit16u*)data); - printf("data[1,2] 16bit: %x\n", *(Bit16u*)(data+1)); - } - ''') - Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate() - self.assertContained('data: 67452301\ndata[0,1] 16bit: 2301\ndata[1,2] 16bit: 4523', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + printf("data: %x\n", *(Bit32u*)data); + printf("data[0,1] 16bit: %x\n", *(Bit16u*)data); + printf("data[1,2] 16bit: %x\n", *(Bit16u*)(data+1)); + } + ''') + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate() + self.assertContained('data: 67452301\ndata[0,1] 16bit: 2301\ndata[1,2] 16bit: 4523', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + nonfastcomp(test) def test_unaligned_memory_2(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') - - open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r''' - #include <string> - #include <stdio.h> + def test(): + open(os.path.join(self.get_dir(), 'test.cpp'), 'w').write(r''' + #include <string> + #include <stdio.h> - int main( int argc, char ** argv ) - { - std::string testString( "Hello, World!" ); + int main( int argc, char ** argv ) + { + std::string testString( "Hello, World!" ); - printf( "testString = %s\n", testString.c_str() ); - return 0; - } - ''') - Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate() - self.assertContained('testString = Hello, World!', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + printf( "testString = %s\n", testString.c_str() ); + return 0; + } + ''') + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'test.cpp'), '-s', 'UNALIGNED_MEMORY=1']).communicate() + self.assertContained('testString = Hello, World!', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + nonfastcomp(test) def test_asm_minify(self): def test(args): @@ -537,12 +539,13 @@ f.close() ''' open('src.c', 'w').write(src) def test(args, expected, err_expected=None): + print args, expected, err_expected out, err = Popen([PYTHON, EMCC, 'src.c'] + args, stderr=PIPE).communicate() if err_expected: self.assertContained(err_expected, err) self.assertContained(expected, run_js(self.in_dir('a.out.js'), stderr=PIPE, full_output=True)) return open(self.in_dir('a.out.js')).read() - if os.environ.get('EMCC_FAST_COMPILER') != '1': + if os.environ.get('EMCC_FAST_COMPILER') == '0': test([], 'my func') # no asm, so casting func works test(['-O2'], 'abort', ['Casting potentially incompatible function pointer i32 ()* to void (...)*, for my_func', 'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure @@ -552,12 +555,12 @@ f.close() 'Incompatible function pointer casts are very dangerous with ASM_JS=1, you should investigate and correct these']) # asm, so failure else: # fastcomp. all asm, so it can't just work with wrong sigs. but, ASSERTIONS=2 gives much better info to debug - test(['-O1'], 'abort') # no useful info - test(['-O1', '-s', 'ASSERTIONS=1'], '''Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an different type, which will fail? + test(['-O1'], 'If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.') # no useful info, but does mention ASSERTIONS + test(['-O1', '-s', 'ASSERTIONS=1'], '''Invalid function pointer called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this) Build with ASSERTIONS=2 for more info. ''') # some useful text - test(['-O1', '-s', 'ASSERTIONS=2'], '''Invalid function pointer '1' called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an different type, which will fail? -This pointer might make sense in another type signature: i: _my_func + test(['-O1', '-s', 'ASSERTIONS=2'], '''Invalid function pointer '0' called with signature 'v'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this) +This pointer might make sense in another type signature: i: 0 ''') # actually useful identity of the bad pointer, with comparisons to what it would be in other types/tables def test_l_link(self): @@ -590,283 +593,289 @@ This pointer might make sense in another type signature: i: _my_func assert not os.path.exists('a.out') and not os.path.exists('a.exe'), 'Must not leave unneeded linker stubs' def test_static_link(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') - - def test(name, header, main, side, expected, args=[], suffix='cpp', first=True): - print name - #t = main ; main = side ; side = t - original_main = main - original_side = side - if header: open(os.path.join(self.get_dir(), 'header.h'), 'w').write(header) - if type(main) == str: - open(os.path.join(self.get_dir(), 'main.' + suffix), 'w').write(main) - main = ['main.' + suffix] - if type(side) == str: - open(os.path.join(self.get_dir(), 'side.' + suffix), 'w').write(side) - side = ['side.' + suffix] - Popen([PYTHON, EMCC] + side + ['-o', 'side.js', '-s', 'SIDE_MODULE=1', '-O2'] + args).communicate() - # TODO: test with and without DISABLE_GL_EMULATION, check that file sizes change - Popen([PYTHON, EMCC] + main + ['-o', 'main.js', '-s', 'MAIN_MODULE=1', '-O2', '-s', 'DISABLE_GL_EMULATION=1'] + args).communicate() - Popen([PYTHON, EMLINK, 'main.js', 'side.js', 'together.js'], stdout=PIPE).communicate() - assert os.path.exists('together.js') - for engine in JS_ENGINES: - out = run_js('together.js', engine=engine, stderr=PIPE, full_output=True) - self.assertContained(expected, out) - if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out) - if first: - shutil.copyfile('together.js', 'first.js') - test(name + ' (reverse)', header, original_side, original_main, expected, args, suffix, False) # test reverse order - - # test a simple call from one module to another. only one has a string (and constant memory initialization for it) - test('basics', '', ''' - #include <stdio.h> - extern int sidey(); - int main() { - printf("other says %d.", sidey()); - return 0; - } - ''', ''' - int sidey() { return 11; } - ''', 'other says 11.') - - # finalization of float variables should pass asm.js validation - test('floats', '', ''' - #include <stdio.h> - extern float sidey(); - int main() { - printf("other says %.2f.", sidey()+1); - return 0; - } - ''', ''' - float sidey() { return 11.5; } - ''', 'other says 12.50') - - # memory initialization in both - test('multiple memory inits', '', r''' - #include <stdio.h> - extern void sidey(); - int main() { - printf("hello from main\n"); - sidey(); - return 0; - } - ''', r''' - #include <stdio.h> - void sidey() { printf("hello from side\n"); } - ''', 'hello from main\nhello from side\n') + def nonfc(): + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp') + + def test(name, header, main, side, expected, args=[], suffix='cpp', first=True): + print name + #t = main ; main = side ; side = t + original_main = main + original_side = side + if header: open(os.path.join(self.get_dir(), 'header.h'), 'w').write(header) + if type(main) == str: + open(os.path.join(self.get_dir(), 'main.' + suffix), 'w').write(main) + main = ['main.' + suffix] + if type(side) == str: + open(os.path.join(self.get_dir(), 'side.' + suffix), 'w').write(side) + side = ['side.' + suffix] + Popen([PYTHON, EMCC] + side + ['-o', 'side.js', '-s', 'SIDE_MODULE=1', '-O2'] + args).communicate() + # TODO: test with and without DISABLE_GL_EMULATION, check that file sizes change + Popen([PYTHON, EMCC] + main + ['-o', 'main.js', '-s', 'MAIN_MODULE=1', '-O2', '-s', 'DISABLE_GL_EMULATION=1'] + args).communicate() + Popen([PYTHON, EMLINK, 'main.js', 'side.js', 'together.js'], stdout=PIPE).communicate() + assert os.path.exists('together.js') + for engine in JS_ENGINES: + out = run_js('together.js', engine=engine, stderr=PIPE, full_output=True) + self.assertContained(expected, out) + if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out) + if first: + shutil.copyfile('together.js', 'first.js') + test(name + ' (reverse)', header, original_side, original_main, expected, args, suffix, False) # test reverse order + + # test a simple call from one module to another. only one has a string (and constant memory initialization for it) + test('basics', '', ''' + #include <stdio.h> + extern int sidey(); + int main() { + printf("other says %d.", sidey()); + return 0; + } + ''', ''' + int sidey() { return 11; } + ''', 'other says 11.') - # function pointers - test('fp1', 'typedef void (*voidfunc)();', r''' - #include <stdio.h> - #include "header.h" - voidfunc sidey(voidfunc f); - void a() { printf("hello from funcptr\n"); } - int main() { - sidey(a)(); - return 0; - } - ''', ''' - #include "header.h" - voidfunc sidey(voidfunc f) { return f; } - ''', 'hello from funcptr\n') + # finalization of float variables should pass asm.js validation + test('floats', '', ''' + #include <stdio.h> + extern float sidey(); + int main() { + printf("other says %.2f.", sidey()+1); + return 0; + } + ''', ''' + float sidey() { return 11.5; } + ''', 'other says 12.50') - # function pointers with 'return' in the name - test('fp2', 'typedef void (*voidfunc)();', r''' - #include <stdio.h> - #include "header.h" - int sidey(voidfunc f); - void areturn0() { printf("hello 0\n"); } - void areturn1() { printf("hello 1\n"); } - void areturn2() { printf("hello 2\n"); } - int main(int argc, char **argv) { - voidfunc table[3] = { areturn0, areturn1, areturn2 }; - table[sidey(NULL)](); - return 0; - } - ''', ''' - #include "header.h" - int sidey(voidfunc f) { if (f) f(); return 1; } - ''', 'hello 1\n') + # memory initialization in both + test('multiple memory inits', '', r''' + #include <stdio.h> + extern void sidey(); + int main() { + printf("hello from main\n"); + sidey(); + return 0; + } + ''', r''' + #include <stdio.h> + void sidey() { printf("hello from side\n"); } + ''', 'hello from main\nhello from side\n') - # Global initializer - test('global init', '', r''' - #include <stdio.h> - struct Class { - Class() { printf("a new Class\n"); } - }; - static Class c; - int main() { - return 0; - } - ''', r''' - void nothing() {} - ''', 'a new Class\n') + # function pointers + test('fp1', 'typedef void (*voidfunc)();', r''' + #include <stdio.h> + #include "header.h" + voidfunc sidey(voidfunc f); + void a() { printf("hello from funcptr\n"); } + int main() { + sidey(a)(); + return 0; + } + ''', ''' + #include "header.h" + voidfunc sidey(voidfunc f) { return f; } + ''', 'hello from funcptr\n') - # Multiple global initializers (LLVM generates overlapping names for them) - test('global inits', r''' - #include <stdio.h> - struct Class { - Class(const char *name) { printf("new %s\n", name); } - }; - ''', r''' - #include "header.h" - static Class c("main"); - int main() { - return 0; - } - ''', r''' - #include "header.h" - static Class c("side"); - ''', ['new main\nnew side\n', 'new side\nnew main\n']) + # function pointers with 'return' in the name + test('fp2', 'typedef void (*voidfunc)();', r''' + #include <stdio.h> + #include "header.h" + int sidey(voidfunc f); + void areturn0() { printf("hello 0\n"); } + void areturn1() { printf("hello 1\n"); } + void areturn2() { printf("hello 2\n"); } + int main(int argc, char **argv) { + voidfunc table[3] = { areturn0, areturn1, areturn2 }; + table[sidey(NULL)](); + return 0; + } + ''', ''' + #include "header.h" + int sidey(voidfunc f) { if (f) f(); return 1; } + ''', 'hello 1\n') - # Class code used across modules - test('codecall', r''' - #include <stdio.h> - struct Class { - Class(const char *name); - }; - ''', r''' - #include "header.h" - int main() { - Class c("main"); - return 0; - } - ''', r''' - #include "header.h" - Class::Class(const char *name) { printf("new %s\n", name); } - ''', ['new main\n']) + # Global initializer + test('global init', '', r''' + #include <stdio.h> + struct Class { + Class() { printf("a new Class\n"); } + }; + static Class c; + int main() { + return 0; + } + ''', r''' + void nothing() {} + ''', 'a new Class\n') - # malloc usage in both modules - test('malloc', r''' - #include <stdlib.h> - #include <string.h> - char *side(const char *data); - ''', r''' - #include <stdio.h> - #include "header.h" - int main() { - char *temp = side("hello through side\n"); - char *ret = (char*)malloc(strlen(temp)+1); - strcpy(ret, temp); - temp[1] = 'x'; - puts(ret); - return 0; - } - ''', r''' - #include "header.h" - char *side(const char *data) { - char *ret = (char*)malloc(strlen(data)+1); - strcpy(ret, data); - return ret; - } - ''', ['hello through side\n']) + # Multiple global initializers (LLVM generates overlapping names for them) + test('global inits', r''' + #include <stdio.h> + struct Class { + Class(const char *name) { printf("new %s\n", name); } + }; + ''', r''' + #include "header.h" + static Class c("main"); + int main() { + return 0; + } + ''', r''' + #include "header.h" + static Class c("side"); + ''', ['new main\nnew side\n', 'new side\nnew main\n']) - # js library call - open('lib.js', 'w').write(r''' - mergeInto(LibraryManager.library, { - test_lib_func: function(x) { - return x + 17.2; + # Class code used across modules + test('codecall', r''' + #include <stdio.h> + struct Class { + Class(const char *name); + }; + ''', r''' + #include "header.h" + int main() { + Class c("main"); + return 0; } - }); - ''') - test('js-lib', 'extern "C" { extern double test_lib_func(int input); }', r''' - #include <stdio.h> - #include "header.h" - extern double sidey(); - int main2() { return 11; } - int main() { - int input = sidey(); - double temp = test_lib_func(input); - printf("other says %.2f\n", temp); - printf("more: %.5f, %d\n", temp, input); - return 0; - } - ''', r''' - #include <stdio.h> - #include "header.h" - extern int main2(); - double sidey() { - int temp = main2(); - printf("main2 sed: %d\n", temp); - printf("main2 sed: %u, %c\n", temp, temp/2); - return test_lib_func(temp); - } - ''', 'other says 45.2', ['--js-library', 'lib.js']) + ''', r''' + #include "header.h" + Class::Class(const char *name) { printf("new %s\n", name); } + ''', ['new main\n']) - # libc usage in one modules. must force libc inclusion in the main module if that isn't the one using mallinfo() - try: - os.environ['EMCC_FORCE_STDLIBS'] = 'libc' - test('malloc-1', r''' + # malloc usage in both modules + test('malloc', r''' + #include <stdlib.h> #include <string.h> - int side(); + char *side(const char *data); ''', r''' #include <stdio.h> #include "header.h" int main() { - printf("|%d|\n", side()); + char *temp = side("hello through side\n"); + char *ret = (char*)malloc(strlen(temp)+1); + strcpy(ret, temp); + temp[1] = 'x'; + puts(ret); return 0; } ''', r''' - #include <stdlib.h> - #include <malloc.h> #include "header.h" - int side() { - struct mallinfo m = mallinfo(); - return m.arena > 1; + char *side(const char *data) { + char *ret = (char*)malloc(strlen(data)+1); + strcpy(ret, data); + return ret; } - ''', ['|1|\n']) - finally: - del os.environ['EMCC_FORCE_STDLIBS'] - - # iostream usage in one and std::string in both - test('iostream', r''' - #include <iostream> - #include <string> - std::string side(); - ''', r''' - #include "header.h" - int main() { - std::cout << "hello from main " << side() << std::endl; - return 0; - } - ''', r''' - #include "header.h" - std::string side() { return "and hello from side"; } - ''', ['hello from main and hello from side\n']) - - # followup to iostream test: a second linking - print 'second linking of a linking output' - open('moar.cpp', 'w').write(r''' - #include <iostream> - struct Moar { - Moar() { std::cout << "moar!" << std::endl; } - }; - Moar m; - ''') - Popen([PYTHON, EMCC, 'moar.cpp', '-o', 'moar.js', '-s', 'SIDE_MODULE=1', '-O2']).communicate() - Popen([PYTHON, EMLINK, 'together.js', 'moar.js', 'triple.js'], stdout=PIPE).communicate() - assert os.path.exists('triple.js') - for engine in JS_ENGINES: - out = run_js('triple.js', engine=engine, stderr=PIPE, full_output=True) - self.assertContained('moar!\nhello from main and hello from side\n', out) - if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out) - - # zlib compression library. tests function pointers in initializers and many other things - test('zlib', '', open(path_from_root('tests', 'zlib', 'example.c'), 'r').read(), - self.get_zlib_library(), - open(path_from_root('tests', 'zlib', 'ref.txt'), 'r').read(), - args=['-I' + path_from_root('tests', 'zlib')], suffix='c') - - use_cmake = WINDOWS - bullet_library = get_bullet_library(self, use_cmake) - - # bullet physics engine. tests all the things - test('bullet', '', open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(), - bullet_library, - [open(path_from_root('tests', 'bullet', 'output.txt'), 'r').read(), # different roundings - open(path_from_root('tests', 'bullet', 'output2.txt'), 'r').read(), - open(path_from_root('tests', 'bullet', 'output3.txt'), 'r').read()], - args=['-I' + path_from_root('tests', 'bullet', 'src')]) + ''', ['hello through side\n']) + + # js library call + open('lib.js', 'w').write(r''' + mergeInto(LibraryManager.library, { + test_lib_func: function(x) { + return x + 17.2; + } + }); + ''') + test('js-lib', 'extern "C" { extern double test_lib_func(int input); }', r''' + #include <stdio.h> + #include "header.h" + extern double sidey(); + int main2() { return 11; } + int main() { + int input = sidey(); + double temp = test_lib_func(input); + printf("other says %.2f\n", temp); + printf("more: %.5f, %d\n", temp, input); + return 0; + } + ''', r''' + #include <stdio.h> + #include "header.h" + extern int main2(); + double sidey() { + int temp = main2(); + printf("main2 sed: %d\n", temp); + printf("main2 sed: %u, %c\n", temp, temp/2); + return test_lib_func(temp); + } + ''', 'other says 45.2', ['--js-library', 'lib.js']) + + # libc usage in one modules. must force libc inclusion in the main module if that isn't the one using mallinfo() + try: + os.environ['EMCC_FORCE_STDLIBS'] = 'libc' + test('malloc-1', r''' + #include <string.h> + int side(); + ''', r''' + #include <stdio.h> + #include "header.h" + int main() { + printf("|%d|\n", side()); + return 0; + } + ''', r''' + #include <stdlib.h> + #include <malloc.h> + #include "header.h" + int side() { + struct mallinfo m = mallinfo(); + return m.arena > 1; + } + ''', ['|1|\n']) + finally: + del os.environ['EMCC_FORCE_STDLIBS'] + + # iostream usage in one and std::string in both + test('iostream', r''' + #include <iostream> + #include <string> + std::string side(); + ''', r''' + #include "header.h" + int main() { + std::cout << "hello from main " << side() << std::endl; + return 0; + } + ''', r''' + #include "header.h" + std::string side() { return "and hello from side"; } + ''', ['hello from main and hello from side\n']) + + # followup to iostream test: a second linking + print 'second linking of a linking output' + open('moar.cpp', 'w').write(r''' + #include <iostream> + struct Moar { + Moar() { std::cout << "moar!" << std::endl; } + }; + Moar m; + ''') + Popen([PYTHON, EMCC, 'moar.cpp', '-o', 'moar.js', '-s', 'SIDE_MODULE=1', '-O2']).communicate() + Popen([PYTHON, EMLINK, 'together.js', 'moar.js', 'triple.js'], stdout=PIPE).communicate() + assert os.path.exists('triple.js') + for engine in JS_ENGINES: + out = run_js('triple.js', engine=engine, stderr=PIPE, full_output=True) + self.assertContained('moar!\nhello from main and hello from side\n', out) + if engine == SPIDERMONKEY_ENGINE: self.validate_asmjs(out) + + # zlib compression library. tests function pointers in initializers and many other things + try: + os.environ['EMCC_FORCE_STDLIBS'] = 'libcextra' + test('zlib', '', open(path_from_root('tests', 'zlib', 'example.c'), 'r').read(), + self.get_zlib_library(), + open(path_from_root('tests', 'zlib', 'ref.txt'), 'r').read(), + args=['-I' + path_from_root('tests', 'zlib')], suffix='c') + finally: + del os.environ['EMCC_FORCE_STDLIBS'] + + use_cmake = WINDOWS + bullet_library = get_bullet_library(self, use_cmake) + + # bullet physics engine. tests all the things + test('bullet', '', open(path_from_root('tests', 'bullet', 'Demos', 'HelloWorld', 'HelloWorld.cpp'), 'r').read(), + bullet_library, + [open(path_from_root('tests', 'bullet', 'output.txt'), 'r').read(), # different roundings + open(path_from_root('tests', 'bullet', 'output2.txt'), 'r').read(), + open(path_from_root('tests', 'bullet', 'output3.txt'), 'r').read()], + args=['-I' + path_from_root('tests', 'bullet', 'src')]) + nonfastcomp(nonfc) def test_outline(self): def test(name, src, libs, expected, expected_ranges, args=[], suffix='cpp'): @@ -914,11 +923,11 @@ This pointer might make sense in another type signature: i: _my_func for test_opts, expected_ranges in [ ([], { 100: (190, 500), - 250: (200, 500), - 500: (250, 500), + 250: (200, 600), + 500: (200, 700), 1000: (230, 1000), - 2000: (380, 2000), - 5000: (800, 5000), + 2000: (300, 2000), + 5000: (500, 5000), 0: (1500, 5000) }), (['-O2'], { @@ -939,11 +948,12 @@ This pointer might make sense in another type signature: i: _my_func args=['-I' + path_from_root('tests', 'zlib')], suffix='c') def test_symlink(self): + self.clear() if os.name == 'nt': return self.skip('Windows FS does not need to be tested for symlinks support, since it does not have them.') open(os.path.join(self.get_dir(), 'foobar.xxx'), 'w').write('int main(){ return 0; }') os.symlink(os.path.join(self.get_dir(), 'foobar.xxx'), os.path.join(self.get_dir(), 'foobar.c')) - Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.c'), '-o', os.path.join(self.get_dir(), 'foobar')], stdout=PIPE, stderr=PIPE).communicate() + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.c'), '-o', os.path.join(self.get_dir(), 'foobar')]).communicate() assert os.path.exists(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar.xxx')) @@ -951,7 +961,7 @@ This pointer might make sense in another type signature: i: _my_func open(os.path.join(self.get_dir(), 'foobar.c'), 'w').write('int main(){ return 0; }') os.symlink(os.path.join(self.get_dir(), 'foobar.c'), os.path.join(self.get_dir(), 'foobar.xxx')) - Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.xxx'), '-o', os.path.join(self.get_dir(), 'foobar')], stdout=PIPE, stderr=PIPE).communicate() + Popen([PYTHON, EMCC, os.path.join(self.get_dir(), 'foobar.xxx'), '-o', os.path.join(self.get_dir(), 'foobar')]).communicate() assert os.path.exists(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar')) try_delete(os.path.join(self.get_dir(), 'foobar.xxx')) @@ -1582,6 +1592,8 @@ This pointer might make sense in another type signature: i: _my_func def test_warn_undefined(self): open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r''' #include <stdio.h> + #include <SDL.h> + #include "SDL/SDL_opengl.h" extern "C" { void something(); @@ -1589,6 +1601,7 @@ This pointer might make sense in another type signature: i: _my_func } int main() { + printf("%p", SDL_GL_GetProcAddress("glGenTextures")); // pull in gl proc stuff, avoid warnings on emulation funcs something(); elsey(); return 0; @@ -1608,6 +1621,7 @@ This pointer might make sense in another type signature: i: _my_func self.assertContained('unresolved symbol: something', output[1]) self.assertContained('unresolved symbol: elsey', output[1]) assert os.path.exists('a.out.js') + self.assertNotContained('unresolved symbol: emscripten_', output[1]) elif action == 'ERROR' and value: self.assertContained('unresolved symbol: something', output[1]) self.assertContained('unresolved symbol: elsey', output[1]) @@ -1764,14 +1778,9 @@ This pointer might make sense in another type signature: i: _my_func def test_js_optimizer(self): for input, expected, passes in [ (path_from_root('tools', 'test-js-optimizer.js'), open(path_from_root('tools', 'test-js-optimizer-output.js')).read(), - ['hoistMultiples', 'loopOptimizer', 'removeAssignsToUndefined', 'simplifyExpressions']), - (path_from_root('tools', 'test-js-optimizer-t2c.js'), open(path_from_root('tools', 'test-js-optimizer-t2c-output.js')).read(), - ['simplifyExpressions', 'optimizeShiftsConservative']), - (path_from_root('tools', 'test-js-optimizer-t2.js'), open(path_from_root('tools', 'test-js-optimizer-t2-output.js')).read(), - ['simplifyExpressions', 'optimizeShiftsAggressive']), - # Make sure that optimizeShifts handles functions with shift statements. - (path_from_root('tools', 'test-js-optimizer-t3.js'), open(path_from_root('tools', 'test-js-optimizer-t3-output.js')).read(), - ['optimizeShiftsAggressive']), + ['hoistMultiples', 'removeAssignsToUndefined', 'simplifyExpressions']), + (path_from_root('tools', 'test-js-optimizer-si.js'), open(path_from_root('tools', 'test-js-optimizer-si-output.js')).read(), + ['simplifyIfs']), (path_from_root('tools', 'test-js-optimizer-regs.js'), open(path_from_root('tools', 'test-js-optimizer-regs-output.js')).read(), ['registerize']), (path_from_root('tools', 'eliminator', 'eliminator-test.js'), open(path_from_root('tools', 'eliminator', 'eliminator-test-output.js')).read(), @@ -1817,26 +1826,28 @@ This pointer might make sense in another type signature: i: _my_func assert 'error' not in err, 'Unexpected stderr: ' + err def test_chunking(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('not relevant for fastcomp, only checks js compiler chunking') - if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode') - if os.environ.get('EMCC_CORES'): return self.skip('cannot run if cores are altered') - if multiprocessing.cpu_count() < 2: return self.skip('need multiple cores') - try: - os.environ['EMCC_DEBUG'] = '1' - os.environ['EMCC_CORES'] = '2' # standardize over machines - for asm, linkable, chunks in [ - (0, 0, 2), (0, 1, 2), - (1, 0, 2), (1, 1, 2) - ]: - print asm, linkable, chunks - output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm] + (['-O2'] if asm else []), stdout=PIPE, stderr=PIPE).communicate() - ok = False - for c in range(chunks, chunks+2): - ok = ok or ('phase 2 working on %d chunks' % c in err) - assert ok, err - finally: - del os.environ['EMCC_DEBUG'] - del os.environ['EMCC_CORES'] + def nonfc(): + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('not relevant for fastcomp, only checks js compiler chunking') + if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode') + if os.environ.get('EMCC_CORES'): return self.skip('cannot run if cores are altered') + if multiprocessing.cpu_count() < 2: return self.skip('need multiple cores') + try: + os.environ['EMCC_DEBUG'] = '1' + os.environ['EMCC_CORES'] = '2' # standardize over machines + for asm, linkable, chunks in [ + (0, 0, 2), (0, 1, 2), + (1, 0, 2), (1, 1, 2) + ]: + print asm, linkable, chunks + output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm] + (['-O2'] if asm else []), stdout=PIPE, stderr=PIPE).communicate() + ok = False + for c in range(chunks, chunks+2): + ok = ok or ('phase 2 working on %d chunks' % c in err) + assert ok, err + finally: + del os.environ['EMCC_DEBUG'] + del os.environ['EMCC_CORES'] + nonfastcomp(nonfc) def test_debuginfo(self): if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode') @@ -1868,23 +1879,25 @@ This pointer might make sense in another type signature: i: _my_func assert 'If you see this - the world is all right!' in output def test_embind(self): - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') - for args, fail in [ - ([], True), # without --bind, we fail - (['--bind'], False), - (['--bind', '-O1'], False), - (['--bind', '-O2'], False), - (['--bind', '-O1', '-s', 'ASM_JS=0'], False), - (['--bind', '-O2', '-s', 'ASM_JS=0'], False) - ]: - print args, fail - self.clear() - try_delete(self.in_dir('a.out.js')) - Popen([PYTHON, EMCC, path_from_root('tests', 'embind', 'embind_test.cpp'), '--post-js', path_from_root('tests', 'embind', 'underscore-1.4.2.js'), '--post-js', path_from_root('tests', 'embind', 'imvu_test_adapter.js'), '--post-js', path_from_root('tests', 'embind', 'embind.test.js')] + args, stderr=PIPE if fail else None).communicate() - assert os.path.exists(self.in_dir('a.out.js')) == (not fail) - if not fail: - output = run_js(self.in_dir('a.out.js'), stdout=PIPE, stderr=PIPE, full_output=True) - assert "FAIL" not in output, output + def nonfc(): + if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('todo in fastcomp') + for args, fail in [ + ([], True), # without --bind, we fail + (['--bind'], False), + (['--bind', '-O1'], False), + (['--bind', '-O2'], False), + (['--bind', '-O1', '-s', 'ASM_JS=0'], False), + (['--bind', '-O2', '-s', 'ASM_JS=0'], False) + ]: + print args, fail + self.clear() + try_delete(self.in_dir('a.out.js')) + Popen([PYTHON, EMCC, path_from_root('tests', 'embind', 'embind_test.cpp'), '--post-js', path_from_root('tests', 'embind', 'underscore-1.4.2.js'), '--post-js', path_from_root('tests', 'embind', 'imvu_test_adapter.js'), '--post-js', path_from_root('tests', 'embind', 'embind.test.js')] + args, stderr=PIPE if fail else None).communicate() + assert os.path.exists(self.in_dir('a.out.js')) == (not fail) + if not fail: + output = run_js(self.in_dir('a.out.js'), stdout=PIPE, stderr=PIPE, full_output=True) + assert "FAIL" not in output, output + nonfastcomp(nonfc) def test_llvm_nativizer(self): try: @@ -1964,23 +1977,6 @@ seeked= file. code = open('a.out.js').read() assert 'SAFE_HEAP' in code, 'valid -s option had an effect' - def test_jcache_printf(self): - open(self.in_dir('src.cpp'), 'w').write(r''' - #include <stdio.h> - #include <stdint.h> - #include <emscripten.h> - int main() { - emscripten_jcache_printf("hello world\n"); - emscripten_jcache_printf("hello %d world\n", 5); - emscripten_jcache_printf("hello %.3f world\n", 123.456789123); - emscripten_jcache_printf("hello %llx world\n", 0x1234567811223344ULL); - return 0; - } - ''') - Popen([PYTHON, EMCC, self.in_dir('src.cpp')]).communicate() - output = run_js('a.out.js') - self.assertIdentical('hello world\nhello 5 world\nhello 123.457 world\nhello 1234567811223300 world\n', output) - def test_conftest_s_flag_passing(self): open(os.path.join(self.get_dir(), 'conftest.c'), 'w').write(r''' int main() { @@ -2097,6 +2093,7 @@ done. EM_ASM(Module.print(demangle('__Z5multiwahtjmxyz'))); EM_ASM(Module.print(demangle('__Z1aA32_iPA5_c'))); EM_ASM(Module.print(demangle('__ZN21FWakaGLXFleeflsMarfooC2EjjjPKvbjj'))); + EM_ASM(Module.print(demangle('__ZN5wakaw2Cm10RasterBaseINS_6watwat9PolocatorEE8merbine1INS4_2OREEEvPKjj'))); // we get this wrong, but at least emit a '?' one(17); return 0; } @@ -2120,6 +2117,7 @@ parseword(char*&, int, int&) multi(wchar_t, signed char, unsigned char, unsigned short, unsigned int, unsigned long, long long, unsigned long long, ...) a(int [32], char [5]*) FWakaGLXFleeflsMarfoo::FWakaGLXFleeflsMarfoo(unsigned int, unsigned int, unsigned int, void*, bool, unsigned int, unsigned int) +void wakaw::Cm::RasterBase<wakaw::watwat::Polocator?>(unsigned int*, unsigned int) ''', output) # test for multiple functions in one stack trace assert 'one(int)' in output @@ -2257,6 +2255,23 @@ int main() assert 'test.o' in head, 'Invalid dependency target' assert 'test.cpp' in tail and 'test.hpp' in tail, 'Invalid dependencies generated' + def test_dependency_file_2(self): + self.clear() + shutil.copyfile(path_from_root('tests', 'hello_world.c'), 'a.c') + Popen([PYTHON, EMCC, 'a.c', '-MMD', '-MF', 'test.d', '-c']).communicate() + self.assertContained(open('test.d').read(), 'a.o: a.c\n') + + self.clear() + shutil.copyfile(path_from_root('tests', 'hello_world.c'), 'a.c') + Popen([PYTHON, EMCC, 'a.c', '-MMD', '-MF', 'test.d', '-c', '-o', 'test.o']).communicate() + self.assertContained(open('test.d').read(), 'test.o: a.c\n') + + self.clear() + shutil.copyfile(path_from_root('tests', 'hello_world.c'), 'a.c') + os.mkdir('obj') + Popen([PYTHON, EMCC, 'a.c', '-MMD', '-MF', 'test.d', '-c', '-o', 'obj/test.o']).communicate() + self.assertContained(open('test.d').read(), 'obj/test.o: a.c\n') + def test_quoted_js_lib_key(self): open('lib.js', 'w').write(r''' mergeInto(LibraryManager.library, { @@ -2278,11 +2293,16 @@ mergeInto(LibraryManager.library, { def test_default_obj_ext(self): outdir = os.path.join(self.get_dir(), 'out_dir') + '/' + + self.clear() os.mkdir(outdir) - process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir], stdout=PIPE, stderr=PIPE) + process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir]) process.communicate() assert(os.path.isfile(outdir + 'hello_world.o')) - process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj'], stdout=PIPE, stderr=PIPE) + + self.clear() + os.mkdir(outdir) + process = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c'), '-o', outdir, '--default-obj-ext', 'obj']) process.communicate() assert(os.path.isfile(outdir + 'hello_world.obj')) @@ -2362,7 +2382,7 @@ int main() { assert '*** PCH/Modules Loaded:\nModule: header.h.gch' not in err[1], err[1] def test_warn_unaligned(self): - if os.environ.get('EMCC_FAST_COMPILER') != '1': return self.skip('need fastcomp') + if os.environ.get('EMCC_FAST_COMPILER') == '0': return self.skip('need fastcomp') open('src.cpp', 'w').write(r''' #include <stdio.h> static const double grid[4][2] = {{-3 / 3., -1 / 3.}, @@ -2382,3 +2402,311 @@ int main() { assert 'emcc: warning: unaligned store' in output[1] assert '@line 9 "src.cpp"' in output[1] + def test_no_exit_runtime(self): + open('code.cpp', 'w').write(r''' +#include <stdio.h> + +template<int x> +struct Waste { + Waste() { + printf("coming around %d\n", x); + } + ~Waste() { + printf("going away %d\n", x); + } +}; + +Waste<1> w1; +Waste<2> w2; +Waste<3> w3; +Waste<4> w4; +Waste<5> w5; + +int main(int argc, char **argv) { + return 0; +} +''') + + for no_exit in [0, 1]: + for opts in [[], ['-O1'], ['-O2', '-g2'], ['-O2', '-g2', '--llvm-lto', '1']]: + print no_exit, opts + Popen([PYTHON, EMCC] + opts + ['code.cpp', '-s', 'NO_EXIT_RUNTIME=' + str(no_exit)]).communicate() + output = run_js(os.path.join(self.get_dir(), 'a.out.js'), stderr=PIPE, full_output=True, engine=NODE_JS) + src = open('a.out.js').read() + exit = 1-no_exit + assert 'coming around' in output + assert ('going away' in output) == exit, 'destructors should not run if no exit' + assert ('_ZN5WasteILi2EED1Ev' in src) == exit, 'destructors should not appear if no exit' + assert ('atexit(' in src) == exit, 'atexit should not appear or be called' + + def test_os_oz(self): + if os.environ.get('EMCC_DEBUG'): return self.skip('cannot run in debug mode') + try: + os.environ['EMCC_DEBUG'] = '1' + for args, expect in [ + (['-O1'], 'LLVM opts: -O1'), + (['-O2'], 'LLVM opts: -O3'), + (['-Os'], 'LLVM opts: -Os'), + (['-Oz'], 'LLVM opts: -Oz'), + (['-O3'], 'LLVM opts: -O3'), + ]: + print args, expect + output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp')] + args, stdout=PIPE, stderr=PIPE).communicate() + self.assertContained(expect, err) + self.assertContained('hello, world!', run_js('a.out.js')) + finally: + del os.environ['EMCC_DEBUG'] + + def test_global_inits(self): + open('inc.h', 'w').write(r''' +#include <stdio.h> + +template<int x> +struct Waste { + int state; + Waste() : state(10) {} + void test(int a) { + printf("%d\n", a + state); + } + ~Waste() { + printf("going away %d\n", x); + } +}; + +Waste<3> *getMore(); + +''') + open('main.cpp', 'w').write(r''' +#include "inc.h" + +Waste<1> mw1; +Waste<2> mw2; + +int main(int argc, char **argv) { + printf("argc: %d\n", argc); + mw1.state += argc; + mw2.state += argc; + mw1.test(5); + mw2.test(6); + getMore()->test(0); + return 0; +} +''') + + open('side.cpp', 'w').write(r''' +#include "inc.h" + +Waste<3> sw3; + +Waste<3> *getMore() { + return &sw3; +} +''') + + for opts, has_global in [ + (['-O2', '-g'], True), + (['-O2', '-g', '-s', 'NO_EXIT_RUNTIME=1'], False), # no-exit-runtime removes the atexits, and then globalgce can work it's magic to remove the global initializer entirely + (['-Os', '-g'], True), + (['-Os', '-g', '-s', 'NO_EXIT_RUNTIME=1'], False), + (['-O2', '-g', '--llvm-lto', '1'], True), + (['-O2', '-g', '-s', 'NO_EXIT_RUNTIME=1', '--llvm-lto', '1'], False), + ]: + print opts, has_global + Popen([PYTHON, EMCC, 'main.cpp', '-c'] + opts).communicate() + Popen([PYTHON, EMCC, 'side.cpp', '-c'] + opts).communicate() + Popen([PYTHON, EMCC, 'main.o', 'side.o'] + opts).communicate() + output = run_js(os.path.join(self.get_dir(), 'a.out.js'), stderr=PIPE, full_output=True, engine=NODE_JS) + src = open('a.out.js').read() + self.assertContained('argc: 1\n16\n17\n10\n', run_js('a.out.js')) + assert ('_GLOBAL_' in src) == has_global + + def test_implicit_func(self): + open('src.c', 'w').write(r''' +#include <stdio.h> +int main() +{ + printf("hello %d\n", strnlen("waka", 2)); // Implicit declaration, no header, for strnlen + int (*my_strnlen)(char*, ...) = strnlen; + printf("hello %d\n", my_strnlen("shaka", 2)); + return 0; +} +''') + + IMPLICIT_WARNING = '''warning: implicit declaration of function 'strnlen' is invalid in C99''' + IMPLICIT_ERROR = '''error: implicit declaration of function 'strnlen' is invalid in C99''' + + for opts, expected, compile_expected in [ + ([], None, [IMPLICIT_ERROR]), + (['-Wno-error=implicit-function-declaration'], ['hello '], [IMPLICIT_WARNING]), # turn error into warning + (['-Wno-implicit-function-declaration'], ['hello '], []), # turn error into nothing at all (runtime output is incorrect) + ]: + print opts, expected + try_delete('a.out.js') + stdout, stderr = Popen([PYTHON, EMCC, 'src.c'] + opts, stderr=PIPE).communicate() + for ce in compile_expected + ['''warning: incompatible pointer types''']: + self.assertContained(ce, stderr) + if expected is None: + assert not os.path.exists('a.out.js') + else: + output = run_js(os.path.join(self.get_dir(), 'a.out.js'), stderr=PIPE, full_output=True) + for e in expected: + self.assertContained(e, output) + + def test_incorrect_static_call(self): + for opts in [0, 1]: + for asserts in [0, 1]: + extra = [] + if opts != 1-asserts: extra = ['-s', 'ASSERTIONS=' + str(asserts)] + cmd = [PYTHON, EMCC, path_from_root('tests', 'cases', 'sillyfuncast2_noasm.ll'), '-O' + str(opts)] + extra + print cmd + stdout, stderr = Popen(cmd, stderr=PIPE).communicate() + assert ('''unexpected number of arguments 3 in call to 'doit', should be 2''' in stderr) == asserts, stderr + assert ('''unexpected return type i32 in call to 'doit', should be void''' in stderr) == asserts, stderr + assert ('''unexpected argument type float at index 1 in call to 'doit', should be i32''' in stderr) == asserts, stderr + + def test_llvm_lit(self): + llvm_src = LLVM_ROOT + while not os.path.exists(os.path.join(llvm_src, 'emscripten-version.txt')): llvm_src = os.path.dirname(llvm_src) + cmd = [os.path.join(LLVM_ROOT, 'llvm-lit'), '-v', os.path.join(llvm_src, 'test', 'CodeGen', 'JS')] + print cmd + p = Popen(cmd) + p.communicate() + assert p.returncode == 0, 'LLVM tests must pass with exit code 0' + + def test_odin_validation(self): + if not SPIDERMONKEY_ENGINE or SPIDERMONKEY_ENGINE not in JS_ENGINES: return self.skip('this test tests asm.js validation in SpiderMonkey') + Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-O1'], stdout=PIPE, stderr=PIPE).communicate() + output = run_js('a.out.js', stderr=PIPE, full_output=True, engine=SPIDERMONKEY_ENGINE) + assert 'asm.js' in output, 'spidermonkey should mention asm.js compilation: ' + output + + def test_bad_triple(self): + Popen([CLANG, path_from_root('tests', 'hello_world.c'), '-c', '-emit-llvm', '-o', 'a.bc'] + get_clang_native_args(), stdout=PIPE, stderr=PIPE).communicate() + out, err = Popen([PYTHON, EMCC, 'a.bc'], stdout=PIPE, stderr=PIPE).communicate() + assert 'warning' in err, err + assert 'incorrect target triple' in err, err + + def test_valid_abspath(self): + # Test whether abspath warning appears + abs_include_path = path_from_root('tests') + process = Popen([PYTHON, EMCC, '-I%s' % abs_include_path, path_from_root('tests', 'hello_world.c')], stdout=PIPE, stderr=PIPE) + out, err = process.communicate() + warning = '-I or -L of an absolute path "-I%s" encountered. If this is to a local system header/library, it may cause problems (local system files make sense for compiling natively on your system, but not necessarily to JavaScript). Pass \'-Wno-warn-absolute-paths\' to emcc to hide this warning.' % abs_include_path + assert(warning in err) + + # Hide warning for this include path + process = Popen([PYTHON, EMCC, '--valid-abspath', abs_include_path,'-I%s' % abs_include_path, path_from_root('tests', 'hello_world.c')], stdout=PIPE, stderr=PIPE) + out, err = process.communicate() + assert(warning not in err) + + def test_simplify_ifs(self): + def test(src, nums): + open('src.c', 'w').write(src) + for opts, ifs in [ + [['-g2'], nums[0]], + [['-profiling'], nums[1]], + [['-profiling', '-g2'], nums[2]] + ]: + print opts, ifs + try_delete('a.out.js') + Popen([PYTHON, EMCC, 'src.c', '-O2'] + opts, stdout=PIPE).communicate() + src = open('a.out.js').read() + main = src[src.find('function _main'):src.find('\n}', src.find('function _main'))] + actual_ifs = main.count('if (') + assert ifs == actual_ifs, main + ' : ' + str([ifs, actual_ifs]) + #print main + + test(r''' + #include <stdio.h> + #include <string.h> + int main(int argc, char **argv) { + if (argc > 5 && strlen(argv[0]) > 1 && strlen(argv[1]) > 2) printf("halp"); + return 0; + } + ''', [3, 1, 1]) + + test(r''' + #include <stdio.h> + #include <string.h> + int main(int argc, char **argv) { + while (argc % 3 == 0) { + if (argc > 5 && strlen(argv[0]) > 1 && strlen(argv[1]) > 2) { + printf("halp"); + argc++; + } else { + while (argc > 0) { + printf("%d\n", argc--); + } + } + } + return 0; + } + ''', [8, 5, 5]) + + test(r''' + #include <stdio.h> + #include <string.h> + int main(int argc, char **argv) { + while (argc % 17 == 0) argc *= 2; + if (argc > 5 && strlen(argv[0]) > 10 && strlen(argv[1]) > 20) { + printf("halp"); + argc++; + } else { + printf("%d\n", argc--); + } + while (argc % 17 == 0) argc *= 2; + return argc; + } + ''', [6, 3, 3]) + + test(r''' + #include <stdio.h> + #include <stdlib.h> + + int main(int argc, char *argv[]) { + if (getenv("A") && getenv("B")) { + printf("hello world\n"); + } else { + printf("goodnight moon\n"); + } + printf("and that's that\n"); + return 0; + } + ''', [3, 1, 1]) + + test(r''' + #include <stdio.h> + #include <stdlib.h> + + int main(int argc, char *argv[]) { + if (getenv("A") || getenv("B")) { + printf("hello world\n"); + } + printf("and that's that\n"); + return 0; + } + ''', [3, 1, 1]) + + def test_symbol_map(self): + for m in [0, 1]: + self.clear() + cmd = [PYTHON, EMCC, path_from_root('tests', 'hello_world.c'), '-O2'] + if m: cmd += ['--emit-symbol-map'] + print cmd + stdout, stderr = Popen(cmd, stderr=PIPE).communicate() + assert ('''wrote symbol map file''' in stderr) == m, stderr + assert (os.path.exists('a.out.js.symbols') == m), stderr + if m: + symbols = open('a.out.js.symbols').read() + assert ':_main' in symbols + + def test_bc_to_bc(self): + # emcc should 'process' bitcode to bitcode. build systems can request this if + # e.g. they assume our 'executable' extension is bc, and compile an .o to a .bc + # (the user would then need to build bc to js of course, but we need to actually + # emit the bc) + cmd = Popen([PYTHON, EMCC, '-c', path_from_root('tests', 'hello_world.c')]).communicate() + assert os.path.exists('hello_world.o') + cmd = Popen([PYTHON, EMCC, 'hello_world.o', '-o', 'hello_world.bc']).communicate() + assert os.path.exists('hello_world.o') + assert os.path.exists('hello_world.bc') + diff --git a/tests/test_sanity.py b/tests/test_sanity.py index 894f2192..3d3da523 100644 --- a/tests/test_sanity.py +++ b/tests/test_sanity.py @@ -15,6 +15,8 @@ def wipe(): def mtime(filename): return os.stat(filename).st_mtime +SANITY_MESSAGE = 'Emscripten: Running sanity checks' + class sanity(RunnerCore): @classmethod def setUpClass(self): @@ -196,9 +198,10 @@ class sanity(RunnerCore): del os.environ['EM_IGNORE_SANITY'] def test_llvm_fastcomp(self): - if os.environ.get('EMCC_FAST_COMPILER') != '1': return self.skip('not using fastcomp') + assert os.environ.get('EMCC_FAST_COMPILER') != '0', 'must be using fastcomp to test fastcomp' WARNING = 'fastcomp in use, but LLVM has not been built with the JavaScript backend as a target' + WARNING2 = 'you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend' restore() @@ -206,22 +209,64 @@ class sanity(RunnerCore): assert check_fastcomp() output = self.check_working(EMCC) assert WARNING not in output, output + assert WARNING2 not in output, output # Fake incorrect llc output, no mention of js backend restore() f = open(CONFIG_FILE, 'a') - f.write('LLVM_ROOT = "' + path_from_root('tests', 'fake') + '"') + f.write('LLVM_ROOT = "' + path_from_root('tests', 'fake', 'bin') + '"') f.close() + #print '1', open(CONFIG_FILE).read() - if not os.path.exists(path_from_root('tests', 'fake')): - os.makedirs(path_from_root('tests', 'fake')) + try_delete(path_from_root('tests', 'fake')) + os.makedirs(path_from_root('tests', 'fake', 'bin')) - f = open(path_from_root('tests', 'fake', 'llc'), 'w') + f = open(path_from_root('tests', 'fake', 'bin', 'llc'), 'w') f.write('#!/bin/sh\n') f.write('echo "llc fake output\nRegistered Targets:\nno j-s backend for you!"') f.close() - os.chmod(path_from_root('tests', 'fake', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC) + os.chmod(path_from_root('tests', 'fake', 'bin', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC) output = self.check_working(EMCC, WARNING) + output = self.check_working(EMCC, WARNING2) + + # fake some more + for fake in ['llvm-link', 'clang', 'clang++', 'llvm-ar', 'opt', 'llvm-as', 'llvm-dis', 'llvm-nm', 'lli']: + open(path_from_root('tests', 'fake', 'bin', fake), 'w').write('.') + try_delete(SANITY_FILE) + output = self.check_working(EMCC, WARNING) + # make sure sanity checks notice there is no source dir with version # + open(path_from_root('tests', 'fake', 'bin', 'llc'), 'w').write('#!/bin/sh\necho "Registered Targets: there IZ a js backend: JavaScript (asm.js, emscripten) backend"') + open(path_from_root('tests', 'fake', 'bin', 'clang++'), 'w').write('#!/bin/sh\necho "clang version %s (blah blah)" >&2\necho "..." >&2\n' % '.'.join(map(str, EXPECTED_LLVM_VERSION))) + os.chmod(path_from_root('tests', 'fake', 'bin', 'llc'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC) + os.chmod(path_from_root('tests', 'fake', 'bin', 'clang++'), stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC) + try_delete(SANITY_FILE) + output = self.check_working(EMCC, 'did not see a source tree above LLVM_DIR, could not verify version numbers match') + + VERSION_WARNING = 'Emscripten, llvm and clang versions do not match, this is dangerous' + + # add version number + open(path_from_root('tests', 'fake', 'emscripten-version.txt'), 'w').write('waka') + try_delete(SANITY_FILE) + output = self.check_working(EMCC, VERSION_WARNING) + + os.makedirs(path_from_root('tests', 'fake', 'tools', 'clang')) + + open(path_from_root('tests', 'fake', 'tools', 'clang', 'emscripten-version.txt'), 'w').write(EMSCRIPTEN_VERSION) + try_delete(SANITY_FILE) + output = self.check_working(EMCC, VERSION_WARNING) + + open(path_from_root('tests', 'fake', 'emscripten-version.txt'), 'w').write(EMSCRIPTEN_VERSION) + try_delete(SANITY_FILE) + output = self.check_working(EMCC) + assert VERSION_WARNING not in output + + open(path_from_root('tests', 'fake', 'tools', 'clang', 'emscripten-version.txt'), 'w').write('waka') + try_delete(SANITY_FILE) + output = self.check_working(EMCC, VERSION_WARNING) + + restore() + + self.check_working([EMCC, 'tests/hello_world.cpp', '-s', 'INIT_HEAP=1'], '''Compiler settings are incompatible with fastcomp. You can fall back to the older compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend''') def test_node(self): NODE_WARNING = 'node version appears too old' @@ -272,7 +317,6 @@ fi del os.environ['EM_IGNORE_SANITY'] def test_emcc(self): - SANITY_MESSAGE = 'Emscripten: Running sanity checks' SANITY_FAIL_MESSAGE = 'sanity check failed to run' # emcc should check sanity if no ${EM_CONFIG}_sanity @@ -311,6 +355,10 @@ fi output = self.check_working(EMCC) self.assertNotContained(SANITY_MESSAGE, output) + # also with -v, with or without inputs + output = self.check_working([EMCC, '-v'], SANITY_MESSAGE) + output = self.check_working([EMCC, '-v', path_from_root('tests', 'hello_world.c')], SANITY_MESSAGE) + # Make sure the test runner didn't do anything to the setup output = self.check_working(EMCC) self.assertNotContained(SANITY_MESSAGE, output) @@ -429,6 +477,7 @@ fi output = self.do([PYTHON, EMCC, '--clear-cache']) assert ERASING_MESSAGE in output assert not os.path.exists(EMCC_CACHE) + assert SANITY_MESSAGE in output # Changing LLVM_ROOT, even without altering .emscripten, clears the cache ensure_cache() @@ -446,111 +495,34 @@ fi try_delete(CANONICAL_TEMP_DIR) def test_relooper(self): - RELOOPER = Cache.get_path('relooper.js') - - restore() - for phase in range(2): # 0: we wipe the relooper dir. 1: we have it, so should just update - if phase == 0: Cache.erase() - try_delete(RELOOPER) - - for i in range(4): - print >> sys.stderr, phase, i - opt = min(i, 2) - try_delete('a.out.js') - output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_loop.cpp'), '-O' + str(opt), '-g'], - stdout=PIPE, stderr=PIPE).communicate() - self.assertContained('hello, world!', run_js('a.out.js')) - output = '\n'.join(output) - assert ('bootstrapping relooper succeeded' in output) == (i == 1), 'only bootstrap on first O2: ' + output - assert os.path.exists(RELOOPER) == (i >= 1), 'have relooper on O2: ' + output - src = open('a.out.js').read() - main = src.split('function _main()')[1].split('\n}\n')[0] - assert ('while (1) {' in main or 'while(1){' in main or 'while(1) {' in main or '} while ($' in main or '}while($' in main) == (i >= 1), 'reloop code on O2: ' + main - assert ('switch' not in main) == (i >= 1), 'reloop code on O2: ' + main - - def test_jcache(self): - PRE_LOAD_MSG = 'loading pre from jcache' - PRE_SAVE_MSG = 'saving pre to jcache' - FUNC_CHUNKS_LOAD_MSG = ' funcchunks from jcache' - FUNC_CHUNKS_SAVE_MSG = ' funcchunks to jcache' - JSFUNC_CHUNKS_LOAD_MSG = 'jsfuncchunks from jcache' - JSFUNC_CHUNKS_SAVE_MSG = 'jsfuncchunks to jcache' - - restore() - Cache.erase() + assert os.environ.get('EMCC_FAST_COMPILER') is None try: - os.environ['EMCC_DEBUG'] = '1' - os.environ['EMCC_JSOPT_MIN_CHUNK_SIZE'] = str(1024*512) - - self.working_dir = os.path.join(TEMP_DIR, 'emscripten_temp') - if not os.path.exists(self.working_dir): os.makedirs(self.working_dir) - - assert not os.path.exists(JCache.get_cachename('emscript_files')) - - srcs = {} - used_jcache = False - - for args, input_file, expect_pre_save, expect_pre_load, expect_funcs_save, expect_funcs_load, expect_jsfuncs_save, expect_jsfuncs_load, expected in [ - ([], 'hello_world_loop.cpp', False, False, False, False, False, False, []), - (['--jcache'], 'hello_world_loop.cpp', True, False, True, False, True, False, []), - (['--jcache'], 'hello_world_loop.cpp', False, True, False, True, False, True, []), - ([], 'hello_world_loop.cpp', False, False, False, False, False, False, []), - # new - ([], 'hello_world.cpp', False, False, False, False, False, False, []), - (['--jcache'], 'hello_world.cpp', True, False, True, False, True, False, []), - (['--jcache'], 'hello_world.cpp', False, True, False, True, False, True, []), - ([], 'hello_world.cpp', False, False, False, False, False, False, []), - # go back to old file, experience caching - (['--jcache'], 'hello_world_loop.cpp', False, True, False, True, False, True, []), - # new, large file - ([], 'hello_malloc.cpp', False, False, False, False, False, False, []), - (['--jcache'], 'hello_malloc.cpp', True, False, True, False, True, False, []), - (['--jcache'], 'hello_malloc.cpp', False, True, False, True, False, True, []), - ([], 'hello_malloc.cpp', False, False, False, False, False, False, []), - # new, huge file - ([], 'hello_libcxx.cpp', False, False, False, False, False, False, ('4 chunks',)), - (['--jcache'], 'hello_libcxx.cpp', True, False, True, False, True, False, []), - (['--jcache'], 'hello_libcxx.cpp', False, True, False, True, False, True, []), - ([], 'hello_libcxx.cpp', False, False, False, False, False, False, []), - # finally, build a file close to the previous, to see that some chunks are found in the cache and some not - (['--jcache'], 'hello_libcxx_mod1.cpp', False, True, True, True, True, True, []), # win on pre, mix on funcs, mix on jsfuncs - (['--jcache'], 'hello_libcxx_mod1.cpp', False, True, False, True, False, True, []), - (None, None, None, None, None, None, None, None, None), # clear - (['--jcache'], 'hello_libcxx_mod2.cpp', True, False, True, False, True, False, []), # load into cache - (['--jcache'], 'hello_libcxx_mod2a.cpp', False, True, True, True, True, True, []) # add a printf, do not lose everything - ]: - self.clear() - if args is None: - Cache.erase() - continue - - print >> sys.stderr, args, input_file, expect_pre_save, expect_pre_load, expect_funcs_save, expect_funcs_load, expect_jsfuncs_save, expect_jsfuncs_load, expected - - out, err = Popen([PYTHON, EMCC, '-O2', '-g', path_from_root('tests', input_file)] + args, stdout=PIPE, stderr=PIPE).communicate() - errtail = err.split('emcc invocation')[-1] - self.assertContained('hello, world!', run_js('a.out.js'), errtail) - assert (PRE_SAVE_MSG in err) == expect_pre_save, errtail - assert (PRE_LOAD_MSG in err) == expect_pre_load, errtail - assert (FUNC_CHUNKS_SAVE_MSG in err) == expect_funcs_save, errtail - assert (FUNC_CHUNKS_LOAD_MSG in err) == expect_funcs_load, errtail - assert (JSFUNC_CHUNKS_SAVE_MSG in err) == expect_jsfuncs_save, errtail - assert (JSFUNC_CHUNKS_LOAD_MSG in err) == expect_jsfuncs_load, errtail - for expect in expected: assert expect in err, expect + ' ? ' + errtail - curr = open('a.out.js').read() - if input_file not in srcs: - srcs[input_file] = curr - else: - #open('/home/alon/Dev/emscripten/a', 'w').write(srcs[input_file]) - #open('/home/alon/Dev/emscripten/b', 'w').write(curr) - assert abs(len(curr)/float(len(srcs[input_file]))-1)<0.01, 'contents may shift in order, but must remain the same size %d vs %d' % (len(curr), len(srcs[input_file])) + '\n' + errtail - used_jcache = used_jcache or ('--jcache' in args) - assert used_jcache == os.path.exists(JCache.get_cachename('emscript_files')) - #print >> sys.stderr, errtail + os.environ['EMCC_FAST_COMPILER'] = '0' + RELOOPER = Cache.get_path('relooper.js') + + restore() + for phase in range(2): # 0: we wipe the relooper dir. 1: we have it, so should just update + if phase == 0: Cache.erase() + try_delete(RELOOPER) + + for i in range(4): + print >> sys.stderr, phase, i + opt = min(i, 2) + try_delete('a.out.js') + output = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world_loop.cpp'), '-O' + str(opt), '-g'], + stdout=PIPE, stderr=PIPE).communicate() + self.assertContained('hello, world!', run_js('a.out.js')) + output = '\n'.join(output) + assert ('bootstrapping relooper succeeded' in output) == (i == 1), 'only bootstrap on first O2: ' + output + assert os.path.exists(RELOOPER) == (i >= 1), 'have relooper on O2: ' + output + src = open('a.out.js').read() + main = src.split('function _main()')[1].split('\n}\n')[0] + assert ('while (1) {' in main or 'while(1){' in main or 'while(1) {' in main or '} while ($' in main or '}while($' in main) == (i >= 1), 'reloop code on O2: ' + main + assert ('switch' not in main) == (i >= 1), 'reloop code on O2: ' + main finally: - del os.environ['EMCC_DEBUG'] - del os.environ['EMCC_JSOPT_MIN_CHUNK_SIZE'] + del os.environ['EMCC_FAST_COMPILER'] def test_nostdincxx(self): restore() @@ -559,7 +531,7 @@ fi try: old = os.environ.get('EMCC_LLVM_TARGET') or '' for compiler in [EMCC, EMXX]: - for target in ['i386-pc-linux-gnu', 'le32-unknown-nacl']: + for target in ['i386-pc-linux-gnu', 'asmjs-unknown-emscripten']: print compiler, target os.environ['EMCC_LLVM_TARGET'] = target out, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp'), '-v'], stdout=PIPE, stderr=PIPE).communicate() diff --git a/tests/test_sockets.py b/tests/test_sockets.py index 3a5555ed..8c2889df 100644 --- a/tests/test_sockets.py +++ b/tests/test_sockets.py @@ -345,12 +345,12 @@ class sockets(BrowserCore): host_outfile = 'host.html' peer_outfile = 'peer.html' - host_filepath = path_from_root('tests', 'sockets', host_src) + host_filepath = path_from_root('tests', 'sockets', host_src) temp_host_filepath = os.path.join(self.get_dir(), os.path.basename(host_src)) with open(host_filepath) as f: host_src = f.read() with open(temp_host_filepath, 'w') as f: f.write(self.with_report_result(host_src)) - peer_filepath = path_from_root('tests', 'sockets', peer_src) + peer_filepath = path_from_root('tests', 'sockets', peer_src) temp_peer_filepath = os.path.join(self.get_dir(), os.path.basename(peer_src)) with open(peer_filepath) as f: peer_src = f.read() with open(temp_peer_filepath, 'w') as f: f.write(self.with_report_result(peer_src)) @@ -358,7 +358,7 @@ class sockets(BrowserCore): open(os.path.join(self.get_dir(), 'host_pre.js'), 'w').write(''' var Module = { webrtc: { - broker: 'https://mdsw.ch:8080', + broker: 'http://localhost:8080', session: undefined, onpeer: function(peer, route) { window.open('http://localhost:8888/peer.html?' + route); @@ -382,7 +382,7 @@ class sockets(BrowserCore): open(os.path.join(self.get_dir(), 'peer_pre.js'), 'w').write(''' var Module = { webrtc: { - broker: 'https://mdsw.ch:8080', + broker: 'http://localhost:8080', session: window.location.toString().split('?')[1], onpeer: function(peer, route) { peer.connect(Module['webrtc']['session']); @@ -403,9 +403,15 @@ class sockets(BrowserCore): Popen([PYTHON, EMCC, temp_host_filepath, '-o', host_outfile] + ['-s', 'GL_TESTING=1', '--pre-js', 'host_pre.js', '-s', 'SOCKET_WEBRTC=1', '-s', 'SOCKET_DEBUG=1']).communicate() Popen([PYTHON, EMCC, temp_peer_filepath, '-o', peer_outfile] + ['-s', 'GL_TESTING=1', '--pre-js', 'peer_pre.js', '-s', 'SOCKET_WEBRTC=1', '-s', 'SOCKET_DEBUG=1']).communicate() + # note: you may need to run this manually yourself, if npm is not in the path, or if you need a version that is not in the path + Popen(['npm', 'install', path_from_root('tests', 'sockets', 'p2p')]).communicate() + broker = Popen(listify(NODE_JS) + [path_from_root('tests', 'sockets', 'p2p', 'broker', 'p2p-broker.js')]) + expected = '1' self.run_browser(host_outfile, '.', ['/report_result?' + e for e in expected]) + broker.kill(); + def test_nodejs_sockets_echo(self): # This test checks that sockets work when the client code is run in Node.js # Run with ./runner.py sockets.test_nodejs_sockets_echo @@ -414,21 +420,54 @@ class sockets(BrowserCore): sockets_include = '-I'+path_from_root('tests', 'sockets') - # Websockify-proxied servers can't run dgram tests harnesses = [ - # Websockify doesn't seem to like ws.WebSocket clients TODO check if this is a ws issue or Websockify issue - #(WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 49160), 0), - (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=0'], 49161), 0), - (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=1'], 49162), 1) + (WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 59160), 0), + (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=0'], 59162), 0), + (CompiledServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include, '-DTEST_DGRAM=1'], 59164), 1) ] + # Basic test of node client against both a Websockified and compiled echo server. for harness, datagram in harnesses: with harness: - Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', path_from_root('tests', 'sockets', 'client.js'), '-DSOCKK=%d' % harness.listen_port, '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate() + Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', 'client.js', '-DSOCKK=%d' % harness.listen_port, '-DTEST_DGRAM=%d' % datagram, '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate() + + out = run_js('client.js', engine=NODE_JS, full_output=True) + self.assertContained('do_msg_read: read 14 bytes', out) + + # Test against a Websockified server with compile time configured WebSocket subprotocol. We use a Websockified + # server because as long as the subprotocol list contains binary it will configure itself to accept binary + # This test also checks that the connect url contains the correct subprotocols. + print "\nTesting compile time WebSocket configuration.\n" + for harness in [ + WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 59166) + ]: + with harness: + Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', 'client.js', '-s', 'SOCKET_DEBUG=1', '-s', 'WEBSOCKET_SUBPROTOCOL="base64, binary"', '-DSOCKK=59166', '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate() + + out = run_js('client.js', engine=NODE_JS, full_output=True) + self.assertContained('do_msg_read: read 14 bytes', out) + self.assertContained('connect: ws://127.0.0.1:59166, base64,binary', out) + + # Test against a Websockified server with runtime WebSocket configuration. We specify both url and subprotocol. + # In this test we have *deliberately* used the wrong port '-DSOCKK=12345' to configure the echo_client.c, so + # the connection would fail without us specifying a valid WebSocket URL in the configuration. + print "\nTesting runtime WebSocket configuration.\n" + for harness in [ + WebsockifyServerHarness(os.path.join('sockets', 'test_sockets_echo_server.c'), [sockets_include], 59168) + ]: + with harness: + open(os.path.join(self.get_dir(), 'websocket_pre.js'), 'w').write(''' + var Module = { + websocket: { + url: 'ws://localhost:59168/testA/testB', + subprotocol: 'text, base64, binary', + } + }; + ''') - self.assertContained('do_msg_read: read 14 bytes', run_js(path_from_root('tests', 'sockets', 'client.js'), engine=NODE_JS)) + Popen([PYTHON, EMCC, path_from_root('tests', 'sockets', 'test_sockets_echo_client.c'), '-o', 'client.js', '--pre-js', 'websocket_pre.js', '-s', 'SOCKET_DEBUG=1', '-DSOCKK=12345', '-DREPORT_RESULT=int dummy'], stdout=PIPE, stderr=PIPE).communicate() - # Tidy up files that might have been created by this test. - try_delete(path_from_root('tests', 'sockets', 'client.js')) - try_delete(path_from_root('tests', 'sockets', 'client.js.map')) + out = run_js('client.js', engine=NODE_JS, full_output=True) + self.assertContained('do_msg_read: read 14 bytes', out) + self.assertContained('connect: ws://localhost:59168/testA/testB, text,base64,binary', out) diff --git a/tests/tex_nonbyte.c b/tests/tex_nonbyte.c index 960d0efb..ffeb9f24 100644 --- a/tests/tex_nonbyte.c +++ b/tests/tex_nonbyte.c @@ -22,7 +22,7 @@ RESULTING FROM THE USE, MODIFICATION, OR REDISTRIBUTION OF THIS SOFTWARE. */ -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ #define USE_GLEW 1 #endif @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) glClearColor( 0, 0, 0, 0 ); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ glEnable( GL_TEXTURE_2D ); // Need this to display a texture XXX unnecessary in OpenGL ES 2.0/WebGL #endif @@ -192,7 +192,7 @@ int main(int argc, char *argv[]) SDL_GL_SwapBuffers(); -#if !EMSCRIPTEN +#ifndef __EMSCRIPTEN__ // Wait for 3 seconds to give us a chance to see the image SDL_Delay(3000); #endif diff --git a/tests/unistd/unlink.c b/tests/unistd/unlink.c index 9f532325..a15baab8 100644 --- a/tests/unistd/unlink.c +++ b/tests/unistd/unlink.c @@ -7,7 +7,7 @@ #include <string.h> #include <unistd.h> #include <sys/stat.h> -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ #include <emscripten.h> #endif @@ -23,7 +23,7 @@ static void create_file(const char *path, const char *buffer, int mode) { void setup() { mkdir("working", 0777); -#if EMSCRIPTEN +#ifdef __EMSCRIPTEN__ EM_ASM( #if NODEFS FS.mount(NODEFS, { root: '.' }, 'working'); diff --git a/tests/uuid/test.c b/tests/uuid/test.c index dc2c6589..f5f84011 100644 --- a/tests/uuid/test.c +++ b/tests/uuid/test.c @@ -59,7 +59,7 @@ int main() { // The following lets the browser test exit cleanly. int result = 1; - #if EMSCRIPTEN + #if defined(__EMSCRIPTEN__) #ifdef REPORT_RESULT REPORT_RESULT(); #endif diff --git a/tests/webidl/output.txt b/tests/webidl/output.txt new file mode 100644 index 00000000..b874d928 --- /dev/null +++ b/tests/webidl/output.txt @@ -0,0 +1,56 @@ +Parent:42 +* +84 +c1 +Parent:7 +Child1:7 +7 +14 +196 +588 +14 +28 +c1 v2 +Parent:16 +Child1:15 +15 +30 +900 +2700 +c2 +Parent:9 +Child2:9 +9 +18 +5832 +0 +0 +1 +*static* +*virtualf* +*virtualf* +*virtualf2* +Parent:9 +Child2:9 +*js virtualf replacement* +*js virtualf replacement* +*js virtualf2 replacement* +*js virtualf3 replacement 123* +caught: a JSImplementation must implement all functions, you forgot Child2JS::virtualFunc4. +*virtualf* +*virtualf* +*virtualf2* +*ok* +|hello|43|world|41| +12.35 +10 +object +10 +11 +object +10 +11 +21.12 +198 + +done. diff --git a/tests/webidl/post.js b/tests/webidl/post.js new file mode 100644 index 00000000..444efcd1 --- /dev/null +++ b/tests/webidl/post.js @@ -0,0 +1,117 @@ + +// Part 1 + +var sme = new Module.Parent(42); +sme.mulVal(2); +Module.print('*') +Module.print(sme.getVal()); + +Module.print('c1'); + +var c1 = new Module.Child1(); +Module.print(c1.getVal()); +c1.mulVal(2); +Module.print(c1.getVal()); +Module.print(c1.getValSqr()); +Module.print(c1.getValSqr(3)); +Module.print(c1.getValTimes()); // default argument should be 1 +Module.print(c1.getValTimes(2)); + +Module.print('c1 v2'); + +c1 = new Module.Child1(8); // now with a parameter, we should handle the overloading automatically and properly and use constructor #2 +Module.print(c1.getVal()); +c1.mulVal(2); +Module.print(c1.getVal()); +Module.print(c1.getValSqr()); +Module.print(c1.getValSqr(3)); + +Module.print('c2') + +var c2 = new Module.Child2(); +Module.print(c2.getVal()); +c2.mulVal(2); +Module.print(c2.getVal()); +Module.print(c2.getValCube()); +var succeeded; +try { + succeeded = 0; + Module.print(c2.doSomethingSecret()); // should fail since private + succeeded = 1; +} catch(e) {} +Module.print(succeeded); +try { + succeeded = 0; + Module.print(c2.getValSqr()); // function from the other class + succeeded = 1; +} catch(e) {} +Module.print(succeeded); +try { + succeeded = 0; + c2.getValCube(); // sanity + succeeded = 1; +} catch(e) {} +Module.print(succeeded); + +Module.Child2.prototype.printStatic(); // static calls go through the prototype + +// virtual function +c2.virtualFunc(); +Module.Child2.prototype.runVirtualFunc(c2); +c2.virtualFunc2(); + +// extend a class from JS +var c3 = new Module.Child2JS; + +c3.virtualFunc = function() { + Module.print('*js virtualf replacement*'); +}; +c3.virtualFunc2 = function() { + Module.print('*js virtualf2 replacement*'); +}; +c3.virtualFunc3 = function(x) { + Module.print('*js virtualf3 replacement ' + x + '*'); +}; + +c3.virtualFunc(); +Module.Child2.prototype.runVirtualFunc(c3); +c3.virtualFunc2(); +c3.virtualFunc3(123); // this one is not replaced! +try { + c3.virtualFunc4(123); +} catch(e) { + Module.print('caught: ' + e); +} + +c2.virtualFunc(); // original should remain the same +Module.Child2.prototype.runVirtualFunc(c2); +c2.virtualFunc2(); +Module.print('*ok*'); + +// Part 2 + +var suser = new Module.StringUser("hello", 43); +suser.Print(41, "world"); +suser.PrintFloat(12.3456); + +var bv = new Module.RefUser(10); +var bv2 = new Module.RefUser(11); +Module.print(bv2.getValue(bv)); + +Module.print(typeof bv2.getMe()); +Module.print(bv2.getMe().getValue(bv)); +Module.print(bv2.getMe().getValue(bv2)); + +Module.print(typeof bv2.getCopy()); +Module.print(bv2.getCopy().getValue(bv)); +Module.print(bv2.getCopy().getValue(bv2)); + +bv2.getAnother().PrintFloat(21.12); + +Module.print(new Module.Inner().get()); +new Module.Inner().mul(2); + +// + +Module.print('\ndone.') + diff --git a/tests/webidl/test.cpp b/tests/webidl/test.cpp new file mode 100644 index 00000000..8a2b5c72 --- /dev/null +++ b/tests/webidl/test.cpp @@ -0,0 +1,8 @@ +#include "test.h" + +Parent::Parent(int val) : value(val) { printf("Parent:%d\n", val); } +Parent::Parent(Parent *p, Parent *q) : value(p->value + q->value) { printf("Parent:%d\n", value); } +void Parent::mulVal(int mul) { value *= mul; } + +#include "glue.cpp" + diff --git a/tests/webidl/test.h b/tests/webidl/test.h new file mode 100644 index 00000000..903f8f78 --- /dev/null +++ b/tests/webidl/test.h @@ -0,0 +1,72 @@ +#include <stdio.h> + +// Part 1 + +class Parent { +protected: + int value; +public: + Parent(int val); + Parent(Parent *p, Parent *q); // overload constructor + int getVal() { return value; }; // inline should work just fine here, unlike Way 1 before + void mulVal(int mul); +}; + +class Child1 : public Parent { +public: + Child1() : Parent(7) { printf("Child1:%d\n", value); }; + Child1(int val) : Parent(val*2) { value -= 1; printf("Child1:%d\n", value); }; + int getValSqr() { return value*value; } + int getValSqr(int more) { return value*value*more; } + int getValTimes(int times=1) { return value*times; } +}; + +// Child2 has vtable, parent does not. Checks we cast child->parent properly - (Parent*)child is not a no-op, must offset +class Child2 : public Parent { +public: + Child2() : Parent(9) { printf("Child2:%d\n", value); }; + int getValCube() { return value*value*value; } + static void printStatic() { printf("*static*\n"); } + + virtual void virtualFunc() { printf("*virtualf*\n"); } + virtual void virtualFunc2() { printf("*virtualf2*\n"); } + static void runVirtualFunc(Child2 *self) { self->virtualFunc(); }; + virtual void virtualFunc3(int x) { printf("*virtualf3: %d*\n", x); } + virtual void virtualFunc4(int x) { printf("*virtualf4: %d*\n", x); } + +private: + void doSomethingSecret() { printf("security breached!\n"); }; // we should not be able to do this +}; + +// Part 2 + +#include <string.h> + +class StringUser { + char *s; + int i; +public: + StringUser(char *string="NO", int integer=99) : s(strdup(string)), i(integer) {} + void Print(int anotherInteger, char *anotherString) { + printf("|%s|%d|%s|%d|\n", s, i, anotherString, anotherInteger); + } + void PrintFloat(float f) { printf("%.2f\n", f); } +}; + +struct RefUser { + int value; + RefUser(int x = 77) : value(x) {} + int getValue(RefUser b) { return b.value; } + RefUser &getMe() { return *this; } + RefUser getCopy() { return RefUser(value*2); } + StringUser getAnother() { return StringUser("another", 5); } +}; + +namespace Space { + struct Inner { + Inner() {} + int get() { return 198; } + Inner& operator*=(float x) { return *this; } + }; +} + diff --git a/tests/webidl/test.idl b/tests/webidl/test.idl new file mode 100644 index 00000000..98ab5070 --- /dev/null +++ b/tests/webidl/test.idl @@ -0,0 +1,64 @@ + +// Part 1 + +interface Parent { + void Parent(long val); + long getVal(); + void mulVal(long mul); +}; + +interface Child1 { + void Child1(optional long val); + long getValSqr(optional long more); + long getValTimes(optional long times=1); +}; + +Child1 implements Parent; + +interface Child2 { + void Child2(); + long getValCube(); + static void printStatic(); + void virtualFunc(); + void virtualFunc2(); + void virtualFunc3(long x); + void virtualFunc4(long x); + static void runVirtualFunc(Child2 self); +}; + +Child2 implements Parent; + +[JSImplementation="Child2"] +interface Child2JS { + void Child2JS(); + void virtualFunc(); + void virtualFunc2(); + void virtualFunc3(long x); + void virtualFunc4(long x); +}; + +// Part 2 + +interface StringUser { + void StringUser(); + void StringUser(DOMString str, long i); + void Print(long anotherInteger, DOMString anotherString); + void PrintFloat(float f); +}; + +interface RefUser { + void RefUser(); + void RefUser(long value); + long getValue([Ref] RefUser b); + [Ref] RefUser getMe(); + [Value] RefUser getCopy(); // must have zero-arg constructor + [Value] StringUser getAnother(); +}; + +[Prefix="Space::"] +interface Inner { + void Inner(); + long get(); + [Operator="*=", Ref] Inner mul(float x); +}; + diff --git a/tests/worker_api_3_main.cpp b/tests/worker_api_3_main.cpp new file mode 100644 index 00000000..595f99b9 --- /dev/null +++ b/tests/worker_api_3_main.cpp @@ -0,0 +1,44 @@ +#include <stdio.h> +#include <assert.h> +#include <emscripten.h> + +int w1; + +bool sawCalls[] = { false, false, false, false }; + +void c1(char *data, int size, void *arg) { + assert((int)arg == 97); + assert(size >= sizeof(int)); + + int *x = (int*)data; + printf("c1: %d\n", x[0]); + + if (*x >= 0 && *x < 4) { + // Calls should have happened in order. + sawCalls[*x] = true; // Note the call with current param was made + for (int i = 0; i < *x - 1; ++i) { + if (!sawCalls[i]) { + // If we were called out of order, fail this and all following calls. + sawCalls[*x] = false; + break; + } + } + } else { + assert(*x == 4); + // This is the last call. All prior calls should have occurred. + int result = 1; // Final call occurred. + for (int i = 0; i < 4; ++i) + if (sawCalls[i]) result++; + REPORT_RESULT(); + } +} + +int main() { + w1 = emscripten_create_worker("worker.js"); + + int x[1] = { 0 }; + emscripten_call_worker(w1, "one", (char*)x, sizeof(x), c1, (void*)97); + + return 0; +} + diff --git a/tests/worker_api_3_worker.cpp b/tests/worker_api_3_worker.cpp new file mode 100644 index 00000000..db14377a --- /dev/null +++ b/tests/worker_api_3_worker.cpp @@ -0,0 +1,25 @@ +#include <assert.h> +#include <emscripten.h> + +extern "C" { + +// Respond with 0, 1, 2, 3 each with finalResponse=false, and 4 with +// finalResponse=true. +void one(char *data, int size) { + int *x = (int*)data; + + if (*x == 0) { + // Respond 0, 1, 2, 3 + for (int i = 0; i < 4; ++i) { + *x = i; + emscripten_worker_respond_provisionally(data, size); + } + } + + // Respond 4 + *x = 4; + emscripten_worker_respond(data, size); +} + +} + |