; LLVM IR from UBIC-repo/core :: Transaction (TransactionHelper)

; 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.UAmount = type { %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned long>, std::_Select1st<std::pair<const unsigned char, unsigned long>>, std::less<unsigned char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned long>, std::_Select1st<std::pair<const unsigned char, unsigned long>>, std::less<unsigned char>>::_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 }
%struct.UAmount32 = type { %"class.std::map.39" }
%"class.std::map.39" = type { %"class.std::_Rb_tree.40" }
%"class.std::_Rb_tree.40" = type { %"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned int>, std::_Select1st<std::pair<const unsigned char, unsigned int>>, std::less<unsigned char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned int>, std::_Select1st<std::pair<const unsigned char, unsigned int>>, std::less<unsigned char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::pair" = type { i8, i64 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN17TransactionHelper19calculateMinimumFeeEmP11BlockHeader(ptr dead_on_unwind noalias writable sret(%struct.UAmount) align 8 %0, i64 noundef %1, ptr noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca %struct.UAmount, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.UAmount32, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %19 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store ptr %0, ptr %4, align 8
  store i64 %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  store i1 false, ptr %7, align 1
  call void @_ZN7UAmountC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  %22 = load ptr, ptr %6, align 8, !tbaa !9
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %3
  store i1 true, ptr %7, align 1
  store i32 1, ptr %8, align 4
  br label %119

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 48, ptr %9) #5
  %26 = load ptr, ptr %6, align 8, !tbaa !9
  %27 = invoke noundef i32 @_ZN11BlockHeader14getBlockHeightEv(ptr noundef nonnull align 8 dereferenceable(400) %26)
          to label %28 unwind label %43

28:                                               ; preds = %25
  %29 = zext i32 %27 to i64
  invoke void @_ZN11BlockHelper14getTotalPayoutEm(ptr dead_on_unwind writable sret(%struct.UAmount) align 8 %9, i64 noundef %29)
          to label %30 unwind label %43

30:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #5
  %31 = load ptr, ptr %6, align 8, !tbaa !9
  invoke void @_ZN11BlockHeader19getUbiReceiverCountEv(ptr dead_on_unwind writable sret(%struct.UAmount32) align 8 %12, ptr noundef nonnull align 8 dereferenceable(400) %31)
          to label %32 unwind label %47

32:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %33 = getelementptr inbounds %struct.UAmount, ptr %9, i32 0, i32 0
  store ptr %33, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %34 = load ptr, ptr %13, align 8, !tbaa !9
  %35 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %34) #5
  %36 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  store ptr %35, ptr %36, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %37 = load ptr, ptr %13, align 8, !tbaa !9
  %38 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %37) #5
  %39 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %15, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  br label %40

40:                                               ; preds = %83, %32
  %41 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %41, label %51, label %42

42:                                               ; preds = %40
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %85

43:                                               ; preds = %28, %25
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %10, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %11, align 4
  br label %118

47:                                               ; preds = %30
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %10, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %11, align 4
  br label %117

51:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKhmEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  store ptr %52, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %53 = getelementptr inbounds %struct.UAmount32, ptr %12, i32 0, i32 0
  %54 = load ptr, ptr %16, align 8, !tbaa !9
  %55 = getelementptr inbounds %"struct.std::pair", ptr %54, i32 0, i32 0
  %56 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIhjSt4lessIhESaISt4pairIKhjEEE2atERS3_(ptr noundef nonnull align 8 dereferenceable(48) %53, ptr noundef nonnull align 1 dereferenceable(1) %55)
          to label %57 unwind label %62

57:                                               ; preds = %51
  %58 = load i32, ptr %56, align 4, !tbaa !11
  store i32 %58, ptr %17, align 4, !tbaa !11
  %59 = load i32, ptr %17, align 4, !tbaa !11
  %60 = icmp ult i32 %59, 1000
  br i1 %60, label %61, label %66

61:                                               ; preds = %57
  store i32 1000, ptr %17, align 4, !tbaa !11
  br label %66

62:                                               ; preds = %51
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %10, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %116

66:                                               ; preds = %61, %57
  %67 = load ptr, ptr %16, align 8, !tbaa !9
  %68 = getelementptr inbounds %"struct.std::pair", ptr %67, i32 0, i32 1
  %69 = load i64, ptr %68, align 8, !tbaa !13
  %70 = load i32, ptr %17, align 4, !tbaa !11
  %71 = zext i32 %70 to i64
  %72 = udiv i64 %69, %71
  %73 = load ptr, ptr %16, align 8, !tbaa !9
  %74 = getelementptr inbounds %"struct.std::pair", ptr %73, i32 0, i32 1
  store i64 %72, ptr %74, align 8, !tbaa !13
  %75 = load ptr, ptr %16, align 8, !tbaa !9
  %76 = getelementptr inbounds %"struct.std::pair", ptr %75, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !13
  %78 = icmp eq i64 %77, 0
  br i1 %78, label %79, label %82

79:                                               ; preds = %66
  %80 = load ptr, ptr %16, align 8, !tbaa !9
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 1
  store i64 1, ptr %81, align 8, !tbaa !13
  br label %82

82:                                               ; preds = %79, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %83

83:                                               ; preds = %82
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKhmEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %40

85:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %86 = getelementptr inbounds %struct.UAmount, ptr %9, i32 0, i32 0
  %87 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %86) #5
  %88 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %19, i32 0, i32 0
  store ptr %87, ptr %88, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKhmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %89

89:                                               ; preds = %109, %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %90 = getelementptr inbounds %struct.UAmount, ptr %9, i32 0, i32 0
  %91 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %90) #5
  %92 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %21, i32 0, i32 0
  store ptr %91, ptr %92, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKhmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #5
  %93 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br i1 %93, label %95, label %94

94:                                               ; preds = %89
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %115

95:                                               ; preds = %89
  %96 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKhmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %97 = getelementptr inbounds %"struct.std::pair", ptr %96, i32 0, i32 1
  %98 = load i64, ptr %97, align 8, !tbaa !13
  %99 = load i64, ptr %5, align 8, !tbaa !5
  %100 = mul i64 %98, %99
  %101 = uitofp i64 %100 to double
  %102 = fmul double %101, 2.500000e-01
  %103 = fptoui double %102 to i64
  %104 = getelementptr inbounds %struct.UAmount, ptr %0, i32 0, i32 0
  %105 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKhmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  %106 = getelementptr inbounds %"struct.std::pair", ptr %105, i32 0, i32 0
  %107 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %104, ptr noundef nonnull align 1 dereferenceable(1) %106)
          to label %108 unwind label %111

108:                                              ; preds = %95
  store i64 %103, ptr %107, align 8, !tbaa !5
  br label %109

109:                                              ; preds = %108
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKhmEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %18) #5
  br label %89, !llvm.loop !15

111:                                              ; preds = %95
  %112 = landingpad { ptr, i32 }
          cleanup
  %113 = extractvalue { ptr, i32 } %112, 0
  store ptr %113, ptr %10, align 8
  %114 = extractvalue { ptr, i32 } %112, 1
  store i32 %114, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %116

115:                                              ; preds = %94
  store i1 true, ptr %7, align 1
  store i32 1, ptr %8, align 4
  call void @_ZN9UAmount32D2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  call void @_ZN7UAmountD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #5
  br label %119

116:                                              ; preds = %111, %62
  call void @_ZN9UAmount32D2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  br label %117

117:                                              ; preds = %116, %47
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  call void @_ZN7UAmountD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %9) #5
  br label %118

118:                                              ; preds = %117, %43
  call void @llvm.lifetime.end.p0(i64 48, ptr %9) #5
  call void @_ZN7UAmountD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  br label %123

119:                                              ; preds = %115, %24
  %120 = load i1, ptr %7, align 1
  br i1 %120, label %122, label %121

121:                                              ; preds = %119
  call void @_ZN7UAmountD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #5
  br label %122

122:                                              ; preds = %121, %119
  ret void

123:                                              ; preds = %118
  %124 = load ptr, ptr %10, align 8
  %125 = load i32, ptr %11, align 4
  %126 = insertvalue { ptr, i32 } poison, ptr %124, 0
  %127 = insertvalue { ptr, i32 } %126, i32 %125, 1
  resume { ptr, i32 } %127
}

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

declare void @_ZN11BlockHelper14getTotalPayoutEm(ptr dead_on_unwind writable sret(%struct.UAmount) align 8, i64 noundef) #3

declare noundef i32 @_ZN11BlockHeader14getBlockHeightEv(ptr noundef nonnull align 8 dereferenceable(400)) #3

declare void @_ZN11BlockHeader19getUbiReceiverCountEv(ptr dead_on_unwind writable sret(%struct.UAmount32) align 8, ptr noundef nonnull align 8 dereferenceable(400)) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

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

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

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


; 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.UAmount = type { %"class.std::map" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned long>, std::_Select1st<std::pair<const unsigned char, unsigned long>>, std::less<unsigned char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned long>, std::_Select1st<std::pair<const unsigned char, unsigned long>>, std::less<unsigned char>>::_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 }
%struct.UAmount32 = type { %"class.std::map.39" }
%"class.std::map.39" = type { %"class.std::_Rb_tree.40" }
%"class.std::_Rb_tree.40" = type { %"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned int>, std::_Select1st<std::pair<const unsigned char, unsigned int>>, std::less<unsigned char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned char, std::pair<const unsigned char, unsigned int>, std::_Select1st<std::pair<const unsigned char, unsigned int>>, std::less<unsigned char>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

; 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 uwtable
define dso_local void @_ZN17TransactionHelper19calculateMinimumFeeEmP11BlockHeader(ptr dead_on_unwind noalias nonnull writable sret(%struct.UAmount) align 8 %0, i64 noundef %1, ptr noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.UAmount, align 8
  %5 = alloca %struct.UAmount32, align 8
  %6 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_iterator", align 8
  tail call void @_ZN7UAmountC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #6
  %12 = icmp eq ptr %2, null
  br i1 %12, label %60, label %13

13:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #6
  %14 = invoke noundef i32 @_ZN11BlockHeader14getBlockHeightEv(ptr noundef nonnull align 8 dereferenceable(400) %2)
          to label %15 unwind label %25

15:                                               ; preds = %13
  %16 = zext i32 %14 to i64
  invoke void @_ZN11BlockHelper14getTotalPayoutEm(ptr dead_on_unwind nonnull writable sret(%struct.UAmount) align 8 %4, i64 noundef %16)
          to label %17 unwind label %25

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #6
  invoke void @_ZN11BlockHeader19getUbiReceiverCountEv(ptr dead_on_unwind nonnull writable sret(%struct.UAmount32) align 8 %5, ptr noundef nonnull align 8 dereferenceable(400) %2)
          to label %18 unwind label %27

18:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %19 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  store ptr %19, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %20 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  store ptr %20, ptr %7, align 8
  %21 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %31, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %22 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  store ptr %22, ptr %9, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKhmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %23 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  store ptr %23, ptr %11, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKhmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %24 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %24, label %.lr.ph23, label %._crit_edge24

25:                                               ; preds = %15, %13
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %59

27:                                               ; preds = %17
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %58

.lr.ph:                                           ; preds = %18, %31
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKhmEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %30 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIhjSt4lessIhESaISt4pairIKhjEEE2atERS3_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 1 dereferenceable(1) %29)
          to label %31 unwind label %40

31:                                               ; preds = %.lr.ph
  %32 = load i32, ptr %30, align 4, !tbaa !5
  %spec.store.select = call i32 @llvm.umax.i32(i32 %32, i32 1000)
  %33 = getelementptr inbounds i8, ptr %29, i64 8
  %34 = load i64, ptr %33, align 8, !tbaa !9
  %35 = zext i32 %spec.store.select to i64
  %36 = udiv i64 %34, %35
  %37 = icmp ult i64 %34, %35
  %spec.select = select i1 %37, i64 1, i64 %36
  store i64 %spec.select, ptr %33, align 8, !tbaa !9
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKhmEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  %39 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br i1 %39, label %.lr.ph, label %._crit_edge

40:                                               ; preds = %.lr.ph
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %57

._crit_edge24:                                    ; preds = %47, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @_ZN9UAmount32D2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  call void @_ZN7UAmountD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #6
  br label %60

.lr.ph23:                                         ; preds = %._crit_edge, %47
  %42 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKhmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %45 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKhmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 1 dereferenceable(1) %45)
          to label %47 unwind label %55

47:                                               ; preds = %.lr.ph23
  %48 = mul i64 %44, %1
  %49 = uitofp i64 %48 to double
  %50 = fmul double %49, 2.500000e-01
  %51 = fptoui double %50 to i64
  store i64 %51, ptr %46, align 8, !tbaa !12
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKhmEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %53 = call ptr @_ZNSt3mapIhmSt4lessIhESaISt4pairIKhmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  store ptr %53, ptr %11, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKhmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %54 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %54, label %.lr.ph23, label %._crit_edge24, !llvm.loop !13

55:                                               ; preds = %.lr.ph23
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %57

57:                                               ; preds = %55, %40
  %.pn = phi { ptr, i32 } [ %41, %40 ], [ %56, %55 ]
  call void @_ZN9UAmount32D2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #6
  br label %58

58:                                               ; preds = %57, %27
  %.pn.pn = phi { ptr, i32 } [ %.pn, %57 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #6
  call void @_ZN7UAmountD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %4) #6
  br label %59

59:                                               ; preds = %58, %25
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %58 ], [ %26, %25 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #6
  call void @_ZN7UAmountD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %0) #6
  resume { ptr, i32 } %.pn.pn.pn

60:                                               ; preds = %._crit_edge24, %3
  ret void
}

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

declare void @_ZN11BlockHelper14getTotalPayoutEm(ptr dead_on_unwind writable sret(%struct.UAmount) align 8, i64 noundef) local_unnamed_addr #3

declare noundef i32 @_ZN11BlockHeader14getBlockHeightEv(ptr noundef nonnull align 8 dereferenceable(400)) local_unnamed_addr #3

declare void @_ZN11BlockHeader19getUbiReceiverCountEv(ptr dead_on_unwind writable sret(%struct.UAmount32) align 8, ptr noundef nonnull align 8 dereferenceable(400)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKhmEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { 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 #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 = !{!10, !11, i64 8}
!10 = !{!"_ZTSSt4pairIKhmE", !7, i64 0, !11, i64 8}
!11 = !{!"long", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass