; LLVM IR from chronoxor/CppBenchmark :: examples/timers.ll/ZN12CppBenchmark15/benchmark (253RunERNS_7ContextE)

; 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::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.47" = type { i8 }

@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution = external hidden global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution = external hidden global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp = external hidden global %"class.std::chrono::time_point", align 8
@_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp = external hidden global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp = external hidden global %"class.std::chrono::time_point", align 8
@_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp = external hidden global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count = external hidden global i64, align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 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

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 @_ZN12CppBenchmark15__benchmark__253RunERNS_7ContextE(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(56) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::chrono::time_point", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::chrono::duration", align 8
  %8 = alloca %"class.std::chrono::duration", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::chrono::duration", align 8
  %11 = alloca %"class.std::chrono::duration", align 8
  %12 = alloca %"class.std::__cxx11::basic_string", align 8
  %13 = alloca %"class.std::allocator.47", align 1
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator.47", align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  %19 = load atomic i8, ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp acquire, align 8
  %20 = icmp eq i8 %19, 0
  br i1 %20, label %21, label %26, !prof !9

21:                                               ; preds = %2
  %22 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp) #2
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %26

24:                                               ; preds = %21
  %25 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #2
  store i64 %25, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp, align 8
  call void @__cxa_guard_release(ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp) #2
  br label %26

26:                                               ; preds = %24, %21, %2
  %27 = load atomic i8, ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp acquire, align 8
  %28 = icmp eq i8 %27, 0
  br i1 %28, label %29, label %34, !prof !9

29:                                               ; preds = %26
  %30 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp) #2
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %34

32:                                               ; preds = %29
  %33 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #2
  store i64 %33, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp, align 8
  call void @__cxa_guard_release(ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp) #2
  br label %34

34:                                               ; preds = %32, %29, %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %35 = call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #2
  %36 = getelementptr inbounds %"class.std::chrono::time_point", ptr %5, i32 0, i32 0
  %37 = getelementptr inbounds %"class.std::chrono::duration", ptr %36, i32 0, i32 0
  store i64 %35, ptr %37, align 8
  %38 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !10
  %39 = add i64 %38, 1
  store i64 %39, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #2
  %40 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp)
  %41 = getelementptr inbounds %"class.std::chrono::duration", ptr %8, i32 0, i32 0
  store i64 %40, ptr %41, align 8
  %42 = call i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000000000EEEElS3_EENSt9enable_ifIXsr13__is_durationIT_EE5valueES6_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %8)
  %43 = getelementptr inbounds %"class.std::chrono::duration", ptr %7, i32 0, i32 0
  store i64 %42, ptr %43, align 8
  %44 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000000000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #2
  store i64 %44, ptr %6, align 8, !tbaa !10
  %45 = load i64, ptr %6, align 8, !tbaa !10
  %46 = icmp ugt i64 %45, 0
  br i1 %46, label %47, label %53

47:                                               ; preds = %34
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZN12CppBenchmark7Context7metricsEv(ptr noundef nonnull align 8 dereferenceable(56) %48) #2
  %50 = load i64, ptr %6, align 8, !tbaa !10
  %51 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !10
  %52 = udiv i64 %50, %51
  call void @_ZN12CppBenchmark12PhaseMetrics10AddLatencyEl(ptr noundef nonnull align 8 dereferenceable(412) %49, i64 noundef %52) #2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !12
  store i64 0, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !10
  br label %53

53:                                               ; preds = %47, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #2
  %54 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp)
  %55 = getelementptr inbounds %"class.std::chrono::duration", ptr %11, i32 0, i32 0
  store i64 %54, ptr %55, align 8
  %56 = call i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000000000EEEElS3_EENSt9enable_ifIXsr13__is_durationIT_EE5valueES6_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %11)
  %57 = getelementptr inbounds %"class.std::chrono::duration", ptr %10, i32 0, i32 0
  store i64 %56, ptr %57, align 8
  %58 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000000000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #2
  store i64 %58, ptr %9, align 8, !tbaa !10
  %59 = load i64, ptr %9, align 8, !tbaa !10
  %60 = icmp ugt i64 %59, 0
  br i1 %60, label %61, label %102

61:                                               ; preds = %53
  %62 = load i64, ptr %9, align 8, !tbaa !10
  %63 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution, align 8, !tbaa !10
  %64 = icmp ult i64 %62, %63
  br i1 %64, label %65, label %81

65:                                               ; preds = %61
  %66 = load i64, ptr %9, align 8, !tbaa !10
  store i64 %66, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution, align 8, !tbaa !10
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZN12CppBenchmark7Context7metricsEv(ptr noundef nonnull align 8 dereferenceable(56) %67) #2
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #2
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #2
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %69 unwind label %72

69:                                               ; preds = %65
  %70 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution, align 8, !tbaa !10
  invoke void @_ZN12CppBenchmark12PhaseMetrics9SetCustomERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(412) %68, ptr noundef nonnull align 8 dereferenceable(32) %12, i64 noundef %70)
          to label %71 unwind label %76

71:                                               ; preds = %69
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #2
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #2
  br label %81

72:                                               ; preds = %65
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %14, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %15, align 4
  br label %80

76:                                               ; preds = %69
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %14, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %15, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #2
  br label %80

80:                                               ; preds = %76, %72
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %13) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #2
  br label %103

81:                                               ; preds = %71, %61
  %82 = load i64, ptr %9, align 8, !tbaa !10
  %83 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution, align 8, !tbaa !10
  %84 = icmp ugt i64 %82, %83
  br i1 %84, label %85, label %101

85:                                               ; preds = %81
  %86 = load i64, ptr %9, align 8, !tbaa !10
  store i64 %86, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution, align 8, !tbaa !10
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZN12CppBenchmark7Context7metricsEv(ptr noundef nonnull align 8 dereferenceable(56) %87) #2
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #2
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #2
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #2
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %89 unwind label %92

89:                                               ; preds = %85
  %90 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution, align 8, !tbaa !10
  invoke void @_ZN12CppBenchmark12PhaseMetrics9SetCustomERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(412) %88, ptr noundef nonnull align 8 dereferenceable(32) %16, i64 noundef %90)
          to label %91 unwind label %96

91:                                               ; preds = %89
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #2
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #2
  br label %101

92:                                               ; preds = %85
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %14, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %15, align 4
  br label %100

96:                                               ; preds = %89
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %14, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %15, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #2
  br label %100

100:                                              ; preds = %96, %92
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #2
  br label %103

101:                                              ; preds = %91, %81
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp, ptr align 8 %5, i64 8, i1 false), !tbaa.struct !12
  br label %102

102:                                              ; preds = %101, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret void

103:                                              ; preds = %100, %80
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  br label %104

104:                                              ; preds = %103
  %105 = load ptr, ptr %14, align 8
  %106 = load i32, ptr %15, align 4
  %107 = insertvalue { ptr, i32 } poison, ptr %105, 0
  %108 = insertvalue { ptr, i32 } %107, i32 %106, 1
  resume { ptr, i32 } %108
}

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #2

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212system_clock3nowEv() #3

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000000000EEEElS3_EENSt9enable_ifIXsr13__is_durationIT_EE5valueES6_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

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

; Function Attrs: nounwind
declare void @_ZN12CppBenchmark12PhaseMetrics10AddLatencyEl(ptr noundef nonnull align 8 dereferenceable(412), i64 noundef) #3

; 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) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12CppBenchmark12PhaseMetrics9SetCustomERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(412), ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { nounwind }
attributes #3 = { 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 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 nounwind willreturn memory(argmem: readwrite) }

!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 = !{!"branch_weights", i32 1, i32 1048575}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{i64 0, i64 8, !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.std::chrono::time_point" = type { %"class.std::chrono::duration" }
%"class.std::chrono::duration" = type { i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.47" = type { i8 }

@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution = external hidden local_unnamed_addr global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution = external hidden local_unnamed_addr global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp = external hidden global %"class.std::chrono::time_point", align 8
@_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp = external hidden global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp = external hidden global %"class.std::chrono::time_point", align 8
@_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp = external hidden global i64, align 8
@_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count = external hidden local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [15 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 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

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 @_ZN12CppBenchmark15__benchmark__253RunERNS_7ContextE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(56) %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::chrono::time_point", align 8
  %4 = alloca %"class.std::chrono::duration", align 8
  %5 = alloca %"class.std::chrono::duration", align 8
  %6 = alloca %"class.std::chrono::duration", align 8
  %7 = alloca %"class.std::chrono::duration", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator.47", align 1
  %10 = alloca %"class.std::__cxx11::basic_string", align 8
  %11 = alloca %"class.std::allocator.47", align 1
  %12 = load atomic i8, ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp acquire, align 8
  %13 = icmp eq i8 %12, 0
  br i1 %13, label %14, label %18, !prof !5

14:                                               ; preds = %2
  %15 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp) #5
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %18, label %16

16:                                               ; preds = %14
  %17 = tail call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #5
  store i64 %17, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp, align 8
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp) #5
  br label %18

18:                                               ; preds = %16, %14, %2
  %19 = load atomic i8, ptr @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp acquire, align 8
  %20 = icmp eq i8 %19, 0
  br i1 %20, label %21, label %25, !prof !5

21:                                               ; preds = %18
  %22 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp) #5
  %.not17 = icmp eq i32 %22, 0
  br i1 %.not17, label %25, label %23

23:                                               ; preds = %21
  %24 = tail call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #5
  store i64 %24, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp, align 8
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp) #5
  br label %25

25:                                               ; preds = %23, %21, %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %26 = tail call i64 @_ZNSt6chrono3_V212system_clock3nowEv() #5
  store i64 %26, ptr %3, align 8
  %27 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !6
  %28 = add i64 %27, 1
  store i64 %28, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %29 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp)
  store i64 %29, ptr %5, align 8
  %30 = call i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000000000EEEElS3_EENSt9enable_ifIXsr13__is_durationIT_EE5valueES6_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %5)
  store i64 %30, ptr %4, align 8
  %31 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000000000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %.not18 = icmp eq i64 %31, 0
  br i1 %.not18, label %37, label %32

32:                                               ; preds = %25
  %33 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZN12CppBenchmark7Context7metricsEv(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  %34 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !6
  %35 = udiv i64 %31, %34
  call void @_ZN12CppBenchmark12PhaseMetrics10AddLatencyEl(ptr noundef nonnull align 8 dereferenceable(412) %33, i64 noundef %35) #5
  %36 = load i64, ptr %3, align 8, !tbaa !6
  store i64 %36, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE17latency_timestamp, align 8, !tbaa !6
  store i64 0, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE5count, align 8, !tbaa !6
  br label %37

37:                                               ; preds = %32, %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %38 = call i64 @_ZNSt6chronomiINS_3_V212system_clockENS_8durationIlSt5ratioILl1ELl1000000000EEEES6_EENSt11common_typeIJT0_T1_EE4typeERKNS_10time_pointIT_S8_EERKNSC_ISD_S9_EE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp)
  store i64 %38, ptr %7, align 8
  %39 = call i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000000000EEEElS3_EENSt9enable_ifIXsr13__is_durationIT_EE5valueES6_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %7)
  store i64 %39, ptr %6, align 8
  %40 = call noundef i64 @_ZNKSt6chrono8durationIlSt5ratioILl1ELl1000000000EEE5countEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %.not19 = icmp eq i64 %40, 0
  br i1 %.not19, label %69, label %41

41:                                               ; preds = %37
  %42 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution, align 8, !tbaa !6
  %43 = icmp ult i64 %40, %42
  br i1 %43, label %44, label %54

44:                                               ; preds = %41
  store i64 %40, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution, align 8, !tbaa !6
  %45 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZN12CppBenchmark7Context7metricsEv(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %46 unwind label %49

46:                                               ; preds = %44
  %47 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13minresolution, align 8, !tbaa !6
  invoke void @_ZN12CppBenchmark12PhaseMetrics9SetCustomERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(412) %45, ptr noundef nonnull align 8 dereferenceable(32) %8, i64 noundef %47)
          to label %48 unwind label %51

48:                                               ; preds = %46
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %54

49:                                               ; preds = %44
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %53

51:                                               ; preds = %46
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %53

53:                                               ; preds = %51, %49
  %.pn = phi { ptr, i32 } [ %52, %51 ], [ %50, %49 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %70

54:                                               ; preds = %48, %41
  %55 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution, align 8, !tbaa !6
  %56 = icmp ugt i64 %40, %55
  br i1 %56, label %57, label %67

57:                                               ; preds = %54
  store i64 %40, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution, align 8, !tbaa !6
  %58 = call noundef nonnull align 8 dereferenceable(412) ptr @_ZN12CppBenchmark7Context7metricsEv(ptr noundef nonnull align 8 dereferenceable(56) %1) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %11) #5
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef nonnull @.str.3, ptr noundef nonnull align 1 dereferenceable(1) %11)
          to label %59 unwind label %62

59:                                               ; preds = %57
  %60 = load i64, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE13maxresolution, align 8, !tbaa !6
  invoke void @_ZN12CppBenchmark12PhaseMetrics9SetCustomERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(412) %58, ptr noundef nonnull align 8 dereferenceable(32) %10, i64 noundef %60)
          to label %61 unwind label %64

61:                                               ; preds = %59
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br label %67

62:                                               ; preds = %57
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %66

64:                                               ; preds = %59
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %10) #5
  br label %66

66:                                               ; preds = %64, %62
  %.pn21 = phi { ptr, i32 } [ %65, %64 ], [ %63, %62 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %11) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  br label %70

67:                                               ; preds = %61, %54
  %68 = load i64, ptr %3, align 8, !tbaa !6
  store i64 %68, ptr @_ZZN12CppBenchmark15__benchmark__253RunERNS_7ContextEE20resolution_timestamp, align 8, !tbaa !6
  br label %69

69:                                               ; preds = %67, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret void

70:                                               ; preds = %66, %53
  %.pn21.pn = phi { ptr, i32 } [ %.pn21, %66 ], [ %.pn, %53 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn21.pn
}

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #2

; Function Attrs: nounwind
declare i64 @_ZNSt6chrono3_V212system_clock3nowEv() local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZNSt6chrono13duration_castINS_8durationIlSt5ratioILl1ELl1000000000EEEElS3_EENSt9enable_ifIXsr13__is_durationIT_EE5valueES6_E4typeERKNS1_IT0_T1_EE(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind
declare void @_ZN12CppBenchmark12PhaseMetrics10AddLatencyEl(ptr noundef nonnull align 8 dereferenceable(412), i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12CppBenchmark12PhaseMetrics9SetCustomERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm(ptr noundef nonnull align 8 dereferenceable(412), ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

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

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

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 = { nofree nounwind }
attributes #3 = { 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 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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = !{!7, !7, i64 0}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass