; LLVM IR from tangjz/acm-icpc :: lydsy/1467.ll (Z4bsgsiii)

; 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.Node = type { i32, i32, i32 }

@e = external dso_local global [32000 x %struct.Node], align 16
@tot = external dso_local global i32, align 4
@pre = external dso_local global [960991 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3invii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3powiii(i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z4bsgsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca %struct.Node, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @e, i8 0, i64 384000, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @pre, i8 0, i64 3843964, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = sitofp i32 %19 to double
  %21 = call double @sqrt(double noundef %20) #6
  %22 = fptosi double %21 to i32
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %89, %3
  %25 = load i32, ptr %9, align 4, !tbaa !5
  %26 = load i32, ptr %8, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %92

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  store i8 0, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %30 = load i32, ptr %10, align 4, !tbaa !5
  %31 = srem i32 %30, 960991
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr %13, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %49, %29
  %36 = load i32, ptr %13, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  store i32 5, ptr %11, align 4
  br label %55

39:                                               ; preds = %35
  %40 = load i32, ptr %13, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %41
  %43 = getelementptr inbounds %struct.Node, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = load i32, ptr %10, align 4, !tbaa !5
  %46 = icmp eq i32 %44, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %39
  store i8 1, ptr %12, align 1, !tbaa !9
  store i32 5, ptr %11, align 4
  br label %55

48:                                               ; preds = %39
  br label %49

49:                                               ; preds = %48
  %50 = load i32, ptr %13, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %51
  %53 = getelementptr inbounds %struct.Node, ptr %52, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !13
  store i32 %54, ptr %13, align 4, !tbaa !5
  br label %35, !llvm.loop !14

55:                                               ; preds = %47, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %56

56:                                               ; preds = %55
  %57 = load i8, ptr %12, align 1, !tbaa !9, !range !16, !noundef !17
  %58 = trunc i8 %57 to i1
  br i1 %58, label %79, label %59

59:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #6
  %60 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 0
  %61 = load i32, ptr %10, align 4, !tbaa !5
  %62 = srem i32 %61, 960991
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  store i32 %65, ptr %60, align 4, !tbaa !13
  %66 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 1
  %67 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %67, ptr %66, align 4, !tbaa !11
  %68 = getelementptr inbounds %struct.Node, ptr %14, i32 0, i32 2
  %69 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %69, ptr %68, align 4, !tbaa !18
  %70 = load i32, ptr @tot, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr @tot, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %72
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %73, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !19
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #6
  %74 = load i32, ptr @tot, align 4, !tbaa !5
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = srem i32 %75, 960991
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %77
  store i32 %74, ptr %78, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %59, %56
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = load i32, ptr %5, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = mul nsw i64 %81, %83
  %85 = load i32, ptr %7, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = srem i64 %84, %86
  %88 = trunc i64 %87 to i32
  store i32 %88, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  br label %89

89:                                               ; preds = %79
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %9, align 4, !tbaa !5
  br label %24, !llvm.loop !20

92:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %93 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %93, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %94 = load i32, ptr %5, align 4, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = call noundef i32 @_Z3powiii(i32 noundef %94, i32 noundef %95, i32 noundef %96)
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = call noundef i32 @_Z3invii(i32 noundef %97, i32 noundef %98)
  store i32 %99, ptr %17, align 4, !tbaa !5
  br label %100

100:                                              ; preds = %152, %92
  %101 = load i32, ptr %15, align 4, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 8, ptr %11, align 4
  br label %155

105:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %106 = load i32, ptr %16, align 4, !tbaa !5
  %107 = srem i32 %106, 960991
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  store i32 %110, ptr %18, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %134, %105
  %112 = load i32, ptr %18, align 4, !tbaa !5
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %115, label %114

114:                                              ; preds = %111
  store i32 11, ptr %11, align 4
  br label %140

115:                                              ; preds = %111
  %116 = load i32, ptr %18, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %117
  %119 = getelementptr inbounds %struct.Node, ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !11
  %121 = load i32, ptr %16, align 4, !tbaa !5
  %122 = icmp eq i32 %120, %121
  br i1 %122, label %123, label %133

123:                                              ; preds = %115
  %124 = load i32, ptr %15, align 4, !tbaa !5
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = mul nsw i32 %124, %125
  %127 = load i32, ptr %18, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %128
  %130 = getelementptr inbounds %struct.Node, ptr %129, i32 0, i32 2
  %131 = load i32, ptr %130, align 4, !tbaa !18
  %132 = add nsw i32 %126, %131
  store i32 %132, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %140

133:                                              ; preds = %115
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %18, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %136
  %138 = getelementptr inbounds %struct.Node, ptr %137, i32 0, i32 0
  %139 = load i32, ptr %138, align 4, !tbaa !13
  store i32 %139, ptr %18, align 4, !tbaa !5
  br label %111, !llvm.loop !21

140:                                              ; preds = %123, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %141 = load i32, ptr %11, align 4
  switch i32 %141, label %155 [
    i32 11, label %142
  ]

142:                                              ; preds = %140
  %143 = load i32, ptr %16, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = load i32, ptr %17, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = mul nsw i64 %144, %146
  %148 = load i32, ptr %7, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = srem i64 %147, %149
  %151 = trunc i64 %150 to i32
  store i32 %151, ptr %16, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %142
  %153 = load i32, ptr %15, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %15, align 4, !tbaa !5
  br label %100, !llvm.loop !22

155:                                              ; preds = %140, %104
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %156 = load i32, ptr %11, align 4
  switch i32 %156, label %158 [
    i32 8, label %157
  ]

157:                                              ; preds = %155
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %11, align 4
  br label %158

158:                                              ; preds = %157, %155
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %159 = load i32, ptr %4, align 4
  ret i32 %159
}

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

attributes #0 = { mustprogress 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 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!12, !6, i64 8}
!19 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}


; 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.Node = type { i32, i32, i32 }

@e = external dso_local local_unnamed_addr global [32000 x %struct.Node], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global [960991 x i32], align 16

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3invii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3powiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z4bsgsiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  store i32 0, ptr @tot, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(384000) @e, i8 0, i64 384000, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3843964) @pre, i8 0, i64 3843964, i1 false)
  %4 = sitofp i32 %2 to double
  %5 = tail call double @sqrt(double noundef %4) #4
  %6 = fptosi double %5 to i32
  %7 = add i32 %6, 1
  %.not57 = icmp slt i32 %6, 0
  br i1 %.not57, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %8 = sext i32 %0 to i64
  %9 = sext i32 %2 to i64
  br label %14

._crit_edge:                                      ; preds = %.loopexit55, %3
  %10 = tail call noundef i32 @_Z3powiii(i32 noundef %0, i32 noundef %7, i32 noundef %2)
  %11 = tail call noundef i32 @_Z3invii(i32 noundef %10, i32 noundef %2)
  br i1 %.not57, label %.loopexit, label %.lr.ph64

.lr.ph64:                                         ; preds = %._crit_edge
  %12 = sext i32 %11 to i64
  %13 = sext i32 %2 to i64
  br label %36

14:                                               ; preds = %.lr.ph, %.loopexit55
  %.04359 = phi i32 [ 0, %.lr.ph ], [ %35, %.loopexit55 ]
  %.04458 = phi i32 [ 1, %.lr.ph ], [ %34, %.loopexit55 ]
  %15 = phi i32 [ %tot.promoted, %.lr.ph ], [ %30, %.loopexit55 ]
  %16 = srem i32 %.04458, 960991
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %17
  br label %19

19:                                               ; preds = %20, %14
  %.047.in = phi ptr [ %18, %14 ], [ %22, %20 ]
  %.047 = load i32, ptr %.047.in, align 4, !tbaa !5
  %.not52.not = icmp eq i32 %.047, 0
  br i1 %.not52.not, label %.critedge, label %20

20:                                               ; preds = %19
  %21 = sext i32 %.047 to i64
  %22 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %21
  %23 = getelementptr inbounds i8, ptr %22, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !9
  %25 = icmp eq i32 %24, %.04458
  br i1 %25, label %.loopexit55, label %19, !llvm.loop !11

.critedge:                                        ; preds = %19
  %26 = load i32, ptr %18, align 4, !tbaa !5
  %27 = add nsw i32 %15, 1
  store i32 %27, ptr @tot, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 4
  store i32 %.04458, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %29, i64 8
  store i32 %.04359, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  store i32 %27, ptr %18, align 4, !tbaa !5
  br label %.loopexit55

.loopexit55:                                      ; preds = %20, %.critedge
  %30 = phi i32 [ %27, %.critedge ], [ %15, %20 ]
  %31 = sext i32 %.04458 to i64
  %32 = mul nsw i64 %31, %8
  %33 = srem i64 %32, %9
  %34 = trunc nsw i64 %33 to i32
  %35 = add nuw i32 %.04359, 1
  %exitcond.not = icmp eq i32 %.04359, %6
  br i1 %exitcond.not, label %._crit_edge, label %14, !llvm.loop !13

36:                                               ; preds = %.lr.ph64, %52
  %.04162 = phi i32 [ %1, %.lr.ph64 ], [ %56, %52 ]
  %.04261 = phi i32 [ 0, %.lr.ph64 ], [ %57, %52 ]
  %37 = srem i32 %.04162, 960991
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [960991 x i32], ptr @pre, i64 0, i64 %38
  br label %40

40:                                               ; preds = %41, %36
  %.0.in = phi ptr [ %39, %36 ], [ %43, %41 ]
  %.0 = load i32, ptr %.0.in, align 4, !tbaa !5
  %.not51 = icmp eq i32 %.0, 0
  br i1 %.not51, label %52, label %41

41:                                               ; preds = %40
  %42 = sext i32 %.0 to i64
  %43 = getelementptr inbounds [32000 x %struct.Node], ptr @e, i64 0, i64 %42
  %44 = getelementptr inbounds i8, ptr %43, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = icmp eq i32 %45, %.04162
  br i1 %46, label %47, label %40, !llvm.loop !14

47:                                               ; preds = %41
  %48 = mul nuw nsw i32 %.04261, %7
  %49 = getelementptr inbounds i8, ptr %43, i64 8
  %50 = load i32, ptr %49, align 4, !tbaa !15
  %51 = add nsw i32 %50, %48
  br label %.loopexit

52:                                               ; preds = %40
  %53 = sext i32 %.04162 to i64
  %54 = mul nsw i64 %53, %12
  %55 = srem i64 %54, %13
  %56 = trunc nsw i64 %55 to i32
  %57 = add nuw i32 %.04261, 1
  %exitcond66.not = icmp eq i32 %.04261, %6
  br i1 %exitcond66.not, label %.loopexit, label %36, !llvm.loop !16

.loopexit:                                        ; preds = %52, %._crit_edge, %47
  %spec.select = phi i32 [ %51, %47 ], [ -1, %._crit_edge ], [ -1, %52 ]
  ret i32 %spec.select
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

attributes #0 = { mustprogress 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 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!10, !6, i64 8}
!16 = distinct !{!16, !12}


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