; LLVM IR from ERGO-Code/HiGHS :: src/lp_data/HighsCallback.ll (ZN13HighsCallback25clearHighsCallbackDataOutEv)

; 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.HighsCallback = type { %"class.std::function", ptr, ptr, %"class.std::vector", %struct.HighsCallbackDataOut, %struct.HighsCallbackDataIn }
%"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 } }
%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%struct.HighsCallbackDataOut = type { i32, double, i32, i32, i32, double, i64, i64, double, double, double, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.HighsCallbackDataIn = type { i32, ptr }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN13HighsCallback25clearHighsCallbackDataOutEv(ptr noundef nonnull align 8 dereferenceable(256) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %5 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %4, i32 0, i32 0
  store i32 -1, ptr %5, align 8, !tbaa !9
  %6 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %7 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %6, i32 0, i32 1
  store double -1.000000e+00, ptr %7, align 8, !tbaa !24
  %8 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %9 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %8, i32 0, i32 2
  store i32 -1, ptr %9, align 8, !tbaa !25
  %10 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %11 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %10, i32 0, i32 3
  store i32 -1, ptr %11, align 4, !tbaa !26
  %12 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %13 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %12, i32 0, i32 4
  store i32 -1, ptr %13, align 8, !tbaa !27
  %14 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %15 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %14, i32 0, i32 5
  store double 0xFFF0000000000000, ptr %15, align 8, !tbaa !28
  %16 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %17 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %16, i32 0, i32 6
  store i64 -1, ptr %17, align 8, !tbaa !29
  %18 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %19 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %18, i32 0, i32 8
  store double 0x7FF0000000000000, ptr %19, align 8, !tbaa !30
  %20 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %21 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %20, i32 0, i32 9
  store double 0xFFF0000000000000, ptr %21, align 8, !tbaa !31
  %22 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %23 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %22, i32 0, i32 10
  store double -1.000000e+00, ptr %23, align 8, !tbaa !32
  %24 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %25 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %24, i32 0, i32 11
  store ptr null, ptr %25, align 8, !tbaa !33
  %26 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %27 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %26, i32 0, i32 12
  store i32 0, ptr %27, align 8, !tbaa !34
  %28 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %29 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %28, i32 0, i32 13
  store i32 0, ptr %29, align 4, !tbaa !35
  %30 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %31 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %30, i32 0, i32 14
  store i32 0, ptr %31, align 8, !tbaa !36
  %32 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %33 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %32, i32 0, i32 15
  store ptr null, ptr %33, align 8, !tbaa !37
  %34 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %35 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %34, i32 0, i32 16
  store ptr null, ptr %35, align 8, !tbaa !38
  %36 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %37 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %36, i32 0, i32 17
  store ptr null, ptr %37, align 8, !tbaa !39
  %38 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %39 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %38, i32 0, i32 18
  store ptr null, ptr %39, align 8, !tbaa !40
  %40 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %41 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %40, i32 0, i32 19
  store ptr null, ptr %41, align 8, !tbaa !41
  %42 = getelementptr inbounds %struct.HighsCallback, ptr %3, i32 0, i32 4
  %43 = getelementptr inbounds %struct.HighsCallbackDataOut, ptr %42, i32 0, i32 20
  store i32 0, ptr %43, align 8, !tbaa !42
  ret void
}

attributes #0 = { 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" }

!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, !19, i64 88}
!10 = !{!"_ZTS13HighsCallback", !11, i64 0, !6, i64 32, !6, i64 40, !13, i64 48, !20, i64 88, !23, i64 240}
!11 = !{!"_ZTSSt8functionIFviRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK20HighsCallbackDataOutP19HighsCallbackDataInPvEE", !12, i64 0, !6, i64 24}
!12 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!13 = !{!"_ZTSSt6vectorIbSaIbEE", !14, i64 0}
!14 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !17, i64 0, !17, i64 16, !6, i64 32}
!17 = !{!"_ZTSSt13_Bit_iterator", !18, i64 0}
!18 = !{!"_ZTSSt18_Bit_iterator_base", !6, i64 0, !19, i64 8}
!19 = !{!"int", !7, i64 0}
!20 = !{!"_ZTS20HighsCallbackDataOut", !19, i64 0, !21, i64 8, !19, i64 16, !19, i64 20, !19, i64 24, !21, i64 32, !22, i64 40, !22, i64 48, !21, i64 56, !21, i64 64, !21, i64 72, !6, i64 80, !19, i64 88, !19, i64 92, !19, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !19, i64 144}
!21 = !{!"double", !7, i64 0}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTS19HighsCallbackDataIn", !19, i64 0, !6, i64 8}
!24 = !{!10, !21, i64 96}
!25 = !{!10, !19, i64 104}
!26 = !{!10, !19, i64 108}
!27 = !{!10, !19, i64 112}
!28 = !{!10, !21, i64 120}
!29 = !{!10, !22, i64 128}
!30 = !{!10, !21, i64 144}
!31 = !{!10, !21, i64 152}
!32 = !{!10, !21, i64 160}
!33 = !{!10, !6, i64 168}
!34 = !{!10, !19, i64 176}
!35 = !{!10, !19, i64 180}
!36 = !{!10, !19, i64 184}
!37 = !{!10, !6, i64 192}
!38 = !{!10, !6, i64 200}
!39 = !{!10, !6, i64 208}
!40 = !{!10, !6, i64 216}
!41 = !{!10, !6, i64 224}
!42 = !{!10, !19, i64 232}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @_ZN13HighsCallback25clearHighsCallbackDataOutEv(ptr nocapture noundef nonnull writeonly align 8 dereferenceable(256) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 88
  store i32 -1, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 96
  store double -1.000000e+00, ptr %3, align 8, !tbaa !23
  %4 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 -1, ptr %4, align 8, !tbaa !24
  %5 = getelementptr inbounds i8, ptr %0, i64 108
  store i32 -1, ptr %5, align 4, !tbaa !25
  %6 = getelementptr inbounds i8, ptr %0, i64 112
  store i32 -1, ptr %6, align 8, !tbaa !26
  %7 = getelementptr inbounds i8, ptr %0, i64 120
  store double 0xFFF0000000000000, ptr %7, align 8, !tbaa !27
  %8 = getelementptr inbounds i8, ptr %0, i64 128
  store i64 -1, ptr %8, align 8, !tbaa !28
  %9 = getelementptr inbounds i8, ptr %0, i64 144
  store <2 x double> <double 0x7FF0000000000000, double 0xFFF0000000000000>, ptr %9, align 8, !tbaa !29
  %10 = getelementptr inbounds i8, ptr %0, i64 160
  store double -1.000000e+00, ptr %10, align 8, !tbaa !30
  %11 = getelementptr inbounds i8, ptr %0, i64 168
  %12 = getelementptr inbounds i8, ptr %0, i64 192
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(20) %11, i8 0, i64 20, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(44) %12, i8 0, i64 44, i1 false)
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !18, i64 88}
!6 = !{!"_ZTS13HighsCallback", !7, i64 0, !11, i64 32, !11, i64 40, !12, i64 48, !19, i64 88, !22, i64 240}
!7 = !{!"_ZTSSt8functionIFviRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK20HighsCallbackDataOutP19HighsCallbackDataInPvEE", !8, i64 0, !11, i64 24}
!8 = !{!"_ZTSSt14_Function_base", !9, i64 0, !11, i64 16}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_ZTSSt6vectorIbSaIbEE", !13, i64 0}
!13 = !{!"_ZTSSt13_Bvector_baseISaIbEE", !14, i64 0}
!14 = !{!"_ZTSNSt13_Bvector_baseISaIbEE13_Bvector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt13_Bvector_baseISaIbEE18_Bvector_impl_dataE", !16, i64 0, !16, i64 16, !11, i64 32}
!16 = !{!"_ZTSSt13_Bit_iterator", !17, i64 0}
!17 = !{!"_ZTSSt18_Bit_iterator_base", !11, i64 0, !18, i64 8}
!18 = !{!"int", !9, i64 0}
!19 = !{!"_ZTS20HighsCallbackDataOut", !18, i64 0, !20, i64 8, !18, i64 16, !18, i64 20, !18, i64 24, !20, i64 32, !21, i64 40, !21, i64 48, !20, i64 56, !20, i64 64, !20, i64 72, !11, i64 80, !18, i64 88, !18, i64 92, !18, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !11, i64 136, !18, i64 144}
!20 = !{!"double", !9, i64 0}
!21 = !{!"long", !9, i64 0}
!22 = !{!"_ZTS19HighsCallbackDataIn", !18, i64 0, !11, i64 8}
!23 = !{!6, !20, i64 96}
!24 = !{!6, !18, i64 104}
!25 = !{!6, !18, i64 108}
!26 = !{!6, !18, i64 112}
!27 = !{!6, !20, i64 120}
!28 = !{!6, !21, i64 128}
!29 = !{!20, !20, i64 0}
!30 = !{!6, !20, i64 160}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass