; LLVM IR from JoshuaSBrown/QC_Tools :: src/libcatnip (qc_functions)

; 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.__gnu_cxx::__normal_iterator.20" = type { ptr }
%"struct.std::pair.26" = type { i32, i32 }
%"struct.std::_List_iterator" = type { ptr }

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

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

; Function Attrs: 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) #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6catnip15updateSwapListsERSt6vectorISt4pairIiiESaIS2_EES5_RNSt7__cxx114listIPNS_6MatrixESaIS9_EEE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %10 = alloca %"struct.std::pair.26", align 4
  %11 = alloca %"struct.std::_List_iterator", align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"struct.std::_List_iterator", align 8
  %14 = alloca %"struct.std::_List_iterator", align 8
  %15 = alloca %"struct.std::_List_iterator", align 8
  %16 = alloca %"struct.std::_List_iterator", align 8
  %17 = alloca %"struct.std::_List_iterator", align 8
  %18 = alloca %"struct.std::_List_iterator", align 8
  %19 = alloca %"struct.std::_List_iterator", align 8
  %20 = alloca %"struct.std::_List_iterator", align 8
  %21 = alloca ptr, align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %24 = alloca %"struct.std::pair.26", align 4
  %25 = alloca %"struct.std::_List_iterator", align 8
  %26 = alloca ptr, align 8
  %27 = alloca %"struct.std::_List_iterator", align 8
  %28 = alloca %"struct.std::_List_iterator", align 8
  %29 = alloca %"struct.std::_List_iterator", align 8
  %30 = alloca %"struct.std::_List_iterator", align 8
  %31 = alloca %"struct.std::_List_iterator", align 8
  %32 = alloca %"struct.std::_List_iterator", align 8
  %33 = alloca %"struct.std::_List_iterator", align 8
  %34 = alloca %"struct.std::_List_iterator", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %35, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #6
  %38 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.20", ptr %8, i32 0, i32 0
  store ptr %37, ptr %38, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %39) #6
  %41 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.20", ptr %9, i32 0, i32 0
  store ptr %40, ptr %41, align 8
  br label %42

42:                                               ; preds = %96, %3
  %43 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  br i1 %43, label %45, label %44

44:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %98

45:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %46 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %46, i64 8, i1 false)
  %47 = getelementptr inbounds %"struct.std::pair.26", ptr %10, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = getelementptr inbounds %"struct.std::pair.26", ptr %10, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !12
  %51 = icmp ne i32 %48, %50
  br i1 %51, label %52, label %95

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = call ptr @_ZNSt7__cxx114listIPN6catnip6MatrixESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %53) #6
  %55 = getelementptr inbounds %"struct.std::_List_iterator", ptr %11, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %56 = getelementptr inbounds %"struct.std::pair.26", ptr %10, i32 0, i32 0
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = sub nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds %"struct.std::_List_iterator", ptr %14, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8
  %62 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %61, i64 noundef %59)
  %63 = getelementptr inbounds %"struct.std::_List_iterator", ptr %13, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  %65 = load ptr, ptr %64, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  store ptr %65, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %66 = getelementptr inbounds %"struct.std::pair.26", ptr %10, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !12
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds %"struct.std::_List_iterator", ptr %16, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8
  %72 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %71, i64 noundef %69)
  %73 = getelementptr inbounds %"struct.std::_List_iterator", ptr %15, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #6
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %76 = getelementptr inbounds %"struct.std::pair.26", ptr %10, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = sub nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds %"struct.std::_List_iterator", ptr %18, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  %82 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %81, i64 noundef %79)
  %83 = getelementptr inbounds %"struct.std::_List_iterator", ptr %17, i32 0, i32 0
  store ptr %82, ptr %83, align 8
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  store ptr %75, ptr %84, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !13
  %86 = getelementptr inbounds %"struct.std::pair.26", ptr %10, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !12
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds %"struct.std::_List_iterator", ptr %20, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8
  %92 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %91, i64 noundef %89)
  %93 = getelementptr inbounds %"struct.std::_List_iterator", ptr %19, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #6
  store ptr %85, ptr %94, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %95

95:                                               ; preds = %52, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %96

96:                                               ; preds = %95
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br label %42

98:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %99, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %100 = load ptr, ptr %21, align 8, !tbaa !5
  %101 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %100) #6
  %102 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.20", ptr %22, i32 0, i32 0
  store ptr %101, ptr %102, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %103 = load ptr, ptr %21, align 8, !tbaa !5
  %104 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %103) #6
  %105 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.20", ptr %23, i32 0, i32 0
  store ptr %104, ptr %105, align 8
  br label %106

106:                                              ; preds = %160, %98
  %107 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23) #6
  br i1 %107, label %109, label %108

108:                                              ; preds = %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %162

109:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %110 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %110, i64 8, i1 false)
  %111 = getelementptr inbounds %"struct.std::pair.26", ptr %24, i32 0, i32 0
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = getelementptr inbounds %"struct.std::pair.26", ptr %24, i32 0, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !12
  %115 = icmp ne i32 %112, %114
  br i1 %115, label %116, label %159

116:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = call ptr @_ZNSt7__cxx114listIPN6catnip6MatrixESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %117) #6
  %119 = getelementptr inbounds %"struct.std::_List_iterator", ptr %25, i32 0, i32 0
  store ptr %118, ptr %119, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %25, i64 8, i1 false), !tbaa.struct !13
  %120 = getelementptr inbounds %"struct.std::pair.26", ptr %24, i32 0, i32 0
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds %"struct.std::_List_iterator", ptr %28, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8
  %126 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %125, i64 noundef %123)
  %127 = getelementptr inbounds %"struct.std::_List_iterator", ptr %27, i32 0, i32 0
  store ptr %126, ptr %127, align 8
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %27) #6
  %129 = load ptr, ptr %128, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  store ptr %129, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %25, i64 8, i1 false), !tbaa.struct !13
  %130 = getelementptr inbounds %"struct.std::pair.26", ptr %24, i32 0, i32 1
  %131 = load i32, ptr %130, align 4, !tbaa !12
  %132 = sub nsw i32 %131, 1
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds %"struct.std::_List_iterator", ptr %30, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8
  %136 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %135, i64 noundef %133)
  %137 = getelementptr inbounds %"struct.std::_List_iterator", ptr %29, i32 0, i32 0
  store ptr %136, ptr %137, align 8
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #6
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %25, i64 8, i1 false), !tbaa.struct !13
  %140 = getelementptr inbounds %"struct.std::pair.26", ptr %24, i32 0, i32 0
  %141 = load i32, ptr %140, align 4, !tbaa !9
  %142 = sub nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds %"struct.std::_List_iterator", ptr %32, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8
  %146 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %145, i64 noundef %143)
  %147 = getelementptr inbounds %"struct.std::_List_iterator", ptr %31, i32 0, i32 0
  store ptr %146, ptr %147, align 8
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %31) #6
  store ptr %139, ptr %148, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  %149 = load ptr, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %25, i64 8, i1 false), !tbaa.struct !13
  %150 = getelementptr inbounds %"struct.std::pair.26", ptr %24, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !12
  %152 = sub nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds %"struct.std::_List_iterator", ptr %34, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8
  %156 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %155, i64 noundef %153)
  %157 = getelementptr inbounds %"struct.std::_List_iterator", ptr %33, i32 0, i32 0
  store ptr %156, ptr %157, align 8
  %158 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #6
  store ptr %149, ptr %158, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  br label %159

159:                                              ; preds = %116, %109
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  br label %160

160:                                              ; preds = %159
  %161 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %22) #6
  br label %106

162:                                              ; preds = %108
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr, i64 noundef) #5

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { 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 = { 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 #5 = { inlinehint 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 #6 = { 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, !11, i64 0}
!10 = !{!"_ZTSSt4pairIiiE", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{i64 0, i64 8, !5}


; 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.__gnu_cxx::__normal_iterator.20" = type { ptr }
%"struct.std::_List_iterator" = type { ptr }

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(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 ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6catnip15updateSwapListsERSt6vectorISt4pairIiiESaIS2_EES5_RNSt7__cxx114listIPNS_6MatrixESaIS9_EEE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #3 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %6 = alloca %"struct.std::_List_iterator", align 8
  %7 = alloca %"struct.std::_List_iterator", align 8
  %8 = alloca %"struct.std::_List_iterator", align 8
  %9 = alloca %"struct.std::_List_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.20", align 8
  %12 = alloca %"struct.std::_List_iterator", align 8
  %13 = alloca %"struct.std::_List_iterator", align 8
  %14 = alloca %"struct.std::_List_iterator", align 8
  %15 = alloca %"struct.std::_List_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %16 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  store ptr %16, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %17 = tail call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  store ptr %17, ptr %5, align 8
  %18 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %18, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %39, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %19 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  store ptr %19, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %20 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  store ptr %20, ptr %11, align 8
  %21 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %21, label %.lr.ph32, label %._crit_edge33

.lr.ph:                                           ; preds = %3, %39
  %22 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %.sroa.018.0.copyload = load i32, ptr %22, align 4
  %.sroa.621.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 4
  %.sroa.621.0.copyload = load i32, ptr %.sroa.621.0..sroa_idx, align 4
  %.not30 = icmp eq i32 %.sroa.018.0.copyload, %.sroa.621.0.copyload
  br i1 %.not30, label %39, label %23

23:                                               ; preds = %.lr.ph
  %24 = call ptr @_ZNSt7__cxx114listIPN6catnip6MatrixESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %25 = add nsw i32 %.sroa.018.0.copyload, -1
  %26 = sext i32 %25 to i64
  %27 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %24, i64 noundef %26)
  store ptr %27, ptr %6, align 8
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #5
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %30 = add nsw i32 %.sroa.621.0.copyload, -1
  %31 = sext i32 %30 to i64
  %32 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %24, i64 noundef %31)
  store ptr %32, ptr %7, align 8
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %35 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %24, i64 noundef %26)
  store ptr %35, ptr %8, align 8
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  store ptr %34, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %37 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %24, i64 noundef %31)
  store ptr %37, ptr %9, align 8
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  store ptr %29, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br label %39

39:                                               ; preds = %23, %.lr.ph
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %41 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  br i1 %41, label %.lr.ph, label %._crit_edge

._crit_edge33:                                    ; preds = %59, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  ret void

.lr.ph32:                                         ; preds = %._crit_edge, %59
  %42 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %.sroa.05.0.copyload = load i32, ptr %42, align 4
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %42, i64 4
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 4
  %.not = icmp eq i32 %.sroa.05.0.copyload, %.sroa.6.0.copyload
  br i1 %.not, label %59, label %43

43:                                               ; preds = %.lr.ph32
  %44 = call ptr @_ZNSt7__cxx114listIPN6catnip6MatrixESaIS3_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #5
  %45 = add nsw i32 %.sroa.05.0.copyload, -1
  %46 = sext i32 %45 to i64
  %47 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %44, i64 noundef %46)
  store ptr %47, ptr %12, align 8
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  %50 = add nsw i32 %.sroa.6.0.copyload, -1
  %51 = sext i32 %50 to i64
  %52 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %44, i64 noundef %51)
  store ptr %52, ptr %13, align 8
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  %55 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %44, i64 noundef %46)
  store ptr %55, ptr %14, align 8
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  store ptr %54, ptr %56, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  %57 = call ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr %44, i64 noundef %51)
  store ptr %57, ptr %15, align 8
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  store ptr %49, ptr %58, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  br label %59

59:                                               ; preds = %43, %.lr.ph32
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %61 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %61, label %.lr.ph32, label %._crit_edge33
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZSt4nextISt14_List_iteratorIPN6catnip6MatrixEEET_S5_NSt15iterator_traitsIS5_E15difference_typeE(ptr, i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14_List_iteratorIPN6catnip6MatrixEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 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 = { 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 #3 = { 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 #4 = { inlinehint 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 #5 = { 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"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass