; LLVM IR from Leet-Us-Code/DSA-A-Z-Practice :: Sid's Levels/Level - 2/Arrays/SubArrayWith0Sum.ll (Z14subArrayExistsPii)

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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

; 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 zeroext i1 @_Z14subArrayExistsPii(ptr noundef %0, i32 noundef %1) #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [100000 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::map", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 400000, ptr %6) #3
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds i32, ptr %16, i64 0
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = getelementptr inbounds [100000 x i32], ptr %6, i64 0, i64 0
  store i32 %18, ptr %19, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %40, %2
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = load i32, ptr %5, align 4, !tbaa !9
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

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

25:                                               ; preds = %20
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr %26, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !9
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = sub nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100000 x i32], ptr %6, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = add nsw i32 %30, %35
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100000 x i32], ptr %6, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %25
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %7, align 4, !tbaa !9
  br label %20, !llvm.loop !11

43:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  store i8 0, ptr %8, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %59, %43
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 5, ptr %10, align 4
  br label %62

49:                                               ; preds = %44
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100000 x i32], ptr %6, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %58

55:                                               ; preds = %49
  store i8 1, ptr %8, align 1, !tbaa !13
  %56 = load i8, ptr %8, align 1, !tbaa !13, !range !15, !noundef !16
  %57 = trunc i8 %56 to i1
  store i1 %57, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %62

58:                                               ; preds = %49
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %9, align 4, !tbaa !9
  br label %44, !llvm.loop !17

62:                                               ; preds = %55, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  %63 = load i32, ptr %10, align 4
  switch i32 %63, label %113 [
    i32 5, label %64
  ]

64:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #3
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %78, %64
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %85

70:                                               ; preds = %65
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100000 x i32], ptr %6, i64 0, i64 %72
  %74 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 4 dereferenceable(4) %73)
          to label %75 unwind label %81

75:                                               ; preds = %70
  %76 = load i32, ptr %74, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %74, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %75
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %12, align 4, !tbaa !9
  br label %65, !llvm.loop !18

81:                                               ; preds = %70
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %13, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %112

85:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %105, %85
  %87 = load i32, ptr %15, align 4, !tbaa !9
  %88 = load i32, ptr %5, align 4, !tbaa !9
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  store i32 11, ptr %10, align 4
  br label %108

91:                                               ; preds = %86
  %92 = load i32, ptr %15, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100000 x i32], ptr %6, i64 0, i64 %93
  %95 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 4 dereferenceable(4) %94)
          to label %96 unwind label %100

96:                                               ; preds = %91
  %97 = load i32, ptr %95, align 4, !tbaa !9
  %98 = icmp sgt i32 %97, 1
  br i1 %98, label %99, label %104

99:                                               ; preds = %96
  store i1 true, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %108

100:                                              ; preds = %91
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %13, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  br label %112

104:                                              ; preds = %96
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %15, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %15, align 4, !tbaa !9
  br label %86, !llvm.loop !19

108:                                              ; preds = %99, %90
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  %109 = load i32, ptr %10, align 4
  switch i32 %109, label %111 [
    i32 11, label %110
  ]

110:                                              ; preds = %108
  store i1 false, ptr %3, align 1
  store i32 1, ptr %10, align 4
  br label %111

111:                                              ; preds = %110, %108
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #3
  br label %113

112:                                              ; preds = %100, %81
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 400000, ptr %6) #3
  br label %115

113:                                              ; preds = %111, %62
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 400000, ptr %6) #3
  %114 = load i1, ptr %3, align 1
  ret i1 %114

115:                                              ; preds = %112
  %116 = load ptr, ptr %13, align 8
  %117 = load i32, ptr %14, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

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

; Function Attrs: mustprogress 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 zeroext i1 @_Z14subArrayExistsPii(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca [100000 x i32], align 16
  %4 = alloca %"class.std::map", align 8
  call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %3) #3
  %5 = load i32, ptr %0, align 4, !tbaa !5
  store i32 %5, ptr %3, align 16, !tbaa !5
  %6 = icmp sgt i32 %1, 1
  br i1 %6, label %.lr.ph.preheader, label %.preheader39

.lr.ph.preheader:                                 ; preds = %2
  %wide.trip.count = zext nneg i32 %1 to i64
  %7 = add nsw i64 %wide.trip.count, -1
  %8 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %7, 3
  %9 = icmp ult i64 %8, 3
  br i1 %9, label %.preheader39.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %7, -4
  br label %.lr.ph

.preheader39.loopexit.unr-lcssa:                  ; preds = %.lr.ph, %.lr.ph.preheader
  %.unr = phi i32 [ %5, %.lr.ph.preheader ], [ %30, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader39, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader39.loopexit.unr-lcssa, %.lr.ph.epil
  %10 = phi i32 [ %13, %.lr.ph.epil ], [ %.unr, %.preheader39.loopexit.unr-lcssa ]
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader39.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader39.loopexit.unr-lcssa ]
  %11 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.epil
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = add nsw i32 %10, %12
  %14 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.epil
  store i32 %13, ptr %14, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader39, label %.lr.ph.epil, !llvm.loop !9

.preheader39:                                     ; preds = %.preheader39.loopexit.unr-lcssa, %.lr.ph.epil, %2
  %.not42 = icmp sgt i32 %1, 0
  br i1 %.not42, label %.lr.ph44.preheader, label %.critedge.thread

.critedge.thread:                                 ; preds = %.preheader39
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #3
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  br label %.critedge38

.lr.ph44.preheader:                               ; preds = %.preheader39
  %wide.trip.count57 = zext nneg i32 %1 to i64
  br label %.lr.ph44

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %15 = phi i32 [ %5, %.lr.ph.preheader.new ], [ %30, %.lr.ph ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %16 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = add nsw i32 %15, %17
  %19 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv
  store i32 %18, ptr %19, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = add nsw i32 %18, %21
  %23 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.next
  store i32 %22, ptr %23, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %24 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.1
  %25 = load i32, ptr %24, align 4, !tbaa !5
  %26 = add nsw i32 %22, %25
  %27 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.next.1
  store i32 %26, ptr %27, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %28 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next.2
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %26, %29
  %31 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv.next.2
  store i32 %30, ptr %31, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader39.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

32:                                               ; preds = %.lr.ph44
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count57
  br i1 %exitcond58.not, label %.critedge, label %.lr.ph44, !llvm.loop !13

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %32
  %indvars.iv54 = phi i64 [ 0, %.lr.ph44.preheader ], [ %indvars.iv.next55, %32 ]
  %33 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv54
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %.loopexit, label %32

.critedge:                                        ; preds = %32
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #3
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  br i1 %.not42, label %.lr.ph46.preheader, label %.critedge38

.lr.ph46.preheader:                               ; preds = %.critedge
  %wide.trip.count62 = zext nneg i32 %1 to i64
  br label %.lr.ph46

.preheader:                                       ; preds = %39
  br i1 %.not42, label %.lr.ph50.preheader, label %.critedge38

.lr.ph50.preheader:                               ; preds = %.preheader
  %36 = zext nneg i32 %1 to i64
  %wide.trip.count66 = zext nneg i32 %1 to i64
  br label %.lr.ph50

.lr.ph46:                                         ; preds = %.lr.ph46.preheader, %39
  %indvars.iv59 = phi i64 [ 0, %.lr.ph46.preheader ], [ %indvars.iv.next60, %39 ]
  %37 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv59
  %38 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %37)
          to label %39 unwind label %42

39:                                               ; preds = %.lr.ph46
  %40 = load i32, ptr %38, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %38, align 4, !tbaa !5
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %exitcond63.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count62
  br i1 %exitcond63.not, label %.preheader, label %.lr.ph46, !llvm.loop !14

42:                                               ; preds = %.lr.ph46
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %52

44:                                               ; preds = %47
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %.not35 = icmp ult i64 %indvars.iv.next65, %36
  %exitcond67.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count66
  br i1 %exitcond67.not, label %.critedge38, label %.lr.ph50, !llvm.loop !15

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %44
  %indvars.iv64 = phi i64 [ 0, %.lr.ph50.preheader ], [ %indvars.iv.next65, %44 ]
  %.not3549 = phi i1 [ true, %.lr.ph50.preheader ], [ %.not35, %44 ]
  %45 = getelementptr inbounds [100000 x i32], ptr %3, i64 0, i64 %indvars.iv64
  %46 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %4, ptr noundef nonnull align 4 dereferenceable(4) %45)
          to label %47 unwind label %50

47:                                               ; preds = %.lr.ph50
  %48 = load i32, ptr %46, align 4, !tbaa !5
  %49 = icmp sgt i32 %48, 1
  br i1 %49, label %.critedge38, label %44

50:                                               ; preds = %.lr.ph50
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %52

.critedge38:                                      ; preds = %47, %44, %.critedge, %.critedge.thread, %.preheader
  %.not35.lcssa = phi i1 [ false, %.preheader ], [ false, %.critedge.thread ], [ false, %.critedge ], [ %.not35, %44 ], [ %.not3549, %47 ]
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #3
  br label %.loopexit

52:                                               ; preds = %50, %42
  %.pn = phi { ptr, i32 } [ %43, %42 ], [ %51, %50 ]
  call void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %3) #3
  resume { ptr, i32 } %.pn

.loopexit:                                        ; preds = %.lr.ph44, %.critedge38
  %.3 = phi i1 [ %.not35.lcssa, %.critedge38 ], [ true, %.lr.ph44 ]
  call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %3) #3
  ret i1 %.3
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIiiSt4lessIiESaISt4pairIKiiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

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


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass