; LLVM IR from CMU-CBML/NeuronTransportIGA :: spline_src/BSplineBasis.ll (ZN12BSplineBasis5CheckEiRKSt6vectorIdSaIdEE)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.BSplineBasis = type { i32, i32, %"class.std::vector" }
%"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 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN12BSplineBasis5CheckEiRKSt6vectorIdSaIdEE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %16 = load ptr, ptr %5, align 8
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = icmp slt i32 %17, 0
  br i1 %18, label %19, label %21

19:                                               ; preds = %3
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
  store i1 false, ptr %4, align 1
  br label %203

21:                                               ; preds = %3
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %24 = getelementptr inbounds %class.BSplineBasis, ptr %16, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = add nsw i32 %25, 1
  %27 = sext i32 %26 to i64
  %28 = icmp ule i64 %23, %27
  br i1 %28, label %29, label %31

29:                                               ; preds = %21
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.1)
  store i1 false, ptr %4, align 1
  br label %203

31:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %55, %31
  %33 = load i32, ptr %9, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #5
  %37 = sub i64 %36, 1
  %38 = icmp ult i64 %34, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %32
  store i32 2, ptr %10, align 4
  br label %58

40:                                               ; preds = %32
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = zext i32 %42 to i64
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %43) #5
  %45 = load double, ptr %44, align 8, !tbaa !17
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i32, ptr %9, align 4, !tbaa !9
  %48 = add i32 %47, 1
  %49 = zext i32 %48 to i64
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %49) #5
  %51 = load double, ptr %50, align 8, !tbaa !17
  %52 = fcmp ogt double %45, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %40
  store i32 1, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %10, align 4
  br label %58

54:                                               ; preds = %40
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = add i32 %56, 1
  store i32 %57, ptr %9, align 4, !tbaa !9
  br label %32, !llvm.loop !19

58:                                               ; preds = %53, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %8, align 4, !tbaa !9
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.2)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %199

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %65

65:                                               ; preds = %86, %64
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = zext i32 %66 to i64
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %68) #5
  %70 = icmp ult i64 %67, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %65
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %89

72:                                               ; preds = %65
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %75) #5
  %77 = load double, ptr %76, align 8, !tbaa !17
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef 0) #5
  %80 = load double, ptr %79, align 8, !tbaa !17
  %81 = fcmp oeq double %77, %80
  br i1 %81, label %82, label %85

82:                                               ; preds = %72
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %11, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %82, %72
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = add i32 %87, 1
  store i32 %88, ptr %12, align 4, !tbaa !9
  br label %65, !llvm.loop !21

89:                                               ; preds = %71
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = getelementptr inbounds %class.BSplineBasis, ptr %16, i32 0, i32 0
  %92 = load i32, ptr %91, align 8, !tbaa !11
  %93 = add nsw i32 %92, 1
  %94 = icmp sgt i32 %90, %93
  br i1 %94, label %95, label %101

95:                                               ; preds = %89
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.3)
  %97 = getelementptr inbounds %class.BSplineBasis, ptr %16, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !11
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %96, i32 noundef %98)
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %99, ptr noundef @.str.4)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %195

101:                                              ; preds = %89
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %102) #5
  %104 = sub i64 %103, 1
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr %13, align 4, !tbaa !9
  br label %106

106:                                              ; preds = %124, %101
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = icmp sge i32 %107, 0
  br i1 %108, label %110, label %109

109:                                              ; preds = %106
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %127

110:                                              ; preds = %106
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = load i32, ptr %13, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %111, i64 noundef %113) #5
  %115 = load double, ptr %114, align 8, !tbaa !17
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %116) #5
  %118 = load double, ptr %117, align 8, !tbaa !17
  %119 = fcmp oeq double %115, %118
  br i1 %119, label %120, label %123

120:                                              ; preds = %110
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %11, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %120, %110
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %13, align 4, !tbaa !9
  br label %106, !llvm.loop !22

127:                                              ; preds = %109
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = getelementptr inbounds %class.BSplineBasis, ptr %16, i32 0, i32 0
  %130 = load i32, ptr %129, align 8, !tbaa !11
  %131 = add nsw i32 %130, 1
  %132 = icmp sgt i32 %128, %131
  br i1 %132, label %133, label %139

133:                                              ; preds = %127
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.5)
  %135 = getelementptr inbounds %class.BSplineBasis, ptr %16, i32 0, i32 0
  %136 = load i32, ptr %135, align 8, !tbaa !11
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %134, i32 noundef %136)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef @.str.4)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %195

139:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %140

140:                                              ; preds = %189, %139
  %141 = load i32, ptr %14, align 4, !tbaa !9
  %142 = zext i32 %141 to i64
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %143) #5
  %145 = sub i64 %144, 1
  %146 = icmp ult i64 %142, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %140
  store i32 11, ptr %10, align 4
  br label %192

148:                                              ; preds = %140
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %149 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %149, ptr %15, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %174, %148
  %151 = load i32, ptr %15, align 4, !tbaa !9
  %152 = zext i32 %151 to i64
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %153) #5
  %155 = sub i64 %154, 1
  %156 = icmp ult i64 %152, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %150
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %177

158:                                              ; preds = %150
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = load i32, ptr %15, align 4, !tbaa !9
  %161 = zext i32 %160 to i64
  %162 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %159, i64 noundef %161) #5
  %163 = load double, ptr %162, align 8, !tbaa !17
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = load i32, ptr %14, align 4, !tbaa !9
  %166 = zext i32 %165 to i64
  %167 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %164, i64 noundef %166) #5
  %168 = load double, ptr %167, align 8, !tbaa !17
  %169 = fcmp oeq double %163, %168
  br i1 %169, label %170, label %173

170:                                              ; preds = %158
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %11, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %170, %158
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %15, align 4, !tbaa !9
  %176 = add i32 %175, 1
  store i32 %176, ptr %15, align 4, !tbaa !9
  br label %150, !llvm.loop !23

177:                                              ; preds = %157
  %178 = load i32, ptr %11, align 4, !tbaa !9
  %179 = getelementptr inbounds %class.BSplineBasis, ptr %16, i32 0, i32 0
  %180 = load i32, ptr %179, align 8, !tbaa !11
  %181 = icmp sgt i32 %178, %180
  br i1 %181, label %182, label %188

182:                                              ; preds = %177
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.6)
  %184 = getelementptr inbounds %class.BSplineBasis, ptr %16, i32 0, i32 0
  %185 = load i32, ptr %184, align 8, !tbaa !11
  %186 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %183, i32 noundef %185)
  %187 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %186, ptr noundef @.str.7)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %192

188:                                              ; preds = %177
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %14, align 4, !tbaa !9
  %191 = add i32 %190, 1
  store i32 %191, ptr %14, align 4, !tbaa !9
  br label %140, !llvm.loop !24

192:                                              ; preds = %182, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  %193 = load i32, ptr %10, align 4
  switch i32 %193, label %195 [
    i32 11, label %194
  ]

194:                                              ; preds = %192
  store i32 0, ptr %10, align 4
  br label %195

195:                                              ; preds = %194, %192, %133, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %196 = load i32, ptr %10, align 4
  switch i32 %196, label %199 [
    i32 0, label %197
  ]

197:                                              ; preds = %195
  br label %198

198:                                              ; preds = %197
  store i32 0, ptr %10, align 4
  br label %199

199:                                              ; preds = %198, %195, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %200 = load i32, ptr %10, align 4
  switch i32 %200, label %205 [
    i32 0, label %201
    i32 1, label %203
  ]

201:                                              ; preds = %199
  br label %202

202:                                              ; preds = %201
  store i1 true, ptr %4, align 1
  br label %203

203:                                              ; preds = %202, %199, %29, %19
  %204 = load i1, ptr %4, align 1
  ret i1 %204

205:                                              ; preds = %199
  unreachable
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

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

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


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN12BSplineBasis5CheckEiRKSt6vectorIdSaIdEE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(32) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2) local_unnamed_addr #0 align 2 {
  %4 = icmp slt i32 %1, 0
  br i1 %4, label %5, label %7

5:                                                ; preds = %3
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
  br label %.loopexit

7:                                                ; preds = %3
  %8 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %9 = load i32, ptr %0, align 8, !tbaa !5
  %10 = add nsw i32 %9, 1
  %11 = sext i32 %10 to i64
  %.not = icmp ugt i64 %8, %11
  br i1 %.not, label %.preheader64, label %12

12:                                               ; preds = %7
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.1)
  br label %.loopexit

.preheader64:                                     ; preds = %7, %19
  %.052 = phi i32 [ %22, %19 ], [ 0, %7 ]
  %14 = zext i32 %.052 to i64
  %15 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %16 = add i64 %15, -1
  %17 = icmp ugt i64 %16, %14
  br i1 %17, label %19, label %.critedge.preheader

.critedge.preheader:                              ; preds = %.preheader64
  %18 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not79 = icmp eq i64 %18, 0
  br i1 %.not79, label %.critedge._crit_edge, label %.critedge

19:                                               ; preds = %.preheader64
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %14) #4
  %21 = load double, ptr %20, align 8, !tbaa !15
  %22 = add i32 %.052, 1
  %23 = zext i32 %22 to i64
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %23) #4
  %25 = load double, ptr %24, align 8, !tbaa !15
  %26 = fcmp ogt double %21, %25
  br i1 %26, label %27, label %.preheader64, !llvm.loop !17

27:                                               ; preds = %19
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.2)
  br label %.loopexit

.critedge._crit_edge:                             ; preds = %.critedge, %.critedge.preheader
  %.048.lcssa = phi i32 [ 0, %.critedge.preheader ], [ %.1, %.critedge ]
  %29 = load i32, ptr %0, align 8, !tbaa !5
  %30 = add nsw i32 %29, 1
  %31 = icmp sgt i32 %.048.lcssa, %30
  br i1 %31, label %43, label %48

.critedge:                                        ; preds = %.critedge.preheader, %.critedge
  %32 = phi i64 [ %40, %.critedge ], [ 0, %.critedge.preheader ]
  %.04766 = phi i32 [ %39, %.critedge ], [ 0, %.critedge.preheader ]
  %.04865 = phi i32 [ %.1, %.critedge ], [ 0, %.critedge.preheader ]
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %32) #4
  %34 = load double, ptr %33, align 8, !tbaa !15
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef 0) #4
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = fcmp oeq double %34, %36
  %38 = zext i1 %37 to i32
  %.1 = add nuw nsw i32 %.04865, %38
  %39 = add i32 %.04766, 1
  %40 = zext i32 %39 to i64
  %41 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %42 = icmp ugt i64 %41, %40
  br i1 %42, label %.critedge, label %.critedge._crit_edge, !llvm.loop !19

43:                                               ; preds = %.critedge._crit_edge
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.3)
  %45 = load i32, ptr %0, align 8, !tbaa !5
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %44, i32 noundef %45)
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @.str.4)
  br label %.loopexit

48:                                               ; preds = %.critedge._crit_edge
  %49 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %50 = trunc i64 %49 to i32
  %.04667 = add i32 %50, -1
  %51 = icmp sgt i32 %.04667, -1
  br i1 %51, label %.lr.ph70.preheader, label %._crit_edge

.lr.ph70.preheader:                               ; preds = %48
  %52 = zext nneg i32 %.04667 to i64
  br label %.lr.ph70

._crit_edge:                                      ; preds = %.lr.ph70, %48
  %.2.lcssa = phi i32 [ 0, %48 ], [ %.3, %.lr.ph70 ]
  %53 = load i32, ptr %0, align 8, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = icmp sgt i32 %.2.lcssa, %54
  br i1 %55, label %64, label %.preheader63

.preheader63:                                     ; preds = %._crit_edge
  %56 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %57 = add i64 %56, -3
  %.not6277 = icmp ult i64 %57, -2
  br i1 %.not6277, label %.preheader, label %.loopexit

.lr.ph70:                                         ; preds = %.lr.ph70.preheader, %.lr.ph70
  %indvars.iv = phi i64 [ %52, %.lr.ph70.preheader ], [ %indvars.iv.next, %.lr.ph70 ]
  %.268 = phi i32 [ 0, %.lr.ph70.preheader ], [ %.3, %.lr.ph70 ]
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #4
  %59 = load double, ptr %58, align 8, !tbaa !15
  %60 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %61 = load double, ptr %60, align 8, !tbaa !15
  %62 = fcmp oeq double %59, %61
  %63 = zext i1 %62 to i32
  %.3 = add nuw nsw i32 %.268, %63
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not82 = icmp eq i64 %indvars.iv, 0
  br i1 %.not82, label %._crit_edge, label %.lr.ph70, !llvm.loop !20

64:                                               ; preds = %._crit_edge
  %65 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.5)
  %66 = load i32, ptr %0, align 8, !tbaa !5
  %67 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %65, i32 noundef %66)
  %68 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull @.str.4)
  br label %.loopexit

69:                                               ; preds = %._crit_edge75
  %70 = add i32 %.04578, 1
  %71 = zext i32 %70 to i64
  %72 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %73 = add i64 %72, -1
  %.not62 = icmp ugt i64 %73, %71
  br i1 %.not62, label %.preheader, label %.loopexit, !llvm.loop !21

.preheader:                                       ; preds = %.preheader63, %69
  %74 = phi i64 [ %71, %69 ], [ 1, %.preheader63 ]
  %.04578 = phi i32 [ %70, %69 ], [ 1, %.preheader63 ]
  %75 = zext i32 %.04578 to i64
  %76 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %77 = add i64 %76, -1
  %78 = icmp ugt i64 %77, %75
  br i1 %78, label %.lr.ph74, label %._crit_edge75

._crit_edge75:                                    ; preds = %.lr.ph74, %.preheader
  %.4.lcssa = phi i32 [ 0, %.preheader ], [ %.5, %.lr.ph74 ]
  %79 = load i32, ptr %0, align 8, !tbaa !5
  %80 = icmp sgt i32 %.4.lcssa, %79
  br i1 %80, label %93, label %69

.lr.ph74:                                         ; preds = %.preheader, %.lr.ph74
  %81 = phi i64 [ %89, %.lr.ph74 ], [ %75, %.preheader ]
  %.073 = phi i32 [ %88, %.lr.ph74 ], [ %.04578, %.preheader ]
  %.472 = phi i32 [ %.5, %.lr.ph74 ], [ 0, %.preheader ]
  %82 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %81) #4
  %83 = load double, ptr %82, align 8, !tbaa !15
  %84 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %74) #4
  %85 = load double, ptr %84, align 8, !tbaa !15
  %86 = fcmp oeq double %83, %85
  %87 = zext i1 %86 to i32
  %.5 = add nuw nsw i32 %.472, %87
  %88 = add i32 %.073, 1
  %89 = zext i32 %88 to i64
  %90 = tail call noundef i64 @_ZNKSt6vectorIdSaIdEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %91 = add i64 %90, -1
  %92 = icmp ugt i64 %91, %89
  br i1 %92, label %.lr.ph74, label %._crit_edge75, !llvm.loop !22

93:                                               ; preds = %._crit_edge75
  %94 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.6)
  %95 = load i32, ptr %0, align 8, !tbaa !5
  %96 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %94, i32 noundef %95)
  %97 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef nonnull @.str.7)
  br label %.loopexit

.loopexit:                                        ; preds = %69, %.preheader63, %27, %93, %64, %43, %12, %5
  %.357 = phi i1 [ false, %5 ], [ false, %12 ], [ false, %27 ], [ false, %43 ], [ false, %64 ], [ false, %93 ], [ true, %.preheader63 ], [ true, %69 ]
  ret i1 %.357
}

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

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

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt6vectorIdSaIdEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS12BSplineBasis", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !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 = !{!16, !16, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


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