; LLVM IR from sgtlaugh/algovault :: code_library/misc (2D_pattern_matcher)

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

@_ZN2pm1nE = external dso_local global i32, align 4
@_ZN2pm1mE = external dso_local global i32, align 4
@_ZN2pm1rE = external dso_local global i32, align 4
@_ZN2pm1cE = external dso_local global i32, align 4
@_ZN2pm2dpE = external dso_local global %"class.std::vector", align 8
@_ZN2pm8base_powE = external dso_local global i64, align 8
@_ZN2pm12pattern_hashE = external dso_local global i64, align 8
@_ZN2pm11pattern_powE = external dso_local global i64, align 8

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2pm5solveERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EESA_(ptr dead_on_unwind noalias writable sret(%"class.std::vector.8") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i1, align 1
  %13 = alloca %"struct.std::pair", align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN2pm5buildERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EESA_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %17)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  store i1 false, ptr %12, align 1
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %18

18:                                               ; preds = %122, %3
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = load i32, ptr @_ZN2pm1cE, align 4, !tbaa !9
  %21 = add nsw i32 %19, %20
  %22 = load i32, ptr @_ZN2pm1mE, align 4, !tbaa !9
  %23 = icmp sle i32 %21, %22
  br i1 %23, label %24, label %125

24:                                               ; preds = %18
  store i64 0, ptr %10, align 8, !tbaa !11
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %37, %24
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = load i32, ptr @_ZN2pm1rE, align 4, !tbaa !9
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %40

29:                                               ; preds = %25
  %30 = load i64, ptr %10, align 8, !tbaa !11
  %31 = mul i64 %30, 1995433697
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %33) #3
  %35 = load i64, ptr %34, align 8, !tbaa !11
  %36 = add i64 %31, %35
  store i64 %36, ptr %10, align 8, !tbaa !11
  br label %37

37:                                               ; preds = %29
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %7, align 4, !tbaa !9
  br label %25, !llvm.loop !13

40:                                               ; preds = %25
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %76, %40
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = load i32, ptr @_ZN2pm1rE, align 4, !tbaa !9
  %44 = add nsw i32 %42, %43
  %45 = load i32, ptr @_ZN2pm1nE, align 4, !tbaa !9
  %46 = icmp sle i32 %44, %45
  br i1 %46, label %47, label %79

47:                                               ; preds = %41
  %48 = load i64, ptr %10, align 8, !tbaa !11
  %49 = load i64, ptr @_ZN2pm12pattern_hashE, align 8, !tbaa !11
  %50 = icmp eq i64 %48, %49
  br i1 %50, label %51, label %58

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  invoke void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %13, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %52 unwind label %54

52:                                               ; preds = %51
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %53 unwind label %54

53:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %58

54:                                               ; preds = %52, %51
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %14, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %129

58:                                               ; preds = %53, %47
  %59 = load i64, ptr %10, align 8, !tbaa !11
  %60 = load i64, ptr @_ZN2pm8base_powE, align 8, !tbaa !11
  %61 = load i32, ptr %7, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %62) #3
  %64 = load i64, ptr %63, align 8, !tbaa !11
  %65 = mul i64 %60, %64
  %66 = sub i64 %59, %65
  store i64 %66, ptr %11, align 8, !tbaa !11
  %67 = load i64, ptr %11, align 8, !tbaa !11
  %68 = mul i64 %67, 1995433697
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = load i32, ptr @_ZN2pm1rE, align 4, !tbaa !9
  %71 = add nsw i32 %69, %70
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %72) #3
  %74 = load i64, ptr %73, align 8, !tbaa !11
  %75 = add i64 %68, %74
  store i64 %75, ptr %10, align 8, !tbaa !11
  br label %76

76:                                               ; preds = %58
  %77 = load i32, ptr %7, align 4, !tbaa !9
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %7, align 4, !tbaa !9
  br label %41, !llvm.loop !15

79:                                               ; preds = %41
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %118, %79
  %81 = load i32, ptr %7, align 4, !tbaa !9
  %82 = load i32, ptr @_ZN2pm1nE, align 4, !tbaa !9
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %84, label %121

84:                                               ; preds = %80
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %86) #3
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = load i64, ptr @_ZN2pm11pattern_powE, align 8, !tbaa !11
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load i32, ptr %7, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %90, i64 noundef %92) #3
  %94 = load i32, ptr %8, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %93, i64 noundef %95) #3
  %97 = load i8, ptr %96, align 1, !tbaa !16
  %98 = sext i8 %97 to i64
  %99 = mul i64 %89, %98
  %100 = sub i64 %88, %99
  store i64 %100, ptr %9, align 8, !tbaa !11
  %101 = load i64, ptr %9, align 8, !tbaa !11
  %102 = mul i64 %101, 2117566807
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %103, i64 noundef %105) #3
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = load i32, ptr @_ZN2pm1cE, align 4, !tbaa !9
  %109 = add nsw i32 %107, %108
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %106, i64 noundef %110) #3
  %112 = load i8, ptr %111, align 1, !tbaa !16
  %113 = sext i8 %112 to i64
  %114 = add i64 %102, %113
  %115 = load i32, ptr %7, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %116) #3
  store i64 %114, ptr %117, align 8, !tbaa !11
  br label %118

118:                                              ; preds = %84
  %119 = load i32, ptr %7, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %7, align 4, !tbaa !9
  br label %80, !llvm.loop !17

121:                                              ; preds = %80
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %8, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %8, align 4, !tbaa !9
  br label %18, !llvm.loop !18

125:                                              ; preds = %18
  store i1 true, ptr %12, align 1
  %126 = load i1, ptr %12, align 1
  br i1 %126, label %128, label %127

127:                                              ; preds = %125
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  br label %128

128:                                              ; preds = %127, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  ret void

129:                                              ; preds = %54
  %130 = load ptr, ptr %14, align 8
  %131 = load i32, ptr %15, align 4
  %132 = insertvalue { ptr, i32 } poison, ptr %130, 0
  %133 = insertvalue { ptr, i32 } %132, i32 %131, 1
  resume { ptr, i32 } %133
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(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

declare i32 @__gxx_personality_v0(...)

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

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


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

@_ZN2pm1nE = external dso_local local_unnamed_addr global i32, align 4
@_ZN2pm1mE = external dso_local local_unnamed_addr global i32, align 4
@_ZN2pm1rE = external dso_local local_unnamed_addr global i32, align 4
@_ZN2pm1cE = external dso_local local_unnamed_addr global i32, align 4
@_ZN2pm2dpE = external dso_local global %"class.std::vector", align 8
@_ZN2pm8base_powE = external dso_local local_unnamed_addr global i64, align 8
@_ZN2pm12pattern_hashE = external dso_local local_unnamed_addr global i64, align 8
@_ZN2pm11pattern_powE = external dso_local local_unnamed_addr global i64, align 8

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2pm5solveERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EESA_(ptr dead_on_unwind noalias writable sret(%"class.std::vector.8") align 8 %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"struct.std::pair", align 4
  tail call void @_ZN2pm5buildERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS6_EESA_(ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  tail call void @_ZNSt6vectorISt4pairIiiESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  %7 = load i32, ptr @_ZN2pm1cE, align 4, !tbaa !5
  %8 = load i32, ptr @_ZN2pm1mE, align 4, !tbaa !5
  %.not26 = icmp sgt i32 %7, %8
  br i1 %.not26, label %._crit_edge27, label %.preheader18

.preheader18:                                     ; preds = %3, %._crit_edge
  store i32 0, ptr %4, align 4, !tbaa !5
  %9 = load i32, ptr @_ZN2pm1rE, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.preheader17

.preheader17:                                     ; preds = %.lr.ph, %.preheader18
  %11 = phi i32 [ %9, %.preheader18 ], [ %20, %.lr.ph ]
  %.0.lcssa = phi i64 [ 0, %.preheader18 ], [ %17, %.lr.ph ]
  store i32 0, ptr %4, align 4, !tbaa !5
  %12 = load i32, ptr @_ZN2pm1nE, align 4, !tbaa !5
  %.not1521 = icmp sgt i32 %11, %12
  br i1 %.not1521, label %.preheader, label %.lr.ph23

.lr.ph:                                           ; preds = %.preheader18, %.lr.ph
  %.020 = phi i64 [ %17, %.lr.ph ], [ 0, %.preheader18 ]
  %storemerge1319 = phi i32 [ %19, %.lr.ph ], [ 0, %.preheader18 ]
  %13 = mul i64 %.020, 1995433697
  %14 = sext i32 %storemerge1319 to i64
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %14) #3
  %16 = load i64, ptr %15, align 8, !tbaa !9
  %17 = add i64 %16, %13
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %4, align 4, !tbaa !5
  %20 = load i32, ptr @_ZN2pm1rE, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph, label %.preheader17, !llvm.loop !11

.preheader:                                       ; preds = %31, %.preheader17
  %22 = phi i32 [ %12, %.preheader17 ], [ %51, %31 ]
  store i32 0, ptr %4, align 4, !tbaa !5
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph25, label %._crit_edge

.lr.ph23:                                         ; preds = %.preheader17, %31
  %24 = phi i32 [ %48, %31 ], [ 0, %.preheader17 ]
  %.122 = phi i64 [ %46, %31 ], [ %.0.lcssa, %.preheader17 ]
  %25 = load i64, ptr @_ZN2pm12pattern_hashE, align 8, !tbaa !9
  %26 = icmp eq i64 %.122, %25
  br i1 %26, label %27, label %31

27:                                               ; preds = %.lr.ph23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  call void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  invoke void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(8) %6)
          to label %28 unwind label %29

28:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  br label %31

29:                                               ; preds = %27
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  resume { ptr, i32 } %30

31:                                               ; preds = %28, %.lr.ph23
  %32 = phi i32 [ %.pre, %28 ], [ %24, %.lr.ph23 ]
  %33 = load i64, ptr @_ZN2pm8base_powE, align 8, !tbaa !9
  %34 = sext i32 %32 to i64
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %34) #3
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = mul i64 %36, %33
  %38 = sub i64 %.122, %37
  %39 = mul i64 %38, 1995433697
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = load i32, ptr @_ZN2pm1rE, align 4, !tbaa !5
  %42 = add nsw i32 %41, %40
  %43 = sext i32 %42 to i64
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %43) #3
  %45 = load i64, ptr %44, align 8, !tbaa !9
  %46 = add i64 %45, %39
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr @_ZN2pm1rE, align 4, !tbaa !5
  %50 = add nsw i32 %49, %48
  %51 = load i32, ptr @_ZN2pm1nE, align 4, !tbaa !5
  %.not15 = icmp sgt i32 %50, %51
  br i1 %.not15, label %.preheader, label %.lr.ph23, !llvm.loop !13

.lr.ph25:                                         ; preds = %.preheader, %.lr.ph25
  %storemerge1624 = phi i32 [ %82, %.lr.ph25 ], [ 0, %.preheader ]
  %52 = sext i32 %storemerge1624 to i64
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %52) #3
  %54 = load i64, ptr %53, align 8, !tbaa !9
  %55 = load i64, ptr @_ZN2pm11pattern_powE, align 8, !tbaa !9
  %56 = load i32, ptr %4, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %57) #3
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %58, i64 noundef %60) #3
  %62 = load i8, ptr %61, align 1, !tbaa !14
  %63 = sext i8 %62 to i64
  %64 = mul i64 %55, %63
  %65 = sub i64 %54, %64
  %66 = mul i64 %65, 2117566807
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %68) #3
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = load i32, ptr @_ZN2pm1cE, align 4, !tbaa !5
  %72 = add nsw i32 %71, %70
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %69, i64 noundef %73) #3
  %75 = load i8, ptr %74, align 1, !tbaa !14
  %76 = sext i8 %75 to i64
  %77 = add i64 %66, %76
  %78 = load i32, ptr %4, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIySaIyEEixEm(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2pm2dpE, i64 noundef %79) #3
  store i64 %77, ptr %80, align 8, !tbaa !9
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %4, align 4, !tbaa !5
  %83 = load i32, ptr @_ZN2pm1nE, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %.lr.ph25, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph25, %.preheader
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %5, align 4, !tbaa !5
  %87 = load i32, ptr @_ZN2pm1cE, align 4, !tbaa !5
  %88 = add nsw i32 %87, %86
  %89 = load i32, ptr @_ZN2pm1mE, align 4, !tbaa !5
  %.not = icmp sgt i32 %88, %89
  br i1 %.not, label %._crit_edge27, label %.preheader18, !llvm.loop !16

._crit_edge27:                                    ; preds = %._crit_edge, %3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret void
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIiiEC2IRiS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(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

declare i32 @__gxx_personality_v0(...)

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

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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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