; LLVM IR from cruppstahl/upscaledb :: tools/ups_bench/generator_runtime.ll (ZN16RuntimeGenerator4findEv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.ups_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }
%struct.Timer.79 = type { %"class.boost::chrono::time_point.80" }
%"class.boost::chrono::time_point.80" = type { %"class.boost::chrono::duration" }
%"class.boost::chrono::duration" = type { i64 }
%class.RuntimeGenerator = type <{ %class.Generator.base, [3 x i8], i32, i64, ptr, %"class.std::vector", %"class.std::vector", %"class.boost::random::mersenne_twister_engine", %"class.boost::random::uniform_01", %struct.Timer, double, ptr, ptr, ptr, %"class.std::basic_ofstream", i8, [7 x i8], %struct.Metrics, i8, [7 x i8] }>
%class.Generator.base = type <{ ptr, i32, [4 x i8], ptr, ptr, i32, [4 x i8], %struct.ups_record_t, ptr, [4 x i32], i8 }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.boost::random::mersenne_twister_engine" = type { [624 x i32], i64 }
%"class.boost::random::uniform_01" = type { %"class.boost::random::detail::backward_compatible_uniform_01" }
%"class.boost::random::detail::backward_compatible_uniform_01" = type { %"class.boost::random::mersenne_twister_engine", double }
%struct.Timer = type { %"class.boost::chrono::time_point" }
%"class.boost::chrono::time_point" = type { %"class.boost::chrono::duration" }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon.4 }
%union.anon.4 = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%struct.Metrics = type { ptr, i64, i64, i64, i64, i64, i64, i64, double, double, double, double, double, double, double, double, double, double, double, double, double, %struct.ups_env_metrics_t }
%struct.ups_env_metrics_t = type { i16, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.btree_metrics_t, %struct.btree_metrics_t, i32 }
%struct.btree_metrics_t = type { i16, i64, i64, i64, i32, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t, %struct.min_max_avg_u32_t }
%struct.min_max_avg_u32_t = type { i32, i32, i32, i32, i32 }
%class.Generator = type <{ ptr, i32, [4 x i8], ptr, ptr, i32, [4 x i8], %struct.ups_record_t, ptr, [4 x i32], i8, [7 x i8] }>

@.str.14 = external hidden unnamed_addr constant [5 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN16RuntimeGenerator4findEv(ptr noundef nonnull align 8 dereferenceable(6569) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.ups_key_t, align 8
  %4 = alloca %struct.ups_record_t, align 8
  %5 = alloca %struct.Timer.79, align 8
  %6 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZN16RuntimeGenerator12generate_keyEv(ptr dead_on_unwind writable sret(%struct.ups_key_t) align 8 %3, ptr noundef nonnull align 8 dereferenceable(6569) %7)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 24, i1 false)
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = getelementptr inbounds ptr, ptr %8, i64 8
  %10 = load ptr, ptr %9, align 8
  call void %10(ptr noundef nonnull align 8 dereferenceable(6569) %7, ptr noundef @.str.14, ptr noundef %3, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @_ZN5TimerIN5boost6chrono12steady_clockEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %11 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 12
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %21

14:                                               ; preds = %1
  %15 = getelementptr inbounds %class.Generator, ptr %7, i32 0, i32 4
  %16 = load ptr, ptr %15, align 8, !tbaa !42
  %17 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 12
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = call noundef i32 @_ZN8Database11cursor_findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef %18, ptr noundef %3, ptr noundef %4)
  %20 = getelementptr inbounds %class.Generator, ptr %7, i32 0, i32 5
  store i32 %19, ptr %20, align 8, !tbaa !43
  br label %28

21:                                               ; preds = %1
  %22 = getelementptr inbounds %class.Generator, ptr %7, i32 0, i32 4
  %23 = load ptr, ptr %22, align 8, !tbaa !42
  %24 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 11
  %25 = load ptr, ptr %24, align 8, !tbaa !44
  %26 = call noundef i32 @_ZN8Database4findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef %25, ptr noundef %3, ptr noundef %4)
  %27 = getelementptr inbounds %class.Generator, ptr %7, i32 0, i32 5
  store i32 %26, ptr %27, align 8, !tbaa !43
  br label %28

28:                                               ; preds = %21, %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %29 = call noundef double @_ZNK5TimerIN5boost6chrono12steady_clockEE7secondsEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
  store double %29, ptr %6, align 8, !tbaa !45
  %30 = getelementptr inbounds %class.Generator, ptr %7, i32 0, i32 9
  %31 = getelementptr inbounds [4 x i32], ptr %30, i64 0, i64 1
  %32 = load i32, ptr %31, align 4, !tbaa !46
  %33 = add i32 %32, 1
  store i32 %33, ptr %31, align 4, !tbaa !46
  %34 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 17
  %35 = getelementptr inbounds %struct.Metrics, ptr %34, i32 0, i32 15
  %36 = load double, ptr %35, align 8, !tbaa !47
  %37 = load double, ptr %6, align 8, !tbaa !45
  %38 = fcmp ogt double %36, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %28
  %40 = load double, ptr %6, align 8, !tbaa !45
  %41 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 17
  %42 = getelementptr inbounds %struct.Metrics, ptr %41, i32 0, i32 15
  store double %40, ptr %42, align 8, !tbaa !47
  br label %43

43:                                               ; preds = %39, %28
  %44 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 17
  %45 = getelementptr inbounds %struct.Metrics, ptr %44, i32 0, i32 16
  %46 = load double, ptr %45, align 8, !tbaa !48
  %47 = load double, ptr %6, align 8, !tbaa !45
  %48 = fcmp olt double %46, %47
  br i1 %48, label %49, label %53

49:                                               ; preds = %43
  %50 = load double, ptr %6, align 8, !tbaa !45
  %51 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 17
  %52 = getelementptr inbounds %struct.Metrics, ptr %51, i32 0, i32 16
  store double %50, ptr %52, align 8, !tbaa !48
  br label %53

53:                                               ; preds = %49, %43
  %54 = load double, ptr %6, align 8, !tbaa !45
  %55 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 17
  %56 = getelementptr inbounds %struct.Metrics, ptr %55, i32 0, i32 17
  %57 = load double, ptr %56, align 8, !tbaa !49
  %58 = fadd double %57, %54
  store double %58, ptr %56, align 8, !tbaa !49
  %59 = getelementptr inbounds %class.Generator, ptr %7, i32 0, i32 5
  %60 = load i32, ptr %59, align 8, !tbaa !43
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %68

62:                                               ; preds = %53
  %63 = getelementptr inbounds %class.Generator, ptr %7, i32 0, i32 5
  %64 = load i32, ptr %63, align 8, !tbaa !43
  %65 = icmp ne i32 %64, -11
  br i1 %65, label %66, label %68

66:                                               ; preds = %62
  %67 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 15
  store i8 0, ptr %67, align 8, !tbaa !50
  br label %68

68:                                               ; preds = %66, %62, %53
  %69 = getelementptr inbounds %struct.ups_record_t, ptr %4, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !51
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 17
  %73 = getelementptr inbounds %struct.Metrics, ptr %72, i32 0, i32 7
  %74 = load i64, ptr %73, align 8, !tbaa !52
  %75 = add i64 %74, %71
  store i64 %75, ptr %73, align 8, !tbaa !52
  %76 = getelementptr inbounds %class.RuntimeGenerator, ptr %7, i32 0, i32 17
  %77 = getelementptr inbounds %struct.Metrics, ptr %76, i32 0, i32 3
  %78 = load i64, ptr %77, align 8, !tbaa !53
  %79 = add i64 %78, 1
  store i64 %79, ptr %77, align 8, !tbaa !53
  %80 = load double, ptr %6, align 8, !tbaa !45
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret double %80
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16RuntimeGenerator12generate_keyEv(ptr dead_on_unwind noalias writable sret(%struct.ups_key_t) align 8, ptr noundef nonnull align 8 dereferenceable(6569)) #2 align 2

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

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

declare noundef i32 @_ZN8Database11cursor_findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef) #4

declare noundef i32 @_ZN8Database4findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !6, i64 5200}
!12 = !{!"_ZTS16RuntimeGenerator", !13, i64 0, !14, i64 92, !17, i64 96, !6, i64 104, !18, i64 112, !18, i64 136, !22, i64 160, !23, i64 2664, !26, i64 5176, !25, i64 5184, !6, i64 5192, !6, i64 5200, !6, i64 5208, !29, i64 5216, !16, i64 5728, !37, i64 5736, !16, i64 6568}
!13 = !{!"_ZTS9Generator", !14, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !15, i64 40, !6, i64 64, !7, i64 72, !16, i64 88}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS12ups_record_t", !14, i64 0, !6, i64 8, !14, i64 16}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSSt6vectorIhSaIhEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSN5boost6random23mersenne_twister_engineIjLm32ELm624ELm397ELm31ELj2567483615ELm11ELj4294967295ELm7ELj2636928640ELm15ELj4022730752ELm18ELj1812433253EEE", !7, i64 0, !17, i64 2496}
!23 = !{!"_ZTSN5boost6random10uniform_01INS0_23mersenne_twister_engineIjLm32ELm624ELm397ELm31ELj2567483615ELm11ELj4294967295ELm7ELj2636928640ELm15ELj4022730752ELm18ELj1812433253EEEdEE", !24, i64 0}
!24 = !{!"_ZTSN5boost6random6detail30backward_compatible_uniform_01INS0_23mersenne_twister_engineIjLm32ELm624ELm397ELm31ELj2567483615ELm11ELj4294967295ELm7ELj2636928640ELm15ELj4022730752ELm18ELj1812433253EEEdEE", !22, i64 0, !25, i64 2504}
!25 = !{!"double", !7, i64 0}
!26 = !{!"_ZTS5TimerIN5boost6chrono12system_clockEE", !27, i64 0}
!27 = !{!"_ZTSN5boost6chrono10time_pointINS0_12system_clockENS0_8durationIlNS_5ratioILl1ELl1000000000EEEEEEE", !28, i64 0}
!28 = !{!"_ZTSN5boost6chrono8durationIlNS_5ratioILl1ELl1000000000EEEEE", !17, i64 0}
!29 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !30, i64 0, !31, i64 8}
!30 = !{!"_ZTSSo"}
!31 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !32, i64 0, !7, i64 64, !34, i64 104, !35, i64 120, !36, i64 124, !36, i64 132, !36, i64 140, !6, i64 152, !17, i64 160, !16, i64 168, !16, i64 169, !16, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !16, i64 192, !6, i64 200, !6, i64 208, !17, i64 216, !6, i64 224, !6, i64 232}
!32 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !33, i64 56}
!33 = !{!"_ZTSSt6locale", !6, i64 0}
!34 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !16, i64 8}
!35 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!36 = !{!"_ZTS11__mbstate_t", !14, i64 0, !7, i64 4}
!37 = !{!"_ZTS7Metrics", !6, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !17, i64 32, !17, i64 40, !17, i64 48, !17, i64 56, !25, i64 64, !25, i64 72, !25, i64 80, !25, i64 88, !25, i64 96, !25, i64 104, !25, i64 112, !25, i64 120, !25, i64 128, !25, i64 136, !25, i64 144, !25, i64 152, !25, i64 160, !38, i64 168}
!38 = !{!"_ZTS17ups_env_metrics_t", !39, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !17, i64 32, !17, i64 40, !17, i64 48, !17, i64 56, !17, i64 64, !17, i64 72, !17, i64 80, !17, i64 88, !17, i64 96, !17, i64 104, !17, i64 112, !17, i64 120, !17, i64 128, !17, i64 136, !17, i64 144, !17, i64 152, !17, i64 160, !17, i64 168, !17, i64 176, !17, i64 184, !17, i64 192, !17, i64 200, !17, i64 208, !17, i64 216, !40, i64 224, !40, i64 440, !14, i64 656}
!39 = !{!"short", !7, i64 0}
!40 = !{!"_ZTS15btree_metrics_t", !39, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !14, i64 32, !41, i64 36, !41, i64 56, !41, i64 76, !41, i64 96, !41, i64 116, !41, i64 136, !41, i64 156, !41, i64 176, !41, i64 196}
!41 = !{!"_ZTS17min_max_avg_u32_t", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16}
!42 = !{!13, !6, i64 24}
!43 = !{!13, !14, i64 32}
!44 = !{!12, !6, i64 5192}
!45 = !{!25, !25, i64 0}
!46 = !{!14, !14, i64 0}
!47 = !{!12, !25, i64 5856}
!48 = !{!12, !25, i64 5864}
!49 = !{!12, !25, i64 5872}
!50 = !{!12, !16, i64 5728}
!51 = !{!15, !14, i64 0}
!52 = !{!12, !17, i64 5792}
!53 = !{!12, !17, i64 5760}


; 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"

%struct.ups_key_t = type { i16, ptr, i32, i32 }
%struct.ups_record_t = type { i32, ptr, i32 }
%struct.Timer.79 = type { %"class.boost::chrono::time_point.80" }
%"class.boost::chrono::time_point.80" = type { %"class.boost::chrono::duration" }
%"class.boost::chrono::duration" = type { i64 }

@.str.14 = external hidden unnamed_addr constant [5 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 nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef double @_ZN16RuntimeGenerator4findEv(ptr noundef nonnull align 8 dereferenceable(6569) %0) local_unnamed_addr #2 align 2 {
  %2 = alloca %struct.ups_key_t, align 8
  %3 = alloca %struct.ups_record_t, align 8
  %4 = alloca %struct.Timer.79, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @_ZN16RuntimeGenerator12generate_keyEv(ptr dead_on_unwind nonnull writable sret(%struct.ups_key_t) align 8 %2, ptr noundef nonnull align 8 dereferenceable(6569) %0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, i8 0, i64 24, i1 false)
  %5 = load ptr, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 64
  %7 = load ptr, ptr %6, align 8
  call void %7(ptr noundef nonnull align 8 dereferenceable(6569) %0, ptr noundef nonnull @.str.14, ptr noundef nonnull %2, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN5TimerIN5boost6chrono12steady_clockEEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %8 = getelementptr inbounds i8, ptr %0, i64 5200
  %9 = load ptr, ptr %8, align 8, !tbaa !8
  %.not = icmp eq ptr %9, null
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load ptr, ptr %10, align 8, !tbaa !41
  br i1 %.not, label %14, label %12

12:                                               ; preds = %1
  %13 = call noundef i32 @_ZN8Database11cursor_findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull %9, ptr noundef nonnull %2, ptr noundef nonnull %3)
  br label %18

14:                                               ; preds = %1
  %15 = getelementptr inbounds i8, ptr %0, i64 5192
  %16 = load ptr, ptr %15, align 8, !tbaa !42
  %17 = call noundef i32 @_ZN8Database4findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef %16, ptr noundef nonnull %2, ptr noundef nonnull %3)
  br label %18

18:                                               ; preds = %14, %12
  %.sink = phi i32 [ %17, %14 ], [ %13, %12 ]
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %.sink, ptr %19, align 8
  %20 = call noundef double @_ZNK5TimerIN5boost6chrono12steady_clockEE7secondsEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %21 = getelementptr inbounds i8, ptr %0, i64 76
  %22 = load i32, ptr %21, align 4, !tbaa !43
  %23 = add i32 %22, 1
  store i32 %23, ptr %21, align 4, !tbaa !43
  %24 = getelementptr inbounds i8, ptr %0, i64 5856
  %25 = load double, ptr %24, align 8, !tbaa !44
  %26 = fcmp ogt double %25, %20
  br i1 %26, label %27, label %28

27:                                               ; preds = %18
  store double %20, ptr %24, align 8, !tbaa !44
  br label %28

28:                                               ; preds = %27, %18
  %29 = getelementptr inbounds i8, ptr %0, i64 5864
  %30 = load double, ptr %29, align 8, !tbaa !45
  %31 = fcmp olt double %30, %20
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  store double %20, ptr %29, align 8, !tbaa !45
  br label %33

33:                                               ; preds = %32, %28
  %34 = getelementptr inbounds i8, ptr %0, i64 5872
  %35 = load double, ptr %34, align 8, !tbaa !46
  %36 = fadd double %20, %35
  store double %36, ptr %34, align 8, !tbaa !46
  %37 = load i32, ptr %19, align 8, !tbaa !47
  switch i32 %37, label %38 [
    i32 0, label %40
    i32 -11, label %40
  ]

38:                                               ; preds = %33
  %39 = getelementptr inbounds i8, ptr %0, i64 5728
  store i8 0, ptr %39, align 8, !tbaa !48
  br label %40

40:                                               ; preds = %33, %33, %38
  %41 = load i32, ptr %3, align 8, !tbaa !49
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds i8, ptr %0, i64 5792
  %44 = load i64, ptr %43, align 8, !tbaa !50
  %45 = add i64 %44, %42
  store i64 %45, ptr %43, align 8, !tbaa !50
  %46 = getelementptr inbounds i8, ptr %0, i64 5760
  %47 = load i64, ptr %46, align 8, !tbaa !51
  %48 = add i64 %47, 1
  store i64 %48, ptr %46, align 8, !tbaa !51
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  ret double %20
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN16RuntimeGenerator12generate_keyEv(ptr dead_on_unwind noalias writable sret(%struct.ups_key_t) align 8, ptr noundef nonnull align 8 dereferenceable(6569)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef double @_ZNK5TimerIN5boost6chrono12steady_clockEE7secondsEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

declare noundef i32 @_ZN8Database11cursor_findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare noundef i32 @_ZN8Database4findEPmP9ups_key_tP12ups_record_t(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 5200}
!9 = !{!"_ZTS16RuntimeGenerator", !10, i64 0, !11, i64 92, !16, i64 96, !13, i64 104, !17, i64 112, !17, i64 136, !21, i64 160, !22, i64 2664, !25, i64 5176, !24, i64 5184, !13, i64 5192, !13, i64 5200, !13, i64 5208, !28, i64 5216, !15, i64 5728, !36, i64 5736, !15, i64 6568}
!10 = !{!"_ZTS9Generator", !11, i64 8, !13, i64 16, !13, i64 24, !11, i64 32, !14, i64 40, !13, i64 64, !12, i64 72, !15, i64 88}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !7, i64 0}
!13 = !{!"any pointer", !12, i64 0}
!14 = !{!"_ZTS12ups_record_t", !11, i64 0, !13, i64 8, !11, i64 16}
!15 = !{!"bool", !12, i64 0}
!16 = !{!"long", !12, i64 0}
!17 = !{!"_ZTSSt6vectorIhSaIhEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!21 = !{!"_ZTSN5boost6random23mersenne_twister_engineIjLm32ELm624ELm397ELm31ELj2567483615ELm11ELj4294967295ELm7ELj2636928640ELm15ELj4022730752ELm18ELj1812433253EEE", !12, i64 0, !16, i64 2496}
!22 = !{!"_ZTSN5boost6random10uniform_01INS0_23mersenne_twister_engineIjLm32ELm624ELm397ELm31ELj2567483615ELm11ELj4294967295ELm7ELj2636928640ELm15ELj4022730752ELm18ELj1812433253EEEdEE", !23, i64 0}
!23 = !{!"_ZTSN5boost6random6detail30backward_compatible_uniform_01INS0_23mersenne_twister_engineIjLm32ELm624ELm397ELm31ELj2567483615ELm11ELj4294967295ELm7ELj2636928640ELm15ELj4022730752ELm18ELj1812433253EEEdEE", !21, i64 0, !24, i64 2504}
!24 = !{!"double", !12, i64 0}
!25 = !{!"_ZTS5TimerIN5boost6chrono12system_clockEE", !26, i64 0}
!26 = !{!"_ZTSN5boost6chrono10time_pointINS0_12system_clockENS0_8durationIlNS_5ratioILl1ELl1000000000EEEEEEE", !27, i64 0}
!27 = !{!"_ZTSN5boost6chrono8durationIlNS_5ratioILl1ELl1000000000EEEEE", !16, i64 0}
!28 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !29, i64 0, !30, i64 8}
!29 = !{!"_ZTSSo"}
!30 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !31, i64 0, !12, i64 64, !33, i64 104, !34, i64 120, !35, i64 124, !35, i64 132, !35, i64 140, !13, i64 152, !16, i64 160, !15, i64 168, !15, i64 169, !15, i64 170, !12, i64 171, !13, i64 176, !13, i64 184, !15, i64 192, !13, i64 200, !13, i64 208, !16, i64 216, !13, i64 224, !13, i64 232}
!31 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !32, i64 56}
!32 = !{!"_ZTSSt6locale", !13, i64 0}
!33 = !{!"_ZTSSt12__basic_fileIcE", !13, i64 0, !15, i64 8}
!34 = !{!"_ZTSSt13_Ios_Openmode", !12, i64 0}
!35 = !{!"_ZTS11__mbstate_t", !11, i64 0, !12, i64 4}
!36 = !{!"_ZTS7Metrics", !13, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !24, i64 64, !24, i64 72, !24, i64 80, !24, i64 88, !24, i64 96, !24, i64 104, !24, i64 112, !24, i64 120, !24, i64 128, !24, i64 136, !24, i64 144, !24, i64 152, !24, i64 160, !37, i64 168}
!37 = !{!"_ZTS17ups_env_metrics_t", !38, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168, !16, i64 176, !16, i64 184, !16, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !39, i64 224, !39, i64 440, !11, i64 656}
!38 = !{!"short", !12, i64 0}
!39 = !{!"_ZTS15btree_metrics_t", !38, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !11, i64 32, !40, i64 36, !40, i64 56, !40, i64 76, !40, i64 96, !40, i64 116, !40, i64 136, !40, i64 156, !40, i64 176, !40, i64 196}
!40 = !{!"_ZTS17min_max_avg_u32_t", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}
!41 = !{!10, !13, i64 24}
!42 = !{!9, !13, i64 5192}
!43 = !{!11, !11, i64 0}
!44 = !{!9, !24, i64 5856}
!45 = !{!9, !24, i64 5864}
!46 = !{!9, !24, i64 5872}
!47 = !{!10, !11, i64 32}
!48 = !{!9, !15, i64 5728}
!49 = !{!14, !11, i64 0}
!50 = !{!9, !16, i64 5792}
!51 = !{!9, !16, i64 5760}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,MergedLoadStoreMotionPass,ReassociatePass,SROAPass,SimplifyCFGPass