; LLVM IR from interpretml/interpret :: shared/libebm/compute/cpu_ebm (cpu_64)

; 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.ObjectiveWrapper = type { ptr, ptr, ptr, ptr, i32, i32, i32, double, double, double, double, double, double, double, double, i32, i64, i64, i64, i32, ptr }
%"struct.NAMESPACE_CPU::FunctionPointersCpp" = type { ptr, ptr, ptr, ptr, ptr }
%struct.BinSumsBoostingBridge = type { i32, i32, i64, i32, i64, i64, ptr, ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [96 x i8], align 1
@__func__.BinSumsBoosting_Cpu_64 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [47 x i8], align 1
@__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 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: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef, i64 noundef) #1

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) #2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
define dso_local i32 @BinSumsBoosting_Cpu_64(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %6, i32 0, i32 20
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds %"struct.NAMESPACE_CPU::FunctionPointersCpp", ptr %8, i32 0, i32 3
  %10 = load ptr, ptr %9, align 8, !tbaa !14
  store ptr %10, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.BinSumsBoostingBridge, ptr %11, i32 0, i32 6
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  %14 = call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %13, i64 noundef 64)
  br i1 %14, label %17, label %15

15:                                               ; preds = %2
  call void @LogAssertFailure(i64 noundef 451, ptr noundef @.str, ptr noundef @__func__.BinSumsBoosting_Cpu_64, ptr noundef @.str.15)
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str, i32 noundef 451, ptr noundef @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #6
  unreachable

16:                                               ; No predecessors!
  br label %17

17:                                               ; preds = %16, %2
  %18 = phi i1 [ true, %2 ], [ false, %16 ]
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.BinSumsBoostingBridge, ptr %19, i32 0, i32 7
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %21, i64 noundef 64)
  br i1 %22, label %25, label %23

23:                                               ; preds = %17
  call void @LogAssertFailure(i64 noundef 452, ptr noundef @.str, ptr noundef @__func__.BinSumsBoosting_Cpu_64, ptr noundef @.str.17)
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str, i32 noundef 452, ptr noundef @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #6
  unreachable

24:                                               ; No predecessors!
  br label %25

25:                                               ; preds = %24, %17
  %26 = phi i1 [ true, %17 ], [ false, %24 ]
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.BinSumsBoostingBridge, ptr %27, i32 0, i32 8
  %29 = load ptr, ptr %28, align 8, !tbaa !19
  %30 = call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %29, i64 noundef 64)
  br i1 %30, label %33, label %31

31:                                               ; preds = %25
  call void @LogAssertFailure(i64 noundef 453, ptr noundef @.str, ptr noundef @__func__.BinSumsBoosting_Cpu_64, ptr noundef @.str.19)
  call void @__assert_fail(ptr noundef @.str.20, ptr noundef @.str, i32 noundef 453, ptr noundef @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #6
  unreachable

32:                                               ; No predecessors!
  br label %33

33:                                               ; preds = %32, %25
  %34 = phi i1 [ true, %25 ], [ false, %32 ]
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.BinSumsBoostingBridge, ptr %35, i32 0, i32 9
  %37 = load ptr, ptr %36, align 8, !tbaa !20
  %38 = call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %37, i64 noundef 64)
  br i1 %38, label %41, label %39

39:                                               ; preds = %33
  call void @LogAssertFailure(i64 noundef 454, ptr noundef @.str, ptr noundef @__func__.BinSumsBoosting_Cpu_64, ptr noundef @.str.21)
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str, i32 noundef 454, ptr noundef @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #6
  unreachable

40:                                               ; No predecessors!
  br label %41

41:                                               ; preds = %40, %33
  %42 = phi i1 [ true, %33 ], [ false, %40 ]
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = call noundef i32 %43(ptr noundef %44)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i32 %45
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { 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 #4 = { 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 #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)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 152}
!10 = !{!"_ZTS16ObjectiveWrapper", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !11, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !11, i64 144, !6, i64 152}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 24}
!15 = !{!"_ZTSN13NAMESPACE_CPU19FunctionPointersCppE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{!17, !6, i64 40}
!17 = !{!"_ZTS21BinSumsBoostingBridge", !11, i64 0, !11, i64 4, !13, i64 8, !11, i64 16, !13, i64 24, !13, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72}
!18 = !{!17, !6, i64 48}
!19 = !{!17, !6, i64 56}
!20 = !{!17, !6, i64 64}


; 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 = external hidden unnamed_addr constant [96 x i8], align 1
@__func__.BinSumsBoosting_Cpu_64 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [47 x i8], align 1
@__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @BinSumsBoosting_Cpu_64(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = getelementptr inbounds i8, ptr %0, i64 152
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %1, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !15
  %9 = tail call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %8, i64 noundef 64)
  br i1 %9, label %11, label %10

10:                                               ; preds = %2
  tail call void @LogAssertFailure(i64 noundef 451, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.BinSumsBoosting_Cpu_64, ptr noundef nonnull @.str.15)
  tail call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str, i32 noundef 451, ptr noundef nonnull @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #4
  unreachable

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %1, i64 48
  %13 = load ptr, ptr %12, align 8, !tbaa !17
  %14 = tail call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %13, i64 noundef 64)
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  tail call void @LogAssertFailure(i64 noundef 452, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.BinSumsBoosting_Cpu_64, ptr noundef nonnull @.str.17)
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str, i32 noundef 452, ptr noundef nonnull @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #4
  unreachable

16:                                               ; preds = %11
  %17 = getelementptr inbounds i8, ptr %1, i64 56
  %18 = load ptr, ptr %17, align 8, !tbaa !18
  %19 = tail call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %18, i64 noundef 64)
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  tail call void @LogAssertFailure(i64 noundef 453, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.BinSumsBoosting_Cpu_64, ptr noundef nonnull @.str.19)
  tail call void @__assert_fail(ptr noundef nonnull @.str.20, ptr noundef nonnull @.str, i32 noundef 453, ptr noundef nonnull @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #4
  unreachable

21:                                               ; preds = %16
  %22 = getelementptr inbounds i8, ptr %1, i64 64
  %23 = load ptr, ptr %22, align 8, !tbaa !19
  %24 = tail call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %23, i64 noundef 64)
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  tail call void @LogAssertFailure(i64 noundef 454, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.BinSumsBoosting_Cpu_64, ptr noundef nonnull @.str.21)
  tail call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str, i32 noundef 454, ptr noundef nonnull @__PRETTY_FUNCTION__.BinSumsBoosting_Cpu_64) #4
  unreachable

26:                                               ; preds = %21
  %27 = tail call noundef i32 %6(ptr noundef nonnull %1)
  ret i32 %27
}

attributes #0 = { inlinehint 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" }
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 = { 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, !7, i64 152}
!6 = !{!"_ZTS16ObjectiveWrapper", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !10, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !10, i64 144, !7, i64 152}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!14, !7, i64 24}
!14 = !{!"_ZTSN13NAMESPACE_CPU19FunctionPointersCppE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!15 = !{!16, !7, i64 40}
!16 = !{!"_ZTS21BinSumsBoostingBridge", !10, i64 0, !10, i64 4, !12, i64 8, !10, i64 16, !12, i64 24, !12, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72}
!17 = !{!16, !7, i64 48}
!18 = !{!16, !7, i64 56}
!19 = !{!16, !7, i64 64}


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