; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Random/Median Updates/A.ll (Z6medianv)

; 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.std::map.4" = type { %"class.std::_Rb_tree.5" }
%"class.std::_Rb_tree.5" = type { %"struct.std::_Rb_tree<int, std::pair<const int, long long>, std::_Select1st<std::pair<const int, long long>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, long long>, std::_Select1st<std::pair<const int, long long>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@cur = external dso_local global i32, align 4
@finv = external dso_local global %"class.std::map.4", align 8
@cnt = external dso_local global %"class.std::multiset", align 8
@itt = external dso_local global %"struct.std::_Rb_tree_const_iterator", align 8
@ncnt = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5queryi(i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6medianv() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca i32, align 4
  %11 = alloca double, align 8
  %12 = load i32, ptr @cur, align 4, !tbaa !5
  %13 = srem i32 %12, 2
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %15, label %42

15:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 1, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %16 = load i32, ptr @ncnt, align 4, !tbaa !5
  store i32 %16, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  br label %17

17:                                               ; preds = %37, %15
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %21, label %38

21:                                               ; preds = %17
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %22, %23
  %25 = sdiv i32 %24, 2
  store i32 %25, ptr %3, align 4, !tbaa !5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = call noundef i32 @_Z5queryi(i32 noundef %26)
  %28 = load i32, ptr @cur, align 4, !tbaa !5
  %29 = sdiv i32 %28, 2
  %30 = add nsw i32 %29, 1
  %31 = icmp sge i32 %27, %30
  br i1 %31, label %32, label %34

32:                                               ; preds = %21
  %33 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %33, ptr %2, align 4, !tbaa !5
  br label %37

34:                                               ; preds = %21
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %1, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %34, %32
  br label %17, !llvm.loop !9

38:                                               ; preds = %17
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @finv, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %40 = load i64, ptr %39, align 8, !tbaa !11
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %40)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  br label %108

42:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %43 = load i32, ptr @ncnt, align 4, !tbaa !5
  store i32 %43, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  br label %44

44:                                               ; preds = %64, %42
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %48, label %65

48:                                               ; preds = %44
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = add nsw i32 %49, %50
  %52 = sdiv i32 %51, 2
  store i32 %52, ptr %6, align 4, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = call noundef i32 @_Z5queryi(i32 noundef %53)
  %55 = load i32, ptr @cur, align 4, !tbaa !5
  %56 = sdiv i32 %55, 2
  %57 = add nsw i32 %56, 1
  %58 = icmp sge i32 %54, %57
  br i1 %58, label %59, label %61

59:                                               ; preds = %48
  %60 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %60, ptr %5, align 4, !tbaa !5
  br label %64

61:                                               ; preds = %48
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %4, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %61, %59
  br label %44, !llvm.loop !13

65:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  store i64 %67, ptr %8, align 8, !tbaa !11
  %68 = call ptr @_ZNSt8multisetIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %69 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %7, i32 0, i32 0
  store ptr %68, ptr %69, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @itt, ptr align 8 %7, i64 8, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %70 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @itt, i32 noundef 0) #6
  %71 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %9, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @itt) #6
  %73 = load i64, ptr %72, align 8, !tbaa !11
  %74 = trunc i64 %73 to i32
  %75 = call noundef i32 @_Z5queryi(i32 noundef %74)
  %76 = load i32, ptr @cur, align 4, !tbaa !5
  %77 = sdiv i32 %76, 2
  %78 = icmp eq i32 %75, %77
  br i1 %78, label %79, label %83

79:                                               ; preds = %65
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @itt) #6
  %81 = load i64, ptr %80, align 8, !tbaa !11
  %82 = trunc i64 %81 to i32
  store i32 %82, ptr %10, align 4, !tbaa !5
  br label %85

83:                                               ; preds = %65
  %84 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %84, ptr %10, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %83, %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @finv, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %87 = load i64, ptr %86, align 8, !tbaa !11
  %88 = sitofp i64 %87 to double
  %89 = fdiv double %88, 2.000000e+00
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @finv, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %91 = load i64, ptr %90, align 8, !tbaa !11
  %92 = sitofp i64 %91 to double
  %93 = fdiv double %92, 2.000000e+00
  %94 = fadd double %89, %93
  store double %94, ptr %11, align 8, !tbaa !17
  %95 = load double, ptr %11, align 8, !tbaa !17
  %96 = load double, ptr %11, align 8, !tbaa !17
  %97 = call double @llvm.floor.f64(double %96)
  %98 = fsub double %95, %97
  %99 = fcmp oeq double %98, 0.000000e+00
  br i1 %99, label %100, label %104

100:                                              ; preds = %85
  %101 = load double, ptr %11, align 8, !tbaa !17
  %102 = fptosi double %101 to i64
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str, i64 noundef %102)
  br label %107

104:                                              ; preds = %85
  %105 = load double, ptr %11, align 8, !tbaa !17
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %105)
  br label %107

107:                                              ; preds = %104, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %108

108:                                              ; preds = %107, %38
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt8multisetIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #5

attributes #0 = { 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 #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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{i64 0, i64 8, !15}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::map.4" = type { %"class.std::_Rb_tree.5" }
%"class.std::_Rb_tree.5" = type { %"struct.std::_Rb_tree<int, std::pair<const int, long long>, std::_Select1st<std::pair<const int, long long>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, long long>, std::_Select1st<std::pair<const int, long long>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

@cur = external dso_local local_unnamed_addr global i32, align 4
@finv = external dso_local global %"class.std::map.4", align 8
@cnt = external dso_local global %"class.std::multiset", align 8
@itt = external dso_local global %"struct.std::_Rb_tree_const_iterator", align 8
@ncnt = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5queryi(i32 noundef) local_unnamed_addr #0

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6medianv() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = load i32, ptr @cur, align 4, !tbaa !5
  %6 = and i32 %5, 1
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %22, label %7

7:                                                ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %8 = load i32, ptr @ncnt, align 4, !tbaa !5
  %9 = icmp sgt i32 %8, 1
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7, %.lr.ph
  %.021 = phi i32 [ %.1, %.lr.ph ], [ 1, %7 ]
  %10 = phi i32 [ %17, %.lr.ph ], [ %8, %7 ]
  %11 = add nuw nsw i32 %10, %.021
  %12 = lshr i32 %11, 1
  %13 = tail call noundef i32 @_Z5queryi(i32 noundef %12)
  %14 = load i32, ptr @cur, align 4, !tbaa !5
  %15 = sdiv i32 %14, 2
  %.not19.not = icmp sgt i32 %13, %15
  %16 = add nuw nsw i32 %12, 1
  %17 = select i1 %.not19.not, i32 %12, i32 %10
  %.1 = select i1 %.not19.not, i32 %.021, i32 %16
  %18 = icmp slt i32 %.1, %17
  br i1 %18, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %7
  %.lcssa20 = phi i32 [ %8, %7 ], [ %17, %.lr.ph ]
  store i32 %.lcssa20, ptr %1, align 4, !tbaa !5
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @finv, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %20 = load i64, ptr %19, align 8, !tbaa !11
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %20)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  br label %68

22:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %23 = load i32, ptr @ncnt, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 1
  br i1 %24, label %.lr.ph26, label %._crit_edge27

.lr.ph26:                                         ; preds = %22, %.lr.ph26
  %.01424 = phi i32 [ %.115, %.lr.ph26 ], [ 1, %22 ]
  %25 = phi i32 [ %32, %.lr.ph26 ], [ %23, %22 ]
  %26 = add nuw nsw i32 %25, %.01424
  %27 = lshr i32 %26, 1
  %28 = tail call noundef i32 @_Z5queryi(i32 noundef %27)
  %29 = load i32, ptr @cur, align 4, !tbaa !5
  %30 = sdiv i32 %29, 2
  %.not18.not = icmp sgt i32 %28, %30
  %31 = add nuw nsw i32 %27, 1
  %32 = select i1 %.not18.not, i32 %27, i32 %25
  %.115 = select i1 %.not18.not, i32 %.01424, i32 %31
  %33 = icmp slt i32 %.115, %32
  br i1 %33, label %.lr.ph26, label %._crit_edge27, !llvm.loop !13

._crit_edge27:                                    ; preds = %.lr.ph26, %22
  %34 = phi i32 [ %23, %22 ], [ %32, %.lr.ph26 ]
  store i32 %34, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %35 = sext i32 %34 to i64
  store i64 %35, ptr %3, align 8, !tbaa !11
  %36 = call ptr @_ZNSt8multisetIxSt4lessIxESaIxEE11lower_boundERKx(ptr noundef nonnull align 8 dereferenceable(48) @cnt, ptr noundef nonnull align 8 dereferenceable(8) %3)
  store ptr %36, ptr @itt, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  %37 = call ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8) @itt, i32 noundef 0) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @itt) #5
  %39 = load i64, ptr %38, align 8, !tbaa !11
  %40 = trunc i64 %39 to i32
  %41 = call noundef i32 @_Z5queryi(i32 noundef %40)
  %42 = load i32, ptr @cur, align 4, !tbaa !5
  %43 = sdiv i32 %42, 2
  %44 = icmp eq i32 %41, %43
  br i1 %44, label %45, label %49

45:                                               ; preds = %._crit_edge27
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt23_Rb_tree_const_iteratorIxEdeEv(ptr noundef nonnull align 8 dereferenceable(8) @itt) #5
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = trunc i64 %47 to i32
  br label %49

49:                                               ; preds = %._crit_edge27, %45
  %storemerge = phi i32 [ %48, %45 ], [ %34, %._crit_edge27 ]
  store i32 %storemerge, ptr %4, align 4, !tbaa !5
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @finv, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %51 = load i64, ptr %50, align 8, !tbaa !11
  %52 = sitofp i64 %51 to double
  %53 = fmul double %52, 5.000000e-01
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @finv, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %55 = load i64, ptr %54, align 8, !tbaa !11
  %56 = sitofp i64 %55 to double
  %57 = fmul double %56, 5.000000e-01
  %58 = fadd double %53, %57
  %59 = call double @llvm.floor.f64(double %58)
  %60 = fsub double %58, %59
  %61 = fcmp oeq double %60, 0.000000e+00
  br i1 %61, label %62, label %65

62:                                               ; preds = %49
  %63 = fptosi double %58 to i64
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %63)
  br label %67

65:                                               ; preds = %49
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %58)
  br label %67

67:                                               ; preds = %65, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  br label %68

68:                                               ; preds = %67, %._crit_edge
  ret void
}

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIixSt4lessIiESaISt4pairIKixEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorIxEmmEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #4

attributes #0 = { 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 #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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}


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