; LLVM IR from mitdbg/deneva :: system/msg_queue.ll (ZN12MessageQueue7enqueueEmP7Messagem)

; 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.mem_alloc = type { i8 }
%class.Stats = type { ptr, ptr, i64, i64, i64, i64 }
%struct.msg_entry = type { ptr, i64, i64 }
%class.MessageQueue = type { ptr, %"class.std::vector", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<msg_entry *, std::allocator<msg_entry *>>::_Vector_impl" }
%"struct.std::_Vector_base<msg_entry *, std::allocator<msg_entry *>>::_Vector_impl" = type { %"struct.std::_Vector_base<msg_entry *, std::allocator<msg_entry *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<msg_entry *, std::allocator<msg_entry *>>::_Vector_impl_data" = type { ptr, 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 }
%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 }

@g_this_send_thread_cnt = external global i32, align 4
@mem_allocator = external global %class.mem_alloc, align 1
@g_total_node_cnt = external global i32, align 4
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@__PRETTY_FUNCTION__._ZN12MessageQueue7enqueueEmP7Messagem = external hidden unnamed_addr constant [58 x i8], align 1
@g_node_id = external global i32, align 4
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@simulation = external global ptr, align 8
@stats = external global %class.Stats, align 8

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

; 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 @_ZN12MessageQueue7enqueueEmP7Messagem(ptr noundef nonnull align 8 dereferenceable(40) %0, i64 noundef %1, ptr noundef %2, i64 noundef %3) #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !9
  %12 = load ptr, ptr %5, align 8
  %13 = load i64, ptr %8, align 8, !tbaa !9
  %14 = load i32, ptr @g_total_node_cnt, align 4, !tbaa !11
  %15 = zext i32 %14 to i64
  %16 = icmp ult i64 %13, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %4
  br label %20

18:                                               ; preds = %4
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 47, ptr noundef @__PRETTY_FUNCTION__._ZN12MessageQueue7enqueueEmP7Messagem) #4
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  %21 = load i64, ptr %8, align 8, !tbaa !9
  %22 = load i32, ptr @g_node_id, align 4, !tbaa !11
  %23 = zext i32 %22 to i64
  %24 = icmp ne i64 %21, %23
  br i1 %24, label %25, label %26

25:                                               ; preds = %20
  br label %28

26:                                               ; preds = %20
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 48, ptr noundef @__PRETTY_FUNCTION__._ZN12MessageQueue7enqueueEmP7Messagem) #4
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %29 = call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 24)
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.msg_entry, ptr %31, i32 0, i32 0
  store ptr %30, ptr %32, align 8, !tbaa !13
  %33 = load i64, ptr %8, align 8, !tbaa !9
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.msg_entry, ptr %34, i32 0, i32 1
  store i64 %33, ptr %35, align 8, !tbaa !15
  %36 = call noundef i64 @_Z13get_sys_clockv()
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.msg_entry, ptr %37, i32 0, i32 2
  store i64 %36, ptr %38, align 8, !tbaa !16
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.msg_entry, ptr %39, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !15
  %42 = load i32, ptr @g_total_node_cnt, align 4, !tbaa !11
  %43 = zext i32 %42 to i64
  %44 = icmp ult i64 %41, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %28
  br label %48

46:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 55, ptr noundef @__PRETTY_FUNCTION__._ZN12MessageQueue7enqueueEmP7Messagem) #4
  unreachable

47:                                               ; No predecessors!
  br label %48

48:                                               ; preds = %47, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %49 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %49, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %50 = load i64, ptr %10, align 8, !tbaa !9
  %51 = load i32, ptr @g_this_send_thread_cnt, align 4, !tbaa !11
  %52 = zext i32 %51 to i64
  %53 = urem i64 %50, %52
  store i64 %53, ptr %11, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %67, %48
  %55 = getelementptr inbounds %class.MessageQueue, ptr %12, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %57 = load i64, ptr %11, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %56, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP9msg_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136) %59, ptr noundef nonnull align 8 dereferenceable(8) %9)
  br i1 %60, label %65, label %61

61:                                               ; preds = %54
  %62 = load ptr, ptr @simulation, align 8, !tbaa !5
  %63 = call noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %62)
  %64 = xor i1 %63, true
  br label %65

65:                                               ; preds = %61, %54
  %66 = phi i1 [ false, %54 ], [ %64, %61 ]
  br i1 %66, label %67, label %68

67:                                               ; preds = %65
  br label %54, !llvm.loop !23

68:                                               ; preds = %65
  %69 = load ptr, ptr @simulation, align 8, !tbaa !5
  %70 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %69)
  br i1 %70, label %71, label %85

71:                                               ; preds = %68
  %72 = call noundef i64 @_Z13get_sys_clockv()
  %73 = load i64, ptr %10, align 8, !tbaa !9
  %74 = sub i64 %72, %73
  %75 = uitofp i64 %74 to double
  %76 = load ptr, ptr @stats, align 8, !tbaa !25
  %77 = load i64, ptr %6, align 8, !tbaa !9
  %78 = getelementptr inbounds ptr, ptr %76, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds %class.Stats_thd, ptr %79, i32 0, i32 197
  %81 = load ptr, ptr %80, align 8, !tbaa !27
  %82 = getelementptr inbounds double, ptr %81, i64 3
  %83 = load double, ptr %82, align 8, !tbaa !32
  %84 = fadd double %83, %75
  store double %84, ptr %82, align 8, !tbaa !32
  br label %85

85:                                               ; preds = %71, %68
  %86 = load ptr, ptr @simulation, align 8, !tbaa !5
  %87 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %86)
  br i1 %87, label %88, label %96

88:                                               ; preds = %85
  %89 = load ptr, ptr @stats, align 8, !tbaa !25
  %90 = load i64, ptr %6, align 8, !tbaa !9
  %91 = getelementptr inbounds ptr, ptr %89, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = getelementptr inbounds %class.Stats_thd, ptr %92, i32 0, i32 66
  %94 = load i64, ptr %93, align 8, !tbaa !33
  %95 = add i64 %94, 1
  store i64 %95, ptr %93, align 8, !tbaa !33
  br label %96

96:                                               ; preds = %88, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret void
}

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

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) #3

declare noundef i64 @_Z13get_sys_clockv() #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5boost8lockfree5queueIP9msg_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

declare noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) #3

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

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 = { 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 = { "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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS9msg_entry", !6, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!14, !10, i64 8}
!16 = !{!14, !10, i64 16}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTS12MessageQueue", !6, i64 0, !19, i64 8, !6, i64 32}
!19 = !{!"_ZTSSt6vectorIP9msg_entrySaIS1_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIP9msg_entrySaIS1_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIP9msg_entrySaIS1_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIP9msg_entrySaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !6, i64 0}
!26 = !{!"_ZTS5Stats", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!27 = !{!28, !6, i64 1888}
!28 = !{!"_ZTS9Stats_thd", !7, i64 0, !6, i64 64, !6, i64 72, !29, 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, !29, i64 184, !10, i64 192, !29, i64 200, !10, i64 208, !29, i64 216, !10, i64 224, !10, i64 232, !29, i64 240, !29, i64 248, !29, i64 256, !29, i64 264, !29, i64 272, !29, i64 280, !29, i64 288, !29, i64 296, !10, i64 304, !29, i64 312, !29, i64 320, !29, i64 328, !29, i64 336, !29, i64 344, !29, i64 352, !29, i64 360, !29, i64 368, !10, i64 376, !10, i64 384, !29, i64 392, !10, i64 400, !29, i64 408, !10, i64 416, !29, i64 424, !29, i64 432, !29, i64 440, !10, i64 448, !10, i64 456, !10, i64 464, !29, i64 472, !29, i64 480, !29, i64 488, !29, i64 496, !29, i64 504, !29, i64 512, !29, i64 520, !29, i64 528, !29, i64 536, !10, i64 544, !6, i64 552, !6, i64 560, !29, i64 568, !10, i64 576, !10, i64 584, !29, i64 592, !29, i64 600, !29, i64 608, !10, i64 616, !10, i64 624, !10, i64 632, !10, i64 640, !10, i64 648, !10, i64 656, !10, i64 664, !29, i64 672, !29, i64 680, !29, 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, !29, i64 768, !29, i64 776, !29, i64 784, !29, i64 792, !29, i64 800, !10, i64 808, !10, i64 816, !29, i64 824, !29, i64 832, !10, i64 840, !10, i64 848, !10, i64 856, !29, i64 864, !29, i64 872, !10, i64 880, !10, i64 888, !29, i64 896, !29, i64 904, !29, i64 912, !29, i64 920, !10, i64 928, !10, i64 936, !29, i64 944, !29, i64 952, !29, i64 960, !10, i64 968, !10, i64 976, !29, i64 984, !29, i64 992, !29, i64 1000, !29, i64 1008, !29, i64 1016, !10, i64 1024, !29, i64 1032, !29, i64 1040, !29, i64 1048, !29, i64 1056, !29, i64 1064, !29, i64 1072, !29, i64 1080, !29, i64 1088, !10, i64 1096, !10, i64 1104, !10, i64 1112, !29, i64 1120, !10, i64 1128, !29, i64 1136, !29, i64 1144, !10, i64 1152, !10, i64 1160, !10, i64 1168, !10, i64 1176, !10, i64 1184, !29, i64 1192, !10, i64 1200, !10, i64 1208, !29, i64 1216, !10, i64 1224, !29, i64 1232, !29, i64 1240, !10, i64 1248, !10, i64 1256, !10, i64 1264, !10, i64 1272, !10, i64 1280, !29, i64 1288, !29, i64 1296, !29, i64 1304, !30, i64 1312, !30, i64 1384, !30, i64 1456, !30, i64 1528, !29, i64 1600, !29, i64 1608, !29, i64 1616, !29, i64 1624, !29, i64 1632, !29, i64 1640, !29, i64 1648, !29, i64 1656, !29, i64 1664, !29, i64 1672, !29, i64 1680, !29, i64 1688, !29, i64 1696, !29, i64 1704, !29, i64 1712, !29, i64 1720, !29, i64 1728, !29, i64 1736, !29, i64 1744, !29, i64 1752, !29, i64 1760, !29, i64 1768, !29, i64 1776, !29, i64 1784, !29, i64 1792, !29, i64 1800, !29, i64 1808, !29, i64 1816, !29, i64 1824, !29, i64 1832, !29, i64 1840, !29, i64 1848, !29, i64 1856, !29, i64 1864, !29, i64 1872, !29, i64 1880, !6, i64 1888, !7, i64 1896}
!29 = !{!"double", !7, i64 0}
!30 = !{!"_ZTS8StatsArr", !6, i64 0, !10, i64 8, !10, i64 16, !31, i64 24, !7, i64 32}
!31 = !{!"_ZTS12StatsArrType", !7, i64 0}
!32 = !{!29, !29, i64 0}
!33 = !{!28, !10, i64 584}


; 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.mem_alloc = type { i8 }
%class.Stats = type { ptr, ptr, i64, i64, i64, i64 }

@g_this_send_thread_cnt = external local_unnamed_addr global i32, align 4
@mem_allocator = external global %class.mem_alloc, align 1
@g_total_node_cnt = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [68 x i8], align 1
@__PRETTY_FUNCTION__._ZN12MessageQueue7enqueueEmP7Messagem = external hidden unnamed_addr constant [58 x i8], align 1
@g_node_id = external local_unnamed_addr global i32, align 4
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [31 x i8], align 1
@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8

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

; 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 @_ZN12MessageQueue7enqueueEmP7Messagem(ptr nocapture noundef nonnull readonly align 8 dereferenceable(40) %0, i64 noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #1 align 2 {
  %5 = alloca ptr, align 8
  %6 = load i32, ptr @g_total_node_cnt, align 4, !tbaa !5
  %7 = zext i32 %6 to i64
  %8 = icmp ugt i64 %7, %3
  br i1 %8, label %10, label %9

9:                                                ; preds = %4
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 47, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12MessageQueue7enqueueEmP7Messagem) #4
  unreachable

10:                                               ; preds = %4
  %11 = load i32, ptr @g_node_id, align 4, !tbaa !5
  %12 = zext i32 %11 to i64
  %.not = icmp eq i64 %12, %3
  br i1 %.not, label %13, label %14

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

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %15 = tail call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 24)
  store ptr %15, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %15, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  store i64 %3, ptr %16, align 8, !tbaa !14
  %17 = tail call noundef i64 @_Z13get_sys_clockv()
  %18 = getelementptr inbounds i8, ptr %15, i64 16
  store i64 %17, ptr %18, align 8, !tbaa !15
  %19 = load i64, ptr %16, align 8, !tbaa !14
  %20 = load i32, ptr @g_total_node_cnt, align 4, !tbaa !5
  %21 = zext i32 %20 to i64
  %22 = icmp ult i64 %19, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 55, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12MessageQueue7enqueueEmP7Messagem) #4
  unreachable

24:                                               ; preds = %14
  %25 = tail call noundef i64 @_Z13get_sys_clockv()
  %26 = load i32, ptr @g_this_send_thread_cnt, align 4, !tbaa !5
  %27 = zext i32 %26 to i64
  %28 = urem i64 %25, %27
  br label %29

29:                                               ; preds = %34, %24
  %30 = load ptr, ptr %0, align 8, !tbaa !16
  %31 = getelementptr inbounds ptr, ptr %30, i64 %28
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP9msg_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136) %32, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %33, label %.critedge, label %34

34:                                               ; preds = %29
  %35 = load ptr, ptr @simulation, align 8, !tbaa !9
  %36 = call noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %35)
  br i1 %36, label %.critedge, label %29, !llvm.loop !22

.critedge:                                        ; preds = %29, %34
  %37 = load ptr, ptr @simulation, align 8, !tbaa !9
  %38 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %37)
  br i1 %38, label %39, label %51

39:                                               ; preds = %.critedge
  %40 = call noundef i64 @_Z13get_sys_clockv()
  %41 = sub i64 %40, %25
  %42 = uitofp i64 %41 to double
  %43 = load ptr, ptr @stats, align 8, !tbaa !24
  %44 = getelementptr inbounds ptr, ptr %43, i64 %1
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds i8, ptr %45, i64 1888
  %47 = load ptr, ptr %46, align 8, !tbaa !26
  %48 = getelementptr inbounds i8, ptr %47, i64 24
  %49 = load double, ptr %48, align 8, !tbaa !31
  %50 = fadd double %49, %42
  store double %50, ptr %48, align 8, !tbaa !31
  br label %51

51:                                               ; preds = %39, %.critedge
  %52 = load ptr, ptr @simulation, align 8, !tbaa !9
  %53 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %52)
  br i1 %53, label %54, label %61

54:                                               ; preds = %51
  %55 = load ptr, ptr @stats, align 8, !tbaa !24
  %56 = getelementptr inbounds ptr, ptr %55, i64 %1
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds i8, ptr %57, i64 584
  %59 = load i64, ptr %58, align 8, !tbaa !32
  %60 = add i64 %59, 1
  store i64 %60, ptr %58, align 8, !tbaa !32
  br label %61

61:                                               ; preds = %54, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret void
}

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

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) local_unnamed_addr #3

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5boost8lockfree5queueIP9msg_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #3

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

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


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