; 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.BinSumsInteractionBridge = type { i32, i64, i64, ptr, ptr, i64, [30 x i64], [30 x i32], [30 x ptr], ptr, ptr }

@.str = external hidden unnamed_addr constant [96 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
@.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.21 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 x i8], align 1
@__func__.BinSumsInteraction_Cpu_64 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__.BinSumsInteraction_Cpu_64 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 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 @BinSumsInteraction_Cpu_64(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, 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
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.ObjectiveWrapper, ptr %7, i32 0, i32 20
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  %10 = getelementptr inbounds %"struct.NAMESPACE_CPU::FunctionPointersCpp", ptr %9, i32 0, i32 4
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  store ptr %11, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.BinSumsInteractionBridge, ptr %12, i32 0, i32 3
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %14, i64 noundef 64)
  br i1 %15, label %18, label %16

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

17:                                               ; No predecessors!
  br label %18

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

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

25:                                               ; No predecessors!
  br label %26

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

32:                                               ; preds = %26
  call void @LogAssertFailure(i64 noundef 468, ptr noundef @.str, ptr noundef @__func__.BinSumsInteraction_Cpu_64, ptr noundef @.str.21)
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str, i32 noundef 468, ptr noundef @__PRETTY_FUNCTION__.BinSumsInteraction_Cpu_64) #6
  unreachable

33:                                               ; No predecessors!
  br label %34

34:                                               ; preds = %33, %26
  %35 = phi i1 [ true, %26 ], [ false, %33 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !20
  br label %36

36:                                               ; preds = %54, %34
  %37 = load i64, ptr %6, align 8, !tbaa !20
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.BinSumsInteractionBridge, ptr %38, i32 0, i32 5
  %40 = load i64, ptr %39, align 8, !tbaa !21
  %41 = icmp ult i64 %37, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %57

43:                                               ; preds = %36
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.BinSumsInteractionBridge, ptr %44, i32 0, i32 8
  %46 = load i64, ptr %6, align 8, !tbaa !20
  %47 = getelementptr inbounds [30 x ptr], ptr %45, i64 0, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %48, i64 noundef 64)
  br i1 %49, label %52, label %50

50:                                               ; preds = %43
  call void @LogAssertFailure(i64 noundef 470, ptr noundef @.str, ptr noundef @__func__.BinSumsInteraction_Cpu_64, ptr noundef @.str.23)
  call void @__assert_fail(ptr noundef @.str.24, ptr noundef @.str, i32 noundef 470, ptr noundef @__PRETTY_FUNCTION__.BinSumsInteraction_Cpu_64) #6
  unreachable

51:                                               ; No predecessors!
  br label %52

52:                                               ; preds = %51, %43
  %53 = phi i1 [ true, %43 ], [ false, %51 ]
  br label %54

54:                                               ; preds = %52
  %55 = load i64, ptr %6, align 8, !tbaa !20
  %56 = add i64 %55, 1
  store i64 %56, ptr %6, align 8, !tbaa !20
  br label %36, !llvm.loop !22

57:                                               ; preds = %42
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = call noundef i32 %58(ptr noundef %59)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i32 %60
}

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 32}
!15 = !{!"_ZTSN13NAMESPACE_CPU19FunctionPointersCppE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{!17, !6, i64 24}
!17 = !{!"_ZTS24BinSumsInteractionBridge", !11, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !7, i64 48, !7, i64 288, !7, i64 408, !6, i64 648, !6, i64 656}
!18 = !{!17, !6, i64 32}
!19 = !{!17, !6, i64 648}
!20 = !{!13, !13, i64 0}
!21 = !{!17, !13, i64 40}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; 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
@.str.15 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [47 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.21 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 x i8], align 1
@__func__.BinSumsInteraction_Cpu_64 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__.BinSumsInteraction_Cpu_64 = external hidden unnamed_addr constant [114 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 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 @BinSumsInteraction_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 32
  %6 = load ptr, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  %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 466, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.BinSumsInteraction_Cpu_64, ptr noundef nonnull @.str.15)
  tail call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str, i32 noundef 466, ptr noundef nonnull @__PRETTY_FUNCTION__.BinSumsInteraction_Cpu_64) #4
  unreachable

11:                                               ; preds = %2
  %12 = getelementptr inbounds i8, ptr %1, i64 32
  %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 467, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.BinSumsInteraction_Cpu_64, ptr noundef nonnull @.str.17)
  tail call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str, i32 noundef 467, ptr noundef nonnull @__PRETTY_FUNCTION__.BinSumsInteraction_Cpu_64) #4
  unreachable

16:                                               ; preds = %11
  %17 = getelementptr inbounds i8, ptr %1, i64 648
  %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 %.preheader, label %23

.preheader:                                       ; preds = %16
  %20 = getelementptr inbounds i8, ptr %1, i64 40
  %21 = load i64, ptr %20, align 8, !tbaa !19
  %.not = icmp eq i64 %21, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %22 = getelementptr inbounds i8, ptr %1, i64 408
  br label %29

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

24:                                               ; preds = %29
  %25 = add nuw i64 %.010, 1
  %26 = load i64, ptr %20, align 8, !tbaa !19
  %27 = icmp ult i64 %25, %26
  br i1 %27, label %29, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %24, %.preheader
  %28 = tail call noundef i32 %6(ptr noundef nonnull %1)
  ret i32 %28

29:                                               ; preds = %.lr.ph, %24
  %.010 = phi i64 [ 0, %.lr.ph ], [ %25, %24 ]
  %30 = getelementptr inbounds [30 x ptr], ptr %22, i64 0, i64 %.010
  %31 = load ptr, ptr %30, align 8, !tbaa !22
  %32 = tail call noundef zeroext i1 @_ZN13NAMESPACE_CPUL9IsAlignedEPKvm(ptr noundef %31, i64 noundef 64)
  br i1 %32, label %24, label %33

33:                                               ; preds = %29
  tail call void @LogAssertFailure(i64 noundef 470, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.BinSumsInteraction_Cpu_64, ptr noundef nonnull @.str.23)
  tail call void @__assert_fail(ptr noundef nonnull @.str.24, ptr noundef nonnull @.str, i32 noundef 470, ptr noundef nonnull @__PRETTY_FUNCTION__.BinSumsInteraction_Cpu_64) #4
  unreachable
}

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 32}
!14 = !{!"_ZTSN13NAMESPACE_CPU19FunctionPointersCppE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!15 = !{!16, !7, i64 24}
!16 = !{!"_ZTS24BinSumsInteractionBridge", !10, i64 0, !12, i64 8, !12, i64 16, !7, i64 24, !7, i64 32, !12, i64 40, !8, i64 48, !8, i64 288, !8, i64 408, !7, i64 648, !7, i64 656}
!17 = !{!16, !7, i64 32}
!18 = !{!16, !7, i64 648}
!19 = !{!16, !12, i64 40}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass