; LLVM IR from brpapa/algorithms :: solutions/uva/116.ll (Z7recoverv)

; 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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@tab = external dso_local global [10 x [100 x i32]], align 16
@ans = external dso_local global [100 x i32], align 16
@qteLIN = external dso_local global i32, align 4
@qteCOL = external dso_local global i32, align 4

; 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 void @_Z7recoverv() #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::priority_queue", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 2147483647, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %32, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %14 = icmp slt i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  br label %35

16:                                               ; preds = %11
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %18
  %20 = getelementptr inbounds [100 x i32], ptr %19, i64 0, i64 0
  %21 = load i32, ptr %20, align 16, !tbaa !5
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %24, label %31

24:                                               ; preds = %16
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %26
  %28 = getelementptr inbounds [100 x i32], ptr %27, i64 0, i64 0
  %29 = load i32, ptr %28, align 16, !tbaa !5
  store i32 %29, ptr %1, align 4, !tbaa !5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %30, ptr @ans, align 16, !tbaa !5
  br label %31

31:                                               ; preds = %24, %16
  br label %32

32:                                               ; preds = %31
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

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

36:                                               ; preds = %119, %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr @qteCOL, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %123

41:                                               ; preds = %36
  store i32 2147483647, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #4
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 -1, ptr %6, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %71, %41
  %43 = load i32, ptr %6, align 4, !tbaa !5
  %44 = icmp sle i32 %43, 1
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %78

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sub nsw i32 %47, 1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100 x i32], ptr @ans, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = add nsw i32 %51, %52
  %54 = icmp slt i32 %53, 0
  br i1 %54, label %55, label %58

55:                                               ; preds = %46
  %56 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %57 = sub nsw i32 %56, 1
  br label %68

58:                                               ; preds = %46
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sub nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100 x i32], ptr @ans, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !5
  %65 = add nsw i32 %63, %64
  %66 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %67 = srem i32 %65, %66
  br label %68

68:                                               ; preds = %58, %55
  %69 = phi i32 [ %57, %55 ], [ %67, %58 ]
  store i32 %69, ptr %7, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %70 unwind label %74

70:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %6, align 4, !tbaa !5
  br label %42, !llvm.loop !11

74:                                               ; preds = %68
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %8, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %122

78:                                               ; preds = %45
  br label %79

79:                                               ; preds = %117, %78
  %80 = invoke noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %81 unwind label %109

81:                                               ; preds = %79
  %82 = xor i1 %80, true
  br i1 %82, label %83, label %118

83:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %84 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %85 unwind label %113

85:                                               ; preds = %83
  %86 = load i32, ptr %84, align 4, !tbaa !5
  store i32 %86, ptr %10, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %5)
          to label %87 unwind label %113

87:                                               ; preds = %85
  %88 = load i32, ptr %10, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %89
  %91 = load i32, ptr %3, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %1, align 4, !tbaa !5
  %96 = icmp sle i32 %94, %95
  br i1 %96, label %97, label %117

97:                                               ; preds = %87
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %99
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100 x i32], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  store i32 %104, ptr %1, align 4, !tbaa !5
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100 x i32], ptr @ans, i64 0, i64 %107
  store i32 %105, ptr %108, align 4, !tbaa !5
  br label %117

109:                                              ; preds = %79
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %8, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %9, align 4
  br label %122

113:                                              ; preds = %85, %83
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %8, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %122

117:                                              ; preds = %97, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %79, !llvm.loop !12

118:                                              ; preds = %81
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %3, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !13

122:                                              ; preds = %113, %109, %74
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  br label %124

123:                                              ; preds = %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void

124:                                              ; preds = %122
  %125 = load ptr, ptr %8, align 8
  %126 = load i32, ptr %9, align 4
  %127 = insertvalue { ptr, i32 } poison, ptr %125, 0
  %128 = insertvalue { ptr, i32 } %127, i32 %126, 1
  resume { ptr, i32 } %128
}

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #3 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 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !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"

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@tab = external dso_local local_unnamed_addr global [10 x [100 x i32]], align 16
@ans = external dso_local local_unnamed_addr global [100 x i32], align 16
@qteLIN = external dso_local local_unnamed_addr global i32, align 4
@qteCOL = external dso_local local_unnamed_addr global i32, align 4

; 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 void @_Z7recoverv() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::priority_queue", align 8
  %2 = alloca i32, align 4
  %3 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph.preheader, label %.preheader31

.lr.ph.preheader:                                 ; preds = %0
  %wide.trip.count = zext nneg i32 %3 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %5 = icmp eq i32 %3, 1
  br i1 %5, label %.preheader31.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.preheader31.loopexit.unr-lcssa:                  ; preds = %23, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %23 ]
  %.033.unr = phi i32 [ 2147483647, %.lr.ph.preheader ], [ %.1.1, %23 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader31, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader31.loopexit.unr-lcssa
  %6 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %indvars.iv.unr
  %7 = load i32, ptr %6, align 16, !tbaa !5
  %8 = icmp slt i32 %7, %.033.unr
  br i1 %8, label %9, label %.preheader31

9:                                                ; preds = %.lr.ph.epil
  %10 = trunc nuw nsw i64 %indvars.iv.unr to i32
  store i32 %10, ptr @ans, align 16, !tbaa !5
  br label %.preheader31

.preheader31:                                     ; preds = %.preheader31.loopexit.unr-lcssa, %9, %.lr.ph.epil, %0
  %11 = load i32, ptr @qteCOL, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 1
  br i1 %12, label %.lr.ph38, label %._crit_edge39

.lr.ph:                                           ; preds = %23, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %23 ]
  %.033 = phi i32 [ 2147483647, %.lr.ph.preheader.new ], [ %.1.1, %23 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %23 ]
  %13 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %indvars.iv
  %14 = load i32, ptr %13, align 16, !tbaa !5
  %15 = icmp slt i32 %14, %.033
  br i1 %15, label %16, label %.lr.ph.1

16:                                               ; preds = %.lr.ph
  %17 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %17, ptr @ans, align 16, !tbaa !5
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph, %16
  %.1 = phi i32 [ %14, %16 ], [ %.033, %.lr.ph ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %18 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %indvars.iv.next
  %19 = load i32, ptr %18, align 16, !tbaa !5
  %20 = icmp slt i32 %19, %.1
  br i1 %20, label %21, label %23

21:                                               ; preds = %.lr.ph.1
  %22 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %22, ptr @ans, align 16, !tbaa !5
  br label %23

23:                                               ; preds = %21, %.lr.ph.1
  %.1.1 = phi i32 [ %19, %21 ], [ %.1, %.lr.ph.1 ]
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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 %.preheader31.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !9

._crit_edge39:                                    ; preds = %._crit_edge, %.preheader31
  ret void

.lr.ph38:                                         ; preds = %.preheader31, %._crit_edge
  %indvars.iv42 = phi i64 [ %indvars.iv.next43, %._crit_edge ], [ 1, %.preheader31 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #4
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %24 = add nsw i64 %indvars.iv42, -1
  %25 = getelementptr inbounds [100 x i32], ptr @ans, i64 0, i64 %24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = icmp slt i32 %26, 1
  br i1 %27, label %29, label %32

.lr.ph36:                                         ; preds = %.preheader
  %28 = getelementptr inbounds [100 x i32], ptr @ans, i64 0, i64 %indvars.iv42
  br label %63

29:                                               ; preds = %.lr.ph38
  %30 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  br label %36

32:                                               ; preds = %.lr.ph38
  %33 = add nsw i32 %26, -1
  %34 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %35 = srem i32 %33, %34
  br label %36

36:                                               ; preds = %32, %29
  %37 = phi i32 [ %31, %29 ], [ %35, %32 ]
  store i32 %37, ptr %2, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %38 unwind label %61

38:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %39 = load i32, ptr %25, align 4, !tbaa !5
  %40 = icmp slt i32 %39, 0
  %41 = load i32, ptr @qteLIN, align 4, !tbaa !5
  br i1 %40, label %44, label %42

42:                                               ; preds = %38
  %43 = srem i32 %39, %41
  br label %46

44:                                               ; preds = %38
  %45 = add nsw i32 %41, -1
  br label %46

46:                                               ; preds = %44, %42
  %47 = phi i32 [ %45, %44 ], [ %43, %42 ]
  store i32 %47, ptr %2, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %48 unwind label %61

48:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %49 = load i32, ptr %25, align 4, !tbaa !5
  %50 = icmp slt i32 %49, -1
  br i1 %50, label %55, label %51

51:                                               ; preds = %48
  %52 = add nsw i32 %49, 1
  %53 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %54 = srem i32 %52, %53
  br label %58

55:                                               ; preds = %48
  %56 = load i32, ptr @qteLIN, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  br label %58

58:                                               ; preds = %55, %51
  %59 = phi i32 [ %57, %55 ], [ %54, %51 ]
  store i32 %59, ptr %2, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %.preheader unwind label %61

.preheader:                                       ; preds = %58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %60 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %60, label %._crit_edge, label %.lr.ph36

61:                                               ; preds = %58, %46, %36
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  br label %78

63:                                               ; preds = %.lr.ph36, %73
  %.235 = phi i32 [ 2147483647, %.lr.ph36 ], [ %.3, %73 ]
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  %65 = load i32, ptr %64, align 4, !tbaa !5
  invoke void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
          to label %66 unwind label %71

66:                                               ; preds = %63
  %67 = sext i32 %65 to i64
  %68 = getelementptr inbounds [10 x [100 x i32]], ptr @tab, i64 0, i64 %67, i64 %indvars.iv42
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %.not = icmp sgt i32 %69, %.235
  br i1 %.not, label %73, label %70

70:                                               ; preds = %66
  store i32 %65, ptr %28, align 4, !tbaa !5
  br label %73

71:                                               ; preds = %63
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %78

73:                                               ; preds = %70, %66
  %.3 = phi i32 [ %69, %70 ], [ %.235, %66 ]
  %74 = call noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) %1)
  br i1 %74, label %._crit_edge, label %63, !llvm.loop !11

._crit_edge:                                      ; preds = %73, %.preheader
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #4
  %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
  %75 = load i32, ptr @qteCOL, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next43, %76
  br i1 %77, label %.lr.ph38, label %._crit_edge39, !llvm.loop !12

78:                                               ; preds = %71, %61
  %.pn = phi { ptr, i32 } [ %62, %61 ], [ %72, %71 ]
  call void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %1) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #4
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(25), 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 noundef zeroext i1 @_ZNKSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt14priority_queueIiSt6vectorIiSaIiEESt4lessIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(25)) unnamed_addr #3 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 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


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