; LLVM IR from cvanaret/Uno :: uno/ingredients/globalization_strategies/switching_methods/filter_methods/filter_2f73e283 (ZN3uno6Filter10acceptableEdd)

; 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.uno::Filter" = type { ptr, i64, %"class.std::vector", %"class.std::vector", double, i64, %"struct.uno::FilterParameters" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"struct.uno::FilterParameters" = type { double, double }

@.str.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [39 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3uno6Filter34infeasibility_sufficient_reductionEdd(ptr noundef nonnull align 8 dereferenceable(96), double noundef, double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3uno6Filter26acceptable_wrt_upper_boundEd(ptr noundef nonnull align 8 dereferenceable(96), double noundef) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3uno6Filter10acceptableEdd(ptr noundef nonnull align 8 dereferenceable(96) %0, double noundef %1, double noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store double %1, ptr %6, align 8, !tbaa !9
  store double %2, ptr %7, align 8, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  %13 = load double, ptr %6, align 8, !tbaa !9
  %14 = call noundef zeroext i1 @_ZNK3uno6Filter26acceptable_wrt_upper_boundEd(ptr noundef nonnull align 8 dereferenceable(96) %12, double noundef %13)
  br i1 %14, label %17, label %15

15:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 4, ptr %8, align 4, !tbaa !11
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA40_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 1 dereferenceable(40) @.str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  store i1 false, ptr %4, align 1
  br label %54

17:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store i64 0, ptr %9, align 8, !tbaa !13
  br label %18

18:                                               ; preds = %33, %17
  %19 = load i64, ptr %9, align 8, !tbaa !13
  %20 = getelementptr inbounds %"class.uno::Filter", ptr %12, i32 0, i32 5
  %21 = load i64, ptr %20, align 8, !tbaa !15
  %22 = icmp ult i64 %19, %21
  br i1 %22, label %23, label %31

23:                                               ; preds = %18
  %24 = getelementptr inbounds %"class.uno::Filter", ptr %12, i32 0, i32 2
  %25 = load i64, ptr %9, align 8, !tbaa !13
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %25) #3
  %27 = load double, ptr %26, align 8, !tbaa !9
  %28 = load double, ptr %6, align 8, !tbaa !9
  %29 = call noundef zeroext i1 @_ZNK3uno6Filter34infeasibility_sufficient_reductionEdd(ptr noundef nonnull align 8 dereferenceable(96) %12, double noundef %27, double noundef %28)
  %30 = xor i1 %29, true
  br label %31

31:                                               ; preds = %23, %18
  %32 = phi i1 [ false, %18 ], [ %30, %23 ]
  br i1 %32, label %33, label %36

33:                                               ; preds = %31
  %34 = load i64, ptr %9, align 8, !tbaa !13
  %35 = add i64 %34, 1
  store i64 %35, ptr %9, align 8, !tbaa !13
  br label %18, !llvm.loop !22

36:                                               ; preds = %31
  %37 = load i64, ptr %9, align 8, !tbaa !13
  %38 = icmp eq i64 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %53

40:                                               ; preds = %36
  %41 = getelementptr inbounds %"class.uno::Filter", ptr %12, i32 0, i32 3
  %42 = load i64, ptr %9, align 8, !tbaa !13
  %43 = sub i64 %42, 1
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %43) #3
  %45 = load double, ptr %44, align 8, !tbaa !9
  %46 = load double, ptr %7, align 8, !tbaa !9
  %47 = load double, ptr %6, align 8, !tbaa !9
  %48 = call noundef zeroext i1 @_ZNK3uno6Filter30objective_sufficient_reductionEddd(ptr noundef nonnull align 8 dereferenceable(96) %12, double noundef %45, double noundef %46, double noundef %47)
  br i1 %48, label %49, label %50

49:                                               ; preds = %40
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %53

50:                                               ; preds = %40
  br label %51

51:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 4, ptr %11, align 4, !tbaa !11
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA39_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 1 dereferenceable(39) @.str.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  br label %53

53:                                               ; preds = %51, %49, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %54

54:                                               ; preds = %53, %15
  %55 = load i1, ptr %4, align 1
  ret i1 %55
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA40_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(40)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3uno6Filter30objective_sufficient_reductionEddd(ptr noundef nonnull align 8 dereferenceable(96), double noundef, double noundef, double noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA39_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(39)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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" }
attributes #2 = { 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 #3 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN3uno5LevelE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !14, i64 72}
!16 = !{!"_ZTSN3uno6FilterE", !14, i64 8, !17, i64 16, !17, i64 40, !10, i64 64, !14, i64 72, !21, i64 80}
!17 = !{!"_ZTSSt6vectorIdSaIdEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSN3uno16FilterParametersE", !10, i64 0, !10, i64 8}
!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.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [39 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3uno6Filter34infeasibility_sufficient_reductionEdd(ptr noundef nonnull align 8 dereferenceable(96), double noundef, double noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZNK3uno6Filter26acceptable_wrt_upper_boundEd(ptr noundef nonnull align 8 dereferenceable(96), double noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3uno6Filter10acceptableEdd(ptr noundef nonnull align 8 dereferenceable(96) %0, double noundef %1, double noundef %2) unnamed_addr #2 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call noundef zeroext i1 @_ZNK3uno6Filter26acceptable_wrt_upper_boundEd(ptr noundef nonnull align 8 dereferenceable(96) %0, double noundef %1)
  br i1 %6, label %.preheader, label %10

.preheader:                                       ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 72
  %8 = load i64, ptr %7, align 8, !tbaa !5
  %.not = icmp eq i64 %8, 0
  br i1 %.not, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  br label %12

10:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  store i32 4, ptr %4, align 4, !tbaa !17
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA40_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(40) @.str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %.critedge.thread

12:                                               ; preds = %.lr.ph, %16
  %.011 = phi i64 [ 0, %.lr.ph ], [ %17, %16 ]
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %.011) #3
  %14 = load double, ptr %13, align 8, !tbaa !19
  %15 = tail call noundef zeroext i1 @_ZNK3uno6Filter34infeasibility_sufficient_reductionEdd(ptr noundef nonnull align 8 dereferenceable(96) %0, double noundef %14, double noundef %1)
  br i1 %15, label %.critedge, label %16

16:                                               ; preds = %12
  %17 = add nuw i64 %.011, 1
  %18 = load i64, ptr %7, align 8, !tbaa !5
  %19 = icmp ult i64 %17, %18
  br i1 %19, label %12, label %.critedge.thread15, !llvm.loop !20

.critedge:                                        ; preds = %12
  %20 = icmp eq i64 %.011, 0
  br i1 %20, label %.critedge.thread, label %.critedge.thread15

.critedge.thread15:                               ; preds = %16, %.critedge
  %.0.lcssa17 = phi i64 [ %.011, %.critedge ], [ %17, %16 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 40
  %22 = add i64 %.0.lcssa17, -1
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIdSaIdEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %22) #3
  %24 = load double, ptr %23, align 8, !tbaa !19
  %25 = tail call noundef zeroext i1 @_ZNK3uno6Filter30objective_sufficient_reductionEddd(ptr noundef nonnull align 8 dereferenceable(96) %0, double noundef %24, double noundef %2, double noundef %1)
  br i1 %25, label %.critedge.thread, label %26

26:                                               ; preds = %.critedge.thread15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  store i32 4, ptr %5, align 4, !tbaa !17
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA39_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(39) @.str.4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %.preheader, %26, %.critedge, %.critedge.thread15, %10
  %.1 = phi i1 [ false, %10 ], [ false, %26 ], [ true, %.critedge ], [ true, %.critedge.thread15 ], [ true, %.preheader ]
  ret i1 %.1
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA40_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(40)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3uno6Filter30objective_sufficient_reductionEddd(ptr noundef nonnull align 8 dereferenceable(96), double noundef, double noundef, double noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3unolsIA39_cEERKNS_5LevelES4_RKT_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(39)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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" }
attributes #2 = { 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 #3 = { 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 72}
!6 = !{!"_ZTSN3uno6FilterE", !7, i64 8, !10, i64 16, !10, i64 40, !15, i64 64, !7, i64 72, !16, i64 80}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorIdSaIdEE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseIdSaIdEE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIdSaIdEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"double", !8, i64 0}
!16 = !{!"_ZTSN3uno16FilterParametersE", !15, i64 0, !15, i64 8}
!17 = !{!18, !18, i64 0}
!18 = !{!"_ZTSN3uno5LevelE", !8, i64 0}
!19 = !{!15, !15, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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