; LLVM IR from jingweizhanghuai/Morn :: src/util (morn_graph)

; 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.HandleList = type { %struct.MList, i32, i32, i32, i32 }
%struct.MList = type { i32, ptr }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleGraphCreate = type { ptr, i32, i32, ptr, i32, ptr, ptr }
%struct.HandleGraphTraversal = type { ptr, ptr, ptr, i32 }
%struct.MObject = type { i32, %union.anon }
%union.anon = type { ptr }

@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@__FUNCTION__.m_GraphTraversal = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

declare void @m_Free(ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #1

declare ptr @m_Malloc(i32 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare dso_local void @endGraphTraversal(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @GraphDFTraversal(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @GraphBFTraversal(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @m_GraphTraversal(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %18, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.HandleList, ptr %19, i64 -1
  %21 = getelementptr inbounds %struct.HandleList, ptr %20, i32 0, i32 0
  %22 = getelementptr inbounds %struct.MList, ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds ptr, ptr %23, i64 1
  %25 = load ptr, ptr %24, align 8, !tbaa !5
  store ptr %25, ptr %11, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %27 = load ptr, ptr %11, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.MHandle, ptr %27, i32 0, i32 0
  %29 = load volatile i32, ptr %28, align 8, !tbaa !14
  %30 = icmp ne i32 %29, -562223887
  %31 = zext i1 %30 to i32
  store i32 %31, ptr %12, align 4, !tbaa !9
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %26
  %35 = load i32, ptr %12, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %35, i32 noundef -1, ptr noundef @.str.2, i32 noundef 210, ptr noundef @__FUNCTION__.m_GraphTraversal, ptr noundef @.str.3)
  br label %36

36:                                               ; preds = %34, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %37

37:                                               ; preds = %36
  br label %38

38:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.MHandle, ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !16
  store ptr %41, ptr %13, align 8, !tbaa !5
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %44, label %79

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %73, %44
  %46 = load i32, ptr %14, align 4, !tbaa !9
  %47 = load ptr, ptr %13, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.HandleGraphCreate, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 8, !tbaa !17
  %50 = icmp slt i32 %46, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %45
  store i32 4, ptr %15, align 4
  br label %76

52:                                               ; preds = %45
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  %54 = load ptr, ptr %13, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.HandleGraphCreate, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = load i32, ptr %14, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %56, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = call i32 %53(ptr noundef %60, ptr noundef %61)
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %72

64:                                               ; preds = %52
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.HandleGraphCreate, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !19
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds ptr, ptr %67, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !5
  store ptr %71, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %76

72:                                               ; preds = %52
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %14, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %14, align 4, !tbaa !9
  br label %45, !llvm.loop !20

76:                                               ; preds = %64, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %77 = load i32, ptr %15, align 4
  switch i32 %77, label %150 [
    i32 4, label %78
  ]

78:                                               ; preds = %76
  store ptr null, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %150

79:                                               ; preds = %38
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = call ptr @GetHandle(ptr noundef %80, i32 noundef 32, i32 noundef 213147989, ptr noundef @endGraphTraversal)
  store ptr %81, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.MHandle, ptr %82, i32 0, i32 3
  %84 = load ptr, ptr %83, align 8, !tbaa !16
  store ptr %84, ptr %16, align 8, !tbaa !5
  %85 = load ptr, ptr %16, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %85, i32 0, i32 3
  %87 = load i32, ptr %86, align 8, !tbaa !22
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.HandleGraphCreate, ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 8, !tbaa !17
  %91 = icmp eq i32 %87, %90
  br i1 %91, label %92, label %123

92:                                               ; preds = %79
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.HandleGraphCreate, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !19
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %96, i32 0, i32 2
  store ptr %95, ptr %97, align 8, !tbaa !24
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.HandleGraphCreate, ptr %98, i32 0, i32 1
  %100 = load i32, ptr %99, align 8, !tbaa !17
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %101, i32 0, i32 3
  store i32 %100, ptr %102, align 8, !tbaa !22
  %103 = load ptr, ptr %16, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !25
  %106 = icmp ne ptr %105, null
  br i1 %106, label %107, label %111

107:                                              ; preds = %92
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %108, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !25
  call void @m_Free(ptr noundef %110)
  br label %111

111:                                              ; preds = %107, %92
  %112 = load ptr, ptr %16, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %112, i32 0, i32 3
  %114 = load i32, ptr %113, align 8, !tbaa !22
  %115 = sext i32 %114 to i64
  %116 = mul i64 %115, 4
  %117 = trunc i64 %116 to i32
  %118 = call ptr @m_Malloc(i32 noundef %117)
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %119, i32 0, i32 1
  store ptr %118, ptr %120, align 8, !tbaa !25
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.MHandle, ptr %121, i32 0, i32 1
  store volatile i32 1, ptr %122, align 4, !tbaa !26
  br label %123

123:                                              ; preds = %111, %79
  %124 = load ptr, ptr %16, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %124, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !25
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.HandleGraphTraversal, ptr %127, i32 0, i32 3
  %129 = load i32, ptr %128, align 8, !tbaa !22
  %130 = sext i32 %129 to i64
  %131 = mul i64 %130, 4
  call void @llvm.memset.p0.i64(ptr align 4 %126, i8 0, i64 %131, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.MObject, ptr %132, i32 0, i32 1
  %134 = load ptr, ptr %133, align 8, !tbaa !27
  store ptr %134, ptr %17, align 8, !tbaa !5
  %135 = load i32, ptr %7, align 4, !tbaa !9
  %136 = icmp eq i32 %135, 0
  br i1 %136, label %137, label %143

137:                                              ; preds = %123
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = load ptr, ptr %17, align 8, !tbaa !5
  %140 = load ptr, ptr %10, align 8, !tbaa !5
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = call ptr @GraphBFTraversal(ptr noundef %138, ptr noundef %139, ptr noundef %140, ptr noundef %141)
  store ptr %142, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %149

143:                                              ; preds = %123
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = load ptr, ptr %17, align 8, !tbaa !5
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = load ptr, ptr %9, align 8, !tbaa !5
  %148 = call ptr @GraphDFTraversal(ptr noundef %144, ptr noundef %145, ptr noundef %146, ptr noundef %147)
  store ptr %148, ptr %5, align 8
  store i32 1, ptr %15, align 4
  br label %149

149:                                              ; preds = %143, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %150

150:                                              ; preds = %149, %78, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %151 = load ptr, ptr %5, align 8
  ret ptr %151
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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" }
attributes #4 = { nounwind }

!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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"HandleList", !13, i64 0, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!13 = !{!"MList", !10, i64 0, !6, i64 8}
!14 = !{!15, !10, i64 0}
!15 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!16 = !{!15, !6, i64 16}
!17 = !{!18, !10, i64 8}
!18 = !{!"HandleGraphCreate", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40}
!19 = !{!18, !6, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !10, i64 24}
!23 = !{!"HandleGraphTraversal", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!24 = !{!23, !6, i64 16}
!25 = !{!23, !6, i64 8}
!26 = !{!15, !10, i64 4}
!27 = !{!7, !7, 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"

@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1
@__FUNCTION__.m_GraphTraversal = external hidden unnamed_addr constant [17 x i8], align 1

declare void @m_Free(ptr noundef) local_unnamed_addr #0

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

declare ptr @m_Malloc(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind uwtable
declare dso_local void @endGraphTraversal(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @GraphDFTraversal(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @GraphBFTraversal(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local ptr @m_GraphTraversal(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 -24
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = load volatile i32, ptr %8, align 8, !tbaa !13
  %.not48 = icmp eq i32 %9, -562223887
  br i1 %.not48, label %11, label %10

10:                                               ; preds = %4
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.2, i32 noundef 210, ptr noundef nonnull @__FUNCTION__.m_GraphTraversal, ptr noundef nonnull @.str.3) #3
  br label %11

11:                                               ; preds = %10, %4
  %12 = getelementptr inbounds i8, ptr %8, i64 16
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  %14 = icmp slt i32 %1, 0
  br i1 %14, label %.preheader, label %28

.preheader:                                       ; preds = %11
  %15 = getelementptr inbounds i8, ptr %13, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !16
  %.not4749 = icmp sgt i32 %16, 0
  br i1 %.not4749, label %.lr.ph, label %.loopexit

17:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %15, align 8, !tbaa !16
  %19 = sext i32 %18 to i64
  %.not47 = icmp slt i64 %indvars.iv.next, %19
  br i1 %.not47, label %.lr.ph, label %.loopexit, !llvm.loop !18

.lr.ph:                                           ; preds = %.preheader, %17
  %indvars.iv = phi i64 [ %indvars.iv.next, %17 ], [ 0, %.preheader ]
  %20 = load ptr, ptr %13, align 8, !tbaa !20
  %21 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv
  %22 = load ptr, ptr %21, align 8, !tbaa !12
  %23 = tail call i32 %2(ptr noundef %22, ptr noundef %3) #3
  %.not46 = icmp eq i32 %23, 0
  br i1 %.not46, label %17, label %24

24:                                               ; preds = %.lr.ph
  %25 = load ptr, ptr %13, align 8, !tbaa !20
  %26 = getelementptr inbounds ptr, ptr %25, i64 %indvars.iv
  %27 = load ptr, ptr %26, align 8, !tbaa !12
  br label %.loopexit

28:                                               ; preds = %11
  %29 = tail call ptr @GetHandle(ptr noundef nonnull %0, i32 noundef 32, i32 noundef 213147989, ptr noundef nonnull @endGraphTraversal) #3
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %31, i64 24
  %33 = load i32, ptr %32, align 8, !tbaa !21
  %34 = getelementptr inbounds i8, ptr %13, i64 8
  %35 = load i32, ptr %34, align 8, !tbaa !16
  %36 = icmp eq i32 %33, %35
  br i1 %36, label %37, label %._crit_edge

._crit_edge:                                      ; preds = %28
  %.phi.trans.insert = getelementptr inbounds i8, ptr %31, i64 8
  %.pre53 = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !23
  br label %48

37:                                               ; preds = %28
  %38 = load ptr, ptr %13, align 8, !tbaa !20
  %39 = getelementptr inbounds i8, ptr %31, i64 16
  store ptr %38, ptr %39, align 8, !tbaa !24
  %40 = getelementptr inbounds i8, ptr %31, i64 8
  %41 = load ptr, ptr %40, align 8, !tbaa !23
  %.not = icmp eq ptr %41, null
  br i1 %.not, label %43, label %42

42:                                               ; preds = %37
  tail call void @m_Free(ptr noundef nonnull %41) #3
  %.pre = load i32, ptr %32, align 8, !tbaa !21
  br label %43

43:                                               ; preds = %42, %37
  %44 = phi i32 [ %.pre, %42 ], [ %33, %37 ]
  %45 = shl i32 %44, 2
  %46 = tail call ptr @m_Malloc(i32 noundef %45) #3
  store ptr %46, ptr %40, align 8, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %29, i64 4
  store volatile i32 1, ptr %47, align 4, !tbaa !25
  %.pre54 = load i32, ptr %32, align 8, !tbaa !21
  br label %48

48:                                               ; preds = %._crit_edge, %43
  %49 = phi i32 [ %33, %._crit_edge ], [ %.pre54, %43 ]
  %50 = phi ptr [ %.pre53, %._crit_edge ], [ %46, %43 ]
  %51 = sext i32 %49 to i64
  %52 = shl nsw i64 %51, 2
  tail call void @llvm.memset.p0.i64(ptr align 4 %50, i8 0, i64 %52, i1 false)
  %53 = getelementptr inbounds i8, ptr %0, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !26
  %55 = icmp eq i32 %1, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %48
  %57 = tail call ptr @GraphBFTraversal(ptr noundef nonnull %31, ptr noundef %54, ptr noundef %2, ptr noundef %3)
  br label %.loopexit

58:                                               ; preds = %48
  %59 = tail call ptr @GraphDFTraversal(ptr noundef nonnull %31, ptr noundef %54, ptr noundef %2, ptr noundef %3)
  br label %.loopexit

.loopexit:                                        ; preds = %17, %.preheader, %24, %56, %58
  %.2 = phi ptr [ %57, %56 ], [ %59, %58 ], [ %27, %24 ], [ null, %.preheader ], [ null, %17 ]
  ret ptr %.2
}

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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" }
attributes #3 = { nounwind }

!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, !11, i64 8}
!6 = !{!"HandleList", !7, i64 0, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!7 = !{!"MList", !8, i64 0, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !8, i64 0}
!14 = !{!"MHandle", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16}
!15 = !{!14, !11, i64 16}
!16 = !{!17, !8, i64 8}
!17 = !{!"HandleGraphCreate", !11, i64 0, !8, i64 8, !8, i64 12, !11, i64 16, !8, i64 24, !11, i64 32, !11, i64 40}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!17, !11, i64 0}
!21 = !{!22, !8, i64 24}
!22 = !{!"HandleGraphTraversal", !11, i64 0, !11, i64 8, !11, i64 16, !8, i64 24}
!23 = !{!22, !11, i64 8}
!24 = !{!22, !11, i64 16}
!25 = !{!14, !8, i64 4}
!26 = !{!9, !9, i64 0}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass