Skip to content

Instantly share code, notes, and snippets.

@kadircet
Created February 4, 2020 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kadircet/918f5bb97a2afe048cb875490edba46e to your computer and use it in GitHub Desktop.
Save kadircet/918f5bb97a2afe048cb875490edba46e to your computer and use it in GitHub Desktop.
reduced crasher for 8413116bf10402eef12f556cb9d80b08faeb9890
; ModuleID = 'bugpoint-reduced-simplified.bc'
source_filename = "third_party/ncurses/ncurses/tinfo/alloc_entry.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
define void @_nc_wrap_entry(i1 %0) local_unnamed_addr #0 align 32 {
br i1 %0, label %2, label %13
2: ; preds = %1
br i1 undef, label %4, label %3
3: ; preds = %2
br label %6
4: ; preds = %8, %2
br i1 undef, label %12, label %5
5: ; preds = %4
br label %9
6: ; preds = %8, %3
switch i64 undef, label %7 [
i64 0, label %8
i64 -1, label %8
]
7: ; preds = %6
br label %8
8: ; preds = %7, %6, %6
br i1 undef, label %6, label %4
9: ; preds = %11, %5
br i1 undef, label %10, label %11
10: ; preds = %9
br label %11
11: ; preds = %10, %9
br i1 undef, label %12, label %9
12: ; preds = %11, %4
br label %13
13: ; preds = %12, %1
br i1 undef, label %21, label %14
14: ; preds = %13
br i1 undef, label %16, label %15
15: ; preds = %14
br label %25
16: ; preds = %71, %14
br i1 undef, label %17, label %21
17: ; preds = %16
switch i64 undef, label %19 [
i64 0, label %20
i64 -1, label %18
]
18: ; preds = %17
br label %20
19: ; preds = %17
br label %20
20: ; preds = %19, %18, %17
br label %21
21: ; preds = %20, %16, %13
br i1 undef, label %38, label %22
22: ; preds = %21
br i1 undef, label %31, label %23
23: ; preds = %22
br label %24
24: ; preds = %24, %23
br i1 undef, label %31, label %24
25: ; preds = %71, %15
br i1 undef, label %26, label %30
26: ; preds = %25
switch i64 undef, label %28 [
i64 0, label %29
i64 -1, label %27
]
27: ; preds = %26
br label %29
28: ; preds = %26
br label %29
29: ; preds = %28, %27, %26
br label %30
30: ; preds = %29, %25
br i1 undef, label %67, label %71
31: ; preds = %31, %24, %22
%32 = load i8*, i8** undef, align 8
%33 = icmp eq i8* %32, null
%34 = ptrtoint i8* %32 to i64
%35 = sub i64 %34, 0
%36 = trunc i64 %35 to i32
%37 = select i1 %33, i32 -1, i32 %36
store i32 %37, i32* undef, align 4
br i1 undef, label %38, label %31
38: ; preds = %31, %21
br i1 undef, label %39, label %40
39: ; preds = %38
unreachable
40: ; preds = %38
br i1 undef, label %48, label %41
41: ; preds = %40
br label %42
42: ; preds = %47, %41
br i1 undef, label %43, label %47
43: ; preds = %42
switch i32 undef, label %45 [
i32 -1, label %46
i32 -2, label %44
]
44: ; preds = %43
br label %46
45: ; preds = %43
br label %46
46: ; preds = %45, %44, %43
br label %47
47: ; preds = %46, %42
br i1 undef, label %42, label %48
48: ; preds = %47, %40
br i1 %0, label %56, label %49
49: ; preds = %48
br i1 undef, label %50, label %56
50: ; preds = %49
br label %51
51: ; preds = %51, %50
br i1 undef, label %52, label %51
52: ; preds = %51
br i1 undef, label %54, label %53
53: ; preds = %52
br i1 undef, label %56, label %55
54: ; preds = %52
unreachable
55: ; preds = %55, %53
br i1 undef, label %56, label %55
56: ; preds = %55, %53, %49, %48
br i1 undef, label %66, label %57
57: ; preds = %56
br i1 undef, label %62, label %58
58: ; preds = %57
br label %59
59: ; preds = %73, %58
br i1 undef, label %61, label %60
60: ; preds = %59
br label %61
61: ; preds = %60, %59
br i1 undef, label %73, label %72
62: ; preds = %73, %57
br i1 undef, label %66, label %63
63: ; preds = %62
br i1 undef, label %65, label %64
64: ; preds = %63
br label %65
65: ; preds = %64, %63
br label %66
66: ; preds = %65, %62, %56
ret void
67: ; preds = %30
switch i64 undef, label %69 [
i64 0, label %70
i64 -1, label %68
]
68: ; preds = %67
br label %70
69: ; preds = %67
br label %70
70: ; preds = %69, %68, %67
br label %71
71: ; preds = %70, %30
br i1 undef, label %16, label %25
72: ; preds = %61
br label %73
73: ; preds = %72, %61
br i1 undef, label %62, label %59
}
attributes #0 = { "use-soft-float"="false" }
!llvm.ident = !{!0}
!0 = !{!"clang version google3-trunk (8413116bf10402eef12f556cb9d80b08faeb9890)"}
; ModuleID = 'third_party/ncurses/ncurses/tinfo/alloc_entry.c'
source_filename = "third_party/ncurses/ncurses/tinfo/alloc_entry.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
%struct.entry = type { %struct.termtype, i32, [32 x %struct.ENTRY_USES], i32, [16 x %struct.entry*], i64, i64, i64, %struct.entry*, %struct.entry* }
%struct.termtype = type { i8*, i8*, i8*, i16*, i8**, i8*, i8**, i16, i16, i16, i16, i16, i16 }
%struct.ENTRY_USES = type { i8*, %struct.entry*, i64 }
@stringbuf = internal unnamed_addr global i8* null, align 8
@.str = private unnamed_addr constant [14 x i8] c"Out of memory\00", align 1
@next_free = internal unnamed_addr global i64 0, align 8
@.str.1 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@_nc_tracing = external local_unnamed_addr global i32, align 4
@.str.2 = private unnamed_addr constant [16 x i8] c"Saved string %s\00", align 1
@.str.3 = private unnamed_addr constant [15 x i8] c"at location %d\00", align 1
@.str.4 = private unnamed_addr constant [32 x i8] c"Too much data, some is lost: %s\00", align 1
; Function Attrs: nounwind uwtable
define void @_nc_init_entry(%struct.entry* %0) local_unnamed_addr #0 align 32 {
%2 = load i8*, i8** @stringbuf, align 8
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call noalias dereferenceable_or_null(4096) i8* @malloc(i64 4096) #7
store i8* %5, i8** @stringbuf, align 8
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %4
tail call void (i8*, ...) @_nc_err_abort(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)) #8
unreachable
8: ; preds = %1, %4
store i64 0, i64* @next_free, align 8
%9 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0
tail call void @_nc_init_termtype(%struct.termtype* %9) #7
ret void
}
; Function Attrs: nofree nounwind
declare noalias i8* @malloc(i64) local_unnamed_addr #1
; Function Attrs: noreturn
declare void @_nc_err_abort(i8*, ...) local_unnamed_addr #2
declare void @_nc_init_termtype(%struct.termtype*) local_unnamed_addr #3
; Function Attrs: nounwind uwtable
define %struct.entry* @_nc_copy_entry(%struct.entry* %0) local_unnamed_addr #0 align 32 {
%2 = tail call noalias dereferenceable_or_null(1024) i8* @calloc(i64 1, i64 1024) #7
%3 = bitcast i8* %2 to %struct.entry*
%4 = icmp eq i8* %2, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = bitcast %struct.entry* %0 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 8 dereferenceable(1024) %2, i8* nonnull align 8 dereferenceable(1024) %6, i64 1024, i1 false)
%7 = bitcast i8* %2 to %struct.termtype*
%8 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0
tail call void @_nc_copy_termtype(%struct.termtype* nonnull %7, %struct.termtype* %8) #7
br label %9
9: ; preds = %1, %5
ret %struct.entry* %3
}
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #4
; Function Attrs: nofree nounwind
declare noalias i8* @calloc(i64, i64) local_unnamed_addr #1
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* noalias nocapture writeonly, i8* noalias nocapture readonly, i64, i1 immarg) #4
declare void @_nc_copy_termtype(%struct.termtype*, %struct.termtype*) local_unnamed_addr #3
; Function Attrs: argmemonly nounwind willreturn
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #4
; Function Attrs: nounwind uwtable
define i8* @_nc_save_str(i8* %0) local_unnamed_addr #0 align 32 {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %5 ]
%4 = ptrtoint i8* %3 to i64
switch i64 %4, label %6 [
i64 -1, label %5
i64 0, label %5
]
5: ; preds = %2, %2
br label %2
6: ; preds = %2
%7 = load i64, i64* @next_free, align 8
%8 = tail call i64 @strlen(i8* nonnull %3) #9
%9 = add i64 %8, 1
%10 = icmp eq i64 %8, 0
%11 = icmp ne i64 %7, 0
%12 = and i1 %11, %10
br i1 %12, label %13, label %19
13: ; preds = %6
%14 = icmp ult i64 %7, 4096
br i1 %14, label %15, label %41
15: ; preds = %13
%16 = load i8*, i8** @stringbuf, align 8
%17 = getelementptr inbounds i8, i8* %16, i64 %7
%18 = getelementptr inbounds i8, i8* %17, i64 -1
br label %41
19: ; preds = %6
%20 = add i64 %9, %7
%21 = icmp ult i64 %20, 4096
br i1 %21, label %22, label %40
22: ; preds = %19
%23 = load i8*, i8** @stringbuf, align 8
%24 = getelementptr inbounds i8, i8* %23, i64 %7
%25 = tail call i8* @strcpy(i8* nonnull dereferenceable(1) %24, i8* nonnull %3) #7
%26 = load i32, i32* @_nc_tracing, align 4
%27 = icmp ugt i32 %26, 57343
br i1 %27, label %28, label %35
28: ; preds = %22
%29 = tail call i8* @_nc_visbuf(i8* nonnull %3) #7
tail call void (i8*, ...) @_tracef(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %29) #7
%30 = load i32, i32* @_nc_tracing, align 4
%31 = icmp ugt i32 %30, 57343
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i64, i64* @next_free, align 8
%34 = trunc i64 %33 to i32
tail call void (i8*, ...) @_tracef(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %34) #7
br label %35
35: ; preds = %22, %32, %28
%36 = load i64, i64* @next_free, align 8
%37 = add i64 %36, %9
store i64 %37, i64* @next_free, align 8
%38 = load i8*, i8** @stringbuf, align 8
%39 = getelementptr inbounds i8, i8* %38, i64 %7
br label %41
40: ; preds = %19
tail call void (i8*, ...) @_nc_warning(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8* nonnull %3) #7
br label %41
41: ; preds = %15, %13, %40, %35
%42 = phi i8* [ %18, %15 ], [ null, %13 ], [ %39, %35 ], [ null, %40 ]
ret i8* %42
}
; Function Attrs: argmemonly nofree nounwind readonly
declare i64 @strlen(i8* nocapture) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare i8* @strcpy(i8* noalias returned, i8* noalias nocapture readonly) local_unnamed_addr #1
declare void @_tracef(i8*, ...) local_unnamed_addr #3
declare i8* @_nc_visbuf(i8*) local_unnamed_addr #3
declare void @_nc_warning(i8*, ...) local_unnamed_addr #3
; Function Attrs: nounwind uwtable
define void @_nc_wrap_entry(%struct.entry* %0, i1 zeroext %1) local_unnamed_addr #0 align 32 {
%3 = alloca [2048 x i32], align 16
%4 = alloca [32 x i32], align 16
%5 = bitcast [2048 x i32]* %3 to i8*
call void @llvm.lifetime.start.p0i8(i64 8192, i8* nonnull %5) #10
%6 = bitcast [32 x i32]* %4 to i8*
call void @llvm.lifetime.start.p0i8(i64 128, i8* nonnull %6) #10
%7 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 1
%8 = load i32, i32* %7, align 8
br i1 %1, label %9, label %52
9: ; preds = %2
store i64 0, i64* @next_free, align 8
%10 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 0
%11 = load i8*, i8** %10, align 8
%12 = tail call i8* @_nc_save_str(i8* %11) #11
store i8* %12, i8** %10, align 8
%13 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 9
%14 = load i16, i16* %13, align 4
%15 = icmp eq i16 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %9
%17 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 4
br label %22
18: ; preds = %34, %9
%19 = icmp eq i32 %8, 0
br i1 %19, label %49, label %20
20: ; preds = %18
%21 = zext i32 %8 to i64
br label %39
22: ; preds = %16, %34
%23 = phi i16 [ %14, %16 ], [ %35, %34 ]
%24 = phi i64 [ 0, %16 ], [ %36, %34 ]
%25 = load i8**, i8*** %17, align 8
%26 = getelementptr inbounds i8*, i8** %25, i64 %24
%27 = load i8*, i8** %26, align 8
%28 = ptrtoint i8* %27 to i64
switch i64 %28, label %29 [
i64 0, label %34
i64 -1, label %34
]
29: ; preds = %22
%30 = tail call i8* @_nc_save_str(i8* nonnull %27) #11
%31 = load i8**, i8*** %17, align 8
%32 = getelementptr inbounds i8*, i8** %31, i64 %24
store i8* %30, i8** %32, align 8
%33 = load i16, i16* %13, align 4
br label %34
34: ; preds = %22, %22, %29
%35 = phi i16 [ %23, %22 ], [ %23, %22 ], [ %33, %29 ]
%36 = add nuw nsw i64 %24, 1
%37 = zext i16 %35 to i64
%38 = icmp ult i64 %36, %37
br i1 %38, label %22, label %18
39: ; preds = %46, %20
%40 = phi i64 [ 0, %20 ], [ %47, %46 ]
%41 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 2, i64 %40, i32 0
%42 = load i8*, i8** %41, align 8
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %46
44: ; preds = %39
%45 = tail call i8* @_nc_save_str(i8* null) #11
store i8* %45, i8** %41, align 8
br label %46
46: ; preds = %39, %44
%47 = add nuw nsw i64 %40, 1
%48 = icmp eq i64 %47, %21
br i1 %48, label %49, label %39
49: ; preds = %46, %18
%50 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 1
%51 = load i8*, i8** %50, align 8
tail call void @free(i8* %51) #7
br label %52
52: ; preds = %49, %2
%53 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 0
%54 = bitcast %struct.entry* %0 to i64*
%55 = load i64, i64* %54, align 8
%56 = load i64, i64* bitcast (i8** @stringbuf to i64*), align 8
%57 = sub i64 %55, %56
%58 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 9
%59 = load i16, i16* %58, align 4
%60 = icmp eq i16 %59, 0
%61 = inttoptr i64 %56 to i8*
br i1 %60, label %86, label %62
62: ; preds = %52
%63 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 4
%64 = zext i16 %59 to i64
%65 = and i64 %64, 1
%66 = icmp eq i16 %59, 1
br i1 %66, label %69, label %67
67: ; preds = %62
%68 = sub nsw i64 %64, %65
br label %129
69: ; preds = %316, %62
%70 = phi i64 [ 0, %62 ], [ %317, %316 ]
%71 = icmp ne i64 %65, 0
%72 = icmp ult i64 %70, 2048
%73 = and i1 %71, %72
br i1 %73, label %74, label %86
74: ; preds = %69
%75 = load i8**, i8*** %63, align 8
%76 = getelementptr inbounds i8*, i8** %75, i64 %70
%77 = bitcast i8** %76 to i64*
%78 = load i64, i64* %77, align 8
switch i64 %78, label %80 [
i64 0, label %83
i64 -1, label %79
]
79: ; preds = %74
br label %83
80: ; preds = %74
%81 = sub i64 %78, %56
%82 = trunc i64 %81 to i32
br label %83
83: ; preds = %80, %79, %74
%84 = phi i32 [ -2, %79 ], [ %82, %80 ], [ -1, %74 ]
%85 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %70
store i32 %84, i32* %85, align 4
br label %86
86: ; preds = %69, %83, %52
%87 = icmp eq i32 %8, 0
br i1 %87, label %160, label %88
88: ; preds = %86
%89 = zext i32 %8 to i64
%90 = icmp ult i32 %8, 5
br i1 %90, label %91, label %93
91: ; preds = %102, %88
%92 = phi i64 [ 0, %88 ], [ %97, %102 ]
br label %148
93: ; preds = %88
%94 = and i64 %89, 3
%95 = icmp eq i64 %94, 0
%96 = select i1 %95, i64 4, i64 %94
%97 = sub nsw i64 %89, %96
%98 = insertelement <2 x i64> undef, i64 %56, i32 0
%99 = shufflevector <2 x i64> %98, <2 x i64> undef, <2 x i32> zeroinitializer
%100 = insertelement <2 x i64> undef, i64 %56, i32 0
%101 = shufflevector <2 x i64> %100, <2 x i64> undef, <2 x i32> zeroinitializer
br label %102
102: ; preds = %102, %93
%103 = phi i64 [ 0, %93 ], [ %127, %102 ]
%104 = or i64 %103, 2
%105 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 2, i64 %103, i32 0
%106 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 2, i64 %104, i32 0
%107 = bitcast i8** %105 to <6 x i8*>*
%108 = bitcast i8** %106 to <6 x i8*>*
%109 = load <6 x i8*>, <6 x i8*>* %107, align 8
%110 = load <6 x i8*>, <6 x i8*>* %108, align 8
%111 = shufflevector <6 x i8*> %109, <6 x i8*> undef, <2 x i32> <i32 0, i32 3>
%112 = shufflevector <6 x i8*> %110, <6 x i8*> undef, <2 x i32> <i32 0, i32 3>
%113 = icmp eq <2 x i8*> %111, zeroinitializer
%114 = icmp eq <2 x i8*> %112, zeroinitializer
%115 = ptrtoint <2 x i8*> %111 to <2 x i64>
%116 = ptrtoint <2 x i8*> %112 to <2 x i64>
%117 = sub <2 x i64> %115, %99
%118 = sub <2 x i64> %116, %101
%119 = trunc <2 x i64> %117 to <2 x i32>
%120 = trunc <2 x i64> %118 to <2 x i32>
%121 = select <2 x i1> %113, <2 x i32> <i32 -1, i32 -1>, <2 x i32> %119
%122 = select <2 x i1> %114, <2 x i32> <i32 -1, i32 -1>, <2 x i32> %120
%123 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %103
%124 = bitcast i32* %123 to <2 x i32>*
store <2 x i32> %121, <2 x i32>* %124, align 16
%125 = getelementptr inbounds i32, i32* %123, i64 2
%126 = bitcast i32* %125 to <2 x i32>*
store <2 x i32> %122, <2 x i32>* %126, align 8
%127 = add i64 %103, 4
%128 = icmp eq i64 %127, %97
br i1 %128, label %91, label %102, !llvm.loop !3
129: ; preds = %316, %67
%130 = phi i64 [ 0, %67 ], [ %317, %316 ]
%131 = phi i64 [ %68, %67 ], [ %318, %316 ]
%132 = icmp ult i64 %130, 2048
br i1 %132, label %133, label %145
133: ; preds = %129
%134 = load i8**, i8*** %63, align 8
%135 = getelementptr inbounds i8*, i8** %134, i64 %130
%136 = bitcast i8** %135 to i64*
%137 = load i64, i64* %136, align 8
switch i64 %137, label %139 [
i64 0, label %142
i64 -1, label %138
]
138: ; preds = %133
br label %142
139: ; preds = %133
%140 = sub i64 %137, %56
%141 = trunc i64 %140 to i32
br label %142
142: ; preds = %133, %139, %138
%143 = phi i32 [ -2, %138 ], [ %141, %139 ], [ -1, %133 ]
%144 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %130
store i32 %143, i32* %144, align 8
br label %145
145: ; preds = %142, %129
%146 = or i64 %130, 1
%147 = icmp ult i64 %130, 2047
br i1 %147, label %304, label %316
148: ; preds = %91, %148
%149 = phi i64 [ %158, %148 ], [ %92, %91 ]
%150 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 2, i64 %149, i32 0
%151 = load i8*, i8** %150, align 8
%152 = icmp eq i8* %151, null
%153 = ptrtoint i8* %151 to i64
%154 = sub i64 %153, %56
%155 = trunc i64 %154 to i32
%156 = select i1 %152, i32 -1, i32 %155
%157 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %149
store i32 %156, i32* %157, align 4
%158 = add nuw nsw i64 %149, 1
%159 = icmp eq i64 %158, %89
br i1 %159, label %160, label %148, !llvm.loop !5
160: ; preds = %148, %86
%161 = load i64, i64* @next_free, align 8
%162 = tail call noalias i8* @malloc(i64 %161) #7
%163 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 1
store i8* %162, i8** %163, align 8
%164 = icmp eq i8* %162, null
br i1 %164, label %165, label %166
165: ; preds = %160
tail call void (i8*, ...) @_nc_err_abort(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)) #8
unreachable
166: ; preds = %160
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 %162, i8* align 1 %61, i64 %161, i1 false)
%167 = and i64 %57, 4294967295
%168 = getelementptr inbounds i8, i8* %162, i64 %167
store i8* %168, i8** %53, align 8
br i1 %60, label %191, label %169
169: ; preds = %166
%170 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 4
br label %171
171: ; preds = %169, %186
%172 = phi i64 [ 0, %169 ], [ %187, %186 ]
%173 = icmp ult i64 %172, 2048
br i1 %173, label %174, label %186
174: ; preds = %171
%175 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %172
%176 = load i32, i32* %175, align 4
switch i32 %176, label %178 [
i32 -1, label %182
i32 -2, label %177
]
177: ; preds = %174
br label %182
178: ; preds = %174
%179 = load i8*, i8** %163, align 8
%180 = sext i32 %176 to i64
%181 = getelementptr inbounds i8, i8* %179, i64 %180
br label %182
182: ; preds = %174, %178, %177
%183 = phi i8* [ inttoptr (i64 -1 to i8*), %177 ], [ %181, %178 ], [ null, %174 ]
%184 = load i8**, i8*** %170, align 8
%185 = getelementptr inbounds i8*, i8** %184, i64 %172
store i8* %183, i8** %185, align 8
br label %186
186: ; preds = %182, %171
%187 = add nuw nsw i64 %172, 1
%188 = load i16, i16* %58, align 4
%189 = zext i16 %188 to i64
%190 = icmp ult i64 %187, %189
br i1 %190, label %171, label %191
191: ; preds = %186, %166
br i1 %1, label %265, label %192
192: ; preds = %191
%193 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 10
%194 = load i16, i16* %193, align 2
%195 = zext i16 %194 to i32
%196 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 11
%197 = load i16, i16* %196, align 8
%198 = zext i16 %197 to i32
%199 = add nuw nsw i32 %198, %195
%200 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 12
%201 = load i16, i16* %200, align 2
%202 = zext i16 %201 to i32
%203 = add nuw nsw i32 %199, %202
%204 = add nsw i32 %203, -1
%205 = icmp ult i32 %204, 2047
br i1 %205, label %206, label %265
206: ; preds = %192
%207 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 6
%208 = load i8**, i8*** %207, align 8
%209 = zext i32 %203 to i64
br label %210
210: ; preds = %210, %206
%211 = phi i64 [ 0, %206 ], [ %222, %210 ]
%212 = phi i64 [ 0, %206 ], [ %217, %210 ]
%213 = getelementptr inbounds i8*, i8** %208, i64 %211
%214 = load i8*, i8** %213, align 8
%215 = tail call i64 @strlen(i8* nonnull dereferenceable(1) %214) #9
%216 = add i64 %212, 1
%217 = add i64 %216, %215
%218 = ptrtoint i8* %214 to i64
%219 = sub i64 %218, %56
%220 = trunc i64 %219 to i32
%221 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %211
store i32 %220, i32* %221, align 4
%222 = add nuw nsw i64 %211, 1
%223 = icmp eq i64 %222, %209
br i1 %223, label %224, label %210
224: ; preds = %210
%225 = tail call noalias i8* @malloc(i64 %217) #7
%226 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 5
store i8* %225, i8** %226, align 8
%227 = icmp eq i8* %225, null
br i1 %227, label %240, label %228
228: ; preds = %224
%229 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 6
%230 = zext i32 %203 to i64
%231 = load i8**, i8*** %229, align 8
store i8* %225, i8** %231, align 8
%232 = load i8**, i8*** %229, align 8
%233 = load i8*, i8** %232, align 8
%234 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 0
%235 = load i32, i32* %234, align 16
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds i8, i8* %61, i64 %236
%238 = tail call i8* @strcpy(i8* nonnull dereferenceable(1) %233, i8* nonnull dereferenceable(1) %237) #7
%239 = icmp eq i32 %203, 1
br i1 %239, label %265, label %241
240: ; preds = %224
tail call void (i8*, ...) @_nc_err_abort(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)) #8
unreachable
241: ; preds = %228, %241
%242 = phi i64 [ %263, %241 ], [ 1, %228 ]
%243 = phi i64 [ %250, %241 ], [ 0, %228 ]
%244 = phi i64 [ %242, %241 ], [ 0, %228 ]
%245 = load i8**, i8*** %229, align 8
%246 = add i64 %243, 1
%247 = getelementptr inbounds i8*, i8** %245, i64 %244
%248 = load i8*, i8** %247, align 8
%249 = tail call i64 @strlen(i8* nonnull dereferenceable(1) %248) #9
%250 = add i64 %246, %249
%251 = load i8*, i8** %226, align 8
%252 = load i8*, i8** @stringbuf, align 8
%253 = getelementptr inbounds i8, i8* %251, i64 %250
%254 = getelementptr inbounds i8*, i8** %245, i64 %242
store i8* %253, i8** %254, align 8
%255 = load i8**, i8*** %229, align 8
%256 = getelementptr inbounds i8*, i8** %255, i64 %242
%257 = load i8*, i8** %256, align 8
%258 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %242
%259 = load i32, i32* %258, align 4
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds i8, i8* %252, i64 %260
%262 = tail call i8* @strcpy(i8* nonnull dereferenceable(1) %257, i8* nonnull dereferenceable(1) %261) #7
%263 = add nuw nsw i64 %242, 1
%264 = icmp eq i64 %263, %230
br i1 %264, label %265, label %241
265: ; preds = %241, %228, %192, %191
br i1 %87, label %303, label %266
266: ; preds = %265
%267 = zext i32 %8 to i64
%268 = and i64 %267, 1
%269 = icmp eq i32 %8, 1
br i1 %269, label %289, label %270
270: ; preds = %266
%271 = sub nsw i64 %267, %268
br label %272
272: ; preds = %324, %270
%273 = phi i64 [ 0, %270 ], [ %327, %324 ]
%274 = phi i64 [ %271, %270 ], [ %328, %324 ]
%275 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %273
%276 = load i32, i32* %275, align 8
%277 = icmp eq i32 %276, -1
br i1 %277, label %282, label %278
278: ; preds = %272
%279 = load i8*, i8** %163, align 8
%280 = sext i32 %276 to i64
%281 = getelementptr inbounds i8, i8* %279, i64 %280
br label %282
282: ; preds = %272, %278
%283 = phi i8* [ %281, %278 ], [ null, %272 ]
%284 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 2, i64 %273, i32 0
store i8* %283, i8** %284, align 8
%285 = or i64 %273, 1
%286 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %285
%287 = load i32, i32* %286, align 4
%288 = icmp eq i32 %287, -1
br i1 %288, label %324, label %320
289: ; preds = %324, %266
%290 = phi i64 [ 0, %266 ], [ %327, %324 ]
%291 = icmp eq i64 %268, 0
br i1 %291, label %303, label %292
292: ; preds = %289
%293 = getelementptr inbounds [32 x i32], [32 x i32]* %4, i64 0, i64 %290
%294 = load i32, i32* %293, align 4
%295 = icmp eq i32 %294, -1
br i1 %295, label %300, label %296
296: ; preds = %292
%297 = load i8*, i8** %163, align 8
%298 = sext i32 %294 to i64
%299 = getelementptr inbounds i8, i8* %297, i64 %298
br label %300
300: ; preds = %296, %292
%301 = phi i8* [ %299, %296 ], [ null, %292 ]
%302 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 2, i64 %290, i32 0
store i8* %301, i8** %302, align 8
br label %303
303: ; preds = %300, %289, %265
call void @llvm.lifetime.end.p0i8(i64 128, i8* nonnull %6) #10
call void @llvm.lifetime.end.p0i8(i64 8192, i8* nonnull %5) #10
ret void
304: ; preds = %145
%305 = load i8**, i8*** %63, align 8
%306 = getelementptr inbounds i8*, i8** %305, i64 %146
%307 = bitcast i8** %306 to i64*
%308 = load i64, i64* %307, align 8
switch i64 %308, label %310 [
i64 0, label %313
i64 -1, label %309
]
309: ; preds = %304
br label %313
310: ; preds = %304
%311 = sub i64 %308, %56
%312 = trunc i64 %311 to i32
br label %313
313: ; preds = %310, %309, %304
%314 = phi i32 [ -2, %309 ], [ %312, %310 ], [ -1, %304 ]
%315 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %146
store i32 %314, i32* %315, align 4
br label %316
316: ; preds = %313, %145
%317 = add nuw nsw i64 %130, 2
%318 = add i64 %131, -2
%319 = icmp eq i64 %318, 0
br i1 %319, label %69, label %129
320: ; preds = %282
%321 = load i8*, i8** %163, align 8
%322 = sext i32 %287 to i64
%323 = getelementptr inbounds i8, i8* %321, i64 %322
br label %324
324: ; preds = %320, %282
%325 = phi i8* [ %323, %320 ], [ null, %282 ]
%326 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 2, i64 %285, i32 0
store i8* %325, i8** %326, align 8
%327 = add nuw nsw i64 %273, 2
%328 = add i64 %274, -2
%329 = icmp eq i64 %328, 0
br i1 %329, label %289, label %272
}
; Function Attrs: nounwind
declare void @free(i8* nocapture) local_unnamed_addr #6
; Function Attrs: nounwind uwtable
define void @_nc_merge_entry(%struct.entry* %0, %struct.entry* %1) local_unnamed_addr #0 align 32 {
%3 = icmp eq %struct.entry* %1, null
%4 = icmp eq %struct.entry* %0, null
%5 = or i1 %4, %3
br i1 %5, label %83, label %6
6: ; preds = %2
%7 = getelementptr inbounds %struct.entry, %struct.entry* %1, i64 0, i32 0
%8 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0
tail call void @_nc_align_termtype(%struct.termtype* %8, %struct.termtype* %7) #7
%9 = getelementptr inbounds %struct.entry, %struct.entry* %1, i64 0, i32 0, i32 7
%10 = load i16, i16* %9, align 8
%11 = icmp eq i16 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 2
%14 = getelementptr inbounds %struct.entry, %struct.entry* %1, i64 0, i32 0, i32 2
br label %22
15: ; preds = %36, %6
%16 = getelementptr inbounds %struct.entry, %struct.entry* %1, i64 0, i32 0, i32 8
%17 = load i16, i16* %16, align 2
%18 = icmp eq i16 %17, 0
br i1 %18, label %41, label %19
19: ; preds = %15
%20 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 3
%21 = getelementptr inbounds %struct.entry, %struct.entry* %1, i64 0, i32 0, i32 3
br label %48
22: ; preds = %12, %36
%23 = phi i16 [ %10, %12 ], [ %37, %36 ]
%24 = phi i64 [ 0, %12 ], [ %38, %36 ]
%25 = load i8*, i8** %13, align 8
%26 = getelementptr inbounds i8, i8* %25, i64 %24
%27 = load i8, i8* %26, align 1
%28 = icmp eq i8 %27, -2
br i1 %28, label %36, label %29
29: ; preds = %22
%30 = load i8*, i8** %14, align 8
%31 = getelementptr inbounds i8, i8* %30, i64 %24
%32 = load i8, i8* %31, align 1
%33 = icmp eq i8 %32, 1
br i1 %33, label %34, label %36
34: ; preds = %29
store i8 1, i8* %26, align 1
%35 = load i16, i16* %9, align 8
br label %36
36: ; preds = %34, %29, %22
%37 = phi i16 [ %35, %34 ], [ %23, %29 ], [ %23, %22 ]
%38 = add nuw nsw i64 %24, 1
%39 = zext i16 %37 to i64
%40 = icmp ult i64 %38, %39
br i1 %40, label %22, label %15
41: ; preds = %60, %15
%42 = getelementptr inbounds %struct.entry, %struct.entry* %1, i64 0, i32 0, i32 9
%43 = load i16, i16* %42, align 4
%44 = icmp eq i16 %43, 0
br i1 %44, label %83, label %45
45: ; preds = %41
%46 = getelementptr inbounds %struct.entry, %struct.entry* %0, i64 0, i32 0, i32 4
%47 = getelementptr inbounds %struct.entry, %struct.entry* %1, i64 0, i32 0, i32 4
br label %65
48: ; preds = %19, %60
%49 = phi i64 [ 0, %19 ], [ %61, %60 ]
%50 = load i16*, i16** %20, align 8
%51 = getelementptr inbounds i16, i16* %50, i64 %49
%52 = load i16, i16* %51, align 2
%53 = icmp eq i16 %52, -2
br i1 %53, label %60, label %54
54: ; preds = %48
%55 = load i16*, i16** %21, align 8
%56 = getelementptr inbounds i16, i16* %55, i64 %49
%57 = load i16, i16* %56, align 2
switch i16 %57, label %59 [
i16 -2, label %58
i16 -1, label %60
]
58: ; preds = %54
store i16 -1, i16* %51, align 2
br label %60
59: ; preds = %54
store i16 %57, i16* %51, align 2
br label %60
60: ; preds = %58, %59, %54, %48
%61 = add nuw nsw i64 %49, 1
%62 = load i16, i16* %16, align 2
%63 = zext i16 %62 to i64
%64 = icmp ult i64 %61, %63
br i1 %64, label %48, label %41
65: ; preds = %45, %78
%66 = phi i64 [ 0, %45 ], [ %79, %78 ]
%67 = load i8**, i8*** %46, align 8
%68 = getelementptr inbounds i8*, i8** %67, i64 %66
%69 = load i8*, i8** %68, align 8
%70 = icmp eq i8* %69, inttoptr (i64 -1 to i8*)
br i1 %70, label %78, label %71
71: ; preds = %65
%72 = load i8**, i8*** %47, align 8
%73 = getelementptr inbounds i8*, i8** %72, i64 %66
%74 = load i8*, i8** %73, align 8
%75 = ptrtoint i8* %74 to i64
switch i64 %75, label %77 [
i64 -1, label %76
i64 0, label %78
]
76: ; preds = %71
store i8* null, i8** %68, align 8
br label %78
77: ; preds = %71
store i8* %74, i8** %68, align 8
br label %78
78: ; preds = %76, %77, %71, %65
%79 = add nuw nsw i64 %66, 1
%80 = load i16, i16* %42, align 4
%81 = zext i16 %80 to i64
%82 = icmp ult i64 %79, %81
br i1 %82, label %65, label %83
83: ; preds = %78, %41, %2
ret void
}
declare void @_nc_align_termtype(%struct.termtype*, %struct.termtype*) local_unnamed_addr #3
attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="non-leaf" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-builtin-fread" "no-builtin-fwrite" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "prefer-vector-width"="128" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+aes,+cx16,+cx8,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nofree nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="non-leaf" "less-precise-fpmad"="false" "no-builtin-fread" "no-builtin-fwrite" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "prefer-vector-width"="128" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+aes,+cx16,+cx8,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #2 = { noreturn "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="non-leaf" "less-precise-fpmad"="false" "no-builtin-fread" "no-builtin-fwrite" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "prefer-vector-width"="128" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+aes,+cx16,+cx8,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #3 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="non-leaf" "less-precise-fpmad"="false" "no-builtin-fread" "no-builtin-fwrite" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "prefer-vector-width"="128" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+aes,+cx16,+cx8,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #4 = { argmemonly nounwind willreturn }
attributes #5 = { argmemonly nofree nounwind readonly "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="non-leaf" "less-precise-fpmad"="false" "no-builtin-fread" "no-builtin-fwrite" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "prefer-vector-width"="128" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+aes,+cx16,+cx8,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #6 = { nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="non-leaf" "less-precise-fpmad"="false" "no-builtin-fread" "no-builtin-fwrite" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "prefer-vector-width"="128" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+aes,+cx16,+cx8,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #7 = { nounwind "no-builtin-fread" "no-builtin-fwrite" }
attributes #8 = { noreturn nounwind "no-builtin-fread" "no-builtin-fwrite" }
attributes #9 = { nounwind readonly "no-builtin-fread" "no-builtin-fwrite" }
attributes #10 = { nounwind }
attributes #11 = { "no-builtin-fread" "no-builtin-fwrite" }
!llvm.module.flags = !{!0, !1}
!llvm.ident = !{!2}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 7, !"PIC Level", i32 2}
!2 = !{!"clang version google3-trunk (8413116bf10402eef12f556cb9d80b08faeb9890)"}
!3 = distinct !{!3, !4}
!4 = !{!"llvm.loop.isvectorized", i32 1}
!5 = distinct !{!5, !6, !4}
!6 = !{!"llvm.loop.unroll.runtime.disable"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment