; LLVM IR from dpt/Containers :: libraries/datastruct/trie/breadthwalk-internal.ll_trie (breadthwalk_internal)

; 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.nodedepth = type { ptr, i32 }
%struct.trie = type { ptr, i32, ptr, ptr, ptr }
%struct.trie__node = type { [2 x ptr], %struct.item }
%struct.item = type { ptr, i64, ptr }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [97 x i8], align 1
@__PRETTY_FUNCTION__.trie__breadthwalk_internal = external hidden unnamed_addr constant [100 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @trie__breadthwalk_internal(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.nodedepth, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.nodedepth, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %4
  store i64 0, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %151

19:                                               ; preds = %4
  %20 = call ptr @queue_create(i32 noundef 100, i64 noundef 16)
  store ptr %20, ptr %11, align 8, !tbaa !5
  %21 = load ptr, ptr %11, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  store i64 1, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %151

24:                                               ; preds = %19
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.trie, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %24
  br label %31

30:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 40, ptr noundef @__PRETTY_FUNCTION__.trie__breadthwalk_internal) #5
  unreachable

31:                                               ; preds = %29
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.trie, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  store ptr %34, ptr %35, align 8, !tbaa !13
  %36 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 1
  store i32 0, ptr %36, align 8, !tbaa !15
  %37 = load ptr, ptr %11, align 8, !tbaa !5
  %38 = call i64 @queue_enqueue(ptr noundef %37, ptr noundef %12)
  store i64 %38, ptr %10, align 8, !tbaa !16
  %39 = load i64, ptr %10, align 8, !tbaa !16
  %40 = icmp ne i64 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %31
  %42 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %42, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %151

43:                                               ; preds = %31
  br label %44

44:                                               ; preds = %148, %43
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = call i32 @queue_empty(ptr noundef %45)
  %47 = icmp ne i32 %46, 0
  %48 = xor i1 %47, true
  br i1 %48, label %49, label %149

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call i64 @queue_dequeue(ptr noundef %50, ptr noundef %12)
  store i64 %51, ptr %10, align 8, !tbaa !16
  %52 = load i64, ptr %10, align 8, !tbaa !16
  %53 = icmp ne i64 %52, 0
  br i1 %53, label %54, label %56

54:                                               ; preds = %49
  %55 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %55, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %146

56:                                               ; preds = %49
  %57 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = getelementptr inbounds %struct.trie__node, ptr %58, i32 0, i32 0
  %60 = getelementptr inbounds [2 x ptr], ptr %59, i64 0, i64 0
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  %62 = icmp eq ptr %61, null
  br i1 %62, label %63, label %70

63:                                               ; preds = %56
  %64 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !13
  %66 = getelementptr inbounds %struct.trie__node, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds [2 x ptr], ptr %66, i64 0, i64 1
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  %69 = icmp eq ptr %68, null
  br label %70

70:                                               ; preds = %63, %56
  %71 = phi i1 [ false, %56 ], [ %69, %63 ]
  %72 = zext i1 %71 to i32
  store i32 %72, ptr %14, align 4, !tbaa !9
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = and i32 %73, 4
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %79

76:                                               ; preds = %70
  %77 = load i32, ptr %14, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %86, label %79

79:                                               ; preds = %76, %70
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = and i32 %80, 8
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %99

83:                                               ; preds = %79
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %99, label %86

86:                                               ; preds = %83, %76
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !13
  %90 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !15
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = call i64 %87(ptr noundef %89, i32 noundef %91, ptr noundef %92)
  store i64 %93, ptr %10, align 8, !tbaa !16
  %94 = load i64, ptr %10, align 8, !tbaa !16
  %95 = icmp ne i64 %94, 0
  br i1 %95, label %96, label %98

96:                                               ; preds = %86
  %97 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %97, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %146

98:                                               ; preds = %86
  br label %99

99:                                               ; preds = %98, %83, %79
  %100 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 1
  %101 = load i32, ptr %100, align 8, !tbaa !15
  %102 = add nsw i32 %101, 1
  %103 = getelementptr inbounds %struct.nodedepth, ptr %15, i32 0, i32 1
  store i32 %102, ptr %103, align 8, !tbaa !15
  %104 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !13
  %106 = getelementptr inbounds %struct.trie__node, ptr %105, i32 0, i32 0
  %107 = getelementptr inbounds [2 x ptr], ptr %106, i64 0, i64 0
  %108 = load ptr, ptr %107, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %124

110:                                              ; preds = %99
  %111 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !13
  %113 = getelementptr inbounds %struct.trie__node, ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds [2 x ptr], ptr %113, i64 0, i64 0
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.nodedepth, ptr %15, i32 0, i32 0
  store ptr %115, ptr %116, align 8, !tbaa !13
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = call i64 @queue_enqueue(ptr noundef %117, ptr noundef %15)
  store i64 %118, ptr %10, align 8, !tbaa !16
  %119 = load i64, ptr %10, align 8, !tbaa !16
  %120 = icmp ne i64 %119, 0
  br i1 %120, label %121, label %123

121:                                              ; preds = %110
  %122 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %122, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %146

123:                                              ; preds = %110
  br label %124

124:                                              ; preds = %123, %99
  %125 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !13
  %127 = getelementptr inbounds %struct.trie__node, ptr %126, i32 0, i32 0
  %128 = getelementptr inbounds [2 x ptr], ptr %127, i64 0, i64 1
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  %130 = icmp ne ptr %129, null
  br i1 %130, label %131, label %145

131:                                              ; preds = %124
  %132 = getelementptr inbounds %struct.nodedepth, ptr %12, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !13
  %134 = getelementptr inbounds %struct.trie__node, ptr %133, i32 0, i32 0
  %135 = getelementptr inbounds [2 x ptr], ptr %134, i64 0, i64 1
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.nodedepth, ptr %15, i32 0, i32 0
  store ptr %136, ptr %137, align 8, !tbaa !13
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = call i64 @queue_enqueue(ptr noundef %138, ptr noundef %15)
  store i64 %139, ptr %10, align 8, !tbaa !16
  %140 = load i64, ptr %10, align 8, !tbaa !16
  %141 = icmp ne i64 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %131
  %143 = load i64, ptr %10, align 8, !tbaa !16
  store i64 %143, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %146

144:                                              ; preds = %131
  br label %145

145:                                              ; preds = %144, %124
  store i32 0, ptr %13, align 4
  br label %146

146:                                              ; preds = %145, %142, %121, %96, %54
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %147 = load i32, ptr %13, align 4
  switch i32 %147, label %151 [
    i32 0, label %148
  ]

148:                                              ; preds = %146
  br label %44, !llvm.loop !18

149:                                              ; preds = %44
  %150 = load ptr, ptr %11, align 8, !tbaa !5
  call void @queue_destroy(ptr noundef %150)
  store i64 0, ptr %5, align 8
  store i32 1, ptr %13, align 4
  br label %151

151:                                              ; preds = %149, %146, %41, %23, %18
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %152 = load i64, ptr %5, align 8
  ret i64 %152
}

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

declare ptr @queue_create(i32 noundef, i64 noundef) #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

declare i64 @queue_enqueue(ptr noundef, ptr noundef) #2

declare i32 @queue_empty(ptr noundef) #2

declare i64 @queue_dequeue(ptr noundef, ptr noundef) #2

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

declare void @queue_destroy(ptr noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { noreturn 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 #4 = { nounwind }
attributes #5 = { noreturn 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 0}
!12 = !{!"trie", !6, i64 0, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!13 = !{!14, !6, i64 0}
!14 = !{!"nodedepth", !6, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


; 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"

%struct.nodedepth = type { ptr, i32 }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [97 x i8], align 1
@__PRETTY_FUNCTION__.trie__breadthwalk_internal = external hidden unnamed_addr constant [100 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i64 @trie__breadthwalk_internal(ptr noundef readonly %0, i32 noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct.nodedepth, align 8
  %6 = alloca %struct.nodedepth, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  %7 = icmp eq ptr %0, null
  br i1 %7, label %109, label %8

8:                                                ; preds = %4
  %9 = tail call ptr @queue_create(i32 noundef 100, i64 noundef 16) #4
  %10 = icmp eq ptr %9, null
  br i1 %10, label %109, label %11

11:                                               ; preds = %8
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %13, label %14

13:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 40, ptr noundef nonnull @__PRETTY_FUNCTION__.trie__breadthwalk_internal) #5
  unreachable

14:                                               ; preds = %11
  store ptr %12, ptr %5, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %5, i64 8
  store i32 0, ptr %15, align 8, !tbaa !13
  %16 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %5) #4
  %.not41 = icmp eq i64 %16, 0
  br i1 %.not41, label %.preheader, label %109

.preheader:                                       ; preds = %14
  %17 = call i32 @queue_empty(ptr noundef nonnull %9) #4
  %.not4253 = icmp eq i32 %17, 0
  br i1 %.not4253, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %18 = and i32 %1, 4
  %.not68 = icmp eq i32 %18, 0
  %19 = and i32 %1, 8
  %20 = icmp eq i32 %19, 0
  %21 = getelementptr inbounds i8, ptr %6, i64 8
  br i1 %.not68, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  br i1 %20, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us, %35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %22 = call i64 @queue_dequeue(ptr noundef nonnull %9, ptr noundef nonnull %5) #4
  %.not43.us.us = icmp eq i64 %22, 0
  br i1 %.not43.us.us, label %.thread.us.us, label %.thread50

.thread.us.us:                                    ; preds = %.lr.ph.split.us.split.us
  %23 = load i32, ptr %15, align 8, !tbaa !13
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %21, align 8, !tbaa !13
  %25 = load ptr, ptr %5, align 8, !tbaa !11
  %26 = load ptr, ptr %25, align 8, !tbaa !14
  %.not45.us.us = icmp eq ptr %26, null
  br i1 %.not45.us.us, label %29, label %27

27:                                               ; preds = %.thread.us.us
  store ptr %26, ptr %6, align 8, !tbaa !11
  %28 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not46.us.us = icmp eq i64 %28, 0
  br i1 %.not46.us.us, label %._crit_edge87, label %.thread50

._crit_edge87:                                    ; preds = %27
  %.pre88 = load ptr, ptr %5, align 8, !tbaa !11
  br label %29

29:                                               ; preds = %._crit_edge87, %.thread.us.us
  %30 = phi ptr [ %.pre88, %._crit_edge87 ], [ %25, %.thread.us.us ]
  %31 = getelementptr inbounds i8, ptr %30, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !14
  %.not47.us.us = icmp eq ptr %32, null
  br i1 %.not47.us.us, label %35, label %33

33:                                               ; preds = %29
  store ptr %32, ptr %6, align 8, !tbaa !11
  %34 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not48.us.us = icmp eq i64 %34, 0
  br i1 %.not48.us.us, label %35, label %.thread50

35:                                               ; preds = %33, %29
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %36 = call i32 @queue_empty(ptr noundef nonnull %9) #4
  %.not42.us.us = icmp eq i32 %36, 0
  br i1 %.not42.us.us, label %.lr.ph.split.us.split.us, label %._crit_edge, !llvm.loop !15

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us, %60
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %37 = call i64 @queue_dequeue(ptr noundef nonnull %9, ptr noundef nonnull %5) #4
  %.not43.us = icmp eq i64 %37, 0
  br i1 %.not43.us, label %38, label %.thread50

38:                                               ; preds = %.lr.ph.split.us.split
  %39 = load ptr, ptr %5, align 8, !tbaa !11
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = icmp eq ptr %40, null
  br i1 %41, label %.thread.us, label %.critedge

.thread.us:                                       ; preds = %38
  %42 = getelementptr inbounds i8, ptr %39, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !14
  %44 = icmp eq ptr %43, null
  br i1 %44, label %.thread, label %.critedge

.thread:                                          ; preds = %.thread.us
  %45 = load i32, ptr %15, align 8, !tbaa !13
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr %21, align 8, !tbaa !13
  br label %54

.critedge:                                        ; preds = %38, %.thread.us
  %47 = load i32, ptr %15, align 8, !tbaa !13
  %48 = call i64 %2(ptr noundef nonnull %39, i32 noundef %47, ptr noundef %3) #4
  %.not44.us = icmp eq i64 %48, 0
  br i1 %.not44.us, label %49, label %.thread50

49:                                               ; preds = %.critedge
  %.pre83 = load ptr, ptr %5, align 8, !tbaa !11
  %.pre84 = load ptr, ptr %.pre83, align 8, !tbaa !14
  %50 = load i32, ptr %15, align 8, !tbaa !13
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %21, align 8, !tbaa !13
  %.not45.us = icmp eq ptr %.pre84, null
  br i1 %.not45.us, label %54, label %52

52:                                               ; preds = %49
  store ptr %.pre84, ptr %6, align 8, !tbaa !11
  %53 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not46.us = icmp eq i64 %53, 0
  br i1 %.not46.us, label %._crit_edge85, label %.thread50

._crit_edge85:                                    ; preds = %52
  %.pre86 = load ptr, ptr %5, align 8, !tbaa !11
  br label %54

54:                                               ; preds = %.thread, %._crit_edge85, %49
  %55 = phi ptr [ %.pre86, %._crit_edge85 ], [ %.pre83, %49 ], [ %39, %.thread ]
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load ptr, ptr %56, align 8, !tbaa !14
  %.not47.us = icmp eq ptr %57, null
  br i1 %.not47.us, label %60, label %58

58:                                               ; preds = %54
  store ptr %57, ptr %6, align 8, !tbaa !11
  %59 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not48.us = icmp eq i64 %59, 0
  br i1 %.not48.us, label %60, label %.thread50

60:                                               ; preds = %58, %54
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %61 = call i32 @queue_empty(ptr noundef nonnull %9) #4
  %.not42.us = icmp eq i32 %61, 0
  br i1 %.not42.us, label %.lr.ph.split.us.split, label %._crit_edge, !llvm.loop !15

.lr.ph.split:                                     ; preds = %.lr.ph
  br i1 %20, label %.lr.ph.split.split.us, label %.lr.ph.split.split

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split, %88
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %62 = call i64 @queue_dequeue(ptr noundef nonnull %9, ptr noundef nonnull %5) #4
  %.not43.us54 = icmp eq i64 %62, 0
  br i1 %.not43.us54, label %63, label %.thread50

63:                                               ; preds = %.lr.ph.split.split.us
  %64 = load ptr, ptr %5, align 8, !tbaa !11
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  %66 = icmp eq ptr %65, null
  br i1 %66, label %69, label %.thread.us55.thread91

.thread.us55.thread91:                            ; preds = %63
  %67 = load i32, ptr %15, align 8, !tbaa !13
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %21, align 8, !tbaa !13
  br label %79

69:                                               ; preds = %63
  %70 = getelementptr inbounds i8, ptr %64, i64 8
  %71 = load ptr, ptr %70, align 8, !tbaa !14
  %72 = icmp eq ptr %71, null
  %73 = load i32, ptr %15, align 8, !tbaa !13
  br i1 %72, label %75, label %.thread.us55.thread

.thread.us55.thread:                              ; preds = %69
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %21, align 8, !tbaa !13
  br label %82

75:                                               ; preds = %69
  %76 = call i64 %2(ptr noundef nonnull %64, i32 noundef %73, ptr noundef %3) #4
  %.not44.us57 = icmp eq i64 %76, 0
  br i1 %.not44.us57, label %.thread.us55, label %.thread50

.thread.us55:                                     ; preds = %75
  %.pre79 = load ptr, ptr %5, align 8, !tbaa !11
  %.pre80 = load ptr, ptr %.pre79, align 8, !tbaa !14
  %77 = load i32, ptr %15, align 8, !tbaa !13
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %21, align 8, !tbaa !13
  %.not45.us58 = icmp eq ptr %.pre80, null
  br i1 %.not45.us58, label %82, label %79

79:                                               ; preds = %.thread.us55.thread91, %.thread.us55
  %80 = phi ptr [ %65, %.thread.us55.thread91 ], [ %.pre80, %.thread.us55 ]
  store ptr %80, ptr %6, align 8, !tbaa !11
  %81 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not46.us59 = icmp eq i64 %81, 0
  br i1 %.not46.us59, label %._crit_edge81, label %.thread50

._crit_edge81:                                    ; preds = %79
  %.pre82 = load ptr, ptr %5, align 8, !tbaa !11
  br label %82

82:                                               ; preds = %.thread.us55.thread, %._crit_edge81, %.thread.us55
  %83 = phi ptr [ %.pre82, %._crit_edge81 ], [ %.pre79, %.thread.us55 ], [ %64, %.thread.us55.thread ]
  %84 = getelementptr inbounds i8, ptr %83, i64 8
  %85 = load ptr, ptr %84, align 8, !tbaa !14
  %.not47.us60 = icmp eq ptr %85, null
  br i1 %.not47.us60, label %88, label %86

86:                                               ; preds = %82
  store ptr %85, ptr %6, align 8, !tbaa !11
  %87 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not48.us61 = icmp eq i64 %87, 0
  br i1 %.not48.us61, label %88, label %.thread50

88:                                               ; preds = %86, %82
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %89 = call i32 @queue_empty(ptr noundef nonnull %9) #4
  %.not42.us62 = icmp eq i32 %89, 0
  br i1 %.not42.us62, label %.lr.ph.split.split.us, label %._crit_edge, !llvm.loop !15

.lr.ph.split.split:                               ; preds = %.lr.ph.split, %107
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  %90 = call i64 @queue_dequeue(ptr noundef nonnull %9, ptr noundef nonnull %5) #4
  %.not43 = icmp eq i64 %90, 0
  br i1 %.not43, label %.critedge66, label %.thread50

.critedge66:                                      ; preds = %.lr.ph.split.split
  %91 = load ptr, ptr %5, align 8, !tbaa !11
  %92 = load i32, ptr %15, align 8, !tbaa !13
  %93 = call i64 %2(ptr noundef nonnull %91, i32 noundef %92, ptr noundef %3) #4
  %.not44 = icmp eq i64 %93, 0
  br i1 %.not44, label %94, label %.thread50

94:                                               ; preds = %.critedge66
  %95 = load i32, ptr %15, align 8, !tbaa !13
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %21, align 8, !tbaa !13
  %97 = load ptr, ptr %5, align 8, !tbaa !11
  %98 = load ptr, ptr %97, align 8, !tbaa !14
  %.not45 = icmp eq ptr %98, null
  br i1 %.not45, label %101, label %99

99:                                               ; preds = %94
  store ptr %98, ptr %6, align 8, !tbaa !11
  %100 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not46 = icmp eq i64 %100, 0
  br i1 %.not46, label %._crit_edge78, label %.thread50

._crit_edge78:                                    ; preds = %99
  %.pre = load ptr, ptr %5, align 8, !tbaa !11
  br label %101

101:                                              ; preds = %._crit_edge78, %94
  %102 = phi ptr [ %.pre, %._crit_edge78 ], [ %97, %94 ]
  %103 = getelementptr inbounds i8, ptr %102, i64 8
  %104 = load ptr, ptr %103, align 8, !tbaa !14
  %.not47 = icmp eq ptr %104, null
  br i1 %.not47, label %107, label %105

105:                                              ; preds = %101
  store ptr %104, ptr %6, align 8, !tbaa !11
  %106 = call i64 @queue_enqueue(ptr noundef nonnull %9, ptr noundef nonnull %6) #4
  %.not48 = icmp eq i64 %106, 0
  br i1 %.not48, label %107, label %.thread50

.thread50:                                        ; preds = %.lr.ph.split.split, %.critedge66, %99, %105, %86, %79, %75, %.lr.ph.split.split.us, %58, %52, %.critedge, %.lr.ph.split.us.split, %33, %27, %.lr.ph.split.us.split.us
  %.us-phi = phi i64 [ %34, %33 ], [ %28, %27 ], [ %22, %.lr.ph.split.us.split.us ], [ %59, %58 ], [ %53, %52 ], [ %48, %.critedge ], [ %37, %.lr.ph.split.us.split ], [ %87, %86 ], [ %81, %79 ], [ %76, %75 ], [ %62, %.lr.ph.split.split.us ], [ %106, %105 ], [ %100, %99 ], [ %93, %.critedge66 ], [ %90, %.lr.ph.split.split ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %109

107:                                              ; preds = %101, %105
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %108 = call i32 @queue_empty(ptr noundef nonnull %9) #4
  %.not42 = icmp eq i32 %108, 0
  br i1 %.not42, label %.lr.ph.split.split, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %107, %88, %60, %35, %.preheader
  call void @queue_destroy(ptr noundef nonnull %9) #4
  br label %109

109:                                              ; preds = %.thread50, %14, %8, %4, %._crit_edge
  %.2 = phi i64 [ 0, %._crit_edge ], [ 0, %4 ], [ 1, %8 ], [ %16, %14 ], [ %.us-phi, %.thread50 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  ret i64 %.2
}

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

declare ptr @queue_create(i32 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare i64 @queue_enqueue(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @queue_empty(ptr noundef) local_unnamed_addr #2

declare i64 @queue_dequeue(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare void @queue_destroy(ptr noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { noreturn 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 #4 = { nounwind }
attributes #5 = { noreturn 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, !7, i64 0}
!6 = !{!"trie", !7, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"nodedepth", !7, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass