; LLVM IR from ERGO-Code/HiGHS :: src/util (HighsUtils)

; 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.HighsScatterData = type <{ i32, i32, i32, [4 x i8], %"class.std::vector.3", %"class.std::vector.3", i8, [7 x i8], double, double, double, double, double, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x i8] }>
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.127 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [28 x i8], align 1

declare i32 @printf(ptr noundef, ...) #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z36printScatterDataRegressionComparisonNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERK16HighsScatterData(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(156) %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.HighsScatterData, ptr %5, i32 0, i32 14
  %7 = load i32, ptr %6, align 8, !tbaa !9
  %8 = icmp ne i32 %7, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %2
  br label %49

10:                                               ; preds = %2
  %11 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #3
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str.127, ptr noundef %11)
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.HighsScatterData, ptr %13, i32 0, i32 14
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.128, i32 noundef %15)
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.HighsScatterData, ptr %17, i32 0, i32 15
  %19 = load i32, ptr %18, align 4, !tbaa !18
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.129, i32 noundef %19, double noundef 2.000000e+00)
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.HighsScatterData, ptr %21, i32 0, i32 16
  %23 = load i32, ptr %22, align 8, !tbaa !19
  %24 = call i32 (ptr, ...) @printf(ptr noundef @.str.130, i32 noundef %23, double noundef 2.000000e+00)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.HighsScatterData, ptr %25, i32 0, i32 17
  %27 = load i32, ptr %26, align 4, !tbaa !20
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.131, i32 noundef %27, double noundef 2.000000e-01)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.HighsScatterData, ptr %29, i32 0, i32 18
  %31 = load i32, ptr %30, align 8, !tbaa !21
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.132, i32 noundef %31, double noundef 2.000000e-01)
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.HighsScatterData, ptr %33, i32 0, i32 19
  %35 = load i32, ptr %34, align 4, !tbaa !22
  %36 = call i32 (ptr, ...) @printf(ptr noundef @.str.133, i32 noundef %35, double noundef 2.000000e-02)
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.HighsScatterData, ptr %37, i32 0, i32 20
  %39 = load i32, ptr %38, align 8, !tbaa !23
  %40 = call i32 (ptr, ...) @printf(ptr noundef @.str.134, i32 noundef %39, double noundef 2.000000e-02)
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.HighsScatterData, ptr %41, i32 0, i32 21
  %43 = load i32, ptr %42, align 4, !tbaa !24
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.135, i32 noundef %43)
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.HighsScatterData, ptr %45, i32 0, i32 22
  %47 = load i32, ptr %46, align 8, !tbaa !25
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.136, i32 noundef %47)
  br label %49

49:                                               ; preds = %10, %9
  ret void
}

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 = { 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 = { 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, !11, i64 120}
!10 = !{!"_ZTS16HighsScatterData", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 16, !12, i64 40, !16, i64 64, !17, i64 72, !17, i64 80, !17, i64 88, !17, i64 96, !17, i64 104, !17, i64 112, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIdSaIdEE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"double", !7, i64 0}
!18 = !{!10, !11, i64 124}
!19 = !{!10, !11, i64 128}
!20 = !{!10, !11, i64 132}
!21 = !{!10, !11, i64 136}
!22 = !{!10, !11, i64 140}
!23 = !{!10, !11, i64 144}
!24 = !{!10, !11, i64 148}
!25 = !{!10, !11, i64 152}


; 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.127 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.132 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.133 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.136 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z36printScatterDataRegressionComparisonNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERK16HighsScatterData(ptr noundef %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(156) %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 120
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %34, label %5

5:                                                ; preds = %2
  %6 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #2
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.127, ptr noundef %6)
  %8 = load i32, ptr %3, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.128, i32 noundef %8)
  %10 = getelementptr inbounds i8, ptr %1, i64 124
  %11 = load i32, ptr %10, align 4, !tbaa !17
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.129, i32 noundef %11, double noundef 2.000000e+00)
  %13 = getelementptr inbounds i8, ptr %1, i64 128
  %14 = load i32, ptr %13, align 8, !tbaa !18
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.130, i32 noundef %14, double noundef 2.000000e+00)
  %16 = getelementptr inbounds i8, ptr %1, i64 132
  %17 = load i32, ptr %16, align 4, !tbaa !19
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.131, i32 noundef %17, double noundef 2.000000e-01)
  %19 = getelementptr inbounds i8, ptr %1, i64 136
  %20 = load i32, ptr %19, align 8, !tbaa !20
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.132, i32 noundef %20, double noundef 2.000000e-01)
  %22 = getelementptr inbounds i8, ptr %1, i64 140
  %23 = load i32, ptr %22, align 4, !tbaa !21
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.133, i32 noundef %23, double noundef 2.000000e-02)
  %25 = getelementptr inbounds i8, ptr %1, i64 144
  %26 = load i32, ptr %25, align 8, !tbaa !22
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.134, i32 noundef %26, double noundef 2.000000e-02)
  %28 = getelementptr inbounds i8, ptr %1, i64 148
  %29 = load i32, ptr %28, align 4, !tbaa !23
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.135, i32 noundef %29)
  %31 = getelementptr inbounds i8, ptr %1, i64 152
  %32 = load i32, ptr %31, align 8, !tbaa !24
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.136, i32 noundef %32)
  br label %34

34:                                               ; preds = %2, %5
  ret void
}

attributes #0 = { 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 #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 = { 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, !7, i64 120}
!6 = !{!"_ZTS16HighsScatterData", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !10, i64 40, !15, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !7, i64 152}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIdSaIdEE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"double", !8, i64 0}
!17 = !{!6, !7, i64 124}
!18 = !{!6, !7, i64 128}
!19 = !{!6, !7, i64 132}
!20 = !{!6, !7, i64 136}
!21 = !{!6, !7, i64 140}
!22 = !{!6, !7, i64 144}
!23 = !{!6, !7, i64 148}
!24 = !{!6, !7, i64 152}


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