; LLVM IR from ShahjalalShohag/code-library :: Data Structures/Cartesian Tree.ll (Z14cartesian_treev)

; 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.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@st = external dso_local global [100009 x i32], align 16
@l = external dso_local global [100009 x i32], align 16
@r = external dso_local global [100009 x i32], align 16
@vis = external dso_local global [100009 x i32], align 16
@a = external dso_local global [100009 x %"struct.std::pair"], align 16

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z14cartesian_treev() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %22, %0
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp sle i32 %8, %9
  br i1 %10, label %12, label %11

11:                                               ; preds = %7
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %25

12:                                               ; preds = %7
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %14
  store i32 0, ptr %15, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [100009 x i32], ptr @r, i64 0, i64 %17
  store i32 0, ptr %18, align 4, !tbaa !5
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100009 x i32], ptr @l, i64 0, i64 %20
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %12
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %1, align 4, !tbaa !5
  br label %7, !llvm.loop !9

25:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %84, %25
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp sle i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %87

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %32 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %32, ptr %3, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %50, %31
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %48

36:                                               ; preds = %33
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 1
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @a, i64 0, i64 %42
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @a, i64 0, i64 %45
  %47 = call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %43, ptr noundef nonnull align 4 dereferenceable(8) %46)
  br label %48

48:                                               ; preds = %36, %33
  %49 = phi i1 [ false, %33 ], [ %47, %36 ]
  br i1 %49, label %50, label %53

50:                                               ; preds = %48
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr %3, align 4, !tbaa !5
  br label %33, !llvm.loop !11

53:                                               ; preds = %48
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %65

56:                                               ; preds = %53
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = load i32, ptr %3, align 4, !tbaa !5
  %59 = sub nsw i32 %58, 1
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100009 x i32], ptr @r, i64 0, i64 %63
  store i32 %57, ptr %64, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %56, %53
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = load i32, ptr @tot, align 4, !tbaa !5
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %69, label %77

69:                                               ; preds = %65
  %70 = load i32, ptr %3, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = load i32, ptr %2, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100009 x i32], ptr @l, i64 0, i64 %75
  store i32 %73, ptr %76, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %69, %65
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = load i32, ptr %3, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %79 to i64
  %82 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %81
  store i32 %78, ptr %82, align 4, !tbaa !5
  %83 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %83, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %84

84:                                               ; preds = %77
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %2, align 4, !tbaa !5
  br label %26, !llvm.loop !12

87:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %106, %87
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = load i32, ptr @n, align 4, !tbaa !5
  %91 = icmp sle i32 %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %109

93:                                               ; preds = %88
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100009 x i32], ptr @r, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %98
  store i32 1, ptr %99, align 4, !tbaa !5
  %100 = load i32, ptr %4, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100009 x i32], ptr @l, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %104
  store i32 1, ptr %105, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %93
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %4, align 4, !tbaa !5
  br label %88, !llvm.loop !13

109:                                              ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %124, %109
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = load i32, ptr @n, align 4, !tbaa !5
  %113 = icmp sle i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %127

115:                                              ; preds = %110
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %123

121:                                              ; preds = %115
  %122 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %122, ptr %5, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %121, %115
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %6, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %6, align 4, !tbaa !5
  br label %110, !llvm.loop !14

127:                                              ; preds = %114
  %128 = load i32, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret i32 %128
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


; 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.std::pair" = type { i32, i32 }

@n = external dso_local local_unnamed_addr global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@st = external dso_local local_unnamed_addr global [100009 x i32], align 16
@l = external dso_local local_unnamed_addr global [100009 x i32], align 16
@r = external dso_local local_unnamed_addr global [100009 x i32], align 16
@vis = external dso_local local_unnamed_addr global [100009 x i32], align 16
@a = external dso_local global [100009 x %"struct.std::pair"], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z14cartesian_treev() local_unnamed_addr #0 {
  store i32 0, ptr @tot, align 4, !tbaa !5
  %1 = load i32, ptr @n, align 4, !tbaa !5
  %.not44 = icmp slt i32 %1, 1
  br i1 %.not44, label %._crit_edge, label %.lr.ph48.preheader

.lr.ph48.preheader:                               ; preds = %0
  %2 = zext nneg i32 %1 to i64
  %3 = shl nuw nsw i64 %2, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @vis, i64 4), i8 0, i64 %3, i1 false), !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @r, i64 4), i8 0, i64 %3, i1 false), !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @l, i64 4), i8 0, i64 %3, i1 false), !tbaa !5
  br label %.lr.ph48

.preheader39:                                     ; preds = %._crit_edge74
  %.not3549 = icmp slt i32 %37, 1
  br i1 %.not3549, label %._crit_edge, label %.lr.ph51.preheader

.lr.ph51.preheader:                               ; preds = %.preheader39
  %4 = zext nneg i32 %37 to i64
  %xtraiter = and i64 %4, 1
  %5 = icmp eq i32 %37, 1
  br i1 %5, label %.preheader.unr-lcssa, label %.lr.ph51.preheader.new

.lr.ph51.preheader.new:                           ; preds = %.lr.ph51.preheader
  %unroll_iter = and i64 %4, 2147483646
  br label %.lr.ph51

.lr.ph48:                                         ; preds = %.lr.ph48.preheader, %._crit_edge74
  %6 = phi i32 [ 0, %.lr.ph48.preheader ], [ %34, %._crit_edge74 ]
  %indvars.iv63 = phi i64 [ 1, %.lr.ph48.preheader ], [ %indvars.iv.next64, %._crit_edge74 ]
  %7 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @a, i64 0, i64 %indvars.iv63
  %8 = zext i32 %6 to i64
  br label %9

9:                                                ; preds = %12, %.lr.ph48
  %indvars.iv = phi i64 [ %13, %12 ], [ %8, %.lr.ph48 ]
  %10 = trunc nuw i64 %indvars.iv to i32
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %12, label %.critedge

12:                                               ; preds = %9
  %13 = add nsw i64 %indvars.iv, -1
  %14 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %13
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [100009 x %"struct.std::pair"], ptr @a, i64 0, i64 %16
  %18 = tail call noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8) %17, ptr noundef nonnull align 4 dereferenceable(8) %7)
  br i1 %18, label %9, label %.critedge.thread, !llvm.loop !9

.critedge:                                        ; preds = %9
  %.not37 = icmp eq i64 %indvars.iv, 0
  br i1 %.not37, label %26, label %.critedge.thread

.critedge.thread:                                 ; preds = %12, %.critedge
  %19 = shl i64 %indvars.iv, 32
  %sext = add i64 %19, -4294967296
  %20 = ashr exact i64 %sext, 32
  %21 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100009 x i32], ptr @r, i64 0, i64 %23
  %25 = trunc nuw nsw i64 %indvars.iv63 to i32
  store i32 %25, ptr %24, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %.critedge.thread, %.critedge
  %27 = load i32, ptr @tot, align 4, !tbaa !5
  %28 = icmp sgt i32 %27, %10
  %sext86 = shl i64 %indvars.iv, 32
  %29 = ashr exact i64 %sext86, 32
  br i1 %28, label %30, label %._crit_edge74

30:                                               ; preds = %26
  %31 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %29
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = getelementptr inbounds [100009 x i32], ptr @l, i64 0, i64 %indvars.iv63
  store i32 %32, ptr %33, align 4, !tbaa !5
  br label %._crit_edge74

._crit_edge74:                                    ; preds = %26, %30
  %34 = add nsw i32 %10, 1
  %35 = getelementptr inbounds [100009 x i32], ptr @st, i64 0, i64 %29
  %36 = trunc nuw nsw i64 %indvars.iv63 to i32
  store i32 %36, ptr %35, align 4, !tbaa !5
  store i32 %34, ptr @tot, align 4, !tbaa !5
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %.not34.not = icmp slt i64 %indvars.iv63, %38
  br i1 %.not34.not, label %.lr.ph48, label %.preheader39, !llvm.loop !11

.preheader.unr-lcssa:                             ; preds = %.lr.ph51, %.lr.ph51.preheader
  %indvars.iv66.unr = phi i64 [ 1, %.lr.ph51.preheader ], [ %indvars.iv.next67.1, %.lr.ph51 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph51.epil

.lr.ph51.epil:                                    ; preds = %.preheader.unr-lcssa
  %39 = getelementptr inbounds [100009 x i32], ptr @r, i64 0, i64 %indvars.iv66.unr
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %41
  store i32 1, ptr %42, align 4, !tbaa !5
  %43 = getelementptr inbounds [100009 x i32], ptr @l, i64 0, i64 %indvars.iv66.unr
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %45
  store i32 1, ptr %46, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.unr-lcssa, %.lr.ph51.epil
  br i1 %.not3549, label %._crit_edge, label %.lr.ph55.preheader

.lr.ph55.preheader:                               ; preds = %.preheader
  %xtraiter97 = and i64 %4, 3
  %47 = icmp ult i32 %37, 4
  br i1 %47, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph55.preheader.new

.lr.ph55.preheader.new:                           ; preds = %.lr.ph55.preheader
  %unroll_iter100 = and i64 %4, 2147483644
  br label %.lr.ph55

.lr.ph51:                                         ; preds = %.lr.ph51, %.lr.ph51.preheader.new
  %indvars.iv66 = phi i64 [ 1, %.lr.ph51.preheader.new ], [ %indvars.iv.next67.1, %.lr.ph51 ]
  %niter = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %niter.next.1, %.lr.ph51 ]
  %48 = getelementptr inbounds [100009 x i32], ptr @r, i64 0, i64 %indvars.iv66
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %50
  store i32 1, ptr %51, align 4, !tbaa !5
  %52 = getelementptr inbounds [100009 x i32], ptr @l, i64 0, i64 %indvars.iv66
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %54
  store i32 1, ptr %55, align 4, !tbaa !5
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %56 = getelementptr inbounds [100009 x i32], ptr @r, i64 0, i64 %indvars.iv.next67
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %58
  store i32 1, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds [100009 x i32], ptr @l, i64 0, i64 %indvars.iv.next67
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %62
  store i32 1, ptr %63, align 4, !tbaa !5
  %indvars.iv.next67.1 = add nuw nsw i64 %indvars.iv66, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph51, !llvm.loop !12

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph55, %.lr.ph55.preheader
  %spec.select.lcssa.ph = phi i32 [ poison, %.lr.ph55.preheader ], [ %spec.select.3, %.lr.ph55 ]
  %indvars.iv69.unr = phi i64 [ 1, %.lr.ph55.preheader ], [ %indvars.iv.next70.3, %.lr.ph55 ]
  %.02953.unr = phi i32 [ 0, %.lr.ph55.preheader ], [ %spec.select.3, %.lr.ph55 ]
  %lcmp.mod98.not = icmp eq i64 %xtraiter97, 0
  br i1 %lcmp.mod98.not, label %._crit_edge, label %.lr.ph55.epil

.lr.ph55.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph55.epil
  %indvars.iv69.epil = phi i64 [ %indvars.iv.next70.epil, %.lr.ph55.epil ], [ %indvars.iv69.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.02953.epil = phi i32 [ %spec.select.epil, %.lr.ph55.epil ], [ %.02953.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph55.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %64 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %indvars.iv69.epil
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp eq i32 %65, 0
  %67 = trunc nuw nsw i64 %indvars.iv69.epil to i32
  %spec.select.epil = select i1 %66, i32 %67, i32 %.02953.epil
  %indvars.iv.next70.epil = add nuw nsw i64 %indvars.iv69.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter97
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph55.epil, !llvm.loop !13

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph55.epil, %.preheader39, %0, %.preheader
  %.029.lcssa = phi i32 [ 0, %.preheader ], [ 0, %0 ], [ 0, %.preheader39 ], [ %spec.select.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %spec.select.epil, %.lr.ph55.epil ]
  ret i32 %.029.lcssa

.lr.ph55:                                         ; preds = %.lr.ph55, %.lr.ph55.preheader.new
  %indvars.iv69 = phi i64 [ 1, %.lr.ph55.preheader.new ], [ %indvars.iv.next70.3, %.lr.ph55 ]
  %.02953 = phi i32 [ 0, %.lr.ph55.preheader.new ], [ %spec.select.3, %.lr.ph55 ]
  %niter101 = phi i64 [ 0, %.lr.ph55.preheader.new ], [ %niter101.next.3, %.lr.ph55 ]
  %68 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %indvars.iv69
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp eq i32 %69, 0
  %71 = trunc nuw nsw i64 %indvars.iv69 to i32
  %spec.select = select i1 %70, i32 %71, i32 %.02953
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %72 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %indvars.iv.next70
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp eq i32 %73, 0
  %75 = trunc nuw nsw i64 %indvars.iv.next70 to i32
  %spec.select.1 = select i1 %74, i32 %75, i32 %spec.select
  %indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 2
  %76 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %indvars.iv.next70.1
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 0
  %79 = trunc nuw nsw i64 %indvars.iv.next70.1 to i32
  %spec.select.2 = select i1 %78, i32 %79, i32 %spec.select.1
  %indvars.iv.next70.2 = add nuw nsw i64 %indvars.iv69, 3
  %80 = getelementptr inbounds [100009 x i32], ptr @vis, i64 0, i64 %indvars.iv.next70.2
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = icmp eq i32 %81, 0
  %83 = trunc nuw nsw i64 %indvars.iv.next70.2 to i32
  %spec.select.3 = select i1 %82, i32 %83, i32 %spec.select.2
  %indvars.iv.next70.3 = add nuw nsw i64 %indvars.iv69, 4
  %niter101.next.3 = add i64 %niter101, 4
  %niter101.ncmp.3 = icmp eq i64 %niter101.next.3, %unroll_iter100
  br i1 %niter101.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph55, !llvm.loop !15
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStltIiiEbRKSt4pairIT_T0_ES5_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

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

attributes #0 = { 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 #1 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}


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