; LLVM IR from avaneev/biteopt :: constr (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, i32, double, %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 [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 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 12232, ptr %3) #6
  call void @_ZN8CTestOptC1Ev(ptr noundef nonnull align 8 dereferenceable(12040) %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 %16

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 = %25, %7
  %9 = load i32, ptr %6, align 4, !tbaa !5
  %10 = icmp slt i32 %9, 500000
  br i1 %10, label %11, label %28

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 %20

13:                                               ; preds = %11
  %14 = icmp sgt i32 %12, 1664
  br i1 %14, label %15, label %24

15:                                               ; preds = %13
  br label %28

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

20:                                               ; preds = %51, %48, %40, %36, %32, %30, %28, %11
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %4, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %63

24:                                               ; preds = %13
  br label %25

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

28:                                               ; preds = %15, %8
  %29 = invoke noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %3)
          to label %30 unwind label %20

30:                                               ; preds = %28
  %31 = invoke noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(12040) %3, ptr noundef %29)
          to label %32 unwind label %20

32:                                               ; preds = %30
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  %35 = invoke i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %34)
          to label %36 unwind label %20

36:                                               ; preds = %32
  %37 = getelementptr inbounds %class.CTestOpt, ptr %3, i32 0, i32 2
  %38 = load double, ptr %37, align 8, !tbaa !11
  %39 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %38)
          to label %40 unwind label %20

40:                                               ; preds = %36
  %41 = getelementptr inbounds %class.CTestOpt, ptr %3, i32 0, i32 1
  %42 = load i32, ptr %41, align 4, !tbaa !34
  %43 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %42)
          to label %44 unwind label %20

44:                                               ; preds = %40
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %58, %44
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = icmp slt i32 %46, 13
  br i1 %47, label %48, label %61

48:                                               ; preds = %45
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = invoke noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %3)
          to label %51 unwind label %20

51:                                               ; preds = %48
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds double, ptr %50, i64 %53
  %55 = load double, ptr %54, align 8, !tbaa !35
  %56 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %49, double noundef %55)
          to label %57 unwind label %20

57:                                               ; preds = %51
  br label %58

58:                                               ; preds = %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %6, align 4, !tbaa !5
  br label %45, !llvm.loop !36

61:                                               ; 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(12040) %3) #6
  call void @llvm.lifetime.end.p0(i64 12232, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #6
  %62 = load i32, ptr %1, align 4
  ret i32 %62

63:                                               ; preds = %20, %16
  call void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12040) %3) #6
  call void @llvm.lifetime.end.p0(i64 12232, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #6
  br label %64

64:                                               ; preds = %63
  %65 = load ptr, ptr %4, align 8
  %66 = load i32, ptr %5, align 4
  %67 = insertvalue { ptr, i32 } poison, ptr %65, 0
  %68 = insertvalue { ptr, i32 } %67, i32 %66, 1
  resume { ptr, i32 } %68
}

; 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(12040)) 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 uwtable
declare dso_local noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(12040), ptr noundef) unnamed_addr #2 align 2

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

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

; 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(12040)) 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, !18, i64 12032}
!12 = !{!"_ZTS8CTestOpt", !13, i64 0, !6, i64 12028, !18, i64 12032}
!13 = !{!"_ZTS8CBiteOpt", !14, i64 0, !19, i64 1432, !19, i64 1528, !21, i64 1624, !19, i64 1720, !21, i64 1816, !22, i64 1912, !23, i64 2008, !22, i64 2104, !22, i64 2200, !22, i64 2296, !7, i64 2392, !22, i64 3160, !7, i64 3256, !22, i64 3640, !7, i64 3736, !7, i64 4120, !22, i64 4504, !22, i64 4600, !19, i64 4696, !22, i64 4792, !22, i64 4888, !22, i64 4984, !22, i64 5080, !19, i64 5176, !19, i64 5272, !22, i64 5368, !19, i64 5464, !22, i64 5560, !19, i64 5656, !7, i64 5752, !7, i64 5944, !17, i64 6264, !24, i64 6272, !27, i64 8248, !29, i64 8408, !27, i64 11864, !6, i64 12024}
!14 = !{!"_ZTS12CBiteOptBaseIlE", !15, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !17, i64 48, !18, i64 56, !16, i64 64, !18, i64 72, !7, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !17, i64 112, !6, i64 116, !18, i64 120, !18, i64 128, !7, i64 136, !7, i64 648, !6, i64 1160, !7, i64 1168, !6, i64 1424}
!15 = !{!"_ZTS17CBiteOptInterface"}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"_ZTS8CBiteSelILi4ELi150EE", !20, i64 0}
!20 = !{!"_ZTS12CBiteSelBase", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !18, i64 16, !7, i64 24, !16, i64 64, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !17, i64 88}
!21 = !{!"_ZTS8CBiteSelILi3ELi150EE", !20, i64 0}
!22 = !{!"_ZTS8CBiteSelILi2ELi150EE", !20, i64 0}
!23 = !{!"_ZTS8CBiteSelILi5ELi150EE", !20, i64 0}
!24 = !{!"_ZTS13CBiteOptOwnedI9CSpherOptE", !25, i64 0, !16, i64 1776}
!25 = !{!"_ZTS9CSpherOpt", !26, i64 0, !16, i64 1432, !16, i64 1440, !18, i64 1448, !18, i64 1456, !18, i64 1464, !18, i64 1472, !6, i64 1480, !6, i64 1484, !19, i64 1488, !19, i64 1584, !21, i64 1680}
!26 = !{!"_ZTS12CBiteOptBaseIdE", !15, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !17, i64 48, !18, i64 56, !16, i64 64, !18, i64 72, !7, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !17, i64 112, !6, i64 116, !18, i64 120, !18, i64 128, !7, i64 136, !7, i64 648, !6, i64 1160, !7, i64 1168, !6, i64 1424}
!27 = !{!"_ZTS8CBitePopIlE", !18, i64 8, !18, i64 16, !6, i64 24, !18, i64 32, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !18, i64 56, !6, i64 64, !6, i64 68, !6, i64 72, !16, i64 80, !16, i64 88, !28, i64 96, !28, i64 104, !28, i64 112, !28, i64 120, !16, i64 128, !17, i64 136, !18, i64 144, !16, i64 152}
!28 = !{!"long", !7, i64 0}
!29 = !{!"_ZTS13CBiteOptOwnedI12CMiniBiteOptE", !30, i64 0, !16, i64 3256}
!30 = !{!"_ZTS12CMiniBiteOpt", !26, i64 0, !21, i64 1432, !31, i64 1528}
!31 = !{!"_ZTS13CBiteOptOwnedI9CNMSeqOptE", !32, i64 0, !16, i64 1528}
!32 = !{!"_ZTS9CNMSeqOpt", !26, i64 0, !6, i64 1428, !6, i64 1432, !6, i64 1436, !18, i64 1440, !6, i64 1448, !6, i64 1452, !6, i64 1456, !16, i64 1464, !16, i64 1472, !16, i64 1480, !16, i64 1488, !18, i64 1496, !16, i64 1504, !16, i64 1512, !6, i64 1520, !33, i64 1524}
!33 = !{!"_ZTSN9CNMSeqOpt6EStateE", !7, i64 0}
!34 = !{!12, !6, i64 12028}
!35 = !{!18, !18, i64 0}
!36 = distinct !{!36, !10}


; 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, i32, double, %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 [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 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 12232, ptr nonnull %2) #6
  call void @_ZN8CTestOptC1Ev(ptr noundef nonnull align 8 dereferenceable(12040) %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 %6

.preheader:                                       ; preds = %0, %8
  %.013 = phi i32 [ %9, %8 ], [ 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 %.loopexit

4:                                                ; preds = %.preheader
  %5 = icmp sgt i32 %3, 1664
  br i1 %5, label %10, label %8

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

.loopexit:                                        ; preds = %.preheader
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %73

.loopexit.split-lp:                               ; preds = %10
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %73

8:                                                ; preds = %4
  %9 = add nuw nsw i32 %.013, 1
  %exitcond.not = icmp eq i32 %9, 500000
  br i1 %exitcond.not, label %10, label %.preheader, !llvm.loop !5

10:                                               ; preds = %4, %8
  %.0.lcssa = phi i32 [ %.013, %4 ], [ 500000, %8 ]
  %11 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %12 = invoke noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(12040) %2, ptr noundef %11)
          to label %13 unwind label %.loopexit.split-lp

13:                                               ; preds = %10
  %14 = add nuw nsw i32 %.0.lcssa, 1
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
  %16 = getelementptr inbounds i8, ptr %2, i64 12032
  %17 = load double, ptr %16, align 8, !tbaa !7
  %18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %17)
  %19 = getelementptr inbounds i8, ptr %2, i64 12028
  %20 = load i32, ptr %19, align 4, !tbaa !33
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
  %22 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %23 = load double, ptr %22, align 8, !tbaa !34
  %24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 0, double noundef %23)
  %25 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = load double, ptr %26, align 8, !tbaa !34
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1, double noundef %27)
  %29 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %31 = load double, ptr %30, align 8, !tbaa !34
  %32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2, double noundef %31)
  %33 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %34 = getelementptr inbounds i8, ptr %33, i64 24
  %35 = load double, ptr %34, align 8, !tbaa !34
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3, double noundef %35)
  %37 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %38 = getelementptr inbounds i8, ptr %37, i64 32
  %39 = load double, ptr %38, align 8, !tbaa !34
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4, double noundef %39)
  %41 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %42 = getelementptr inbounds i8, ptr %41, i64 40
  %43 = load double, ptr %42, align 8, !tbaa !34
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5, double noundef %43)
  %45 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %46 = getelementptr inbounds i8, ptr %45, i64 48
  %47 = load double, ptr %46, align 8, !tbaa !34
  %48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6, double noundef %47)
  %49 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %50 = getelementptr inbounds i8, ptr %49, i64 56
  %51 = load double, ptr %50, align 8, !tbaa !34
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7, double noundef %51)
  %53 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %54 = getelementptr inbounds i8, ptr %53, i64 64
  %55 = load double, ptr %54, align 8, !tbaa !34
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8, double noundef %55)
  %57 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %58 = getelementptr inbounds i8, ptr %57, i64 72
  %59 = load double, ptr %58, align 8, !tbaa !34
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9, double noundef %59)
  %61 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %62 = getelementptr inbounds i8, ptr %61, i64 80
  %63 = load double, ptr %62, align 8, !tbaa !34
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10, double noundef %63)
  %65 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %66 = getelementptr inbounds i8, ptr %65, i64 88
  %67 = load double, ptr %66, align 8, !tbaa !34
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11, double noundef %67)
  %69 = call noundef ptr @_ZNK12CBiteOptBaseIlE13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(1428) %2)
  %70 = getelementptr inbounds i8, ptr %69, i64 96
  %71 = load double, ptr %70, align 8, !tbaa !34
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12, double noundef %71)
  call void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12040) %2) #6
  call void @llvm.lifetime.end.p0(i64 12232, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #6
  ret i32 0

73:                                               ; preds = %.loopexit, %.loopexit.split-lp, %6
  %.pn = phi { ptr, i32 } [ %7, %6 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZN8CTestOptD1Ev(ptr noundef nonnull align 8 dereferenceable(12040) %2) #6
  call void @llvm.lifetime.end.p0(i64 12232, 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(12040)) 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 uwtable
declare dso_local noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(12040), ptr noundef) unnamed_addr #2 align 2

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; 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(12040)) 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, !16, i64 12032}
!8 = !{!"_ZTS8CTestOpt", !9, i64 0, !17, i64 12028, !16, i64 12032}
!9 = !{!"_ZTS8CBiteOpt", !10, i64 0, !18, i64 1432, !18, i64 1528, !20, i64 1624, !18, i64 1720, !20, i64 1816, !21, i64 1912, !22, i64 2008, !21, i64 2104, !21, i64 2200, !21, i64 2296, !13, i64 2392, !21, i64 3160, !13, i64 3256, !21, i64 3640, !13, i64 3736, !13, i64 4120, !21, i64 4504, !21, i64 4600, !18, i64 4696, !21, i64 4792, !21, i64 4888, !21, i64 4984, !21, i64 5080, !18, i64 5176, !18, i64 5272, !21, i64 5368, !18, i64 5464, !21, i64 5560, !18, i64 5656, !13, i64 5752, !13, i64 5944, !15, i64 6264, !23, i64 6272, !26, i64 8248, !28, i64 8408, !26, i64 11864, !17, i64 12024}
!10 = !{!"_ZTS12CBiteOptBaseIlE", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !15, i64 48, !16, i64 56, !12, i64 64, !16, i64 72, !13, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !15, i64 112, !17, i64 116, !16, i64 120, !16, i64 128, !13, i64 136, !13, i64 648, !17, i64 1160, !13, i64 1168, !17, i64 1424}
!11 = !{!"_ZTS17CBiteOptInterface"}
!12 = !{!"any pointer", !13, i64 0}
!13 = !{!"omnipotent char", !14, i64 0}
!14 = !{!"Simple C++ TBAA"}
!15 = !{!"bool", !13, i64 0}
!16 = !{!"double", !13, i64 0}
!17 = !{!"int", !13, i64 0}
!18 = !{!"_ZTS8CBiteSelILi4ELi150EE", !19, i64 0}
!19 = !{!"_ZTS12CBiteSelBase", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12, !16, i64 16, !13, i64 24, !12, i64 64, !17, i64 72, !17, i64 76, !17, i64 80, !17, i64 84, !15, i64 88}
!20 = !{!"_ZTS8CBiteSelILi3ELi150EE", !19, i64 0}
!21 = !{!"_ZTS8CBiteSelILi2ELi150EE", !19, i64 0}
!22 = !{!"_ZTS8CBiteSelILi5ELi150EE", !19, i64 0}
!23 = !{!"_ZTS13CBiteOptOwnedI9CSpherOptE", !24, i64 0, !12, i64 1776}
!24 = !{!"_ZTS9CSpherOpt", !25, i64 0, !12, i64 1432, !12, i64 1440, !16, i64 1448, !16, i64 1456, !16, i64 1464, !16, i64 1472, !17, i64 1480, !17, i64 1484, !18, i64 1488, !18, i64 1584, !20, i64 1680}
!25 = !{!"_ZTS12CBiteOptBaseIdE", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !15, i64 48, !16, i64 56, !12, i64 64, !16, i64 72, !13, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !15, i64 112, !17, i64 116, !16, i64 120, !16, i64 128, !13, i64 136, !13, i64 648, !17, i64 1160, !13, i64 1168, !17, i64 1424}
!26 = !{!"_ZTS8CBitePopIlE", !16, i64 8, !16, i64 16, !17, i64 24, !16, i64 32, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !16, i64 56, !17, i64 64, !17, i64 68, !17, i64 72, !12, i64 80, !12, i64 88, !27, i64 96, !27, i64 104, !27, i64 112, !27, i64 120, !12, i64 128, !15, i64 136, !16, i64 144, !12, i64 152}
!27 = !{!"long", !13, i64 0}
!28 = !{!"_ZTS13CBiteOptOwnedI12CMiniBiteOptE", !29, i64 0, !12, i64 3256}
!29 = !{!"_ZTS12CMiniBiteOpt", !25, i64 0, !20, i64 1432, !30, i64 1528}
!30 = !{!"_ZTS13CBiteOptOwnedI9CNMSeqOptE", !31, i64 0, !12, i64 1528}
!31 = !{!"_ZTS9CNMSeqOpt", !25, i64 0, !17, i64 1428, !17, i64 1432, !17, i64 1436, !16, i64 1440, !17, i64 1448, !17, i64 1452, !17, i64 1456, !12, i64 1464, !12, i64 1472, !12, i64 1480, !12, i64 1488, !16, i64 1496, !12, i64 1504, !12, i64 1512, !17, i64 1520, !32, i64 1524}
!32 = !{!"_ZTSN9CNMSeqOpt6EStateE", !13, i64 0}
!33 = !{!8, !17, i64 12028}
!34 = !{!16, !16, i64 0}


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