; LLVM IR from ERGO-Code/HiGHS :: src/util/HighsLinearSumBounds.ll (ZNK20HighsLinearSumBounds19getResidualSumLowerEiid)

; 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.HighsCDouble = type { double, double }
%class.HighsLinearSumBounds = type { %"class.std::vector", %"class.std::vector", %"class.std::vector.3", %"class.std::vector.3", %"class.std::vector", %"class.std::vector", %"class.std::vector.3", %"class.std::vector.3", ptr, ptr, ptr, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<HighsCDouble, std::allocator<HighsCDouble>>::_Vector_impl" }
%"struct.std::_Vector_base<HighsCDouble, std::allocator<HighsCDouble>>::_Vector_impl" = type { %"struct.std::_Vector_base<HighsCDouble, std::allocator<HighsCDouble>>::_Vector_impl_data" }
%"struct.std::_Vector_base<HighsCDouble, std::allocator<HighsCDouble>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZNK20HighsLinearSumBounds19getResidualSumLowerEiid(ptr noundef nonnull align 8 dereferenceable(240) %0, i32 noundef %1, i32 noundef %2, double noundef %3) #2 align 2 {
  %5 = alloca double, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca %class.HighsCDouble, align 8
  %12 = alloca double, align 8
  %13 = alloca %class.HighsCDouble, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store double %3, ptr %9, align 8, !tbaa !11
  %16 = load ptr, ptr %6, align 8
  %17 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 6
  %18 = load i32, ptr %7, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %19) #4
  %21 = load i32, ptr %20, align 4, !tbaa !9
  switch i32 %21, label %200 [
    i32 0, label %22
    i32 1, label %113
  ]

22:                                               ; preds = %4
  %23 = load double, ptr %9, align 8, !tbaa !11
  %24 = fcmp ogt double %23, 0.000000e+00
  br i1 %24, label %25, label %69

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %26 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 12
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i32, ptr %27, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = load i32, ptr %7, align 4, !tbaa !9
  %33 = icmp eq i32 %31, %32
  br i1 %33, label %34, label %41

34:                                               ; preds = %25
  %35 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 8
  %36 = load ptr, ptr %35, align 8, !tbaa !23
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds double, ptr %36, i64 %38
  %40 = load double, ptr %39, align 8, !tbaa !11
  br label %54

41:                                               ; preds = %25
  %42 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 10
  %43 = load ptr, ptr %42, align 8, !tbaa !24
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds double, ptr %43, i64 %45
  %47 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 8
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  %49 = load i32, ptr %8, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds double, ptr %48, i64 %50
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %51)
  %53 = load double, ptr %52, align 8, !tbaa !11
  br label %54

54:                                               ; preds = %41, %34
  %55 = phi double [ %40, %34 ], [ %53, %41 ]
  store double %55, ptr %10, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  %56 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 4
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %56, i64 noundef %58) #4
  %60 = load double, ptr %10, align 8, !tbaa !11
  %61 = load double, ptr %9, align 8, !tbaa !11
  %62 = fmul double %60, %61
  %63 = call { double, double } @_ZNK12HighsCDoublemiEd(ptr noundef nonnull align 8 dereferenceable(16) %59, double noundef %62)
  %64 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 0
  %65 = extractvalue { double, double } %63, 0
  store double %65, ptr %64, align 8
  %66 = getelementptr inbounds { double, double }, ptr %11, i32 0, i32 1
  %67 = extractvalue { double, double } %63, 1
  store double %67, ptr %66, align 8
  %68 = call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %11)
  store double %68, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %201

69:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %70 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 13
  %71 = load ptr, ptr %70, align 8, !tbaa !25
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %71, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = icmp eq i32 %75, %76
  br i1 %77, label %78, label %85

78:                                               ; preds = %69
  %79 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 9
  %80 = load ptr, ptr %79, align 8, !tbaa !26
  %81 = load i32, ptr %8, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds double, ptr %80, i64 %82
  %84 = load double, ptr %83, align 8, !tbaa !11
  br label %98

85:                                               ; preds = %69
  %86 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 11
  %87 = load ptr, ptr %86, align 8, !tbaa !27
  %88 = load i32, ptr %8, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds double, ptr %87, i64 %89
  %91 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 9
  %92 = load ptr, ptr %91, align 8, !tbaa !26
  %93 = load i32, ptr %8, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds double, ptr %92, i64 %94
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef nonnull align 8 dereferenceable(8) %95)
  %97 = load double, ptr %96, align 8, !tbaa !11
  br label %98

98:                                               ; preds = %85, %78
  %99 = phi double [ %84, %78 ], [ %97, %85 ]
  store double %99, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #4
  %100 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 4
  %101 = load i32, ptr %7, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %100, i64 noundef %102) #4
  %104 = load double, ptr %12, align 8, !tbaa !11
  %105 = load double, ptr %9, align 8, !tbaa !11
  %106 = fmul double %104, %105
  %107 = call { double, double } @_ZNK12HighsCDoublemiEd(ptr noundef nonnull align 8 dereferenceable(16) %103, double noundef %106)
  %108 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %109 = extractvalue { double, double } %107, 0
  store double %109, ptr %108, align 8
  %110 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %111 = extractvalue { double, double } %107, 1
  store double %111, ptr %110, align 8
  %112 = call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  store double %112, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %201

113:                                              ; preds = %4
  %114 = load double, ptr %9, align 8, !tbaa !11
  %115 = fcmp ogt double %114, 0.000000e+00
  br i1 %115, label %116, label %158

116:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %117 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 12
  %118 = load ptr, ptr %117, align 8, !tbaa !13
  %119 = load i32, ptr %8, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i32, ptr %118, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !9
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = icmp eq i32 %122, %123
  br i1 %124, label %125, label %132

125:                                              ; preds = %116
  %126 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 8
  %127 = load ptr, ptr %126, align 8, !tbaa !23
  %128 = load i32, ptr %8, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %127, i64 %129
  %131 = load double, ptr %130, align 8, !tbaa !11
  br label %145

132:                                              ; preds = %116
  %133 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 10
  %134 = load ptr, ptr %133, align 8, !tbaa !24
  %135 = load i32, ptr %8, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds double, ptr %134, i64 %136
  %138 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 8
  %139 = load ptr, ptr %138, align 8, !tbaa !23
  %140 = load i32, ptr %8, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds double, ptr %139, i64 %141
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef nonnull align 8 dereferenceable(8) %142)
  %144 = load double, ptr %143, align 8, !tbaa !11
  br label %145

145:                                              ; preds = %132, %125
  %146 = phi double [ %131, %125 ], [ %144, %132 ]
  store double %146, ptr %14, align 8, !tbaa !11
  %147 = load double, ptr %14, align 8, !tbaa !11
  %148 = fcmp oeq double %147, 0xFFF0000000000000
  br i1 %148, label %149, label %155

149:                                              ; preds = %145
  %150 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 4
  %151 = load i32, ptr %7, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %150, i64 noundef %152) #4
  %154 = call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %153)
  br label %156

155:                                              ; preds = %145
  br label %156

156:                                              ; preds = %155, %149
  %157 = phi double [ %154, %149 ], [ 0xFFF0000000000000, %155 ]
  store double %157, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %201

158:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %159 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 13
  %160 = load ptr, ptr %159, align 8, !tbaa !25
  %161 = load i32, ptr %8, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %160, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !9
  %165 = load i32, ptr %7, align 4, !tbaa !9
  %166 = icmp eq i32 %164, %165
  br i1 %166, label %167, label %174

167:                                              ; preds = %158
  %168 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 9
  %169 = load ptr, ptr %168, align 8, !tbaa !26
  %170 = load i32, ptr %8, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds double, ptr %169, i64 %171
  %173 = load double, ptr %172, align 8, !tbaa !11
  br label %187

174:                                              ; preds = %158
  %175 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 11
  %176 = load ptr, ptr %175, align 8, !tbaa !27
  %177 = load i32, ptr %8, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %176, i64 %178
  %180 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 9
  %181 = load ptr, ptr %180, align 8, !tbaa !26
  %182 = load i32, ptr %8, align 4, !tbaa !9
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds double, ptr %181, i64 %183
  %185 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %179, ptr noundef nonnull align 8 dereferenceable(8) %184)
  %186 = load double, ptr %185, align 8, !tbaa !11
  br label %187

187:                                              ; preds = %174, %167
  %188 = phi double [ %173, %167 ], [ %186, %174 ]
  store double %188, ptr %15, align 8, !tbaa !11
  %189 = load double, ptr %15, align 8, !tbaa !11
  %190 = fcmp oeq double %189, 0x7FF0000000000000
  br i1 %190, label %191, label %197

191:                                              ; preds = %187
  %192 = getelementptr inbounds %class.HighsLinearSumBounds, ptr %16, i32 0, i32 4
  %193 = load i32, ptr %7, align 4, !tbaa !9
  %194 = sext i32 %193 to i64
  %195 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %192, i64 noundef %194) #4
  %196 = call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %195)
  br label %198

197:                                              ; preds = %187
  br label %198

198:                                              ; preds = %197, %191
  %199 = phi double [ %196, %191 ], [ 0xFFF0000000000000, %197 ]
  store double %199, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %201

200:                                              ; preds = %4
  store double 0xFFF0000000000000, ptr %5, align 8
  br label %201

201:                                              ; preds = %200, %198, %156, %98, %54
  %202 = load double, ptr %5, align 8
  ret double %202
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK12HighsCDoublemiEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = { 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 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 224}
!14 = !{!"_ZTS20HighsLinearSumBounds", !15, i64 0, !15, i64 24, !19, i64 48, !19, i64 72, !15, i64 96, !15, i64 120, !19, i64 144, !19, i64 168, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232}
!15 = !{!"_ZTSSt6vectorI12HighsCDoubleSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI12HighsCDoubleSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI12HighsCDoubleSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI12HighsCDoubleSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!14, !6, i64 192}
!24 = !{!14, !6, i64 208}
!25 = !{!14, !6, i64 232}
!26 = !{!14, !6, i64 200}
!27 = !{!14, !6, i64 216}


; 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.HighsCDouble = type { double, double }

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZNK20HighsLinearSumBounds19getResidualSumLowerEiid(ptr noundef nonnull align 8 dereferenceable(240) %0, i32 noundef %1, i32 noundef %2, double noundef %3) local_unnamed_addr #2 align 2 {
  %5 = alloca %class.HighsCDouble, align 8
  %6 = alloca %class.HighsCDouble, align 8
  %7 = getelementptr inbounds i8, ptr %0, i64 144
  %8 = sext i32 %1 to i64
  %9 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %8) #3
  %10 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %10, label %123 [
    i32 0, label %11
    i32 1, label %70
  ]

11:                                               ; preds = %4
  %12 = fcmp ogt double %3, 0.000000e+00
  %13 = sext i32 %2 to i64
  br i1 %12, label %14, label %42

14:                                               ; preds = %11
  %15 = getelementptr inbounds i8, ptr %0, i64 224
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds i32, ptr %16, i64 %13
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = icmp eq i32 %18, %1
  br i1 %19, label %20, label %24

20:                                               ; preds = %14
  %21 = getelementptr inbounds i8, ptr %0, i64 192
  %22 = load ptr, ptr %21, align 8, !tbaa !20
  %23 = getelementptr inbounds double, ptr %22, i64 %13
  br label %32

24:                                               ; preds = %14
  %25 = getelementptr inbounds i8, ptr %0, i64 208
  %26 = load ptr, ptr %25, align 8, !tbaa !21
  %27 = getelementptr inbounds double, ptr %26, i64 %13
  %28 = getelementptr inbounds i8, ptr %0, i64 192
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = getelementptr inbounds double, ptr %29, i64 %13
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull align 8 dereferenceable(8) %30)
  br label %32

32:                                               ; preds = %24, %20
  %.in37 = phi ptr [ %23, %20 ], [ %31, %24 ]
  %33 = load double, ptr %.in37, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  %34 = getelementptr inbounds i8, ptr %0, i64 96
  %35 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %8) #3
  %36 = fmul double %33, %3
  %37 = tail call { double, double } @_ZNK12HighsCDoublemiEd(ptr noundef nonnull align 8 dereferenceable(16) %35, double noundef %36)
  %38 = extractvalue { double, double } %37, 0
  store double %38, ptr %5, align 8
  %39 = getelementptr inbounds i8, ptr %5, i64 8
  %40 = extractvalue { double, double } %37, 1
  store double %40, ptr %39, align 8
  %41 = call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  br label %123

42:                                               ; preds = %11
  %43 = getelementptr inbounds i8, ptr %0, i64 232
  %44 = load ptr, ptr %43, align 8, !tbaa !24
  %45 = getelementptr inbounds i32, ptr %44, i64 %13
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp eq i32 %46, %1
  br i1 %47, label %48, label %52

48:                                               ; preds = %42
  %49 = getelementptr inbounds i8, ptr %0, i64 200
  %50 = load ptr, ptr %49, align 8, !tbaa !25
  %51 = getelementptr inbounds double, ptr %50, i64 %13
  br label %60

52:                                               ; preds = %42
  %53 = getelementptr inbounds i8, ptr %0, i64 216
  %54 = load ptr, ptr %53, align 8, !tbaa !26
  %55 = getelementptr inbounds double, ptr %54, i64 %13
  %56 = getelementptr inbounds i8, ptr %0, i64 200
  %57 = load ptr, ptr %56, align 8, !tbaa !25
  %58 = getelementptr inbounds double, ptr %57, i64 %13
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef nonnull align 8 dereferenceable(8) %58)
  br label %60

60:                                               ; preds = %52, %48
  %.in36 = phi ptr [ %51, %48 ], [ %59, %52 ]
  %61 = load double, ptr %.in36, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #3
  %62 = getelementptr inbounds i8, ptr %0, i64 96
  %63 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %8) #3
  %64 = fmul double %61, %3
  %65 = tail call { double, double } @_ZNK12HighsCDoublemiEd(ptr noundef nonnull align 8 dereferenceable(16) %63, double noundef %64)
  %66 = extractvalue { double, double } %65, 0
  store double %66, ptr %6, align 8
  %67 = getelementptr inbounds i8, ptr %6, i64 8
  %68 = extractvalue { double, double } %65, 1
  store double %68, ptr %67, align 8
  %69 = call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #3
  br label %123

70:                                               ; preds = %4
  %71 = fcmp ogt double %3, 0.000000e+00
  %72 = sext i32 %2 to i64
  br i1 %71, label %73, label %98

73:                                               ; preds = %70
  %74 = getelementptr inbounds i8, ptr %0, i64 224
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds i32, ptr %75, i64 %72
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp eq i32 %77, %1
  br i1 %78, label %79, label %83

79:                                               ; preds = %73
  %80 = getelementptr inbounds i8, ptr %0, i64 192
  %81 = load ptr, ptr %80, align 8, !tbaa !20
  %82 = getelementptr inbounds double, ptr %81, i64 %72
  br label %91

83:                                               ; preds = %73
  %84 = getelementptr inbounds i8, ptr %0, i64 208
  %85 = load ptr, ptr %84, align 8, !tbaa !21
  %86 = getelementptr inbounds double, ptr %85, i64 %72
  %87 = getelementptr inbounds i8, ptr %0, i64 192
  %88 = load ptr, ptr %87, align 8, !tbaa !20
  %89 = getelementptr inbounds double, ptr %88, i64 %72
  %90 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef nonnull align 8 dereferenceable(8) %89)
  br label %91

91:                                               ; preds = %83, %79
  %.in35 = phi ptr [ %82, %79 ], [ %90, %83 ]
  %92 = load double, ptr %.in35, align 8, !tbaa !22
  %93 = fcmp oeq double %92, 0xFFF0000000000000
  br i1 %93, label %94, label %123

94:                                               ; preds = %91
  %95 = getelementptr inbounds i8, ptr %0, i64 96
  %96 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %8) #3
  %97 = tail call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %96)
  br label %123

98:                                               ; preds = %70
  %99 = getelementptr inbounds i8, ptr %0, i64 232
  %100 = load ptr, ptr %99, align 8, !tbaa !24
  %101 = getelementptr inbounds i32, ptr %100, i64 %72
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = icmp eq i32 %102, %1
  br i1 %103, label %104, label %108

104:                                              ; preds = %98
  %105 = getelementptr inbounds i8, ptr %0, i64 200
  %106 = load ptr, ptr %105, align 8, !tbaa !25
  %107 = getelementptr inbounds double, ptr %106, i64 %72
  br label %116

108:                                              ; preds = %98
  %109 = getelementptr inbounds i8, ptr %0, i64 216
  %110 = load ptr, ptr %109, align 8, !tbaa !26
  %111 = getelementptr inbounds double, ptr %110, i64 %72
  %112 = getelementptr inbounds i8, ptr %0, i64 200
  %113 = load ptr, ptr %112, align 8, !tbaa !25
  %114 = getelementptr inbounds double, ptr %113, i64 %72
  %115 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull align 8 dereferenceable(8) %114)
  br label %116

116:                                              ; preds = %108, %104
  %.in = phi ptr [ %107, %104 ], [ %115, %108 ]
  %117 = load double, ptr %.in, align 8, !tbaa !22
  %118 = fcmp oeq double %117, 0x7FF0000000000000
  br i1 %118, label %119, label %123

119:                                              ; preds = %116
  %120 = getelementptr inbounds i8, ptr %0, i64 96
  %121 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %120, i64 noundef %8) #3
  %122 = tail call noundef double @_ZNK12HighsCDoublecvdEv(ptr noundef nonnull align 8 dereferenceable(16) %121)
  br label %123

123:                                              ; preds = %4, %119, %116, %94, %91, %60, %32
  %.0 = phi double [ %41, %32 ], [ %69, %60 ], [ %97, %94 ], [ 0xFFF0000000000000, %91 ], [ %122, %119 ], [ 0xFFF0000000000000, %116 ], [ 0xFFF0000000000000, %4 ]
  ret double %.0
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIiSaIiEEixEm(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 8 dereferenceable(16) ptr @_ZNKSt6vectorI12HighsCDoubleSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { double, double } @_ZNK12HighsCDoublemiEd(ptr noundef nonnull align 8 dereferenceable(16), double noundef) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !15, i64 224}
!10 = !{!"_ZTS20HighsLinearSumBounds", !11, i64 0, !11, i64 24, !16, i64 48, !16, i64 72, !11, i64 96, !11, i64 120, !16, i64 144, !16, i64 168, !15, i64 192, !15, i64 200, !15, i64 208, !15, i64 216, !15, i64 224, !15, i64 232}
!11 = !{!"_ZTSSt6vectorI12HighsCDoubleSaIS0_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseI12HighsCDoubleSaIS0_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseI12HighsCDoubleSaIS0_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseI12HighsCDoubleSaIS0_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTSSt6vectorIiSaIiEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!20 = !{!10, !15, i64 192}
!21 = !{!10, !15, i64 208}
!22 = !{!23, !23, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = !{!10, !15, i64 232}
!25 = !{!10, !15, i64 200}
!26 = !{!10, !15, i64 216}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass