; LLVM IR from FSmallenburg/EDMD :: Grow (mdgrow)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.sevent = type { double, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32 }

@root = external dso_local global ptr, align 8
@checknode.count = external hidden global i32, align 4
@.str.20 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1

declare i32 @printf(ptr noundef, ...) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @checknode(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.sevent, ptr %3, i32 0, i32 3
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = icmp ne ptr %5, null
  br i1 %6, label %7, label %66

7:                                                ; preds = %1
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.sevent, ptr %8, i32 0, i32 3
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = getelementptr inbounds %struct.sevent, ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = icmp ne ptr %12, %13
  br i1 %14, label %15, label %25

15:                                               ; preds = %7
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.sevent, ptr %16, i32 0, i32 3
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct.sevent, ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = icmp ne ptr %20, %21
  br i1 %22, label %23, label %25

23:                                               ; preds = %15
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  br label %25

25:                                               ; preds = %23, %15, %7
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.sevent, ptr %26, i32 0, i32 3
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.sevent, ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = icmp eq ptr %30, %31
  br i1 %32, label %33, label %45

33:                                               ; preds = %25
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.sevent, ptr %34, i32 0, i32 0
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.sevent, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.sevent, ptr %39, i32 0, i32 0
  %41 = load double, ptr %40, align 8, !tbaa !15
  %42 = fcmp ogt double %36, %41
  br i1 %42, label %43, label %45

43:                                               ; preds = %33
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  br label %45

45:                                               ; preds = %43, %33, %25
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.sevent, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.sevent, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !14
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = icmp eq ptr %50, %51
  br i1 %52, label %53, label %65

53:                                               ; preds = %45
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.sevent, ptr %54, i32 0, i32 0
  %56 = load double, ptr %55, align 8, !tbaa !15
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.sevent, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.sevent, ptr %59, i32 0, i32 0
  %61 = load double, ptr %60, align 8, !tbaa !15
  %62 = fcmp olt double %56, %61
  br i1 %62, label %63, label %65

63:                                               ; preds = %53
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  br label %65

65:                                               ; preds = %63, %53, %45
  br label %73

66:                                               ; preds = %1
  %67 = load ptr, ptr @root, align 8, !tbaa !5
  %68 = load ptr, ptr %2, align 8, !tbaa !5
  %69 = icmp ne ptr %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %66
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  br label %72

72:                                               ; preds = %70, %66
  store i32 0, ptr @checknode.count, align 4, !tbaa !16
  br label %73

73:                                               ; preds = %72, %65
  %74 = load ptr, ptr %2, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.sevent, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !13
  %77 = icmp ne ptr %76, null
  br i1 %77, label %78, label %105

78:                                               ; preds = %73
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.sevent, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !13
  %82 = call i32 @checknode(ptr noundef %81)
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.sevent, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !13
  %86 = getelementptr inbounds %struct.sevent, ptr %85, i32 0, i32 3
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = icmp ne ptr %87, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %78
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  br label %92

92:                                               ; preds = %90, %78
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.sevent, ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !13
  %96 = getelementptr inbounds %struct.sevent, ptr %95, i32 0, i32 0
  %97 = load double, ptr %96, align 8, !tbaa !15
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.sevent, ptr %98, i32 0, i32 0
  %100 = load double, ptr %99, align 8, !tbaa !15
  %101 = fcmp ogt double %97, %100
  br i1 %101, label %102, label %104

102:                                              ; preds = %92
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  br label %104

104:                                              ; preds = %102, %92
  br label %105

105:                                              ; preds = %104, %73
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.sevent, ptr %106, i32 0, i32 2
  %108 = load ptr, ptr %107, align 8, !tbaa !14
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %137

110:                                              ; preds = %105
  %111 = load ptr, ptr %2, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.sevent, ptr %111, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !14
  %114 = call i32 @checknode(ptr noundef %113)
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.sevent, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !14
  %118 = getelementptr inbounds %struct.sevent, ptr %117, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = icmp ne ptr %119, %120
  br i1 %121, label %122, label %124

122:                                              ; preds = %110
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.26)
  br label %124

124:                                              ; preds = %122, %110
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.sevent, ptr %125, i32 0, i32 2
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  %128 = getelementptr inbounds %struct.sevent, ptr %127, i32 0, i32 0
  %129 = load double, ptr %128, align 8, !tbaa !15
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.sevent, ptr %130, i32 0, i32 0
  %132 = load double, ptr %131, align 8, !tbaa !15
  %133 = fcmp olt double %129, %132
  br i1 %133, label %134, label %136

134:                                              ; preds = %124
  %135 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  br label %136

136:                                              ; preds = %134, %124
  br label %137

137:                                              ; preds = %136, %105
  %138 = load i32, ptr @checknode.count, align 4, !tbaa !16
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr @checknode.count, align 4, !tbaa !16
  %140 = load i32, ptr @checknode.count, align 4, !tbaa !16
  ret i32 %140
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"sevent", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !7, i64 64, !12, i64 68, !12, i64 72}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !11, i64 0}
!16 = !{!12, !12, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@root = external dso_local local_unnamed_addr global ptr, align 8
@checknode.count = external hidden local_unnamed_addr global i32, align 4
@.str.20 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: nofree nounwind uwtable
define dso_local range(i32 -2147483647, -2147483648) i32 @checknode(ptr noundef readonly %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 24
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %33, label %4

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %3, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !12
  %.not30 = icmp eq ptr %6, %0
  br i1 %.not30, label %.thread, label %7

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %3, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %.not31 = icmp eq ptr %9, %0
  br i1 %.not31, label %12, label %10

10:                                               ; preds = %7
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %.pre = load ptr, ptr %2, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 8
  %.pre36 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !12
  br label %12

12:                                               ; preds = %10, %7
  %13 = phi ptr [ %.pre36, %10 ], [ %6, %7 ]
  %14 = phi ptr [ %.pre, %10 ], [ %3, %7 ]
  %15 = icmp eq ptr %13, %0
  br i1 %15, label %.thread, label %22

.thread:                                          ; preds = %4, %12
  %16 = phi ptr [ %14, %12 ], [ %3, %4 ]
  %17 = load double, ptr %0, align 8, !tbaa !14
  %18 = load double, ptr %16, align 8, !tbaa !14
  %19 = fcmp ogt double %17, %18
  br i1 %19, label %20, label %22

20:                                               ; preds = %.thread
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  %.pre37 = load ptr, ptr %2, align 8, !tbaa !5
  br label %22

22:                                               ; preds = %20, %.thread, %12
  %23 = phi ptr [ %.pre37, %20 ], [ %16, %.thread ], [ %14, %12 ]
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = icmp eq ptr %25, %0
  br i1 %26, label %27, label %38

27:                                               ; preds = %22
  %28 = load double, ptr %0, align 8, !tbaa !14
  %29 = load double, ptr %23, align 8, !tbaa !14
  %30 = fcmp olt double %28, %29
  br i1 %30, label %31, label %38

31:                                               ; preds = %27
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  br label %38

33:                                               ; preds = %1
  %34 = load ptr, ptr @root, align 8, !tbaa !15
  %.not29 = icmp eq ptr %34, %0
  br i1 %.not29, label %37, label %35

35:                                               ; preds = %33
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  br label %37

37:                                               ; preds = %35, %33
  store i32 0, ptr @checknode.count, align 4, !tbaa !16
  br label %38

38:                                               ; preds = %22, %27, %31, %37
  %39 = getelementptr inbounds i8, ptr %0, i64 8
  %40 = load ptr, ptr %39, align 8, !tbaa !12
  %.not32 = icmp eq ptr %40, null
  br i1 %.not32, label %55, label %41

41:                                               ; preds = %38
  %42 = tail call i32 @checknode(ptr noundef nonnull %40)
  %43 = load ptr, ptr %39, align 8, !tbaa !12
  %44 = getelementptr inbounds i8, ptr %43, i64 24
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %.not33 = icmp eq ptr %45, %0
  br i1 %.not33, label %48, label %46

46:                                               ; preds = %41
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %.pre38 = load ptr, ptr %39, align 8, !tbaa !12
  br label %48

48:                                               ; preds = %46, %41
  %49 = phi ptr [ %.pre38, %46 ], [ %43, %41 ]
  %50 = load double, ptr %49, align 8, !tbaa !14
  %51 = load double, ptr %0, align 8, !tbaa !14
  %52 = fcmp ogt double %50, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %48
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  br label %55

55:                                               ; preds = %48, %53, %38
  %56 = getelementptr inbounds i8, ptr %0, i64 16
  %57 = load ptr, ptr %56, align 8, !tbaa !13
  %.not34 = icmp eq ptr %57, null
  br i1 %.not34, label %72, label %58

58:                                               ; preds = %55
  %59 = tail call i32 @checknode(ptr noundef nonnull %57)
  %60 = load ptr, ptr %56, align 8, !tbaa !13
  %61 = getelementptr inbounds i8, ptr %60, i64 24
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %.not35 = icmp eq ptr %62, %0
  br i1 %.not35, label %65, label %63

63:                                               ; preds = %58
  %64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26)
  %.pre39 = load ptr, ptr %56, align 8, !tbaa !13
  br label %65

65:                                               ; preds = %63, %58
  %66 = phi ptr [ %.pre39, %63 ], [ %60, %58 ]
  %67 = load double, ptr %66, align 8, !tbaa !14
  %68 = load double, ptr %0, align 8, !tbaa !14
  %69 = fcmp olt double %67, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %65
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  br label %72

72:                                               ; preds = %65, %70, %55
  %73 = load i32, ptr @checknode.count, align 4, !tbaa !16
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @checknode.count, align 4, !tbaa !16
  ret i32 %74
}

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 24}
!6 = !{!"sevent", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !8, i64 64, !11, i64 68, !11, i64 72}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !10, i64 16}
!14 = !{!6, !7, i64 0}
!15 = !{!10, !10, i64 0}
!16 = !{!11, !11, i64 0}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass