; LLVM IR from xirc/cp-algorithm :: atcoder/abc169/D/main.ll (Z5solvel)

; 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<long, std::pair<const long, int>, std::_Select1st<std::pair<const long, int>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, int>, std::_Select1st<std::pair<const long, int>>, std::less<long>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvel = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z19prime_factorizationl(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8, i64 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 void @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solvel(i64 noundef %0) #0 {
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::map", align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %3) #5
  %16 = load i64, ptr %2, align 8, !tbaa !5
  call void @_Z19prime_factorizationl(ptr dead_on_unwind writable sret(%"class.std::map") align 8 %3, i64 noundef %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %17 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %17, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr %3, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !11
  %19 = call ptr @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %18) #5
  %20 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %7, i32 0, i32 0
  store ptr %19, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !11
  %22 = call ptr @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #5
  %23 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %8, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  br label %24

24:                                               ; preds = %78, %1
  %25 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKliEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %80

27:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %28 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKliEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %28, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %29 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 0
  %30 = load i64, ptr %29, align 8, !tbaa !13
  store i64 %30, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %31 = getelementptr inbounds %"struct.std::pair", ptr %10, i32 0, i32 1
  %32 = load i32, ptr %31, align 8, !tbaa !15
  %33 = sext i32 %32 to i64
  store i64 %33, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %60, %27
  %35 = load i32, ptr %13, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = load i64, ptr %12, align 8, !tbaa !5
  %38 = icmp sle i64 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %34
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %63

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

41:                                               ; preds = %50, %40
  %42 = load i32, ptr %14, align 4, !tbaa !9
  %43 = load i32, ptr %13, align 4, !tbaa !9
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %53

46:                                               ; preds = %41
  %47 = load i64, ptr %11, align 8, !tbaa !5
  %48 = load i64, ptr %4, align 8, !tbaa !5
  %49 = sdiv i64 %48, %47
  store i64 %49, ptr %4, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %46
  %51 = load i32, ptr %14, align 4, !tbaa !9
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %14, align 4, !tbaa !9
  br label %41, !llvm.loop !16

53:                                               ; preds = %45
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = load i64, ptr %12, align 8, !tbaa !5
  %57 = sub nsw i64 %56, %55
  store i64 %57, ptr %12, align 8, !tbaa !5
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %53
  %61 = load i32, ptr %13, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %13, align 4, !tbaa !9
  br label %34, !llvm.loop !18

63:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %74, %63
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = load i64, ptr %12, align 8, !tbaa !5
  %68 = icmp slt i64 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %64
  store i32 10, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %77

70:                                               ; preds = %64
  %71 = load i64, ptr %11, align 8, !tbaa !5
  %72 = load i64, ptr %4, align 8, !tbaa !5
  %73 = sdiv i64 %72, %71
  store i64 %73, ptr %4, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %70
  %75 = load i32, ptr %15, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %15, align 4, !tbaa !9
  br label %64, !llvm.loop !19

77:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %78

78:                                               ; preds = %77
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKliEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  br label %24

80:                                               ; preds = %26
  %81 = load i64, ptr %4, align 8, !tbaa !5
  %82 = icmp eq i64 %81, 1
  br i1 %82, label %83, label %84

83:                                               ; preds = %80
  br label %86

84:                                               ; preds = %80
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 37, ptr noundef @__PRETTY_FUNCTION__._Z5solvel) #6
  unreachable

85:                                               ; No predecessors!
  br label %86

86:                                               ; preds = %85, %83
  %87 = load i32, ptr %5, align 4, !tbaa !9
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %3) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %3) #5
  ret i32 %87
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKliEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; 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) #3

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

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

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: readwrite) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTSSt4pairIKliE", !6, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}


; 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<long, std::pair<const long, int>, std::_Select1st<std::pair<const long, int>>, std::less<long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long, std::pair<const long, int>, std::_Select1st<std::pair<const long, int>>, std::less<long>>::_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 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvel = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z19prime_factorizationl(ptr dead_on_unwind noalias writable sret(%"class.std::map") align 8, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress 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 void @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z5solvel(i64 noundef %0) local_unnamed_addr #0 {
  %2 = alloca %"class.std::map", align 8
  %3 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #4
  call void @_Z19prime_factorizationl(ptr dead_on_unwind nonnull writable sret(%"class.std::map") align 8 %2, i64 noundef %0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %5 = call ptr @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #4
  store ptr %5, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %6 = call ptr @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #4
  store ptr %6, ptr %4, align 8
  %7 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKliEES5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %7, label %.lr.ph44, label %._crit_edge45

._crit_edge45:                                    ; preds = %._crit_edge, %1
  %.025.lcssa = phi i32 [ 0, %1 ], [ %.126.lcssa, %._crit_edge ]
  %.024.lcssa = phi i64 [ %0, %1 ], [ %.3.lcssa, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %8 = icmp eq i64 %.024.lcssa, 1
  br i1 %8, label %30, label %29

.lr.ph44:                                         ; preds = %1, %._crit_edge
  %.02442 = phi i64 [ %.3.lcssa, %._crit_edge ], [ %0, %1 ]
  %.02541 = phi i32 [ %.126.lcssa, %._crit_edge ], [ 0, %1 ]
  %9 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKliEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %.sroa.0.0.copyload = load i64, ptr %9, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 8
  %10 = sext i32 %.sroa.4.0.copyload to i64
  %.not31 = icmp slt i32 %.sroa.4.0.copyload, 1
  br i1 %.not31, label %.preheader28, label %.preheader

.preheader28:                                     ; preds = %.epilog-lcssa, %.lr.ph44
  %.126.lcssa = phi i32 [ %.02541, %.lr.ph44 ], [ %16, %.epilog-lcssa ]
  %.1.lcssa = phi i64 [ %.02442, %.lr.ph44 ], [ %.lcssa, %.epilog-lcssa ]
  %.023.lcssa = phi i64 [ %10, %.lr.ph44 ], [ %15, %.epilog-lcssa ]
  %11 = icmp sgt i64 %.023.lcssa, 0
  br i1 %11, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader28
  %xtraiter66 = and i64 %.023.lcssa, 3
  %12 = icmp ult i64 %.023.lcssa, 4
  br i1 %12, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter70 = and i64 %.023.lcssa, 9223372036854775804
  br label %.lr.ph

.preheader:                                       ; preds = %.lr.ph44, %.epilog-lcssa
  %indvar = phi i64 [ %indvar.next, %.epilog-lcssa ], [ 0, %.lr.ph44 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.epilog-lcssa ], [ 1, %.lr.ph44 ]
  %.02334 = phi i64 [ %15, %.epilog-lcssa ], [ %10, %.lr.ph44 ]
  %.133 = phi i64 [ %.lcssa, %.epilog-lcssa ], [ %.02442, %.lr.ph44 ]
  %.12632 = phi i32 [ %16, %.epilog-lcssa ], [ %.02541, %.lr.ph44 ]
  %xtraiter = and i64 %indvars.iv, 3
  %13 = icmp ult i64 %indvar, 3
  br i1 %13, label %.unr-lcssa, label %.preheader.new

.preheader.new:                                   ; preds = %.preheader
  %unroll_iter = and i64 %indvars.iv, 9223372036854775804
  br label %17

.unr-lcssa:                                       ; preds = %17, %.preheader
  %.lcssa.ph = phi i64 [ poison, %.preheader ], [ %21, %17 ]
  %.229.unr = phi i64 [ %.133, %.preheader ], [ %21, %17 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.epilog-lcssa, label %.epil.preheader

.epil.preheader:                                  ; preds = %.unr-lcssa, %.epil.preheader
  %.229.epil = phi i64 [ %14, %.epil.preheader ], [ %.229.unr, %.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.unr-lcssa ]
  %14 = sdiv i64 %.229.epil, %.sroa.0.0.copyload
  %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 %.epilog-lcssa, label %.epil.preheader, !llvm.loop !5

.epilog-lcssa:                                    ; preds = %.epil.preheader, %.unr-lcssa
  %.lcssa = phi i64 [ %.lcssa.ph, %.unr-lcssa ], [ %14, %.epil.preheader ]
  %15 = sub nsw i64 %.02334, %indvars.iv
  %16 = add nsw i32 %.12632, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not.not = icmp sgt i64 %15, %indvars.iv
  %indvar.next = add i64 %indvar, 1
  br i1 %.not.not, label %.preheader, label %.preheader28, !llvm.loop !7

17:                                               ; preds = %17, %.preheader.new
  %.229 = phi i64 [ %.133, %.preheader.new ], [ %21, %17 ]
  %niter = phi i64 [ 0, %.preheader.new ], [ %niter.next.3, %17 ]
  %18 = sdiv i64 %.229, %.sroa.0.0.copyload
  %19 = sdiv i64 %18, %.sroa.0.0.copyload
  %20 = sdiv i64 %19, %.sroa.0.0.copyload
  %21 = sdiv i64 %20, %.sroa.0.0.copyload
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.unr-lcssa, label %17, !llvm.loop !9

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa64.ph = phi i64 [ poison, %.lr.ph.preheader ], [ %28, %.lr.ph ]
  %.338.unr = phi i64 [ %.1.lcssa, %.lr.ph.preheader ], [ %28, %.lr.ph ]
  %lcmp.mod68.not = icmp eq i64 %xtraiter66, 0
  br i1 %lcmp.mod68.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %.338.epil = phi i64 [ %22, %.lr.ph.epil ], [ %.338.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter67 = phi i64 [ %epil.iter67.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %22 = sdiv i64 %.338.epil, %.sroa.0.0.copyload
  %epil.iter67.next = add i64 %epil.iter67, 1
  %epil.iter67.cmp.not = icmp eq i64 %epil.iter67.next, %xtraiter66
  br i1 %epil.iter67.cmp.not, label %._crit_edge, label %.lr.ph.epil, !llvm.loop !10

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil, %.preheader28
  %.3.lcssa = phi i64 [ %.1.lcssa, %.preheader28 ], [ %.lcssa64.ph, %._crit_edge.loopexit.unr-lcssa ], [ %22, %.lr.ph.epil ]
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKliEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %24 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKliEES5_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %24, label %.lr.ph44, label %._crit_edge45

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %.338 = phi i64 [ %.1.lcssa, %.lr.ph.preheader.new ], [ %28, %.lr.ph ]
  %niter71 = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter71.next.3, %.lr.ph ]
  %25 = sdiv i64 %.338, %.sroa.0.0.copyload
  %26 = sdiv i64 %25, %.sroa.0.0.copyload
  %27 = sdiv i64 %26, %.sroa.0.0.copyload
  %28 = sdiv i64 %27, %.sroa.0.0.copyload
  %niter71.next.3 = add i64 %niter71, 4
  %niter71.ncmp.3 = icmp eq i64 %niter71.next.3, %unroll_iter70
  br i1 %niter71.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !11

29:                                               ; preds = %._crit_edge45
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 37, ptr noundef nonnull @__PRETTY_FUNCTION__._Z5solvel) #5
  unreachable

30:                                               ; preds = %._crit_edge45
  call void @_ZNSt3mapIliSt4lessIlESaISt4pairIKliEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #4
  ret i32 %.025.lcssa
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKliEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKliEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr 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 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.unroll.disable"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
!9 = distinct !{!9, !8}
!10 = distinct !{!10, !6}
!11 = distinct !{!11, !8}


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