; LLVM IR from ERGO-Code/HiGHS :: src/presolve/ICrash.ll (Z12checkOptionsRK7HighsLp13ICrashOptions)

; 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.ICrashOptions = type { i8, i32, double, i32, i32, i8, i8, [6 x i8], %struct.HighsLogOptions }
%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.58 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z12checkOptionsRK7HighsLp13ICrashOptions(ptr noundef nonnull align 8 dereferenceable(920) %0, ptr noundef %1) #0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 5
  %7 = load i8, ptr %6, align 8, !tbaa !9, !range !18, !noundef !19
  %8 = trunc i8 %7 to i1
  br i1 %8, label %9, label %11

9:                                                ; preds = %2
  %10 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 8
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %10, i32 noundef 1, ptr noundef @.str.58)
  store i1 false, ptr %3, align 1
  br label %30

11:                                               ; preds = %2
  %12 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 6
  %13 = load i8, ptr %12, align 1, !tbaa !20, !range !18, !noundef !19
  %14 = trunc i8 %13 to i1
  br i1 %14, label %15, label %29

15:                                               ; preds = %11
  %16 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 5
  %17 = load i8, ptr %16, align 8, !tbaa !9, !range !18, !noundef !19
  %18 = trunc i8 %17 to i1
  br i1 %18, label %19, label %21

19:                                               ; preds = %15
  %20 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 8
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %20, i32 noundef 1, ptr noundef @.str.59)
  store i1 false, ptr %3, align 1
  br label %30

21:                                               ; preds = %15
  %22 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 0
  %23 = load i8, ptr %22, align 8, !tbaa !21, !range !18, !noundef !19
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %27

25:                                               ; preds = %21
  %26 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 8
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %26, i32 noundef 1, ptr noundef @.str.60)
  store i1 false, ptr %3, align 1
  br label %30

27:                                               ; preds = %21
  %28 = getelementptr inbounds %struct.ICrashOptions, ptr %1, i32 0, i32 8
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %28, i32 noundef 1, ptr noundef @.str.61)
  store i1 false, ptr %3, align 1
  br label %30

29:                                               ; preds = %11
  store i1 true, ptr %3, align 1
  br label %30

30:                                               ; preds = %29, %27, %25, %19, %9
  %31 = load i1, ptr %3, align 1
  ret i1 %31
}

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

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

!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 24}
!10 = !{!"_ZTS13ICrashOptions", !11, i64 0, !12, i64 4, !13, i64 8, !14, i64 16, !14, i64 20, !11, i64 24, !11, i64 25, !15, i64 32}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTS14ICrashStrategy", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS15HighsLogOptions", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !16, i64 48, !6, i64 80, !11, i64 88}
!16 = !{!"_ZTSSt8functionIFviRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK20HighsCallbackDataOutP19HighsCallbackDataInPvEE", !17, i64 0, !6, i64 24}
!17 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!10, !11, i64 25}
!21 = !{!10, !11, 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.58 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z12checkOptionsRK7HighsLp13ICrashOptions(ptr nocapture noundef nonnull readnone align 8 dereferenceable(920) %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 24
  %4 = load i8, ptr %3, align 8, !tbaa !5, !range !17, !noundef !18
  %5 = trunc nuw i8 %4 to i1
  br i1 %5, label %6, label %8

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %1, i64 32
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %7, i32 noundef 1, ptr noundef nonnull @.str.58)
  br label %18

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %1, i64 25
  %10 = load i8, ptr %9, align 1, !tbaa !19, !range !17, !noundef !18
  %11 = trunc nuw i8 %10 to i1
  br i1 %11, label %12, label %18

12:                                               ; preds = %8
  %13 = load i8, ptr %1, align 8, !tbaa !20, !range !17, !noundef !18
  %14 = trunc nuw i8 %13 to i1
  %15 = getelementptr inbounds i8, ptr %1, i64 32
  br i1 %14, label %16, label %17

16:                                               ; preds = %12
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %15, i32 noundef 1, ptr noundef nonnull @.str.60)
  br label %18

17:                                               ; preds = %12
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %15, i32 noundef 1, ptr noundef nonnull @.str.61)
  br label %18

18:                                               ; preds = %8, %17, %16, %6
  %.0 = phi i1 [ false, %6 ], [ false, %16 ], [ false, %17 ], [ true, %8 ]
  ret i1 %.0
}

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

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

!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 24}
!6 = !{!"_ZTS13ICrashOptions", !7, i64 0, !10, i64 4, !11, i64 8, !12, i64 16, !12, i64 20, !7, i64 24, !7, i64 25, !13, i64 32}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS14ICrashStrategy", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"_ZTS15HighsLogOptions", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !15, i64 48, !14, i64 80, !7, i64 88}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"_ZTSSt8functionIFviRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPK20HighsCallbackDataOutP19HighsCallbackDataInPvEE", !16, i64 0, !14, i64 24}
!16 = !{!"_ZTSSt14_Function_base", !8, i64 0, !14, i64 16}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!6, !7, i64 25}
!20 = !{!6, !7, i64 0}


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