; LLVM IR from cvanaret/Uno :: uno/ingredients/globalization_strategies/switching_methods/filter_methods/filter_45108ebe (ZN3uno17NonmonotoneFilter3addEdd)

; 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.uno::Range" = type { %"class.uno::Collection", i64, i64 }
%"class.uno::Collection" = type { ptr }
%"class.uno::Collection<unsigned long>::iterator" = type { ptr, i64 }
%"class.uno::Filter" = type { ptr, i64, %"class.std::vector", %"class.std::vector", double, i64, %"struct.uno::FilterParameters" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.uno::FilterParameters" = type { double, double }
%"class.uno::NonmonotoneFilter" = type { %"class.uno::Filter", i64 }

; 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 uwtable
define dso_local void @_ZN3uno17NonmonotoneFilter3addEdd(ptr noundef nonnull align 8 dereferenceable(104) %0, double noundef %1, double noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.uno::Range", align 8
  %9 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %"class.uno::Range", align 8
  %18 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  %19 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  %20 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  store double %2, ptr %6, align 8, !tbaa !9
  %21 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #5
  %22 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %23 = load i64, ptr %22, align 8, !tbaa !11
  call void @_ZN3uno5RangeILNS_14RangeDirectionE0EEC2Em(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %23)
  store ptr %8, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %24)
          to label %26 unwind label %42

26:                                               ; preds = %3
  %27 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 0
  %28 = extractvalue { ptr, i64 } %25, 0
  store ptr %28, ptr %27, align 8
  %29 = getelementptr inbounds { ptr, i64 }, ptr %9, i32 0, i32 1
  %30 = extractvalue { ptr, i64 } %25, 1
  store i64 %30, ptr %29, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %33 unwind label %46

33:                                               ; preds = %26
  %34 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 0
  %35 = extractvalue { ptr, i64 } %32, 0
  store ptr %35, ptr %34, align 8
  %36 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 1
  %37 = extractvalue { ptr, i64 } %32, 1
  store i64 %37, ptr %36, align 8
  br label %38

38:                                               ; preds = %159, %33
  %39 = invoke noundef zeroext i1 @_ZN3unoneERKNS_10CollectionImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %40 unwind label %46

40:                                               ; preds = %38
  br i1 %39, label %50, label %41

41:                                               ; preds = %40
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %164

42:                                               ; preds = %3
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  br label %163

46:                                               ; preds = %157, %38, %26
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  br label %162

50:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %51 = invoke noundef i64 @_ZNK3uno10CollectionImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %52 unwind label %67

52:                                               ; preds = %50
  store i64 %51, ptr %14, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !19
  %53 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 3
  %54 = load i64, ptr %14, align 8, !tbaa !19
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %54) #5
  %56 = load double, ptr %55, align 8, !tbaa !9
  %57 = load double, ptr %6, align 8, !tbaa !9
  %58 = fcmp ogt double %56, %57
  br i1 %58, label %59, label %71

59:                                               ; preds = %52
  %60 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 2
  %61 = load i64, ptr %14, align 8, !tbaa !19
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %61) #5
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = load double, ptr %5, align 8, !tbaa !9
  %65 = fcmp ogt double %63, %64
  br i1 %65, label %66, label %71

66:                                               ; preds = %59
  store i64 1, ptr %15, align 8, !tbaa !19
  br label %71

67:                                               ; preds = %50
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %10, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %11, align 4
  br label %161

71:                                               ; preds = %66, %59, %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #5
  %72 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %73 = load i64, ptr %72, align 8, !tbaa !11
  invoke void @_ZN3uno5RangeILNS_14RangeDirectionE0EEC2Em(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %73)
          to label %74 unwind label %93

74:                                               ; preds = %71
  store ptr %17, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %75)
          to label %77 unwind label %97

77:                                               ; preds = %74
  %78 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 0
  %79 = extractvalue { ptr, i64 } %76, 0
  store ptr %79, ptr %78, align 8
  %80 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 1
  %81 = extractvalue { ptr, i64 } %76, 1
  store i64 %81, ptr %80, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  %82 = load ptr, ptr %16, align 8, !tbaa !5
  %83 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %82)
          to label %84 unwind label %101

84:                                               ; preds = %77
  %85 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 0
  %86 = extractvalue { ptr, i64 } %83, 0
  store ptr %86, ptr %85, align 8
  %87 = getelementptr inbounds { ptr, i64 }, ptr %19, i32 0, i32 1
  %88 = extractvalue { ptr, i64 } %83, 1
  store i64 %88, ptr %87, align 8
  br label %89

89:                                               ; preds = %137, %84
  %90 = invoke noundef zeroext i1 @_ZN3unoneERKNS_10CollectionImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16) %18, ptr noundef nonnull align 8 dereferenceable(16) %19)
          to label %91 unwind label %101

91:                                               ; preds = %89
  br i1 %90, label %105, label %92

92:                                               ; preds = %91
  store i32 4, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %141

93:                                               ; preds = %71
  %94 = landingpad { ptr, i32 }
          cleanup
  %95 = extractvalue { ptr, i32 } %94, 0
  store ptr %95, ptr %10, align 8
  %96 = extractvalue { ptr, i32 } %94, 1
  store i32 %96, ptr %11, align 4
  br label %140

97:                                               ; preds = %74
  %98 = landingpad { ptr, i32 }
          cleanup
  %99 = extractvalue { ptr, i32 } %98, 0
  store ptr %99, ptr %10, align 8
  %100 = extractvalue { ptr, i32 } %98, 1
  store i32 %100, ptr %11, align 4
  br label %139

101:                                              ; preds = %135, %89, %77
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %10, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %11, align 4
  br label %138

105:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %106 = invoke noundef i64 @_ZNK3uno10CollectionImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %107 unwind label %130

107:                                              ; preds = %105
  store i64 %106, ptr %20, align 8, !tbaa !19
  %108 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 3
  %109 = load i64, ptr %14, align 8, !tbaa !19
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %109) #5
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 3
  %113 = load i64, ptr %20, align 8, !tbaa !19
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %112, i64 noundef %113) #5
  %115 = load double, ptr %114, align 8, !tbaa !9
  %116 = fcmp ogt double %111, %115
  br i1 %116, label %117, label %134

117:                                              ; preds = %107
  %118 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 2
  %119 = load i64, ptr %14, align 8, !tbaa !19
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %118, i64 noundef %119) #5
  %121 = load double, ptr %120, align 8, !tbaa !9
  %122 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 2
  %123 = load i64, ptr %20, align 8, !tbaa !19
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %122, i64 noundef %123) #5
  %125 = load double, ptr %124, align 8, !tbaa !9
  %126 = fcmp ogt double %121, %125
  br i1 %126, label %127, label %134

127:                                              ; preds = %117
  %128 = load i64, ptr %15, align 8, !tbaa !19
  %129 = add i64 %128, 1
  store i64 %129, ptr %15, align 8, !tbaa !19
  br label %134

130:                                              ; preds = %105
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %10, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %138

134:                                              ; preds = %127, %117, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %135

135:                                              ; preds = %134
  %136 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno10CollectionImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %18)
          to label %137 unwind label %101

137:                                              ; preds = %135
  br label %89

138:                                              ; preds = %130, %101
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %139

139:                                              ; preds = %138, %97
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #5
  br label %140

140:                                              ; preds = %139, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %160

141:                                              ; preds = %92
  %142 = load i64, ptr %15, align 8, !tbaa !19
  %143 = getelementptr inbounds %"class.uno::NonmonotoneFilter", ptr %21, i32 0, i32 1
  %144 = load i64, ptr %143, align 8, !tbaa !20
  %145 = icmp ugt i64 %142, %144
  br i1 %145, label %146, label %156

146:                                              ; preds = %141
  %147 = load i64, ptr %14, align 8, !tbaa !19
  invoke void @_ZN3uno6Filter10left_shiftEmm(ptr noundef nonnull align 8 dereferenceable(96) %21, i64 noundef %147, i64 noundef 1)
          to label %148 unwind label %152

148:                                              ; preds = %146
  %149 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %150 = load i64, ptr %149, align 8, !tbaa !11
  %151 = add i64 %150, -1
  store i64 %151, ptr %149, align 8, !tbaa !11
  br label %156

152:                                              ; preds = %146
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %10, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %11, align 4
  br label %160

156:                                              ; preds = %148, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %157

157:                                              ; preds = %156
  %158 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno10CollectionImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %159 unwind label %46

159:                                              ; preds = %157
  br label %38

160:                                              ; preds = %152, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %161

161:                                              ; preds = %160, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %162

162:                                              ; preds = %161, %46
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %163

163:                                              ; preds = %162, %42
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %188

164:                                              ; preds = %41
  %165 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %166 = load i64, ptr %165, align 8, !tbaa !11
  %167 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 1
  %168 = load i64, ptr %167, align 8, !tbaa !22
  %169 = icmp uge i64 %166, %168
  br i1 %169, label %170, label %174

170:                                              ; preds = %164
  call void @_ZN3uno6Filter10left_shiftEmm(ptr noundef nonnull align 8 dereferenceable(96) %21, i64 noundef 1, i64 noundef 1)
  %171 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %172 = load i64, ptr %171, align 8, !tbaa !11
  %173 = add i64 %172, -1
  store i64 %173, ptr %171, align 8, !tbaa !11
  br label %174

174:                                              ; preds = %170, %164
  %175 = load double, ptr %5, align 8, !tbaa !9
  %176 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 2
  %177 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %178 = load i64, ptr %177, align 8, !tbaa !11
  %179 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %176, i64 noundef %178) #5
  store double %175, ptr %179, align 8, !tbaa !9
  %180 = load double, ptr %6, align 8, !tbaa !9
  %181 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 3
  %182 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %183 = load i64, ptr %182, align 8, !tbaa !11
  %184 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %181, i64 noundef %183) #5
  store double %180, ptr %184, align 8, !tbaa !9
  %185 = getelementptr inbounds %"class.uno::Filter", ptr %21, i32 0, i32 5
  %186 = load i64, ptr %185, align 8, !tbaa !11
  %187 = add i64 %186, 1
  store i64 %187, ptr %185, align 8, !tbaa !11
  ret void

188:                                              ; preds = %163
  %189 = load ptr, ptr %10, align 8
  %190 = load i32, ptr %11, align 4
  %191 = insertvalue { ptr, i32 } poison, ptr %189, 0
  %192 = insertvalue { ptr, i32 } %191, i32 %190, 1
  resume { ptr, i32 } %192
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno10CollectionImE5beginEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno10CollectionImE3endEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

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

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

declare void @_ZN3uno6Filter10left_shiftEmm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef, i64 noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 = { "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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !13, i64 72}
!12 = !{!"_ZTSN3uno6FilterE", !13, i64 8, !14, i64 16, !14, i64 40, !10, i64 64, !13, i64 72, !18, i64 80}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTSSt6vectorIdSaIdEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSN3uno16FilterParametersE", !10, i64 0, !10, i64 8}
!19 = !{!13, !13, i64 0}
!20 = !{!21, !13, i64 96}
!21 = !{!"_ZTSN3uno17NonmonotoneFilterE", !12, i64 0, !13, i64 96}
!22 = !{!12, !13, i64 8}


; 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.uno::Range" = type { %"class.uno::Collection", i64, i64 }
%"class.uno::Collection" = type { ptr }
%"class.uno::Collection<unsigned long>::iterator" = type { ptr, i64 }

; 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 uwtable
define dso_local void @_ZN3uno17NonmonotoneFilter3addEdd(ptr noundef nonnull align 8 dereferenceable(104) %0, double noundef %1, double noundef %2) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.uno::Range", align 8
  %5 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  %6 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  %7 = alloca %"class.uno::Range", align 8
  %8 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  %9 = alloca %"class.uno::Collection<unsigned long>::iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %10 = getelementptr inbounds i8, ptr %0, i64 72
  %11 = load i64, ptr %10, align 8, !tbaa !5
  call void @_ZN3uno5RangeILNS_14RangeDirectionE0EEC2Em(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %11)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %12 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %13 unwind label %33

13:                                               ; preds = %3
  %14 = extractvalue { ptr, i64 } %12, 0
  store ptr %14, ptr %5, align 8
  %15 = getelementptr inbounds i8, ptr %5, i64 8
  %16 = extractvalue { ptr, i64 } %12, 1
  store i64 %16, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %17 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %18 unwind label %.loopexit.split-lp37

18:                                               ; preds = %13
  %19 = extractvalue { ptr, i64 } %17, 0
  store ptr %19, ptr %6, align 8
  %20 = getelementptr inbounds i8, ptr %6, i64 8
  %21 = extractvalue { ptr, i64 } %17, 1
  store i64 %21, ptr %20, align 8
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = getelementptr inbounds i8, ptr %8, i64 8
  %25 = getelementptr inbounds i8, ptr %9, i64 8
  %26 = getelementptr inbounds i8, ptr %0, i64 96
  br label %27

27:                                               ; preds = %96, %18
  %28 = call noundef zeroext i1 @_ZN3unoneERKNS_10CollectionImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  br i1 %28, label %35, label %29

29:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  %30 = load i64, ptr %10, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  %32 = load i64, ptr %31, align 8, !tbaa !17
  %.not = icmp ult i64 %30, %32
  br i1 %.not, label %103, label %100

33:                                               ; preds = %3
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %99

.loopexit36:                                      ; preds = %96
  %lpad.loopexit38 = landingpad { ptr, i32 }
          cleanup
  br label %98

.loopexit.split-lp37:                             ; preds = %13
  %lpad.loopexit.split-lp39 = landingpad { ptr, i32 }
          cleanup
  br label %98

35:                                               ; preds = %27
  %36 = invoke noundef i64 @_ZNK3uno10CollectionImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %37 unwind label %46

37:                                               ; preds = %35
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %36) #5
  %39 = load double, ptr %38, align 8, !tbaa !18
  %40 = fcmp ogt double %39, %2
  br i1 %40, label %41, label %48

41:                                               ; preds = %37
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %36) #5
  %43 = load double, ptr %42, align 8, !tbaa !18
  %44 = fcmp ogt double %43, %1
  br i1 %44, label %45, label %48

45:                                               ; preds = %41
  br label %48

46:                                               ; preds = %35
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %98

48:                                               ; preds = %45, %41, %37
  %.026 = phi i64 [ 1, %45 ], [ 0, %41 ], [ 0, %37 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %49 = load i64, ptr %10, align 8, !tbaa !5
  invoke void @_ZN3uno5RangeILNS_14RangeDirectionE0EEC2Em(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %49)
          to label %50 unwind label %64

50:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %51 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE5beginEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %52 unwind label %66

52:                                               ; preds = %50
  %53 = extractvalue { ptr, i64 } %51, 0
  store ptr %53, ptr %8, align 8
  %54 = extractvalue { ptr, i64 } %51, 1
  store i64 %54, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  %55 = invoke { ptr, i64 } @_ZNK3uno10CollectionImE3endEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %56 unwind label %.loopexit.split-lp

56:                                               ; preds = %52
  %57 = extractvalue { ptr, i64 } %55, 0
  store ptr %57, ptr %9, align 8
  %58 = extractvalue { ptr, i64 } %55, 1
  store i64 %58, ptr %25, align 8
  br label %59

59:                                               ; preds = %86, %56
  %.127 = phi i64 [ %.026, %56 ], [ %.228, %86 ]
  %60 = call noundef zeroext i1 @_ZN3unoneERKNS_10CollectionImE8iteratorES4_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  br i1 %60, label %68, label %61

61:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %62 = load i64, ptr %26, align 8, !tbaa !19
  %63 = icmp ugt i64 %.127, %62
  br i1 %63, label %90, label %96

64:                                               ; preds = %48
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %98

66:                                               ; preds = %50
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %89

.loopexit:                                        ; preds = %86
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %88

.loopexit.split-lp:                               ; preds = %52
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %88

68:                                               ; preds = %59
  %69 = invoke noundef i64 @_ZNK3uno10CollectionImE8iteratordeEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %70 unwind label %84

70:                                               ; preds = %68
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %36) #5
  %72 = load double, ptr %71, align 8, !tbaa !18
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %69) #5
  %74 = load double, ptr %73, align 8, !tbaa !18
  %75 = fcmp ogt double %72, %74
  br i1 %75, label %76, label %86

76:                                               ; preds = %70
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %36) #5
  %78 = load double, ptr %77, align 8, !tbaa !18
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %69) #5
  %80 = load double, ptr %79, align 8, !tbaa !18
  %81 = fcmp ogt double %78, %80
  br i1 %81, label %82, label %86

82:                                               ; preds = %76
  %83 = add i64 %.127, 1
  br label %86

84:                                               ; preds = %68
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %88

86:                                               ; preds = %82, %76, %70
  %.228 = phi i64 [ %83, %82 ], [ %.127, %76 ], [ %.127, %70 ]
  %87 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno10CollectionImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %59 unwind label %.loopexit

88:                                               ; preds = %.loopexit, %.loopexit.split-lp, %84
  %.pn = phi { ptr, i32 } [ %85, %84 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  br label %89

89:                                               ; preds = %88, %66
  %.pn.pn = phi { ptr, i32 } [ %.pn, %88 ], [ %67, %66 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %98

90:                                               ; preds = %61
  invoke void @_ZN3uno6Filter10left_shiftEmm(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 noundef %36, i64 noundef 1)
          to label %91 unwind label %94

91:                                               ; preds = %90
  %92 = load i64, ptr %10, align 8, !tbaa !5
  %93 = add i64 %92, -1
  store i64 %93, ptr %10, align 8, !tbaa !5
  br label %96

94:                                               ; preds = %90
  %95 = landingpad { ptr, i32 }
          cleanup
  br label %98

96:                                               ; preds = %91, %61
  %97 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN3uno10CollectionImE8iteratorppEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %27 unwind label %.loopexit36

98:                                               ; preds = %.loopexit36, %.loopexit.split-lp37, %46, %64, %89, %94
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %47, %46 ], [ %95, %94 ], [ %.pn.pn, %89 ], [ %65, %64 ], [ %lpad.loopexit38, %.loopexit36 ], [ %lpad.loopexit.split-lp39, %.loopexit.split-lp37 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  br label %99

99:                                               ; preds = %98, %33
  %.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn.pn, %98 ], [ %34, %33 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @_ZN3uno10CollectionImED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn.pn

100:                                              ; preds = %29
  call void @_ZN3uno6Filter10left_shiftEmm(ptr noundef nonnull align 8 dereferenceable(96) %0, i64 noundef 1, i64 noundef 1)
  %101 = load i64, ptr %10, align 8, !tbaa !5
  %102 = add i64 %101, -1
  store i64 %102, ptr %10, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %100, %29
  %104 = phi i64 [ %102, %100 ], [ %30, %29 ]
  %105 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %104) #5
  store double %1, ptr %105, align 8, !tbaa !18
  %106 = load i64, ptr %10, align 8, !tbaa !5
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %106) #5
  store double %2, ptr %107, align 8, !tbaa !18
  %108 = load i64, ptr %10, align 8, !tbaa !5
  %109 = add i64 %108, 1
  store i64 %109, ptr %10, align 8, !tbaa !5
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno10CollectionImE5beginEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNK3uno10CollectionImE3endEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

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

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

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

declare void @_ZN3uno6Filter10left_shiftEmm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef, i64 noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 = { "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, !7, i64 72}
!6 = !{!"_ZTSN3uno6FilterE", !7, i64 8, !10, i64 16, !10, i64 40, !15, i64 64, !7, i64 72, !16, i64 80}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIdSaIdEE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTSN3uno16FilterParametersE", !15, i64 0, !15, i64 8}
!17 = !{!6, !7, i64 8}
!18 = !{!15, !15, i64 0}
!19 = !{!20, !7, i64 96}
!20 = !{!"_ZTSN3uno17NonmonotoneFilterE", !6, i64 0, !7, i64 96}


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