; LLVM IR from ERGO-Code/HiGHS :: src/mip/HighsMipSolverData.ll (Z8clockOffR16HighsMipAnalysis)

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

%class.HighsMipAnalysis = type { ptr, %"class.std::__cxx11::basic_string", %struct.HighsTimerClock, i8, %"class.std::vector.8", %"class.std::vector.8" }
%"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.HighsTimerClock = type { ptr, %"class.std::vector.3" }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = 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.85 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._Z8clockOffR16HighsMipAnalysis = external hidden unnamed_addr constant [34 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 i32 @printf(ptr noundef, ...) #1

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

declare void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8clockOffR16HighsMipAnalysis(ptr noundef nonnull align 8 dereferenceable(128) %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %class.HighsMipAnalysis, ptr %7, i32 0, i32 3
  %9 = load i8, ptr %8, align 8, !tbaa !9, !range !24, !noundef !25
  %10 = trunc i8 %9 to i1
  br i1 %10, label %12, label %11

11:                                               ; preds = %1
  br label %61

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = call noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128) %13, i32 noundef 35)
  %15 = zext i1 %14 to i64
  %16 = select i1 %14, i32 1, i32 0
  store i32 %16, ptr %3, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = call noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128) %17, i32 noundef 36)
  %19 = zext i1 %18 to i64
  %20 = select i1 %18, i32 1, i32 0
  store i32 %20, ptr %4, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = call noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128) %21, i32 noundef 37)
  %23 = zext i1 %22 to i64
  %24 = select i1 %22, i32 1, i32 0
  store i32 %24, ptr %5, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #4
  %25 = load i32, ptr %3, align 4, !tbaa !26
  %26 = load i32, ptr %4, align 4, !tbaa !26
  %27 = add nsw i32 %25, %26
  %28 = load i32, ptr %5, align 4, !tbaa !26
  %29 = add nsw i32 %27, %28
  %30 = icmp ne i32 %29, 0
  %31 = zext i1 %30 to i8
  store i8 %31, ptr %6, align 1, !tbaa !28
  %32 = load i8, ptr %6, align 1, !tbaa !28, !range !24, !noundef !25
  %33 = trunc i8 %32 to i1
  br i1 %33, label %39, label %34

34:                                               ; preds = %12
  %35 = load i32, ptr %3, align 4, !tbaa !26
  %36 = load i32, ptr %4, align 4, !tbaa !26
  %37 = load i32, ptr %5, align 4, !tbaa !26
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.134, i32 noundef %35, i32 noundef %36, i32 noundef %37)
  br label %39

39:                                               ; preds = %34, %12
  %40 = load i8, ptr %6, align 1, !tbaa !28, !range !24, !noundef !25
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  br label %45

43:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.135, ptr noundef @.str.85, i32 noundef 1744, ptr noundef @__PRETTY_FUNCTION__._Z8clockOffR16HighsMipAnalysis) #5
  unreachable

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %42
  %46 = load i32, ptr %3, align 4, !tbaa !26
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %50

48:                                               ; preds = %45
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128) %49, i32 noundef 35)
  br label %50

50:                                               ; preds = %48, %45
  %51 = load i32, ptr %4, align 4, !tbaa !26
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %50
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128) %54, i32 noundef 36)
  br label %55

55:                                               ; preds = %53, %50
  %56 = load i32, ptr %5, align 4, !tbaa !26
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %60

58:                                               ; preds = %55
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128) %59, i32 noundef 37)
  br label %60

60:                                               ; preds = %58, %55
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %61

61:                                               ; preds = %60, %11
  ret void
}

declare noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) #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, !19, i64 72}
!10 = !{!"_ZTS16HighsMipAnalysis", !6, i64 0, !11, i64 8, !14, i64 40, !19, i64 72, !20, i64 80, !20, i64 104}
!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 = !{!"_ZTS15HighsTimerClock", !6, i64 0, !15, i64 8}
!15 = !{!"_ZTSSt6vectorIiSaIiEE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSSt6vectorIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!27, !27, i64 0}
!27 = !{!"int", !7, i64 0}
!28 = !{!19, !19, i64 0}


; 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.85 = external hidden unnamed_addr constant [80 x i8], align 1
@.str.134 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.135 = external hidden unnamed_addr constant [12 x i8], align 1
@__PRETTY_FUNCTION__._Z8clockOffR16HighsMipAnalysis = external hidden unnamed_addr constant [34 x i8], align 1

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

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

declare void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8clockOffR16HighsMipAnalysis(ptr noundef nonnull align 8 dereferenceable(128) %0) local_unnamed_addr #3 {
  %2 = getelementptr inbounds i8, ptr %0, i64 72
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !23, !noundef !24
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %5, label %21

5:                                                ; preds = %1
  %6 = tail call noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef 35)
  %7 = zext i1 %6 to i32
  %8 = tail call noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef 36)
  %9 = zext i1 %8 to i32
  %10 = tail call noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef 37)
  %11 = zext i1 %10 to i32
  %12 = add nuw nsw i32 %9, %7
  %13 = or i32 %12, %11
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %.critedge

14:                                               ; preds = %5
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.134, i32 noundef %7, i32 noundef %9, i32 noundef %11)
  tail call void @__assert_fail(ptr noundef nonnull @.str.135, ptr noundef nonnull @.str.85, i32 noundef 1744, ptr noundef nonnull @__PRETTY_FUNCTION__._Z8clockOffR16HighsMipAnalysis) #4
  unreachable

.critedge:                                        ; preds = %5
  br i1 %6, label %16, label %17

16:                                               ; preds = %.critedge
  tail call void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef 35)
  br label %17

17:                                               ; preds = %16, %.critedge
  br i1 %8, label %18, label %19

18:                                               ; preds = %17
  tail call void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef 36)
  br label %19

19:                                               ; preds = %18, %17
  br i1 %10, label %20, label %21

20:                                               ; preds = %19
  tail call void @_ZNK16HighsMipAnalysis12mipTimerStopEi(ptr noundef nonnull align 8 dereferenceable(128) %0, i32 noundef 37)
  br label %21

21:                                               ; preds = %19, %20, %1
  ret void
}

declare noundef zeroext i1 @_ZNK16HighsMipAnalysis15mipTimerRunningEi(ptr noundef nonnull align 8 dereferenceable(128), i32 noundef) local_unnamed_addr #2

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 = { 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 = { "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 = { 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, !18, i64 72}
!6 = !{!"_ZTS16HighsMipAnalysis", !7, i64 0, !10, i64 8, !13, i64 40, !18, i64 72, !19, i64 80, !19, i64 104}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !11, i64 0, !12, i64 8, !8, i64 16}
!11 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_ZTS15HighsTimerClock", !7, i64 0, !14, i64 8}
!14 = !{!"_ZTSSt6vectorIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"_ZTSSt6vectorIdSaIdEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!23 = !{i8 0, i8 2}
!24 = !{}


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