; LLVM IR from ERGO-Code/HiGHS :: src/ipm (IpxWrapper)

; 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.52 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._Z14ipxStatusErrorbRK12HighsOptionsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi = external hidden unnamed_addr constant [78 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z14ipxStatusErrorbRK12HighsOptionsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(i1 noundef zeroext %0, ptr noundef nonnull align 8 dereferenceable(1020) %1, ptr noundef %2, i32 noundef %3) #2 {
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = zext i1 %0 to i8
  store i8 %9, ptr %5, align 1, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !11
  %10 = load i8, ptr %5, align 1, !tbaa !5, !range !13, !noundef !14
  %11 = trunc i8 %10 to i1
  br i1 %11, label %12, label %26

12:                                               ; preds = %4
  %13 = load i32, ptr %8, align 4, !tbaa !11
  %14 = icmp slt i32 %13, 0
  br i1 %14, label %15, label %19

15:                                               ; preds = %12
  %16 = load ptr, ptr %6, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %16, i32 0, i32 130
  %18 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %17, i32 noundef 5, ptr noundef @.str.90, ptr noundef %18)
  br label %24

19:                                               ; preds = %12
  %20 = load ptr, ptr %6, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.HighsOptionsStruct, ptr %20, i32 0, i32 130
  %22 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #4
  %23 = load i32, ptr %8, align 4, !tbaa !11
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %21, i32 noundef 5, ptr noundef @.str.91, ptr noundef %22, i32 noundef %23)
  br label %24

24:                                               ; preds = %19, %15
  %25 = call i32 @fflush(ptr noundef null)
  br label %26

26:                                               ; preds = %24, %4
  %27 = load i8, ptr %5, align 1, !tbaa !5, !range !13, !noundef !14
  %28 = trunc i8 %27 to i1
  %29 = xor i1 %28, true
  br i1 %29, label %30, label %31

30:                                               ; preds = %26
  br label %33

31:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str.92, ptr noundef @.str.52, i32 noundef 653, ptr noundef @__PRETTY_FUNCTION__._Z14ipxStatusErrorbRK12HighsOptionsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi) #5
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %30
  %34 = load i8, ptr %5, align 1, !tbaa !5, !range !13, !noundef !14
  %35 = trunc i8 %34 to i1
  ret i1 %35
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

declare i32 @fflush(ptr noundef) #1

attributes #0 = { 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 #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 = { 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 }
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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{i8 0, i8 2}
!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"

@.str.52 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__._Z14ipxStatusErrorbRK12HighsOptionsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi = external hidden unnamed_addr constant [78 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z14ipxStatusErrorbRK12HighsOptionsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(i1 noundef zeroext %0, ptr noundef nonnull align 8 dereferenceable(1020) %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  br i1 %0, label %5, label %.critedge

5:                                                ; preds = %4
  %6 = icmp slt i32 %3, 0
  %7 = getelementptr inbounds i8, ptr %1, i64 896
  %8 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %2) #5
  br i1 %6, label %9, label %10

9:                                                ; preds = %5
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %7, i32 noundef 5, ptr noundef nonnull @.str.90, ptr noundef %8)
  br label %11

10:                                               ; preds = %5
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %7, i32 noundef 5, ptr noundef nonnull @.str.91, ptr noundef %8, i32 noundef %3)
  br label %11

11:                                               ; preds = %9, %10
  %12 = tail call i32 @fflush(ptr noundef null)
  tail call void @__assert_fail(ptr noundef nonnull @.str.92, ptr noundef nonnull @.str.52, i32 noundef 653, ptr noundef nonnull @__PRETTY_FUNCTION__._Z14ipxStatusErrorbRK12HighsOptionsNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi) #6
  unreachable

.critedge:                                        ; preds = %4
  ret i1 false
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #4

attributes #0 = { 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 #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 = { 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 = { nofree 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 #5 = { nounwind }
attributes #6 = { 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)"}


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