; LLVM IR from balintbalazs/B3D :: source/src/B3D_cudaCompress/profiler/profiler.ll (ZN8Profiler9endSampleEv)

; 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.Profiler = type { [100 x %"struct.Profiler::sample"], %"class.std::set", i32, i32, i32, i32, i32, i64, i64, i32, i64, i64, i32, i64, i8, i64, i64, i64 }
%"struct.Profiler::sample" = type { i8, %"class.std::__cxx11::basic_string", i32, i32, i8, i64, i64, i64, i64, i64, i32, i32, i32, i32, 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<IProfilerOutputHandler *, IProfilerOutputHandler *, std::_Identity<IProfilerOutputHandler *>, std::less<IProfilerOutputHandler *>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<IProfilerOutputHandler *, IProfilerOutputHandler *, std::_Identity<IProfilerOutputHandler *>, std::less<IProfilerOutputHandler *>>::_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 }

@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_17getTimeEv() #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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8Profiler9endSampleEv(ptr noundef nonnull align 8 dereferenceable(12160) %0) #3 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 14
  %7 = load i8, ptr %6, align 8, !tbaa !9, !range !23, !noundef !24
  %8 = trunc i8 %7 to i1
  br i1 %8, label %10, label %9

9:                                                ; preds = %1
  br label %188

10:                                               ; preds = %1
  %11 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %12 = load i32, ptr %11, align 4, !tbaa !25
  %13 = icmp sge i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %10
  br label %17

15:                                               ; preds = %10
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 206, ptr noundef @__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv) #4
  unreachable

16:                                               ; No predecessors!
  br label %17

17:                                               ; preds = %16, %14
  %18 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 5
  %19 = load i32, ptr %18, align 4, !tbaa !26
  %20 = icmp ugt i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %17
  br label %24

22:                                               ; preds = %17
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 207, ptr noundef @__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv) #4
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %26 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %27 = load i32, ptr %26, align 4, !tbaa !25
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %25, i64 0, i64 %28
  %30 = getelementptr inbounds %"struct.Profiler::sample", ptr %29, i32 0, i32 13
  %31 = load i32, ptr %30, align 4, !tbaa !27
  %32 = icmp ugt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %24
  br label %36

34:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 208, ptr noundef @__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv) #4
  unreachable

35:                                               ; No predecessors!
  br label %36

36:                                               ; preds = %35, %33
  %37 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 6
  %38 = load i32, ptr %37, align 8, !tbaa !31
  %39 = icmp ugt i32 %38, 0
  br i1 %39, label %40, label %44

40:                                               ; preds = %36
  %41 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 6
  %42 = load i32, ptr %41, align 8, !tbaa !31
  %43 = add i32 %42, -1
  store i32 %43, ptr %41, align 8, !tbaa !31
  br label %188

44:                                               ; preds = %36
  %45 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 4
  %46 = load i32, ptr %45, align 8, !tbaa !32
  %47 = icmp ugt i32 %46, 0
  br i1 %47, label %48, label %52

48:                                               ; preds = %44
  %49 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 4
  %50 = load i32, ptr %49, align 8, !tbaa !32
  %51 = add i32 %50, -1
  store i32 %51, ptr %49, align 8, !tbaa !32
  br label %188

52:                                               ; preds = %44
  %53 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %54 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %55 = load i32, ptr %54, align 4, !tbaa !25
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %53, i64 0, i64 %56
  %58 = getelementptr inbounds %"struct.Profiler::sample", ptr %57, i32 0, i32 13
  %59 = load i32, ptr %58, align 4, !tbaa !27
  %60 = icmp ugt i32 %59, 1
  br i1 %60, label %61, label %70

61:                                               ; preds = %52
  %62 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %63 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %64 = load i32, ptr %63, align 4, !tbaa !25
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %62, i64 0, i64 %65
  %67 = getelementptr inbounds %"struct.Profiler::sample", ptr %66, i32 0, i32 13
  %68 = load i32, ptr %67, align 4, !tbaa !27
  %69 = add i32 %68, -1
  store i32 %69, ptr %67, align 4, !tbaa !27
  br label %188

70:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %71 = call noundef i64 @_ZN12_GLOBAL__N_17getTimeEv()
  store i64 %71, ptr %3, align 8, !tbaa !33
  %72 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %73 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %74 = load i32, ptr %73, align 4, !tbaa !25
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %72, i64 0, i64 %75
  %77 = getelementptr inbounds %"struct.Profiler::sample", ptr %76, i32 0, i32 13
  store i32 0, ptr %77, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %78 = load i64, ptr %3, align 8, !tbaa !33
  %79 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %80 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %81 = load i32, ptr %80, align 4, !tbaa !25
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %79, i64 0, i64 %82
  %84 = getelementptr inbounds %"struct.Profiler::sample", ptr %83, i32 0, i32 14
  %85 = load i64, ptr %84, align 8, !tbaa !34
  %86 = sub i64 %78, %85
  store i64 %86, ptr %4, align 8, !tbaa !33
  %87 = load i64, ptr %4, align 8, !tbaa !33
  %88 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %89 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %90 = load i32, ptr %89, align 4, !tbaa !25
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %88, i64 0, i64 %91
  %93 = getelementptr inbounds %"struct.Profiler::sample", ptr %92, i32 0, i32 5
  %94 = load i64, ptr %93, align 8, !tbaa !35
  %95 = add i64 %94, %87
  store i64 %95, ptr %93, align 8, !tbaa !35
  %96 = load i64, ptr %4, align 8, !tbaa !33
  %97 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %98 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %99 = load i32, ptr %98, align 4, !tbaa !25
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %97, i64 0, i64 %100
  %102 = getelementptr inbounds %"struct.Profiler::sample", ptr %101, i32 0, i32 6
  %103 = load i64, ptr %102, align 8, !tbaa !36
  %104 = icmp ugt i64 %96, %103
  br i1 %104, label %105, label %113

105:                                              ; preds = %70
  %106 = load i64, ptr %4, align 8, !tbaa !33
  %107 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %108 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %109 = load i32, ptr %108, align 4, !tbaa !25
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %107, i64 0, i64 %110
  %112 = getelementptr inbounds %"struct.Profiler::sample", ptr %111, i32 0, i32 6
  store i64 %106, ptr %112, align 8, !tbaa !36
  br label %113

113:                                              ; preds = %105, %70
  %114 = load i64, ptr %4, align 8, !tbaa !33
  %115 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %116 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %117 = load i32, ptr %116, align 4, !tbaa !25
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %115, i64 0, i64 %118
  %120 = getelementptr inbounds %"struct.Profiler::sample", ptr %119, i32 0, i32 8
  %121 = load i64, ptr %120, align 8, !tbaa !37
  %122 = add i64 %121, %114
  store i64 %122, ptr %120, align 8, !tbaa !37
  %123 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %124 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %125 = load i32, ptr %124, align 4, !tbaa !25
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %123, i64 0, i64 %126
  %128 = getelementptr inbounds %"struct.Profiler::sample", ptr %127, i32 0, i32 8
  %129 = load i64, ptr %128, align 8, !tbaa !37
  %130 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %131 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %132 = load i32, ptr %131, align 4, !tbaa !25
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %130, i64 0, i64 %133
  %135 = getelementptr inbounds %"struct.Profiler::sample", ptr %134, i32 0, i32 9
  %136 = load i64, ptr %135, align 8, !tbaa !38
  %137 = icmp ugt i64 %129, %136
  br i1 %137, label %138, label %152

138:                                              ; preds = %113
  %139 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %140 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %141 = load i32, ptr %140, align 4, !tbaa !25
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %139, i64 0, i64 %142
  %144 = getelementptr inbounds %"struct.Profiler::sample", ptr %143, i32 0, i32 8
  %145 = load i64, ptr %144, align 8, !tbaa !37
  %146 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %147 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %148 = load i32, ptr %147, align 4, !tbaa !25
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %146, i64 0, i64 %149
  %151 = getelementptr inbounds %"struct.Profiler::sample", ptr %150, i32 0, i32 9
  store i64 %145, ptr %151, align 8, !tbaa !38
  br label %152

152:                                              ; preds = %138, %113
  %153 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %154 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %155 = load i32, ptr %154, align 4, !tbaa !25
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %153, i64 0, i64 %156
  %158 = getelementptr inbounds %"struct.Profiler::sample", ptr %157, i32 0, i32 2
  %159 = load i32, ptr %158, align 8, !tbaa !39
  %160 = icmp sge i32 %159, 0
  br i1 %160, label %161, label %176

161:                                              ; preds = %152
  %162 = load i64, ptr %4, align 8, !tbaa !33
  %163 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %164 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %165 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %166 = load i32, ptr %165, align 4, !tbaa !25
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %164, i64 0, i64 %167
  %169 = getelementptr inbounds %"struct.Profiler::sample", ptr %168, i32 0, i32 2
  %170 = load i32, ptr %169, align 8, !tbaa !39
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %163, i64 0, i64 %171
  %173 = getelementptr inbounds %"struct.Profiler::sample", ptr %172, i32 0, i32 7
  %174 = load i64, ptr %173, align 8, !tbaa !40
  %175 = add i64 %174, %162
  store i64 %175, ptr %173, align 8, !tbaa !40
  br label %176

176:                                              ; preds = %161, %152
  %177 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 0
  %178 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  %179 = load i32, ptr %178, align 4, !tbaa !25
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %177, i64 0, i64 %180
  %182 = getelementptr inbounds %"struct.Profiler::sample", ptr %181, i32 0, i32 2
  %183 = load i32, ptr %182, align 8, !tbaa !39
  %184 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 3
  store i32 %183, ptr %184, align 4, !tbaa !25
  %185 = getelementptr inbounds %class.Profiler, ptr %5, i32 0, i32 5
  %186 = load i32, ptr %185, align 4, !tbaa !26
  %187 = add i32 %186, -1
  store i32 %187, ptr %185, align 4, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  br label %188

188:                                              ; preds = %176, %61, %48, %40, %9
  ret void
}

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 = { noreturn 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 #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !22, i64 12128}
!10 = !{!"_ZTS8Profiler", !7, i64 0, !11, i64 12000, !20, i64 12048, !20, i64 12052, !20, i64 12056, !20, i64 12060, !20, i64 12064, !21, i64 12072, !21, i64 12080, !20, i64 12088, !21, i64 12096, !21, i64 12104, !20, i64 12112, !21, i64 12120, !22, i64 12128, !21, i64 12136, !21, i64 12144, !21, i64 12152}
!11 = !{!"_ZTSSt3setIP22IProfilerOutputHandlerSt4lessIS1_ESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt8_Rb_treeIP22IProfilerOutputHandlerS1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt8_Rb_treeIP22IProfilerOutputHandlerS1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIP22IProfilerOutputHandlerEE", !15, i64 0}
!15 = !{!"_ZTSSt4lessIP22IProfilerOutputHandlerE"}
!16 = !{!"_ZTSSt15_Rb_tree_header", !17, i64 0, !19, i64 32}
!17 = !{!"_ZTSSt18_Rb_tree_node_base", !18, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!"long long", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!10, !20, i64 12052}
!26 = !{!10, !20, i64 12060}
!27 = !{!28, !20, i64 108}
!28 = !{!"_ZTSN8Profiler6sampleE", !22, i64 0, !29, i64 8, !20, i64 40, !20, i64 44, !22, i64 48, !21, i64 56, !21, i64 64, !21, i64 72, !21, i64 80, !21, i64 88, !20, i64 96, !20, i64 100, !20, i64 104, !20, i64 108, !21, i64 112}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !30, i64 0, !19, i64 8, !7, i64 16}
!30 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!31 = !{!10, !20, i64 12064}
!32 = !{!10, !20, i64 12056}
!33 = !{!21, !21, i64 0}
!34 = !{!28, !21, i64 112}
!35 = !{!28, !21, i64 56}
!36 = !{!28, !21, i64 64}
!37 = !{!28, !21, i64 80}
!38 = !{!28, !21, i64 88}
!39 = !{!28, !20, i64 40}
!40 = !{!28, !21, i64 72}


; 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.Profiler::sample" = type { i8, %"class.std::__cxx11::basic_string", i32, i32, i8, i64, i64, i64, i64, i64, i32, i32, i32, i32, 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] }

@.str.1 = external hidden unnamed_addr constant [100 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv = external hidden unnamed_addr constant [27 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [45 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN12_GLOBAL__N_17getTimeEv() local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN8Profiler9endSampleEv(ptr nocapture noundef nonnull align 8 dereferenceable(12160) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 12128
  %3 = load i8, ptr %2, align 8, !tbaa !5, !range !22, !noundef !23
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %5, label %68

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 12052
  %7 = load i32, ptr %6, align 4, !tbaa !24
  %8 = icmp sgt i32 %7, -1
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 206, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv) #2
  unreachable

10:                                               ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 12060
  %12 = load i32, ptr %11, align 4, !tbaa !25
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %14

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 207, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv) #2
  unreachable

14:                                               ; preds = %10
  %15 = zext nneg i32 %7 to i64
  %16 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %0, i64 0, i64 %15, i32 13
  %17 = load i32, ptr %16, align 4, !tbaa !26
  %.not12 = icmp eq i32 %17, 0
  br i1 %.not12, label %18, label %19

18:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 208, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN8Profiler9endSampleEv) #2
  unreachable

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 12064
  %21 = load i32, ptr %20, align 8, !tbaa !30
  %.not13 = icmp eq i32 %21, 0
  br i1 %.not13, label %24, label %22

22:                                               ; preds = %19
  %23 = add i32 %21, -1
  store i32 %23, ptr %20, align 8, !tbaa !30
  br label %68

24:                                               ; preds = %19
  %25 = getelementptr inbounds i8, ptr %0, i64 12056
  %26 = load i32, ptr %25, align 8, !tbaa !31
  %.not14 = icmp eq i32 %26, 0
  br i1 %.not14, label %29, label %27

27:                                               ; preds = %24
  %28 = add i32 %26, -1
  store i32 %28, ptr %25, align 8, !tbaa !31
  br label %68

29:                                               ; preds = %24
  %.not15 = icmp eq i32 %17, 1
  br i1 %.not15, label %32, label %30

30:                                               ; preds = %29
  %31 = add i32 %17, -1
  store i32 %31, ptr %16, align 4, !tbaa !26
  br label %68

32:                                               ; preds = %29
  %33 = tail call noundef i64 @_ZN12_GLOBAL__N_17getTimeEv()
  %34 = load i32, ptr %6, align 4, !tbaa !24
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %0, i64 0, i64 %35, i32 13
  store i32 0, ptr %36, align 4, !tbaa !26
  %37 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %0, i64 0, i64 %35
  %38 = getelementptr inbounds i8, ptr %37, i64 112
  %39 = load i64, ptr %38, align 8, !tbaa !32
  %40 = sub i64 %33, %39
  %41 = getelementptr inbounds i8, ptr %37, i64 56
  %42 = load i64, ptr %41, align 8, !tbaa !33
  %43 = add i64 %42, %40
  store i64 %43, ptr %41, align 8, !tbaa !33
  %44 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %0, i64 0, i64 %35, i32 6
  %45 = load i64, ptr %44, align 8, !tbaa !34
  %46 = icmp ugt i64 %40, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %32
  store i64 %40, ptr %44, align 8, !tbaa !34
  br label %48

48:                                               ; preds = %47, %32
  %49 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %0, i64 0, i64 %35, i32 8
  %50 = load i64, ptr %49, align 8, !tbaa !35
  %51 = add i64 %50, %40
  store i64 %51, ptr %49, align 8, !tbaa !35
  %52 = getelementptr inbounds i8, ptr %37, i64 88
  %53 = load i64, ptr %52, align 8, !tbaa !36
  %54 = icmp ugt i64 %51, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %48
  store i64 %51, ptr %52, align 8, !tbaa !36
  br label %56

56:                                               ; preds = %55, %48
  %57 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %0, i64 0, i64 %35, i32 2
  %58 = load i32, ptr %57, align 8, !tbaa !37
  %59 = icmp sgt i32 %58, -1
  br i1 %59, label %60, label %65

60:                                               ; preds = %56
  %61 = zext nneg i32 %58 to i64
  %62 = getelementptr inbounds [100 x %"struct.Profiler::sample"], ptr %0, i64 0, i64 %61, i32 7
  %63 = load i64, ptr %62, align 8, !tbaa !38
  %64 = add i64 %63, %40
  store i64 %64, ptr %62, align 8, !tbaa !38
  br label %65

65:                                               ; preds = %60, %56
  store i32 %58, ptr %6, align 4, !tbaa !24
  %66 = load i32, ptr %11, align 4, !tbaa !25
  %67 = add i32 %66, -1
  store i32 %67, ptr %11, align 4, !tbaa !25
  br label %68

68:                                               ; preds = %1, %65, %30, %27, %22
  ret void
}

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 = { noreturn 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 #2 = { noreturn 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, !21, i64 12128}
!6 = !{!"_ZTS8Profiler", !7, i64 0, !9, i64 12000, !19, i64 12048, !19, i64 12052, !19, i64 12056, !19, i64 12060, !19, i64 12064, !20, i64 12072, !20, i64 12080, !19, i64 12088, !20, i64 12096, !20, i64 12104, !19, i64 12112, !20, i64 12120, !21, i64 12128, !20, i64 12136, !20, i64 12144, !20, i64 12152}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"_ZTSSt3setIP22IProfilerOutputHandlerSt4lessIS1_ESaIS1_EE", !10, i64 0}
!10 = !{!"_ZTSSt8_Rb_treeIP22IProfilerOutputHandlerS1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE", !11, i64 0}
!11 = !{!"_ZTSNSt8_Rb_treeIP22IProfilerOutputHandlerS1_St9_IdentityIS1_ESt4lessIS1_ESaIS1_EE13_Rb_tree_implIS5_Lb1EEE", !12, i64 0, !14, i64 8}
!12 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIP22IProfilerOutputHandlerEE", !13, i64 0}
!13 = !{!"_ZTSSt4lessIP22IProfilerOutputHandlerE"}
!14 = !{!"_ZTSSt15_Rb_tree_header", !15, i64 0, !18, i64 32}
!15 = !{!"_ZTSSt18_Rb_tree_node_base", !16, i64 0, !17, i64 8, !17, i64 16, !17, i64 24}
!16 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!17 = !{!"any pointer", !7, i64 0}
!18 = !{!"long", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!"long long", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!6, !19, i64 12052}
!25 = !{!6, !19, i64 12060}
!26 = !{!27, !19, i64 108}
!27 = !{!"_ZTSN8Profiler6sampleE", !21, i64 0, !28, i64 8, !19, i64 40, !19, i64 44, !21, i64 48, !20, i64 56, !20, i64 64, !20, i64 72, !20, i64 80, !20, i64 88, !19, i64 96, !19, i64 100, !19, i64 104, !19, i64 108, !20, i64 112}
!28 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !29, i64 0, !18, i64 8, !7, i64 16}
!29 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !17, i64 0}
!30 = !{!6, !19, i64 12064}
!31 = !{!6, !19, i64 12056}
!32 = !{!27, !20, i64 112}
!33 = !{!27, !20, i64 56}
!34 = !{!27, !20, i64 64}
!35 = !{!27, !20, i64 80}
!36 = !{!27, !20, i64 88}
!37 = !{!27, !19, i64 40}
!38 = !{!27, !20, i64 72}


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