; LLVM IR from ERGO-Code/HiGHS :: src/interfaces (highs_c_api)

; 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"

%struct.HighsBasis = type { i8, i8, i8, i8, i32, i32, %"class.std::__cxx11::basic_string", %"class.std::vector.3", %"class.std::vector.3" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl" }
%"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl" = type { %"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str.9 = external hidden unnamed_addr constant [1 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: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @Highs_getNumCol(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local i32 @Highs_setBasis(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %struct.HighsBasis, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %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
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %8) #6
  call void @_ZN10HighsBasisC2Ev(ptr noundef nonnull align 8 dereferenceable(96) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = invoke i32 @Highs_getNumCol(ptr noundef %18)
          to label %20 unwind label %33

20:                                               ; preds = %3
  store i32 %19, ptr %9, align 4, !tbaa !9
  %21 = load i32, ptr %9, align 4, !tbaa !9
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %23, label %109

23:                                               ; preds = %20
  %24 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 7
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  invoke void @_ZNSt6vectorI16HighsBasisStatusSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %26)
          to label %27 unwind label %33

27:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %103, %27
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %37, label %32

32:                                               ; preds = %28
  store i32 2, ptr %13, align 4
  br label %106

33:                                               ; preds = %23, %3
  %34 = landingpad { ptr, i32 }
          cleanup
  %35 = extractvalue { ptr, i32 } %34, 0
  store ptr %35, ptr %10, align 8
  %36 = extractvalue { ptr, i32 } %34, 1
  store i32 %36, ptr %11, align 4
  br label %219

37:                                               ; preds = %28
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i32, ptr %38, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %49

44:                                               ; preds = %37
  %45 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 7
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %47) #6
  store i8 0, ptr %48, align 1, !tbaa !11
  br label %102

49:                                               ; preds = %37
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load i32, ptr %12, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %50, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %61

56:                                               ; preds = %49
  %57 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 7
  %58 = load i32, ptr %12, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %59) #6
  store i8 1, ptr %60, align 1, !tbaa !11
  br label %101

61:                                               ; preds = %49
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr %62, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = icmp eq i32 %66, 2
  br i1 %67, label %68, label %73

68:                                               ; preds = %61
  %69 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 7
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %71) #6
  store i8 2, ptr %72, align 1, !tbaa !11
  br label %100

73:                                               ; preds = %61
  %74 = load ptr, ptr %6, align 8, !tbaa !5
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %74, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !9
  %79 = icmp eq i32 %78, 3
  br i1 %79, label %80, label %85

80:                                               ; preds = %73
  %81 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 7
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %83) #6
  store i8 3, ptr %84, align 1, !tbaa !11
  br label %99

85:                                               ; preds = %73
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %86, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 4
  br i1 %91, label %92, label %97

92:                                               ; preds = %85
  %93 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 7
  %94 = load i32, ptr %12, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %95) #6
  store i8 4, ptr %96, align 1, !tbaa !11
  br label %98

97:                                               ; preds = %85
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %106

98:                                               ; preds = %92
  br label %99

99:                                               ; preds = %98, %80
  br label %100

100:                                              ; preds = %99, %68
  br label %101

101:                                              ; preds = %100, %56
  br label %102

102:                                              ; preds = %101, %44
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !9
  br label %28, !llvm.loop !13

106:                                              ; preds = %97, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %107 = load i32, ptr %13, align 4
  switch i32 %107, label %217 [
    i32 2, label %108
  ]

108:                                              ; preds = %106
  br label %109

109:                                              ; preds = %108, %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = invoke i32 @Highs_getNumRow(ptr noundef %110)
          to label %112 unwind label %125

112:                                              ; preds = %109
  store i32 %111, ptr %14, align 4, !tbaa !9
  %113 = load i32, ptr %14, align 4, !tbaa !9
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %115, label %201

115:                                              ; preds = %112
  %116 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 8
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  invoke void @_ZNSt6vectorI16HighsBasisStatusSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %116, i64 noundef %118)
          to label %119 unwind label %125

119:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %195, %119
  %121 = load i32, ptr %15, align 4, !tbaa !9
  %122 = load i32, ptr %14, align 4, !tbaa !9
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %129, label %124

124:                                              ; preds = %120
  store i32 5, ptr %13, align 4
  br label %198

125:                                              ; preds = %115, %109
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %10, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %11, align 4
  br label %216

129:                                              ; preds = %120
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = load i32, ptr %15, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %130, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !9
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %141

136:                                              ; preds = %129
  %137 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 8
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %137, i64 noundef %139) #6
  store i8 0, ptr %140, align 1, !tbaa !11
  br label %194

141:                                              ; preds = %129
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load i32, ptr %15, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds i32, ptr %142, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !9
  %147 = icmp eq i32 %146, 1
  br i1 %147, label %148, label %153

148:                                              ; preds = %141
  %149 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 8
  %150 = load i32, ptr %15, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %149, i64 noundef %151) #6
  store i8 1, ptr %152, align 1, !tbaa !11
  br label %193

153:                                              ; preds = %141
  %154 = load ptr, ptr %7, align 8, !tbaa !5
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i32, ptr %154, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !9
  %159 = icmp eq i32 %158, 2
  br i1 %159, label %160, label %165

160:                                              ; preds = %153
  %161 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 8
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %161, i64 noundef %163) #6
  store i8 2, ptr %164, align 1, !tbaa !11
  br label %192

165:                                              ; preds = %153
  %166 = load ptr, ptr %7, align 8, !tbaa !5
  %167 = load i32, ptr %15, align 4, !tbaa !9
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds i32, ptr %166, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !9
  %171 = icmp eq i32 %170, 3
  br i1 %171, label %172, label %177

172:                                              ; preds = %165
  %173 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 8
  %174 = load i32, ptr %15, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %173, i64 noundef %175) #6
  store i8 3, ptr %176, align 1, !tbaa !11
  br label %191

177:                                              ; preds = %165
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = load i32, ptr %15, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds i32, ptr %178, i64 %180
  %182 = load i32, ptr %181, align 4, !tbaa !9
  %183 = icmp eq i32 %182, 4
  br i1 %183, label %184, label %189

184:                                              ; preds = %177
  %185 = getelementptr inbounds %struct.HighsBasis, ptr %8, i32 0, i32 8
  %186 = load i32, ptr %15, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %185, i64 noundef %187) #6
  store i8 4, ptr %188, align 1, !tbaa !11
  br label %190

189:                                              ; preds = %177
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %198

190:                                              ; preds = %184
  br label %191

191:                                              ; preds = %190, %172
  br label %192

192:                                              ; preds = %191, %160
  br label %193

193:                                              ; preds = %192, %148
  br label %194

194:                                              ; preds = %193, %136
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %15, align 4, !tbaa !9
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %15, align 4, !tbaa !9
  br label %120, !llvm.loop !15

198:                                              ; preds = %189, %124
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %199 = load i32, ptr %13, align 4
  switch i32 %199, label %215 [
    i32 5, label %200
  ]

200:                                              ; preds = %198
  br label %201

201:                                              ; preds = %200, %112
  %202 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.9, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %203 unwind label %206

203:                                              ; preds = %201
  %204 = invoke noundef i32 @_ZN5Highs8setBasisERK10HighsBasisRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(20928) %202, ptr noundef nonnull align 8 dereferenceable(96) %8, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %205 unwind label %210

205:                                              ; preds = %203
  store i32 %204, ptr %4, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  store i32 1, ptr %13, align 4
  br label %215

206:                                              ; preds = %201
  %207 = landingpad { ptr, i32 }
          cleanup
  %208 = extractvalue { ptr, i32 } %207, 0
  store ptr %208, ptr %10, align 8
  %209 = extractvalue { ptr, i32 } %207, 1
  store i32 %209, ptr %11, align 4
  br label %214

210:                                              ; preds = %203
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %10, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #6
  br label %214

214:                                              ; preds = %210, %206
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #6
  br label %216

215:                                              ; preds = %205, %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %217

216:                                              ; preds = %214, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %219

217:                                              ; preds = %215, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZN10HighsBasisD2Ev(ptr noundef nonnull align 8 dereferenceable(96) %8) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %8) #6
  %218 = load i32, ptr %4, align 4
  ret i32 %218

219:                                              ; preds = %216, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZN10HighsBasisD2Ev(ptr noundef nonnull align 8 dereferenceable(96) %8) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %8) #6
  br label %220

220:                                              ; preds = %219
  %221 = load ptr, ptr %10, align 8
  %222 = load i32, ptr %11, align 4
  %223 = insertvalue { ptr, i32 } poison, ptr %221, 0
  %224 = insertvalue { ptr, i32 } %223, i32 %222, 1
  resume { ptr, i32 } %224
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @Highs_getNumRow(ptr noundef) #2

declare noundef i32 @_ZN5Highs8setBasisERK10HighsBasisRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(20928), ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(32)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10HighsBasisD2Ev(ptr noundef nonnull align 8 dereferenceable(96)) unnamed_addr #5 align 2

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.HighsBasis = type { i8, i8, i8, i8, i32, i32, %"class.std::__cxx11::basic_string", %"class.std::vector.3", %"class.std::vector.3" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl" }
%"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl" = type { %"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HighsBasisStatus, std::allocator<HighsBasisStatus>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }

@.str.9 = external hidden unnamed_addr constant [1 x i8], align 1

; 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 nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

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

; 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local i32 @Highs_getNumCol(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @Highs_setBasis(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.HighsBasis, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::allocator", align 1
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %4) #6
  call void @_ZN10HighsBasisC2Ev(ptr noundef nonnull align 8 dereferenceable(96) %4)
  %7 = invoke i32 @Highs_getNumCol(ptr noundef %0)
          to label %8 unwind label %13

8:                                                ; preds = %3
  %9 = icmp sgt i32 %7, 0
  br i1 %9, label %10, label %.critedge

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %4, i64 48
  %12 = zext nneg i32 %7 to i64
  invoke void @_ZNSt6vectorI16HighsBasisStatusSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %12)
          to label %.lr.ph unwind label %13

13:                                               ; preds = %10, %3
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %39

.lr.ph:                                           ; preds = %10, %switch.lookup
  %indvars.iv = phi i64 [ %indvars.iv.next, %switch.lookup ], [ 0, %10 ]
  %15 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp ult i32 %16, 5
  br i1 %17, label %switch.lookup, label %.loopexit

switch.lookup:                                    ; preds = %.lr.ph
  %switch.idx.cast = trunc nuw i32 %16 to i8
  %18 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %indvars.iv) #6
  store i8 %switch.idx.cast, ptr %18, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %12
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !11

.critedge:                                        ; preds = %switch.lookup, %8
  %19 = invoke i32 @Highs_getNumRow(ptr noundef %0)
          to label %20 unwind label %25

20:                                               ; preds = %.critedge
  %21 = icmp sgt i32 %19, 0
  br i1 %21, label %22, label %.critedge67

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %4, i64 72
  %24 = zext nneg i32 %19 to i64
  invoke void @_ZNSt6vectorI16HighsBasisStatusSaIS0_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %24)
          to label %.lr.ph74 unwind label %25

25:                                               ; preds = %22, %.critedge
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %39

.lr.ph74:                                         ; preds = %22, %switch.lookup87
  %indvars.iv77 = phi i64 [ %indvars.iv.next78, %switch.lookup87 ], [ 0, %22 ]
  %27 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv77
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = icmp ult i32 %28, 5
  br i1 %29, label %switch.lookup87, label %.loopexit

switch.lookup87:                                  ; preds = %.lr.ph74
  %switch.idx.cast88 = trunc nuw i32 %28 to i8
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorI16HighsBasisStatusSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %indvars.iv77) #6
  store i8 %switch.idx.cast88, ptr %30, align 1, !tbaa !9
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %exitcond81.not = icmp eq i64 %indvars.iv.next78, %24
  br i1 %exitcond81.not, label %.critedge67, label %.lr.ph74, !llvm.loop !13

.critedge67:                                      ; preds = %switch.lookup87, %20
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull @.str.9, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %31 unwind label %34

31:                                               ; preds = %.critedge67
  %32 = invoke noundef i32 @_ZN5Highs8setBasisERK10HighsBasisRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(20928) %0, ptr noundef nonnull align 8 dereferenceable(96) %4, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %33 unwind label %36

33:                                               ; preds = %31
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %.loopexit

34:                                               ; preds = %.critedge67
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %31
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %39

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph74, %33
  %.4 = phi i32 [ %32, %33 ], [ -1, %.lr.ph74 ], [ -1, %.lr.ph ]
  call void @_ZN10HighsBasisD2Ev(ptr noundef nonnull align 8 dereferenceable(96) %4) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #6
  ret i32 %.4

39:                                               ; preds = %25, %38, %13
  %.pn.pn.pn = phi { ptr, i32 } [ %14, %13 ], [ %.pn, %38 ], [ %26, %25 ]
  call void @_ZN10HighsBasisD2Ev(ptr noundef nonnull align 8 dereferenceable(96) %4) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %4) #6
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i32 @Highs_getNumRow(ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN5Highs8setBasisERK10HighsBasisRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(20928), ptr noundef nonnull align 8 dereferenceable(96), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10HighsBasisD2Ev(ptr noundef nonnull align 8 dereferenceable(96)) unnamed_addr #5 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTS16HighsBasisStatus", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass