; LLVM IR from mitdbg/deneva :: concurrency_control/maat.ll (ZN9TimeTable7releaseEmm)

; 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.Stats = type { ptr, ptr, i64, i64, i64, i64 }
%class.mem_alloc = type { i8 }
%class.TimeTable = type { i64, ptr, %union.sem_t }
%union.sem_t = type { i64, [24 x i8] }
%struct.TimeTableNode = type { ptr, ptr, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%class.Stats_thd = type { [64 x i8], ptr, ptr, double, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, double, i64, double, i64, double, i64, i64, double, double, double, double, double, double, double, double, i64, double, double, double, double, double, double, double, double, i64, i64, double, i64, double, i64, double, double, double, i64, i64, i64, double, double, double, double, double, double, double, double, double, i64, ptr, ptr, double, i64, i64, double, double, double, i64, i64, i64, i64, i64, i64, i64, double, double, double, i64, i64, i64, i64, i64, i64, i64, i64, i64, double, double, double, double, double, i64, i64, double, double, i64, i64, i64, double, double, i64, i64, double, double, double, double, i64, i64, double, double, double, i64, i64, double, double, double, double, double, i64, double, double, double, double, double, double, double, double, i64, i64, i64, double, i64, double, double, i64, i64, i64, i64, i64, double, i64, i64, double, i64, double, double, i64, i64, i64, i64, i64, double, double, double, %class.StatsArr, %class.StatsArr, %class.StatsArr, %class.StatsArr, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, ptr, [64 x i8] }
%class.StatsArr = type { ptr, i64, i64, i32, %union.pthread_mutex_t }
%struct.TimeTableEntry = type { i64, i64, i64, i32, ptr, ptr }

@simulation = external global ptr, align 8
@stats = external global %class.Stats, align 8
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@__PRETTY_FUNCTION__._ZN9TimeTable7releaseEmm = external hidden unnamed_addr constant [44 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 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 noundef i64 @_Z13get_sys_clockv() #1

declare noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) #1

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

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

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

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) #4

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9TimeTable7releaseEmm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %1, i64 noundef %2) #5 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  store i64 %2, ptr %6, align 8, !tbaa !9
  %10 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %11 = load i64, ptr %6, align 8, !tbaa !9
  %12 = call noundef i64 @_ZN9TimeTable4hashEm(ptr noundef nonnull align 8 dereferenceable(48) %10, i64 noundef %11)
  store i64 %12, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %13 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %13, ptr %8, align 8, !tbaa !9
  %14 = getelementptr inbounds %class.TimeTable, ptr %10, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %16 = load i64, ptr %7, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.TimeTableNode, ptr %15, i64 %16
  %18 = getelementptr inbounds %struct.TimeTableNode, ptr %17, i32 0, i32 2
  %19 = call i32 @pthread_mutex_lock(ptr noundef %18) #6
  %20 = load ptr, ptr @simulation, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %20)
  br i1 %21, label %22, label %36

22:                                               ; preds = %3
  %23 = call noundef i64 @_Z13get_sys_clockv()
  %24 = load i64, ptr %8, align 8, !tbaa !9
  %25 = sub i64 %23, %24
  %26 = uitofp i64 %25 to double
  %27 = load ptr, ptr @stats, align 8, !tbaa !13
  %28 = load i64, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds ptr, ptr %27, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.Stats_thd, ptr %30, i32 0, i32 197
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  %33 = getelementptr inbounds double, ptr %32, i64 35
  %34 = load double, ptr %33, align 8, !tbaa !20
  %35 = fadd double %34, %26
  store double %35, ptr %33, align 8, !tbaa !20
  br label %36

36:                                               ; preds = %22, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %37 = load i64, ptr %6, align 8, !tbaa !9
  %38 = call noundef ptr @_ZN9TimeTable4findEm(ptr noundef nonnull align 8 dereferenceable(48) %10, i64 noundef %37)
  store ptr %38, ptr %9, align 8, !tbaa !5
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %111

41:                                               ; preds = %36
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.TimeTableEntry, ptr %42, i32 0, i32 4
  %44 = load ptr, ptr %43, align 8, !tbaa !21
  %45 = icmp ne ptr %44, null
  br i1 %45, label %46, label %54

46:                                               ; preds = %41
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.TimeTableEntry, ptr %47, i32 0, i32 5
  %49 = load ptr, ptr %48, align 8, !tbaa !24
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.TimeTableEntry, ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !21
  %53 = getelementptr inbounds %struct.TimeTableEntry, ptr %52, i32 0, i32 5
  store ptr %49, ptr %53, align 8, !tbaa !24
  br label %75

54:                                               ; preds = %41
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %class.TimeTable, ptr %10, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8, !tbaa !11
  %58 = load i64, ptr %7, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.TimeTableNode, ptr %57, i64 %58
  %60 = getelementptr inbounds %struct.TimeTableNode, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !25
  %62 = icmp eq ptr %55, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %54
  br label %66

64:                                               ; preds = %54
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 239, ptr noundef @__PRETTY_FUNCTION__._ZN9TimeTable7releaseEmm) #7
  unreachable

65:                                               ; No predecessors!
  br label %66

66:                                               ; preds = %65, %63
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.TimeTableEntry, ptr %67, i32 0, i32 5
  %69 = load ptr, ptr %68, align 8, !tbaa !24
  %70 = getelementptr inbounds %class.TimeTable, ptr %10, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  %72 = load i64, ptr %7, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.TimeTableNode, ptr %71, i64 %72
  %74 = getelementptr inbounds %struct.TimeTableNode, ptr %73, i32 0, i32 1
  store ptr %69, ptr %74, align 8, !tbaa !25
  br label %75

75:                                               ; preds = %66, %46
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.TimeTableEntry, ptr %76, i32 0, i32 5
  %78 = load ptr, ptr %77, align 8, !tbaa !24
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %88

80:                                               ; preds = %75
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.TimeTableEntry, ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.TimeTableEntry, ptr %84, i32 0, i32 5
  %86 = load ptr, ptr %85, align 8, !tbaa !24
  %87 = getelementptr inbounds %struct.TimeTableEntry, ptr %86, i32 0, i32 4
  store ptr %83, ptr %87, align 8, !tbaa !21
  br label %109

88:                                               ; preds = %75
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %class.TimeTable, ptr %10, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !11
  %92 = load i64, ptr %7, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.TimeTableNode, ptr %91, i64 %92
  %94 = getelementptr inbounds %struct.TimeTableNode, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !27
  %96 = icmp eq ptr %89, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %88
  br label %100

98:                                               ; preds = %88
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 239, ptr noundef @__PRETTY_FUNCTION__._ZN9TimeTable7releaseEmm) #7
  unreachable

99:                                               ; No predecessors!
  br label %100

100:                                              ; preds = %99, %97
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.TimeTableEntry, ptr %101, i32 0, i32 4
  %103 = load ptr, ptr %102, align 8, !tbaa !21
  %104 = getelementptr inbounds %class.TimeTable, ptr %10, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !11
  %106 = load i64, ptr %7, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.TimeTableNode, ptr %105, i64 %106
  %108 = getelementptr inbounds %struct.TimeTableNode, ptr %107, i32 0, i32 0
  store ptr %103, ptr %108, align 8, !tbaa !27
  br label %109

109:                                              ; preds = %100, %80
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef %110, i64 noundef 48)
  br label %111

111:                                              ; preds = %109, %36
  %112 = getelementptr inbounds %class.TimeTable, ptr %10, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8, !tbaa !11
  %114 = load i64, ptr %7, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.TimeTableNode, ptr %113, i64 %114
  %116 = getelementptr inbounds %struct.TimeTableNode, ptr %115, i32 0, i32 2
  %117 = call i32 @pthread_mutex_unlock(ptr noundef %116) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  ret void
}

declare void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"_ZTS9TimeTable", !10, i64 0, !6, i64 8, !7, i64 16}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS5Stats", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!15 = !{!16, !6, i64 1888}
!16 = !{!"_ZTS9Stats_thd", !7, i64 0, !6, i64 64, !6, i64 72, !17, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !17, i64 184, !10, i64 192, !17, i64 200, !10, i64 208, !17, i64 216, !10, i64 224, !10, i64 232, !17, i64 240, !17, i64 248, !17, i64 256, !17, i64 264, !17, i64 272, !17, i64 280, !17, i64 288, !17, i64 296, !10, i64 304, !17, i64 312, !17, i64 320, !17, i64 328, !17, i64 336, !17, i64 344, !17, i64 352, !17, i64 360, !17, i64 368, !10, i64 376, !10, i64 384, !17, i64 392, !10, i64 400, !17, i64 408, !10, i64 416, !17, i64 424, !17, i64 432, !17, i64 440, !10, i64 448, !10, i64 456, !10, i64 464, !17, i64 472, !17, i64 480, !17, i64 488, !17, i64 496, !17, i64 504, !17, i64 512, !17, i64 520, !17, i64 528, !17, i64 536, !10, i64 544, !6, i64 552, !6, i64 560, !17, i64 568, !10, i64 576, !10, i64 584, !17, i64 592, !17, i64 600, !17, i64 608, !10, i64 616, !10, i64 624, !10, i64 632, !10, i64 640, !10, i64 648, !10, i64 656, !10, i64 664, !17, i64 672, !17, i64 680, !17, i64 688, !10, i64 696, !10, i64 704, !10, i64 712, !10, i64 720, !10, i64 728, !10, i64 736, !10, i64 744, !10, i64 752, !10, i64 760, !17, i64 768, !17, i64 776, !17, i64 784, !17, i64 792, !17, i64 800, !10, i64 808, !10, i64 816, !17, i64 824, !17, i64 832, !10, i64 840, !10, i64 848, !10, i64 856, !17, i64 864, !17, i64 872, !10, i64 880, !10, i64 888, !17, i64 896, !17, i64 904, !17, i64 912, !17, i64 920, !10, i64 928, !10, i64 936, !17, i64 944, !17, i64 952, !17, i64 960, !10, i64 968, !10, i64 976, !17, i64 984, !17, i64 992, !17, i64 1000, !17, i64 1008, !17, i64 1016, !10, i64 1024, !17, i64 1032, !17, i64 1040, !17, i64 1048, !17, i64 1056, !17, i64 1064, !17, i64 1072, !17, i64 1080, !17, i64 1088, !10, i64 1096, !10, i64 1104, !10, i64 1112, !17, i64 1120, !10, i64 1128, !17, i64 1136, !17, i64 1144, !10, i64 1152, !10, i64 1160, !10, i64 1168, !10, i64 1176, !10, i64 1184, !17, i64 1192, !10, i64 1200, !10, i64 1208, !17, i64 1216, !10, i64 1224, !17, i64 1232, !17, i64 1240, !10, i64 1248, !10, i64 1256, !10, i64 1264, !10, i64 1272, !10, i64 1280, !17, i64 1288, !17, i64 1296, !17, i64 1304, !18, i64 1312, !18, i64 1384, !18, i64 1456, !18, i64 1528, !17, i64 1600, !17, i64 1608, !17, i64 1616, !17, i64 1624, !17, i64 1632, !17, i64 1640, !17, i64 1648, !17, i64 1656, !17, i64 1664, !17, i64 1672, !17, i64 1680, !17, i64 1688, !17, i64 1696, !17, i64 1704, !17, i64 1712, !17, i64 1720, !17, i64 1728, !17, i64 1736, !17, i64 1744, !17, i64 1752, !17, i64 1760, !17, i64 1768, !17, i64 1776, !17, i64 1784, !17, i64 1792, !17, i64 1800, !17, i64 1808, !17, i64 1816, !17, i64 1824, !17, i64 1832, !17, i64 1840, !17, i64 1848, !17, i64 1856, !17, i64 1864, !17, i64 1872, !17, i64 1880, !6, i64 1888, !7, i64 1896}
!17 = !{!"double", !7, i64 0}
!18 = !{!"_ZTS8StatsArr", !6, i64 0, !10, i64 8, !10, i64 16, !19, i64 24, !7, i64 32}
!19 = !{!"_ZTS12StatsArrType", !7, i64 0}
!20 = !{!17, !17, i64 0}
!21 = !{!22, !6, i64 32}
!22 = !{!"_ZTS14TimeTableEntry", !10, i64 0, !10, i64 8, !10, i64 16, !23, i64 24, !6, i64 32, !6, i64 40}
!23 = !{!"_ZTS9MAATState", !7, i64 0}
!24 = !{!22, !6, i64 40}
!25 = !{!26, !6, i64 8}
!26 = !{!"_ZTS13TimeTableNode", !6, i64 0, !6, i64 8, !7, i64 16}
!27 = !{!26, !6, i64 0}


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

%class.Stats = type { ptr, ptr, i64, i64, i64, i64 }
%class.mem_alloc = type { i8 }
%struct.TimeTableNode = type { ptr, ptr, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8
@.str.1 = external hidden unnamed_addr constant [76 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@__PRETTY_FUNCTION__._ZN9TimeTable7releaseEmm = external hidden unnamed_addr constant [44 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #0

declare noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) 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
declare dso_local noundef i64 @_ZN9TimeTable4hashEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @pthread_mutex_unlock(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9TimeTable7releaseEmm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %1, i64 noundef %2) local_unnamed_addr #4 align 2 {
  %4 = tail call noundef i64 @_ZN9TimeTable4hashEm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %2)
  %5 = tail call noundef i64 @_Z13get_sys_clockv()
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.TimeTableNode, ptr %7, i64 %4, i32 2
  %9 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %8) #5
  %10 = load ptr, ptr @simulation, align 8, !tbaa !11
  %11 = tail call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %10)
  br i1 %11, label %12, label %24

12:                                               ; preds = %3
  %13 = tail call noundef i64 @_Z13get_sys_clockv()
  %14 = sub i64 %13, %5
  %15 = uitofp i64 %14 to double
  %16 = load ptr, ptr @stats, align 8, !tbaa !12
  %17 = getelementptr inbounds ptr, ptr %16, i64 %1
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = getelementptr inbounds i8, ptr %18, i64 1888
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = getelementptr inbounds i8, ptr %20, i64 280
  %22 = load double, ptr %21, align 8, !tbaa !19
  %23 = fadd double %22, %15
  store double %23, ptr %21, align 8, !tbaa !19
  br label %24

24:                                               ; preds = %12, %3
  %25 = tail call noundef ptr @_ZN9TimeTable4findEm(ptr noundef nonnull align 8 dereferenceable(48) %0, i64 noundef %2)
  %.not = icmp eq ptr %25, null
  br i1 %.not, label %53, label %26

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %25, i64 32
  %28 = load ptr, ptr %27, align 8, !tbaa !20
  %.not24 = icmp eq ptr %28, null
  br i1 %.not24, label %33, label %29

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %25, i64 40
  %31 = load ptr, ptr %30, align 8, !tbaa !23
  %32 = getelementptr inbounds i8, ptr %28, i64 40
  store ptr %31, ptr %32, align 8, !tbaa !23
  br label %42

33:                                               ; preds = %26
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.TimeTableNode, ptr %34, i64 %4, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !24
  %37 = icmp eq ptr %25, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 239, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9TimeTable7releaseEmm) #6
  unreachable

39:                                               ; preds = %33
  %40 = getelementptr inbounds i8, ptr %25, i64 40
  %41 = load ptr, ptr %40, align 8, !tbaa !23
  store ptr %41, ptr %35, align 8, !tbaa !24
  br label %42

42:                                               ; preds = %39, %29
  %43 = phi ptr [ %41, %39 ], [ %31, %29 ]
  %.not25 = icmp eq ptr %43, null
  br i1 %.not25, label %46, label %44

44:                                               ; preds = %42
  %45 = getelementptr inbounds i8, ptr %43, i64 32
  br label %52

46:                                               ; preds = %42
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.TimeTableNode, ptr %47, i64 %4
  %49 = load ptr, ptr %48, align 8, !tbaa !26
  %50 = icmp eq ptr %25, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 239, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9TimeTable7releaseEmm) #6
  unreachable

52:                                               ; preds = %46, %44
  %.sink = phi ptr [ %45, %44 ], [ %48, %46 ]
  store ptr %28, ptr %.sink, align 8, !tbaa !11
  tail call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef nonnull %25, i64 noundef 48)
  br label %53

53:                                               ; preds = %52, %24
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.TimeTableNode, ptr %54, i64 %4, i32 2
  %56 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %55) #5
  ret void
}

declare void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, i64 noundef) local_unnamed_addr #0

attributes #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 = { 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 = { 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 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 }
attributes #6 = { 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, !10, i64 8}
!6 = !{!"_ZTS9TimeTable", !7, i64 0, !10, i64 8, !8, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"_ZTS5Stats", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!14 = !{!15, !10, i64 1888}
!15 = !{!"_ZTS9Stats_thd", !8, i64 0, !10, i64 64, !10, i64 72, !16, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !16, i64 184, !7, i64 192, !16, i64 200, !7, i64 208, !16, i64 216, !7, i64 224, !7, i64 232, !16, i64 240, !16, i64 248, !16, i64 256, !16, i64 264, !16, i64 272, !16, i64 280, !16, i64 288, !16, i64 296, !7, i64 304, !16, i64 312, !16, i64 320, !16, i64 328, !16, i64 336, !16, i64 344, !16, i64 352, !16, i64 360, !16, i64 368, !7, i64 376, !7, i64 384, !16, i64 392, !7, i64 400, !16, i64 408, !7, i64 416, !16, i64 424, !16, i64 432, !16, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !16, i64 472, !16, i64 480, !16, i64 488, !16, i64 496, !16, i64 504, !16, i64 512, !16, i64 520, !16, i64 528, !16, i64 536, !7, i64 544, !10, i64 552, !10, i64 560, !16, i64 568, !7, i64 576, !7, i64 584, !16, i64 592, !16, i64 600, !16, i64 608, !7, i64 616, !7, i64 624, !7, i64 632, !7, i64 640, !7, i64 648, !7, i64 656, !7, i64 664, !16, i64 672, !16, i64 680, !16, i64 688, !7, i64 696, !7, i64 704, !7, i64 712, !7, i64 720, !7, i64 728, !7, i64 736, !7, i64 744, !7, i64 752, !7, i64 760, !16, i64 768, !16, i64 776, !16, i64 784, !16, i64 792, !16, i64 800, !7, i64 808, !7, i64 816, !16, i64 824, !16, i64 832, !7, i64 840, !7, i64 848, !7, i64 856, !16, i64 864, !16, i64 872, !7, i64 880, !7, i64 888, !16, i64 896, !16, i64 904, !16, i64 912, !16, i64 920, !7, i64 928, !7, i64 936, !16, i64 944, !16, i64 952, !16, i64 960, !7, i64 968, !7, i64 976, !16, i64 984, !16, i64 992, !16, i64 1000, !16, i64 1008, !16, i64 1016, !7, i64 1024, !16, i64 1032, !16, i64 1040, !16, i64 1048, !16, i64 1056, !16, i64 1064, !16, i64 1072, !16, i64 1080, !16, i64 1088, !7, i64 1096, !7, i64 1104, !7, i64 1112, !16, i64 1120, !7, i64 1128, !16, i64 1136, !16, i64 1144, !7, i64 1152, !7, i64 1160, !7, i64 1168, !7, i64 1176, !7, i64 1184, !16, i64 1192, !7, i64 1200, !7, i64 1208, !16, i64 1216, !7, i64 1224, !16, i64 1232, !16, i64 1240, !7, i64 1248, !7, i64 1256, !7, i64 1264, !7, i64 1272, !7, i64 1280, !16, i64 1288, !16, i64 1296, !16, i64 1304, !17, i64 1312, !17, i64 1384, !17, i64 1456, !17, i64 1528, !16, i64 1600, !16, i64 1608, !16, i64 1616, !16, i64 1624, !16, i64 1632, !16, i64 1640, !16, i64 1648, !16, i64 1656, !16, i64 1664, !16, i64 1672, !16, i64 1680, !16, i64 1688, !16, i64 1696, !16, i64 1704, !16, i64 1712, !16, i64 1720, !16, i64 1728, !16, i64 1736, !16, i64 1744, !16, i64 1752, !16, i64 1760, !16, i64 1768, !16, i64 1776, !16, i64 1784, !16, i64 1792, !16, i64 1800, !16, i64 1808, !16, i64 1816, !16, i64 1824, !16, i64 1832, !16, i64 1840, !16, i64 1848, !16, i64 1856, !16, i64 1864, !16, i64 1872, !16, i64 1880, !10, i64 1888, !8, i64 1896}
!16 = !{!"double", !8, i64 0}
!17 = !{!"_ZTS8StatsArr", !10, i64 0, !7, i64 8, !7, i64 16, !18, i64 24, !8, i64 32}
!18 = !{!"_ZTS12StatsArrType", !8, i64 0}
!19 = !{!16, !16, i64 0}
!20 = !{!21, !10, i64 32}
!21 = !{!"_ZTS14TimeTableEntry", !7, i64 0, !7, i64 8, !7, i64 16, !22, i64 24, !10, i64 32, !10, i64 40}
!22 = !{!"_ZTS9MAATState", !8, i64 0}
!23 = !{!21, !10, i64 40}
!24 = !{!25, !10, i64 8}
!25 = !{!"_ZTS13TimeTableNode", !10, i64 0, !10, i64 8, !8, i64 16}
!26 = !{!25, !10, i64 0}


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