; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2018-19/Open 2019/Plat/escape (TLE).ll (Z10processRowii)

; 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::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.16" = type { ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = 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 }
%"struct.std::pair" = type { i32, %struct.modInt }
%struct.modInt = type { i32 }
%"struct.std::pair.14" = type { %"class.std::vector.8", %"struct.std::pair" }

@K = external dso_local global i32, align 4
@h = external dso_local global [30000 x [6 x i32]], align 16
@cur = external dso_local global %"class.std::vector.3", align 8
@tmp = external dso_local global %"class.std::vector.3", align 8
@zz = 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5uniteRSt6vectorIiSaIiEEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2adSt6vectorIiSaIiEESt4pairIi6modIntIiEE(ptr noundef, i64) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3swav() #2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10processRowii(i32 noundef %0, i32 noundef %1) #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::vector.8", align 8
  %12 = alloca %"struct.std::pair", align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %88, %2
  %17 = load i32, ptr %5, align 4, !tbaa !5
  %18 = load i32, ptr @K, align 4, !tbaa !5
  %19 = sub nsw i32 %18, 1
  %20 = icmp slt i32 %17, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %16
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %91

22:                                               ; preds = %16
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [30000 x [6 x i32]], ptr @h, i64 0, i64 %24
  %26 = load i32, ptr %5, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [6 x i32], ptr %25, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp eq i32 %29, %30
  br i1 %31, label %32, label %87

32:                                               ; preds = %22
  %33 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EEaSERKS8_(ptr noundef nonnull align 8 dereferenceable(24) @tmp, ptr noundef nonnull align 8 dereferenceable(24) @cur)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store ptr @cur, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %34 = call ptr @_ZNSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #4
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.16", ptr %8, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %36 = call ptr @_ZNSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #4
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.16", ptr %9, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  br label %38

38:                                               ; preds = %80, %32
  %39 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairISt6vectorIiSaIiEES1_Ii6modIntIiEEES2_IS8_SaIS8_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %42 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairISt6vectorIiSaIiEES1_Ii6modIntIiEEES2_IS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  store ptr %42, ptr %10, align 8, !tbaa !9
  %43 = load ptr, ptr %10, align 8, !tbaa !9
  %44 = getelementptr inbounds %"struct.std::pair.14", ptr %43, i32 0, i32 0
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %46) #4
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = getelementptr inbounds %"struct.std::pair.14", ptr %49, i32 0, i32 0
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  %53 = sext i32 %52 to i64
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %53) #4
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = icmp eq i32 %48, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %41
  store i32 6, ptr %6, align 4
  br label %77

58:                                               ; preds = %41
  %59 = load ptr, ptr %10, align 8, !tbaa !9
  %60 = getelementptr inbounds %"struct.std::pair.14", ptr %59, i32 0, i32 0
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  call void @_Z5uniteRSt6vectorIiSaIiEEii(ptr noundef nonnull align 8 dereferenceable(24) %60, i32 noundef %61, i32 noundef %63)
  %64 = load ptr, ptr %10, align 8, !tbaa !9
  %65 = getelementptr inbounds %"struct.std::pair.14", ptr %64, i32 0, i32 0
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %65)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %66 = load ptr, ptr %10, align 8, !tbaa !9
  %67 = getelementptr inbounds %"struct.std::pair.14", ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 0
  %69 = load i32, ptr %68, align 8, !tbaa !11
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %13, align 4, !tbaa !5
  %71 = load ptr, ptr %10, align 8, !tbaa !9
  %72 = getelementptr inbounds %"struct.std::pair.14", ptr %71, i32 0, i32 1
  %73 = getelementptr inbounds %"struct.std::pair", ptr %72, i32 0, i32 1
  invoke void @_ZNSt4pairIi6modIntIiEEC2IiRS1_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %73)
          to label %74 unwind label %82

74:                                               ; preds = %58
  %75 = load i64, ptr %12, align 4
  invoke void @_Z2adSt6vectorIiSaIiEESt4pairIi6modIntIiEE(ptr noundef %11, i64 %75)
          to label %76 unwind label %82

76:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  store i32 0, ptr %6, align 4
  br label %77

77:                                               ; preds = %76, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  %78 = load i32, ptr %6, align 4
  switch i32 %78, label %99 [
    i32 0, label %79
    i32 6, label %80
  ]

79:                                               ; preds = %77
  br label %80

80:                                               ; preds = %79, %77
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairISt6vectorIiSaIiEES1_Ii6modIntIiEEES2_IS8_SaIS8_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  br label %38

82:                                               ; preds = %74, %58
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %14, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %94

86:                                               ; preds = %40
  call void @_Z3swav()
  br label %87

87:                                               ; preds = %86, %22
  br label %88

88:                                               ; preds = %87
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %5, align 4, !tbaa !5
  br label %16, !llvm.loop !19

91:                                               ; preds = %21
  %92 = call noundef i64 @_ZNKSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #4
  %93 = trunc i64 %92 to i32
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) @zz, i32 noundef %93)
  ret void

94:                                               ; preds = %82
  %95 = load ptr, ptr %14, align 8
  %96 = load i32, ptr %15, align 4
  %97 = insertvalue { ptr, i32 } poison, ptr %95, 0
  %98 = insertvalue { ptr, i32 } %97, i32 %96, 1
  resume { ptr, i32 } %98

99:                                               ; preds = %77
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EEaSERKS8_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_ZTSSt4pairISt6vectorIiSaIiEES_Ii6modIntIiEEE", !13, i64 0, !17, i64 24}
!13 = !{!"_ZTSSt6vectorIiSaIiEE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!17 = !{!"_ZTSSt4pairIi6modIntIiEE", !6, i64 0, !18, i64 4}
!18 = !{!"_ZTS6modIntIiE", !6, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; 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::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::vector<int>, std::pair<int, modInt<int>>>, std::allocator<std::pair<std::vector<int>, std::pair<int, modInt<int>>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.16" = type { ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = 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 }
%"struct.std::pair" = type { i32, %struct.modInt }
%struct.modInt = type { i32 }

@K = external dso_local local_unnamed_addr global i32, align 4
@h = external dso_local local_unnamed_addr global [30000 x [6 x i32]], align 16
@cur = external dso_local global %"class.std::vector.3", align 8
@tmp = external dso_local global %"class.std::vector.3", align 8
@zz = external dso_local 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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5uniteRSt6vectorIiSaIiEEii(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z2adSt6vectorIiSaIiEESt4pairIi6modIntIiEE(ptr noundef, i64) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3swav() local_unnamed_addr #2

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10processRowii(i32 noundef %0, i32 noundef %1) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.16", align 8
  %5 = alloca %"class.std::vector.8", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i32, align 4
  %8 = load i32, ptr @K, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 1
  br i1 %9, label %.lr.ph19, label %._crit_edge20

.lr.ph19:                                         ; preds = %2
  %10 = sext i32 %1 to i64
  br label %13

._crit_edge20:                                    ; preds = %44, %2
  %11 = call noundef i64 @_ZNKSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #4
  %12 = trunc i64 %11 to i32
  call void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) @zz, i32 noundef %12)
  ret void

13:                                               ; preds = %.lr.ph19, %44
  %14 = phi i32 [ %8, %.lr.ph19 ], [ %45, %44 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph19 ], [ %indvars.iv.next, %44 ]
  %indvars21 = trunc i64 %indvars.iv to i32
  %15 = getelementptr inbounds [30000 x [6 x i32]], ptr @h, i64 0, i64 %10, i64 %indvars.iv
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp eq i32 %16, %0
  br i1 %17, label %18, label %44

18:                                               ; preds = %13
  %19 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EEaSERKS8_(ptr noundef nonnull align 8 dereferenceable(24) @tmp, ptr noundef nonnull align 8 dereferenceable(24) @cur)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %20 = call ptr @_ZNSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #4
  store ptr %20, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %21 = call ptr @_ZNSt6vectorISt4pairIS_IiSaIiEES0_Ii6modIntIiEEESaIS6_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @cur) #4
  store ptr %21, ptr %4, align 8
  %22 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairISt6vectorIiSaIiEES1_Ii6modIntIiEEES2_IS8_SaIS8_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %22, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18
  %23 = add nuw nsw i64 %indvars.iv, 1
  %24 = add nuw nsw i32 %indvars21, 1
  br label %25

._crit_edge:                                      ; preds = %39, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @_Z3swav()
  %.pre = load i32, ptr @K, align 4, !tbaa !5
  br label %44

25:                                               ; preds = %.lr.ph, %39
  %26 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairISt6vectorIiSaIiEES1_Ii6modIntIiEEES2_IS8_SaIS8_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %indvars.iv) #4
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %26, i64 noundef %23) #4
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = icmp eq i32 %28, %30
  br i1 %31, label %39, label %32

32:                                               ; preds = %25
  call void @_Z5uniteRSt6vectorIiSaIiEEii(ptr noundef nonnull align 8 dereferenceable(24) %26, i32 noundef %indvars21, i32 noundef %24)
  call void @_ZNSt6vectorIiSaIiEEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %26)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %33 = getelementptr inbounds i8, ptr %26, i64 24
  %34 = load i32, ptr %33, align 8, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %7, align 4, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %26, i64 28
  call void @_ZNSt4pairIi6modIntIiEEC2IiRS1_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %36)
  %37 = load i64, ptr %6, align 8
  invoke void @_Z2adSt6vectorIiSaIiEESt4pairIi6modIntIiEE(ptr noundef nonnull %5, i64 %37)
          to label %38 unwind label %42

38:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  br label %39

39:                                               ; preds = %25, %38
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairISt6vectorIiSaIiEES1_Ii6modIntIiEEES2_IS8_SaIS8_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairISt6vectorIiSaIiEES1_Ii6modIntIiEEES2_IS8_SaIS8_EEEEbRKNS_17__normal_iteratorIT_T0_EESH_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  br i1 %41, label %25, label %._crit_edge

42:                                               ; preds = %32
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %43

44:                                               ; preds = %13, %._crit_edge
  %45 = phi i32 [ %14, %13 ], [ %.pre, %._crit_edge ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = add nsw i32 %45, -1
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv.next, %47
  br i1 %48, label %13, label %._crit_edge20, !llvm.loop !18
}

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5ckmaxIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = !{!10, !6, i64 24}
!10 = !{!"_ZTSSt4pairISt6vectorIiSaIiEES_Ii6modIntIiEEE", !11, i64 0, !16, i64 24}
!11 = !{!"_ZTSSt6vectorIiSaIiEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTSSt4pairIi6modIntIiEE", !6, i64 0, !17, i64 4}
!17 = !{!"_ZTS6modIntIiE", !6, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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