; LLVM IR from ERGO-Code/HiGHS :: src/lp_data (HighsSolutionDebug)

; 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.HighsOptionsStruct = type { ptr, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", double, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, %"class.std::__cxx11::basic_string", double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %"class.std::__cxx11::basic_string", i8, i8, i8, i32, i32, %"class.std::__cxx11::basic_string", i8, i8, i8, i32, i8, i8, i32, i32, double, i32, i32, i32, i8, i32, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, i8, i8, i8, double, double, double, double, double, double, double, double, double, double, double, i8, i8, i8, i8, i32, double, i8, i8, %"class.std::__cxx11::basic_string", double, i32, i32, i8, i8, i8, i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, double, double, double, double, double, i8, i8, %"class.std::__cxx11::basic_string", i8, i32, %struct.HighsLogOptions }
%"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] }
%struct.HighsLogOptions = type <{ ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::function", ptr, i8, [7 x i8] }>
%"class.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }

@.str.62 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._Z19debugBasisRightSizeRK12HighsOptionsRK7HighsLpRK10HighsBasis = external hidden unnamed_addr constant [96 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

declare void @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z19debugBasisRightSizeRK12HighsOptionsRK7HighsLpRK10HighsBasis(ptr noundef nonnull align 8 dereferenceable(1020) %0, ptr noundef nonnull align 8 dereferenceable(920) %1, ptr noundef nonnull align 8 dereferenceable(96) %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i8, 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
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %10, i32 0, i32 24
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = icmp slt i32 %12, 1
  br i1 %13, label %14, label %15

14:                                               ; preds = %3
  store i32 -1, ptr %4, align 4
  br label %33

15:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_Z16isBasisRightSizeRK7HighsLpRK10HighsBasis(ptr noundef nonnull align 8 dereferenceable(920) %16, ptr noundef nonnull align 8 dereferenceable(96) %17)
  %19 = zext i1 %18 to i8
  store i8 %19, ptr %9, align 1, !tbaa !22
  %20 = load i8, ptr %9, align 1, !tbaa !22, !range !23, !noundef !24
  %21 = trunc i8 %20 to i1
  br i1 %21, label %31, label %22

22:                                               ; preds = %15
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %23, i32 0, i32 130
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %24, i32 noundef 5, ptr noundef @.str.63)
  %25 = load i8, ptr %9, align 1, !tbaa !22, !range !23, !noundef !24
  %26 = trunc i8 %25 to i1
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  br label %30

28:                                               ; preds = %22
  call void @__assert_fail(ptr noundef @.str.64, ptr noundef @.str.62, i32 noundef 231, ptr noundef @__PRETTY_FUNCTION__._Z19debugBasisRightSizeRK12HighsOptionsRK7HighsLpRK10HighsBasis) #5
  unreachable

29:                                               ; No predecessors!
  br label %30

30:                                               ; preds = %29, %27
  store i32 6, ptr %8, align 4, !tbaa !20
  br label %31

31:                                               ; preds = %30, %15
  %32 = load i32, ptr %8, align 4, !tbaa !20
  store i32 %32, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %33

33:                                               ; preds = %31, %14
  %34 = load i32, ptr %4, align 4
  ret i32 %34
}

declare noundef zeroext i1 @_Z16isBasisRightSizeRK7HighsLpRK10HighsBasis(ptr noundef nonnull align 8 dereferenceable(920), ptr noundef nonnull align 8 dereferenceable(96)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { noreturn 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, !15, i64 348}
!10 = !{!"_ZTS18HighsOptionsStruct", !11, i64 8, !11, i64 40, !11, i64 72, !11, i64 104, !14, i64 136, !11, i64 144, !11, i64 176, !15, i64 208, !11, i64 216, !14, i64 248, !14, i64 256, !14, i64 264, !14, i64 272, !14, i64 280, !14, i64 288, !14, i64 296, !14, i64 304, !14, i64 312, !14, i64 320, !14, i64 328, !15, i64 336, !15, i64 340, !15, i64 344, !15, i64 348, !15, i64 352, !15, i64 356, !15, i64 360, !15, i64 364, !15, i64 368, !15, i64 372, !15, i64 376, !15, i64 380, !15, i64 384, !15, i64 388, !11, i64 392, !16, i64 424, !16, i64 425, !16, i64 426, !15, i64 428, !15, i64 432, !11, i64 440, !16, i64 472, !16, i64 473, !16, i64 474, !15, i64 476, !16, i64 480, !16, i64 481, !15, i64 484, !15, i64 488, !14, i64 496, !15, i64 504, !15, i64 508, !15, i64 512, !16, i64 516, !15, i64 520, !16, i64 524, !16, i64 525, !16, i64 526, !16, i64 527, !16, i64 528, !16, i64 529, !16, i64 530, !15, i64 532, !15, i64 536, !15, i64 540, !15, i64 544, !15, i64 548, !15, i64 552, !15, i64 556, !15, i64 560, !15, i64 564, !15, i64 568, !15, i64 572, !15, i64 576, !15, i64 580, !15, i64 584, !15, i64 588, !16, i64 592, !16, i64 593, !16, i64 594, !16, i64 595, !14, i64 600, !14, i64 608, !14, i64 616, !14, i64 624, !14, i64 632, !14, i64 640, !14, i64 648, !14, i64 656, !14, i64 664, !14, i64 672, !14, i64 680, !16, i64 688, !16, i64 689, !16, i64 690, !16, i64 691, !15, i64 692, !14, i64 696, !16, i64 704, !16, i64 705, !11, i64 712, !14, i64 744, !15, i64 752, !15, i64 756, !16, i64 760, !16, i64 761, !16, i64 762, !16, i64 763, !15, i64 764, !15, i64 768, !15, i64 772, !15, i64 776, !15, i64 780, !15, i64 784, !15, i64 788, !15, i64 792, !15, i64 796, !15, i64 800, !15, i64 804, !14, i64 808, !14, i64 816, !14, i64 824, !14, i64 832, !14, i64 840, !16, i64 848, !16, i64 849, !11, i64 856, !16, i64 888, !15, i64 892, !17, i64 896}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !12, i64 0, !13, i64 8, !7, i64 16}
!12 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTS15HighsLogOptions", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !18, i64 48, !6, i64 80, !16, i64 88}
!18 = !{!"_ZTSSt8functionIFviRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK20HighsCallbackDataOutP19HighsCallbackDataInPvEE", !19, i64 0, !6, i64 24}
!19 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!20 = !{!21, !21, i64 0}
!21 = !{!"_ZTS16HighsDebugStatus", !7, i64 0}
!22 = !{!16, !16, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}


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

@.str.62 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [11 x i8], align 1
@__PRETTY_FUNCTION__._Z19debugBasisRightSizeRK12HighsOptionsRK7HighsLpRK10HighsBasis = external hidden unnamed_addr constant [96 x i8], align 1

declare void @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_Z19debugBasisRightSizeRK12HighsOptionsRK7HighsLpRK10HighsBasis(ptr noundef nonnull align 8 dereferenceable(1020) %0, ptr noundef nonnull align 8 dereferenceable(920) %1, ptr noundef nonnull align 8 dereferenceable(96) %2) local_unnamed_addr #2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 348
  %5 = load i32, ptr %4, align 4, !tbaa !5
  %6 = icmp slt i32 %5, 1
  br i1 %6, label %11, label %7

7:                                                ; preds = %3
  %8 = tail call noundef zeroext i1 @_Z16isBasisRightSizeRK7HighsLpRK10HighsBasis(ptr noundef nonnull align 8 dereferenceable(920) %1, ptr noundef nonnull align 8 dereferenceable(96) %2)
  br i1 %8, label %11, label %9

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 896
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %10, i32 noundef 5, ptr noundef nonnull @.str.63)
  tail call void @__assert_fail(ptr noundef nonnull @.str.64, ptr noundef nonnull @.str.62, i32 noundef 231, ptr noundef nonnull @__PRETTY_FUNCTION__._Z19debugBasisRightSizeRK12HighsOptionsRK7HighsLpRK10HighsBasis) #3
  unreachable

11:                                               ; preds = %7, %3
  %.0 = phi i32 [ -1, %3 ], [ 0, %7 ]
  ret i32 %.0
}

declare noundef zeroext i1 @_Z16isBasisRightSizeRK7HighsLpRK10HighsBasis(ptr noundef nonnull align 8 dereferenceable(920), ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #0

attributes #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 = { noreturn nounwind "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 = { noreturn 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, !14, i64 348}
!6 = !{!"_ZTS18HighsOptionsStruct", !7, i64 8, !7, i64 40, !7, i64 72, !7, i64 104, !13, i64 136, !7, i64 144, !7, i64 176, !14, i64 208, !7, i64 216, !13, i64 248, !13, i64 256, !13, i64 264, !13, i64 272, !13, i64 280, !13, i64 288, !13, i64 296, !13, i64 304, !13, i64 312, !13, i64 320, !13, i64 328, !14, i64 336, !14, i64 340, !14, i64 344, !14, i64 348, !14, i64 352, !14, i64 356, !14, i64 360, !14, i64 364, !14, i64 368, !14, i64 372, !14, i64 376, !14, i64 380, !14, i64 384, !14, i64 388, !7, i64 392, !15, i64 424, !15, i64 425, !15, i64 426, !14, i64 428, !14, i64 432, !7, i64 440, !15, i64 472, !15, i64 473, !15, i64 474, !14, i64 476, !15, i64 480, !15, i64 481, !14, i64 484, !14, i64 488, !13, i64 496, !14, i64 504, !14, i64 508, !14, i64 512, !15, i64 516, !14, i64 520, !15, i64 524, !15, i64 525, !15, i64 526, !15, i64 527, !15, i64 528, !15, i64 529, !15, i64 530, !14, i64 532, !14, i64 536, !14, i64 540, !14, i64 544, !14, i64 548, !14, i64 552, !14, i64 556, !14, i64 560, !14, i64 564, !14, i64 568, !14, i64 572, !14, i64 576, !14, i64 580, !14, i64 584, !14, i64 588, !15, i64 592, !15, i64 593, !15, i64 594, !15, i64 595, !13, i64 600, !13, i64 608, !13, i64 616, !13, i64 624, !13, i64 632, !13, i64 640, !13, i64 648, !13, i64 656, !13, i64 664, !13, i64 672, !13, i64 680, !15, i64 688, !15, i64 689, !15, i64 690, !15, i64 691, !14, i64 692, !13, i64 696, !15, i64 704, !15, i64 705, !7, i64 712, !13, i64 744, !14, i64 752, !14, i64 756, !15, i64 760, !15, i64 761, !15, i64 762, !15, i64 763, !14, i64 764, !14, i64 768, !14, i64 772, !14, i64 776, !14, i64 780, !14, i64 784, !14, i64 788, !14, i64 792, !14, i64 796, !14, i64 800, !14, i64 804, !13, i64 808, !13, i64 816, !13, i64 824, !13, i64 832, !13, i64 840, !15, i64 848, !15, i64 849, !7, i64 856, !15, i64 888, !14, i64 892, !16, i64 896}
!7 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !8, i64 0, !12, i64 8, !10, i64 16}
!8 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"long", !10, i64 0}
!13 = !{!"double", !10, i64 0}
!14 = !{!"int", !10, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"_ZTS15HighsLogOptions", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24, !9, i64 32, !9, i64 40, !17, i64 48, !9, i64 80, !15, i64 88}
!17 = !{!"_ZTSSt8functionIFviRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK20HighsCallbackDataOutP19HighsCallbackDataInPvEE", !18, i64 0, !9, i64 24}
!18 = !{!"_ZTSSt14_Function_base", !10, i64 0, !9, i64 16}


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