; LLVM IR from avaneev/biteopt :: example (main)

; 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.CBiteRnd = type <{ ptr, ptr, i64, i64, i64, i64, i32, [4 x i8] }>
%class.CTestOpt = type { %class.CBiteOpt.base, %class.CBiteParPops.base, %class.CBitePop }
%class.CBiteOpt.base = type <{ %class.CBiteOptBase.base, [4 x i8], %class.CBiteSel, %class.CBiteSel, %class.CBiteSel.0, %class.CBiteSel, %class.CBiteSel.0, %class.CBiteSel.2, %class.CBiteSel.4, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel.2, [8 x %class.CBiteSel.2], %class.CBiteSel.2, [4 x %class.CBiteSel.2], %class.CBiteSel.2, [4 x %class.CBiteSel], [4 x %class.CBiteSel], %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel, %class.CBiteSel, %class.CBiteSel.2, %class.CBiteSel, %class.CBiteSel.2, %class.CBiteSel, [2 x %class.CBiteSel], [2 x %class.CBitePop], i8, [7 x i8], %class.CBiteOptOwned, %class.CBitePop, %class.CBiteOptOwned.11, %class.CBitePop, i32 }>
%class.CBiteOptBase.base = type <{ %class.CBiteOptInterface, ptr, ptr, ptr, ptr, ptr, i8, [7 x i8], double, ptr, double, [1 x double], ptr, ptr, ptr, i8, [3 x i8], i32, double, double, [64 x ptr], [64 x ptr], i32, [4 x i8], [32 x ptr], i32 }>
%class.CBiteOptInterface = type { ptr }
%class.CBiteSel.0 = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteSelBase.base = type <{ i32, i32, i32, i32, double, [5 x ptr], ptr, i32, i32, i32, i32, i8 }>
%class.CBiteSel.4 = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteSel.2 = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteSel = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteOptOwned = type { %class.CSpherOpt.base, ptr, %class.CBiteParPops.base.9, %class.CBitePop.7 }
%class.CSpherOpt.base = type { %class.CBiteOptBase.base.10, ptr, ptr, double, double, double, double, i32, i32, %class.CBiteSel, %class.CBiteSel, %class.CBiteSel.0 }
%class.CBiteOptBase.base.10 = type <{ %class.CBiteOptInterface, ptr, ptr, ptr, ptr, ptr, i8, [7 x i8], double, ptr, double, [1 x double], ptr, ptr, ptr, i8, [3 x i8], i32, double, double, [64 x ptr], [64 x ptr], i32, [4 x i8], [32 x ptr], i32 }>
%class.CBiteParPops.base.9 = type { ptr, ptr, i32, ptr }
%class.CBitePop.7 = type { ptr, double, double, i32, double, i32, i32, i32, i32, double, i32, i32, i32, ptr, ptr, i64, i64, i64, i64, ptr, i8, double, ptr }
%class.CBiteOptOwned.11 = type { %class.CMiniBiteOpt.base, ptr, %class.CBiteParPops.base.9, %class.CBitePop.7 }
%class.CMiniBiteOpt.base = type { %class.CBiteOptBase.base.10, [4 x i8], %class.CBiteSel.0, %class.CBiteOptOwned.12 }
%class.CBiteOptOwned.12 = type { %class.CNMSeqOpt.base, ptr, %class.CBiteParPops.base.9, %class.CBitePop.7 }
%class.CNMSeqOpt.base = type { %class.CBiteOptBase.base.10, i32, i32, i32, double, i32, i32, i32, ptr, ptr, ptr, ptr, double, ptr, ptr, i32, i32 }
%class.CBiteParPops.base = type { ptr, ptr, i32, ptr }
%class.CBitePop = type { ptr, double, double, i32, double, i32, i32, i32, i32, double, i32, i32, i32, ptr, ptr, i64, i64, i64, i64, ptr, i8, double, ptr }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %class.CBiteRnd, align 8
  %3 = alloca %class.CTestOpt, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 56, ptr %2) #6
  call void @_ZN8CBiteRndC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %2)
  call void @_ZN8CBiteRnd4initEiPFjPvES0_(ptr noundef nonnull align 8 dereferenceable(52) %2, i32 noundef 1, ptr noundef null, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 12224, ptr %3) #6
  call void @_ZN8CTestOptC1Ev(ptr noundef nonnull align 8 dereferenceable(12028) %3)
  invoke void @_ZN8CBiteOpt4initER8CBiteRndPKdd(ptr noundef nonnull align 8 dereferenceable(12028) %3, ptr noundef nonnull align 8 dereferenceable(52) %2, ptr noundef null, double noundef 1.000000e+00)
          to label %7 unwind label %18

7:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %27, %7
  %9 = load i32, ptr %6, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 10000
  br i1 %10, label %11, label %30

11:                                               ; preds = %8
  %12 = invoke noundef i32 @_ZN8CBiteOpt8optimizeER8CBiteRndPS_(ptr noundef nonnull align 8 dereferenceable(12028) %3, ptr noundef nonnull align 8 dereferenceable(52) %2, ptr noundef null)
          to label %13 unwind label %22

13:                                               ; preds = %11
  %14 = invoke noundef double @_ZNK12CBiteOptBaseIlE11getBestCostEv(ptr noundef nonnull align 8 dereferenceable(1428) %3)
          to label %15 unwind label %22

15:                                               ; preds = %13
  %16 = fcmp olt double %14, 0x3EB0C6F7A0B5ED8D
  br i1 %16, label %17, label %26

17:                                               ; preds = %15
  br label %30

18:                                               ; preds = %0
  %19 = landingpad { ptr, i32 }
          cleanup
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %4, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %5, align 4
  br label %51

22:                                               ; preds = %45, %43, %39, %37, %35, %33, %30, %13, %11
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %4, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %51

26:                                               ; preds = %15
  br label %27

27:                                               ; preds = %26
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %6, align 4, !tbaa !5
  br label %8, !llvm.loop !9

30:                                               ; preds = %17, %8
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %31)
          to label %33 unwind label %22

33:                                               ; preds = %30
  %34 = invoke noundef double @_ZNK12CBiteOptBaseIlE11getBestCostEv(ptr noundef nonnull align 8 dereferenceable(1428) %3)
          to label %35 unwind label %22

35:                                               ; preds = %33
  %36 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %34)
          to label %37 unwind label %22

37:                                               ; preds = %35
  %38 = invoke noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %3)
          to label %39 unwind label %22

39:                                               ; preds = %37
  %40 = getelementptr inbounds double, ptr %38, i64 0
  %41 = load double, ptr %40, align 8, !tbaa !11
  %42 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %41)
          to label %43 unwind label %22

43:                                               ; preds = %39
  %44 = invoke noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %3)
          to label %45 unwind label %22

45:                                               ; preds = %43
  %46 = getelementptr inbounds double, ptr %44, i64 1
  %47 = load double, ptr %46, align 8, !tbaa !11
  %48 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %47)
          to label %49 unwind label %22

49:                                               ; preds = %45
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12028) %3) #6
  call void @llvm.lifetime.end.p0(i64 12224, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #6
  %50 = load i32, ptr %1, align 4
  ret i32 %50

51:                                               ; preds = %22, %18
  call void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12028) %3) #6
  call void @llvm.lifetime.end.p0(i64 12224, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #6
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %4, align 8
  %54 = load i32, ptr %5, align 4
  %55 = insertvalue { ptr, i32 } poison, ptr %53, 0
  %56 = insertvalue { ptr, i32 } %55, i32 %54, 1
  resume { ptr, i32 } %56
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CBiteRndC2Ev(ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CBiteRnd4initEiPFjPvES0_(ptr noundef nonnull align 8 dereferenceable(52), i32 noundef, ptr noundef, ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CTestOptC1Ev(ptr noundef nonnull align 8 dereferenceable(12028)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CBiteOpt4initER8CBiteRndPKdd(ptr noundef nonnull align 8 dereferenceable(12028), ptr noundef nonnull align 8 dereferenceable(52), ptr noundef, double noundef) #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8CBiteOpt8optimizeER8CBiteRndPS_(ptr noundef nonnull align 8 dereferenceable(12028), ptr noundef nonnull align 8 dereferenceable(52), ptr noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12CBiteOptBaseIlE11getBestCostEv(ptr noundef nonnull align 8 dereferenceable(1428)) unnamed_addr #3 align 2

declare i32 @printf(ptr noundef, ...) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12028)) unnamed_addr #5 align 2

attributes #0 = { mustprogress norecurse 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { "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 = { inlinehint 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 #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, 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"

%class.CBiteRnd = type <{ ptr, ptr, i64, i64, i64, i64, i32, [4 x i8] }>
%class.CTestOpt = type { %class.CBiteOpt.base, %class.CBiteParPops.base, %class.CBitePop }
%class.CBiteOpt.base = type <{ %class.CBiteOptBase.base, [4 x i8], %class.CBiteSel, %class.CBiteSel, %class.CBiteSel.0, %class.CBiteSel, %class.CBiteSel.0, %class.CBiteSel.2, %class.CBiteSel.4, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel.2, [8 x %class.CBiteSel.2], %class.CBiteSel.2, [4 x %class.CBiteSel.2], %class.CBiteSel.2, [4 x %class.CBiteSel], [4 x %class.CBiteSel], %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel.2, %class.CBiteSel, %class.CBiteSel, %class.CBiteSel.2, %class.CBiteSel, %class.CBiteSel.2, %class.CBiteSel, [2 x %class.CBiteSel], [2 x %class.CBitePop], i8, [7 x i8], %class.CBiteOptOwned, %class.CBitePop, %class.CBiteOptOwned.11, %class.CBitePop, i32 }>
%class.CBiteOptBase.base = type <{ %class.CBiteOptInterface, ptr, ptr, ptr, ptr, ptr, i8, [7 x i8], double, ptr, double, [1 x double], ptr, ptr, ptr, i8, [3 x i8], i32, double, double, [64 x ptr], [64 x ptr], i32, [4 x i8], [32 x ptr], i32 }>
%class.CBiteOptInterface = type { ptr }
%class.CBiteSel.0 = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteSelBase.base = type <{ i32, i32, i32, i32, double, [5 x ptr], ptr, i32, i32, i32, i32, i8 }>
%class.CBiteSel.4 = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteSel.2 = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteSel = type { %class.CBiteSelBase.base, [7 x i8] }
%class.CBiteOptOwned = type { %class.CSpherOpt.base, ptr, %class.CBiteParPops.base.9, %class.CBitePop.7 }
%class.CSpherOpt.base = type { %class.CBiteOptBase.base.10, ptr, ptr, double, double, double, double, i32, i32, %class.CBiteSel, %class.CBiteSel, %class.CBiteSel.0 }
%class.CBiteOptBase.base.10 = type <{ %class.CBiteOptInterface, ptr, ptr, ptr, ptr, ptr, i8, [7 x i8], double, ptr, double, [1 x double], ptr, ptr, ptr, i8, [3 x i8], i32, double, double, [64 x ptr], [64 x ptr], i32, [4 x i8], [32 x ptr], i32 }>
%class.CBiteParPops.base.9 = type { ptr, ptr, i32, ptr }
%class.CBitePop.7 = type { ptr, double, double, i32, double, i32, i32, i32, i32, double, i32, i32, i32, ptr, ptr, i64, i64, i64, i64, ptr, i8, double, ptr }
%class.CBiteOptOwned.11 = type { %class.CMiniBiteOpt.base, ptr, %class.CBiteParPops.base.9, %class.CBitePop.7 }
%class.CMiniBiteOpt.base = type { %class.CBiteOptBase.base.10, [4 x i8], %class.CBiteSel.0, %class.CBiteOptOwned.12 }
%class.CBiteOptOwned.12 = type { %class.CNMSeqOpt.base, ptr, %class.CBiteParPops.base.9, %class.CBitePop.7 }
%class.CNMSeqOpt.base = type { %class.CBiteOptBase.base.10, i32, i32, i32, double, i32, i32, i32, ptr, ptr, ptr, ptr, double, ptr, ptr, i32, i32 }
%class.CBiteParPops.base = type { ptr, ptr, i32, ptr }
%class.CBitePop = type { ptr, double, double, i32, double, i32, i32, i32, i32, double, i32, i32, i32, ptr, ptr, i64, i64, i64, i64, ptr, i8, double, ptr }

@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.CBiteRnd, align 8
  %2 = alloca %class.CTestOpt, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %1) #6
  call void @_ZN8CBiteRndC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %1)
  call void @_ZN8CBiteRnd4initEiPFjPvES0_(ptr noundef nonnull align 8 dereferenceable(52) %1, i32 noundef 1, ptr noundef null, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 12224, ptr nonnull %2) #6
  call void @_ZN8CTestOptC1Ev(ptr noundef nonnull align 8 dereferenceable(12028) %2)
  invoke void @_ZN8CBiteOpt4initER8CBiteRndPKdd(ptr noundef nonnull align 8 dereferenceable(12028) %2, ptr noundef nonnull align 8 dereferenceable(52) %1, ptr noundef null, double noundef 1.000000e+00)
          to label %.preheader unwind label %7

.preheader:                                       ; preds = %0, %11
  %.09 = phi i32 [ %12, %11 ], [ 0, %0 ]
  %3 = invoke noundef i32 @_ZN8CBiteOpt8optimizeER8CBiteRndPS_(ptr noundef nonnull align 8 dereferenceable(12028) %2, ptr noundef nonnull align 8 dereferenceable(52) %1, ptr noundef null)
          to label %4 unwind label %9

4:                                                ; preds = %.preheader
  %5 = call noundef double @_ZNK12CBiteOptBaseIlE11getBestCostEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %6 = fcmp olt double %5, 0x3EB0C6F7A0B5ED8D
  br i1 %6, label %13, label %11

7:                                                ; preds = %0
  %8 = landingpad { ptr, i32 }
          cleanup
  br label %24

9:                                                ; preds = %.preheader
  %10 = landingpad { ptr, i32 }
          cleanup
  br label %24

11:                                               ; preds = %4
  %12 = add nuw nsw i32 %.09, 1
  %exitcond.not = icmp eq i32 %12, 10000
  br i1 %exitcond.not, label %13, label %.preheader, !llvm.loop !5

13:                                               ; preds = %4, %11
  %.0.lcssa = phi i32 [ %.09, %4 ], [ 10000, %11 ]
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.0.lcssa)
  %15 = call noundef double @_ZNK12CBiteOptBaseIlE11getBestCostEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %15)
  %17 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %18 = load double, ptr %17, align 8, !tbaa !7
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %18)
  %20 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %21 = getelementptr inbounds i8, ptr %20, i64 8
  %22 = load double, ptr %21, align 8, !tbaa !7
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %22)
  call void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12028) %2) #6
  call void @llvm.lifetime.end.p0(i64 12224, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #6
  ret i32 0

24:                                               ; preds = %9, %7
  %.pn = phi { ptr, i32 } [ %10, %9 ], [ %8, %7 ]
  call void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12028) %2) #6
  call void @llvm.lifetime.end.p0(i64 12224, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CBiteRndC2Ev(ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CBiteRnd4initEiPFjPvES0_(ptr noundef nonnull align 8 dereferenceable(52), i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CTestOptC1Ev(ptr noundef nonnull align 8 dereferenceable(12028)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CBiteOpt4initER8CBiteRndPKdd(ptr noundef nonnull align 8 dereferenceable(12028), ptr noundef nonnull align 8 dereferenceable(52), ptr noundef, double noundef) local_unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN8CBiteOpt8optimizeER8CBiteRndPS_(ptr noundef nonnull align 8 dereferenceable(12028), ptr noundef nonnull align 8 dereferenceable(52), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK12CBiteOptBaseIlE11getBestCostEv(ptr noundef nonnull align 8 dereferenceable(1428)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12028)) unnamed_addr #5 align 2

attributes #0 = { mustprogress norecurse 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass