; LLVM IR from avaneev/biteopt :: constr3 (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.CBiteOptDeep.base, i32, double }
%class.CBiteOptDeep.base = type <{ %class.CBiteOptInterface, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>
%class.CBiteOptInterface = type { 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 [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 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 i32, align 4
  %4 = alloca %class.CTestOpt, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [10 x double], align 16
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 56, ptr %2) #7
  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 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr %4) #7
  call void @_ZN8CTestOptC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %4)
  invoke void @_ZN12CBiteOptDeep10updateDimsEiii(ptr noundef nonnull align 8 dereferenceable(60) %4, i32 noundef 10, i32 noundef 6, i32 noundef 0)
          to label %8 unwind label %18

8:                                                ; preds = %0
  invoke void @_ZN12CBiteOptDeep4initER8CBiteRndPKdd(ptr noundef nonnull align 8 dereferenceable(60) %4, ptr noundef nonnull align 8 dereferenceable(52) %2, ptr noundef null, double noundef 1.000000e+00)
          to label %9 unwind label %18

9:                                                ; preds = %8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %23, %9
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 500000
  br i1 %12, label %13, label %26

13:                                               ; preds = %10
  %14 = invoke noundef i32 @_ZN12CBiteOptDeep8optimizeER8CBiteRnd(ptr noundef nonnull align 8 dereferenceable(60) %4, ptr noundef nonnull align 8 dereferenceable(52) %2)
          to label %15 unwind label %18

15:                                               ; preds = %13
  %16 = icmp sgt i32 %14, 1280
  br i1 %16, label %17, label %22

17:                                               ; preds = %15
  br label %26

18:                                               ; preds = %55, %49, %46, %38, %34, %30, %28, %26, %13, %8, %0
  %19 = landingpad { ptr, i32 }
          cleanup
  %20 = extractvalue { ptr, i32 } %19, 0
  store ptr %20, ptr %5, align 8
  %21 = extractvalue { ptr, i32 } %19, 1
  store i32 %21, ptr %6, align 4
  br label %84

22:                                               ; preds = %15
  br label %23

23:                                               ; preds = %22
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !5
  br label %10, !llvm.loop !9

26:                                               ; preds = %17, %10
  %27 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %4)
          to label %28 unwind label %18

28:                                               ; preds = %26
  %29 = invoke noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(72) %4, ptr noundef %27)
          to label %30 unwind label %18

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

34:                                               ; preds = %30
  %35 = getelementptr inbounds %class.CTestOpt, ptr %4, i32 0, i32 2
  %36 = load double, ptr %35, align 8, !tbaa !11
  %37 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, double noundef %36)
          to label %38 unwind label %18

38:                                               ; preds = %34
  %39 = getelementptr inbounds %class.CTestOpt, ptr %4, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !17
  %41 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %40)
          to label %42 unwind label %18

42:                                               ; preds = %38
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %58, %42
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = icmp slt i32 %44, 10
  br i1 %45, label %46, label %61

46:                                               ; preds = %43
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %4)
          to label %49 unwind label %18

49:                                               ; preds = %46
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds double, ptr %48, i64 %51
  %53 = load double, ptr %52, align 8, !tbaa !18
  %54 = invoke noundef double @_Z10applyRoundd(double noundef %53)
          to label %55 unwind label %18

55:                                               ; preds = %49
  %56 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %47, double noundef %54)
          to label %57 unwind label %18

57:                                               ; preds = %55
  br label %58

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

61:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #7
  %62 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 0
  store double 0x4001603F705857B0, ptr %62, align 16, !tbaa !18
  %63 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 1
  store double 0x4002E8D2A1F8E3AC, ptr %63, align 8, !tbaa !18
  %64 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 2
  store double 0x40218C4007570C56, ptr %64, align 16, !tbaa !18
  %65 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 3
  store double 0x40146249A133C1CE, ptr %65, align 8, !tbaa !18
  %66 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 4
  store double 0x3FEFB371B1F40372, ptr %66, align 16, !tbaa !18
  %67 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 5
  store double 0x3FF6E3A190082060, ptr %67, align 8, !tbaa !18
  %68 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 6
  store double 0x3FF525742DCF4624, ptr %68, align 16, !tbaa !18
  %69 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 7
  store double 0x4023A84EC636B096, ptr %69, align 8, !tbaa !18
  %70 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 8
  store double 0x40208F6837F7BE12, ptr %70, align 16, !tbaa !18
  %71 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 9
  store double 0x4020C07980F55DE6, ptr %71, align 8, !tbaa !18
  %72 = getelementptr inbounds [10 x double], ptr %7, i64 0, i64 0
  %73 = invoke noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(72) %4, ptr noundef %72)
          to label %74 unwind label %80

74:                                               ; preds = %61
  %75 = getelementptr inbounds %class.CTestOpt, ptr %4, i32 0, i32 2
  %76 = load double, ptr %75, align 8, !tbaa !11
  %77 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.4, double noundef %76)
          to label %78 unwind label %80

78:                                               ; preds = %74
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #7
  call void @_ZN12CBiteOptDeepD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %4) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #7
  %79 = load i32, ptr %1, align 4
  ret i32 %79

80:                                               ; preds = %74, %61
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %5, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #7
  br label %84

84:                                               ; preds = %80, %18
  call void @_ZN12CBiteOptDeepD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %4) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %2) #7
  br label %85

85:                                               ; preds = %84
  %86 = load ptr, ptr %5, align 8
  %87 = load i32, ptr %6, align 4
  %88 = insertvalue { ptr, i32 } poison, ptr %86, 0
  %89 = insertvalue { ptr, i32 } %88, i32 %87, 1
  resume { ptr, i32 } %89
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZN8CTestOptC2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z10applyRoundd(double noundef) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12CBiteOptDeepD2Ev(ptr noundef nonnull align 8 dereferenceable(60)) unnamed_addr #6 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 = { 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 #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 = { 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 #7 = { 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, !16, i64 64}
!12 = !{!"_ZTS8CTestOpt", !13, i64 0, !6, i64 60, !16, i64 64}
!13 = !{!"_ZTS12CBiteOptDeep", !14, i64 0, !6, i64 8, !6, i64 12, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !6, i64 56}
!14 = !{!"_ZTS17CBiteOptInterface"}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!12, !6, i64 60}
!18 = !{!16, !16, i64 0}
!19 = distinct !{!19, !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.CBiteOptDeep.base, i32, double }
%class.CBiteOptDeep.base = type <{ %class.CBiteOptInterface, i32, i32, ptr, ptr, ptr, ptr, ptr, i32 }>
%class.CBiteOptInterface = type { 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 [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 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
  %3 = alloca [10 x double], align 16
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %1) #7
  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 72, ptr nonnull %2) #7
  call void @_ZN8CTestOptC2Ev(ptr noundef nonnull align 8 dereferenceable(72) %2)
  invoke void @_ZN12CBiteOptDeep10updateDimsEiii(ptr noundef nonnull align 8 dereferenceable(60) %2, i32 noundef 10, i32 noundef 6, i32 noundef 0)
          to label %4 unwind label %.loopexit.split-lp.loopexit.split-lp

4:                                                ; preds = %0
  invoke void @_ZN12CBiteOptDeep4initER8CBiteRndPKdd(ptr noundef nonnull align 8 dereferenceable(60) %2, ptr noundef nonnull align 8 dereferenceable(52) %1, ptr noundef null, double noundef 1.000000e+00)
          to label %.preheader unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader:                                       ; preds = %4, %8
  %.01016 = phi i32 [ %9, %8 ], [ 0, %4 ]
  %5 = invoke noundef i32 @_ZN12CBiteOptDeep8optimizeER8CBiteRnd(ptr noundef nonnull align 8 dereferenceable(60) %2, ptr noundef nonnull align 8 dereferenceable(52) %1)
          to label %6 unwind label %.loopexit.split-lp.loopexit

6:                                                ; preds = %.preheader
  %7 = icmp sgt i32 %5, 1280
  br i1 %7, label %10, label %8

.loopexit:                                        ; preds = %71, %65, %59, %53, %47, %41, %35, %29, %24, %14
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

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

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

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

10:                                               ; preds = %6, %8
  %.010.lcssa = phi i32 [ %.01016, %6 ], [ 500000, %8 ]
  %11 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %12 unwind label %.loopexit.split-lp.loopexit.split-lp

12:                                               ; preds = %10
  %13 = invoke noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(72) %2, ptr noundef %11)
          to label %14 unwind label %.loopexit.split-lp.loopexit.split-lp

14:                                               ; preds = %12
  %15 = add nuw nsw i32 %.010.lcssa, 1
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
  %17 = getelementptr inbounds i8, ptr %2, i64 64
  %18 = load double, ptr %17, align 8, !tbaa !7
  %19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %18)
  %20 = getelementptr inbounds i8, ptr %2, i64 60
  %21 = load i32, ptr %20, align 4, !tbaa !16
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
  %23 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %24 unwind label %.loopexit

24:                                               ; preds = %14
  %25 = load double, ptr %23, align 8, !tbaa !17
  %26 = call noundef double @_Z10applyRoundd(double noundef %25)
  %27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 0, double noundef %26)
  %28 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %29 unwind label %.loopexit

29:                                               ; preds = %24
  %30 = getelementptr inbounds i8, ptr %28, i64 8
  %31 = load double, ptr %30, align 8, !tbaa !17
  %32 = call noundef double @_Z10applyRoundd(double noundef %31)
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1, double noundef %32)
  %34 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %35 unwind label %.loopexit

35:                                               ; preds = %29
  %36 = getelementptr inbounds i8, ptr %34, i64 16
  %37 = load double, ptr %36, align 8, !tbaa !17
  %38 = call noundef double @_Z10applyRoundd(double noundef %37)
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2, double noundef %38)
  %40 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %41 unwind label %.loopexit

41:                                               ; preds = %35
  %42 = getelementptr inbounds i8, ptr %40, i64 24
  %43 = load double, ptr %42, align 8, !tbaa !17
  %44 = call noundef double @_Z10applyRoundd(double noundef %43)
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3, double noundef %44)
  %46 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %47 unwind label %.loopexit

47:                                               ; preds = %41
  %48 = getelementptr inbounds i8, ptr %46, i64 32
  %49 = load double, ptr %48, align 8, !tbaa !17
  %50 = call noundef double @_Z10applyRoundd(double noundef %49)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4, double noundef %50)
  %52 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %53 unwind label %.loopexit

53:                                               ; preds = %47
  %54 = getelementptr inbounds i8, ptr %52, i64 40
  %55 = load double, ptr %54, align 8, !tbaa !17
  %56 = call noundef double @_Z10applyRoundd(double noundef %55)
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5, double noundef %56)
  %58 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %59 unwind label %.loopexit

59:                                               ; preds = %53
  %60 = getelementptr inbounds i8, ptr %58, i64 48
  %61 = load double, ptr %60, align 8, !tbaa !17
  %62 = call noundef double @_Z10applyRoundd(double noundef %61)
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6, double noundef %62)
  %64 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %65 unwind label %.loopexit

65:                                               ; preds = %59
  %66 = getelementptr inbounds i8, ptr %64, i64 56
  %67 = load double, ptr %66, align 8, !tbaa !17
  %68 = call noundef double @_Z10applyRoundd(double noundef %67)
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7, double noundef %68)
  %70 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %71 unwind label %.loopexit

71:                                               ; preds = %65
  %72 = getelementptr inbounds i8, ptr %70, i64 64
  %73 = load double, ptr %72, align 8, !tbaa !17
  %74 = call noundef double @_Z10applyRoundd(double noundef %73)
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8, double noundef %74)
  %76 = invoke noundef ptr @_ZNK12CBiteOptDeep13getBestParamsEv(ptr noundef nonnull align 8 dereferenceable(60) %2)
          to label %77 unwind label %.loopexit

77:                                               ; preds = %71
  %78 = getelementptr inbounds i8, ptr %76, i64 72
  %79 = load double, ptr %78, align 8, !tbaa !17
  %80 = call noundef double @_Z10applyRoundd(double noundef %79)
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9, double noundef %80)
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #7
  store <2 x double> <double 0x4001603F705857B0, double 0x4002E8D2A1F8E3AC>, ptr %3, align 16, !tbaa !17
  %82 = getelementptr inbounds i8, ptr %3, i64 16
  store <2 x double> <double 0x40218C4007570C56, double 0x40146249A133C1CE>, ptr %82, align 16, !tbaa !17
  %83 = getelementptr inbounds i8, ptr %3, i64 32
  store <2 x double> <double 0x3FEFB371B1F40372, double 0x3FF6E3A190082060>, ptr %83, align 16, !tbaa !17
  %84 = getelementptr inbounds i8, ptr %3, i64 48
  store <2 x double> <double 0x3FF525742DCF4624, double 0x4023A84EC636B096>, ptr %84, align 16, !tbaa !17
  %85 = getelementptr inbounds i8, ptr %3, i64 64
  store <2 x double> <double 0x40208F6837F7BE12, double 0x4020C07980F55DE6>, ptr %85, align 16, !tbaa !17
  %86 = invoke noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(72) %2, ptr noundef nonnull %3)
          to label %87 unwind label %90

87:                                               ; preds = %77
  %88 = load double, ptr %17, align 8, !tbaa !7
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, double noundef %88)
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #7
  call void @_ZN12CBiteOptDeepD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %2) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #7
  ret i32 0

90:                                               ; preds = %77
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #7
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %90
  %.pn = phi { ptr, i32 } [ %91, %90 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit12, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp13, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN12CBiteOptDeepD2Ev(ptr noundef nonnull align 8 dereferenceable(72) %2) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #7
  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: inlinehint mustprogress uwtable
declare dso_local void @_ZN8CTestOptC2Ev(ptr noundef nonnull align 8 dereferenceable(72)) unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZN8CTestOpt7optcostEPKd(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_Z10applyRoundd(double noundef) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12CBiteOptDeepD2Ev(ptr noundef nonnull align 8 dereferenceable(60)) unnamed_addr #6 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 = { 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 #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 = { 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 #7 = { 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, !15, i64 64}
!8 = !{!"_ZTS8CTestOpt", !9, i64 0, !11, i64 60, !15, i64 64}
!9 = !{!"_ZTS12CBiteOptDeep", !10, i64 0, !11, i64 8, !11, i64 12, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !11, i64 56}
!10 = !{!"_ZTS17CBiteOptInterface"}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"any pointer", !12, i64 0}
!15 = !{!"double", !12, i64 0}
!16 = !{!8, !11, i64 60}
!17 = !{!15, !15, i64 0}


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