; LLVM IR from ERGO-Code/HiGHS :: src/simplex (HSimplexDebug)

; 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.51 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [53 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 nounwind uwtable
declare dso_local void @_Z23debugDualChuzcFailNormsiRKSt6vectorISt4pairIidESaIS1_EERdiPKdS6_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z23debugDualChuzcFailQuad0RK12HighsOptionsiRKSt6vectorISt4pairIidESaIS4_EEiPKdddb(ptr noundef nonnull align 8 dereferenceable(1020) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3, ptr noundef %4, double noundef %5, double noundef %6, i1 noundef zeroext %7) #2 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i8, align 1
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  store ptr %0, ptr %10, align 8, !tbaa !5
  store i32 %1, ptr %11, align 4, !tbaa !9
  store ptr %2, ptr %12, align 8, !tbaa !5
  store i32 %3, ptr %13, align 4, !tbaa !9
  store ptr %4, ptr %14, align 8, !tbaa !5
  store double %5, ptr %15, align 8, !tbaa !11
  store double %6, ptr %16, align 8, !tbaa !11
  %20 = zext i1 %7 to i8
  store i8 %20, ptr %17, align 1, !tbaa !13
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %21, i32 0, i32 24
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = icmp slt i32 %23, 2
  br i1 %24, label %25, label %29

25:                                               ; preds = %8
  %26 = load i8, ptr %17, align 1, !tbaa !13, !range !23, !noundef !24
  %27 = trunc i8 %26 to i1
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 -1, ptr %9, align 4
  br label %45

29:                                               ; preds = %25, %8
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %30, i32 0, i32 130
  call void (ptr, i32, ptr, ...) @_Z11highsLogDevRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %31, i32 noundef 1, ptr noundef @.str.51)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %32 = load i32, ptr %11, align 4, !tbaa !9
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = load i32, ptr %13, align 4, !tbaa !9
  %35 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_Z23debugDualChuzcFailNormsiRKSt6vectorISt4pairIidESaIS1_EERdiPKdS6_(i32 noundef %32, ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef %34, ptr noundef %35, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %36, i32 0, i32 130
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = load double, ptr %15, align 8, !tbaa !11
  %40 = load double, ptr %16, align 8, !tbaa !11
  call void (ptr, i32, ptr, ...) @_Z11highsLogDevRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %37, i32 noundef 1, ptr noundef @.str.52, i32 noundef %38, double noundef %39, double noundef %40)
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %41, i32 0, i32 130
  %43 = load double, ptr %18, align 8, !tbaa !11
  %44 = load double, ptr %19, align 8, !tbaa !11
  call void (ptr, i32, ptr, ...) @_Z11highsLogDevRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %42, i32 noundef 1, ptr noundef @.str.53, double noundef %43, double noundef %44)
  store i32 0, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %45

45:                                               ; preds = %29, %28
  %46 = load i32, ptr %9, align 4
  ret i32 %46
}

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

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 = { "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, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !10, i64 348}
!16 = !{!"_ZTS18HighsOptionsStruct", !17, i64 8, !17, i64 40, !17, i64 72, !17, i64 104, !12, i64 136, !17, i64 144, !17, i64 176, !10, i64 208, !17, i64 216, !12, i64 248, !12, i64 256, !12, i64 264, !12, i64 272, !12, i64 280, !12, i64 288, !12, i64 296, !12, i64 304, !12, i64 312, !12, i64 320, !12, i64 328, !10, i64 336, !10, i64 340, !10, i64 344, !10, i64 348, !10, i64 352, !10, i64 356, !10, i64 360, !10, i64 364, !10, i64 368, !10, i64 372, !10, i64 376, !10, i64 380, !10, i64 384, !10, i64 388, !17, i64 392, !14, i64 424, !14, i64 425, !14, i64 426, !10, i64 428, !10, i64 432, !17, i64 440, !14, i64 472, !14, i64 473, !14, i64 474, !10, i64 476, !14, i64 480, !14, i64 481, !10, i64 484, !10, i64 488, !12, i64 496, !10, i64 504, !10, i64 508, !10, i64 512, !14, i64 516, !10, i64 520, !14, i64 524, !14, i64 525, !14, i64 526, !14, i64 527, !14, i64 528, !14, i64 529, !14, i64 530, !10, i64 532, !10, i64 536, !10, i64 540, !10, i64 544, !10, i64 548, !10, i64 552, !10, i64 556, !10, i64 560, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !14, i64 592, !14, i64 593, !14, i64 594, !14, i64 595, !12, i64 600, !12, i64 608, !12, i64 616, !12, i64 624, !12, i64 632, !12, i64 640, !12, i64 648, !12, i64 656, !12, i64 664, !12, i64 672, !12, i64 680, !14, i64 688, !14, i64 689, !14, i64 690, !14, i64 691, !10, i64 692, !12, i64 696, !14, i64 704, !14, i64 705, !17, i64 712, !12, i64 744, !10, i64 752, !10, i64 756, !14, i64 760, !14, i64 761, !14, i64 762, !14, i64 763, !10, i64 764, !10, i64 768, !10, i64 772, !10, i64 776, !10, i64 780, !10, i64 784, !10, i64 788, !10, i64 792, !10, i64 796, !10, i64 800, !10, i64 804, !12, i64 808, !12, i64 816, !12, i64 824, !12, i64 832, !12, i64 840, !14, i64 848, !14, i64 849, !17, i64 856, !14, i64 888, !10, i64 892, !20, i64 896}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !19, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTS15HighsLogOptions", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !21, i64 48, !6, i64 80, !14, i64 88}
!21 = !{!"_ZTSSt8functionIFviRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK20HighsCallbackDataOutP19HighsCallbackDataInPvEE", !22, i64 0, !6, i64 24}
!22 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!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.51 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [53 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 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 dso_local void @_Z23debugDualChuzcFailNormsiRKSt6vectorISt4pairIidESaIS1_EERdiPKdS6_(i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -1, 1) i32 @_Z23debugDualChuzcFailQuad0RK12HighsOptionsiRKSt6vectorISt4pairIidESaIS4_EEiPKdddb(ptr noundef nonnull align 8 dereferenceable(1020) %0, i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %3, ptr noundef %4, double noundef %5, double noundef %6, i1 noundef zeroext %7) local_unnamed_addr #2 {
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 348
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = icmp sgt i32 %12, 1
  %brmerge = or i1 %13, %7
  br i1 %brmerge, label %14, label %18

14:                                               ; preds = %8
  %15 = getelementptr inbounds i8, ptr %0, i64 896
  tail call void (ptr, i32, ptr, ...) @_Z11highsLogDevRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %15, i32 noundef 1, ptr noundef nonnull @.str.51)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @_Z23debugDualChuzcFailNormsiRKSt6vectorISt4pairIidESaIS1_EERdiPKdS6_(i32 noundef %1, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(8) %9, i32 noundef %3, ptr noundef %4, ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void (ptr, i32, ptr, ...) @_Z11highsLogDevRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %15, i32 noundef 1, ptr noundef nonnull @.str.52, i32 noundef %1, double noundef %5, double noundef %6)
  %16 = load double, ptr %9, align 8, !tbaa !19
  %17 = load double, ptr %10, align 8, !tbaa !19
  call void (ptr, i32, ptr, ...) @_Z11highsLogDevRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %15, i32 noundef 1, ptr noundef nonnull @.str.53, double noundef %16, double noundef %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br label %18

18:                                               ; preds = %8, %14
  %.0 = phi i32 [ 0, %14 ], [ -1, %8 ]
  ret i32 %.0
}

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

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 = { "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, !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}
!19 = !{!13, !13, i64 0}


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