; LLVM IR from mitdbg/deneva :: system/work_queue.ll (ZN10QWorkQueue7enqueueEmP7Messageb)

; 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.work_queue_entry = type { ptr, i64, i64, i32, i64 }
%class.Message = type { ptr, i32, i64, i64, i64, i64, i64, i64, double, double, double, double, double, double, double }
%class.QWorkQueue = type { ptr, ptr, ptr, ptr, i64, ptr, i64 }
%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_node_cnt = external global i32, align 4
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [69 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@g_node_id = external global i32, align 4
@simulation = external global ptr, align 8
@stats = external global %class.Stats, align 8
@__PRETTY_FUNCTION__._ZN10QWorkQueue7enqueueEmP7Messageb = external hidden unnamed_addr constant [52 x i8], align 1
@g_client_node_cnt = external global i32, align 4
@g_repl_cnt = external global i32, align 4
@.str.4 = external hidden unnamed_addr constant [22 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

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

declare noundef i64 @_Z13get_sys_clockv() #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10QWorkQueue7enqueueEmP7Messageb(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %1, ptr noundef %2, i1 noundef zeroext %3) #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i64, align 8
  %10 = alloca ptr, 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
  %12 = zext i1 %3 to i8
  store i8 %12, ptr %8, align 1, !tbaa !11
  %13 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %14 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %14, ptr %9, align 8, !tbaa !9
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  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 156, ptr noundef @__PRETTY_FUNCTION__._ZN10QWorkQueue7enqueueEmP7Messageb) #5
  unreachable

19:                                               ; No predecessors!
  br label %20

20:                                               ; preds = %19, %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %21 = call noundef ptr @_ZN9mem_alloc11align_allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 40)
  store ptr %21, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.work_queue_entry, ptr %23, i32 0, i32 0
  store ptr %22, ptr %24, align 8, !tbaa !13
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %class.Message, ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !16
  %28 = load ptr, ptr %10, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.work_queue_entry, ptr %28, i32 0, i32 3
  store i32 %27, ptr %29, align 8, !tbaa !19
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = getelementptr inbounds %class.Message, ptr %30, i32 0, i32 2
  %32 = load i64, ptr %31, align 8, !tbaa !20
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.work_queue_entry, ptr %33, i32 0, i32 2
  store i64 %32, ptr %34, align 8, !tbaa !21
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %class.Message, ptr %35, i32 0, i32 3
  %37 = load i64, ptr %36, align 8, !tbaa !22
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.work_queue_entry, ptr %38, i32 0, i32 1
  store i64 %37, ptr %39, align 8, !tbaa !23
  %40 = call noundef i64 @_Z13get_sys_clockv()
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.work_queue_entry, ptr %41, i32 0, i32 4
  store i64 %40, ptr %42, align 8, !tbaa !24
  %43 = load i32, ptr @g_node_id, align 4, !tbaa !25
  %44 = load i32, ptr @g_node_cnt, align 4, !tbaa !25
  %45 = icmp ult i32 %43, %44
  br i1 %45, label %64, label %46

46:                                               ; preds = %20
  %47 = load i32, ptr @g_node_id, align 4, !tbaa !25
  %48 = load i32, ptr @g_node_cnt, align 4, !tbaa !25
  %49 = load i32, ptr @g_client_node_cnt, align 4, !tbaa !25
  %50 = add i32 %48, %49
  %51 = icmp uge i32 %47, %50
  br i1 %51, label %52, label %62

52:                                               ; preds = %46
  %53 = load i32, ptr @g_node_id, align 4, !tbaa !25
  %54 = load i32, ptr @g_node_cnt, align 4, !tbaa !25
  %55 = load i32, ptr @g_client_node_cnt, align 4, !tbaa !25
  %56 = add i32 %54, %55
  %57 = load i32, ptr @g_repl_cnt, align 4, !tbaa !25
  %58 = load i32, ptr @g_node_cnt, align 4, !tbaa !25
  %59 = mul i32 %57, %58
  %60 = add i32 %56, %59
  %61 = icmp ult i32 %53, %60
  br label %62

62:                                               ; preds = %52, %46
  %63 = phi i1 [ false, %46 ], [ %61, %52 ]
  br label %64

64:                                               ; preds = %62, %20
  %65 = phi i1 [ true, %20 ], [ %63, %62 ]
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  br label %69

67:                                               ; preds = %64
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 164, ptr noundef @__PRETTY_FUNCTION__._ZN10QWorkQueue7enqueueEmP7Messageb) #5
  unreachable

68:                                               ; No predecessors!
  br label %69

69:                                               ; preds = %68, %66
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %70 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %70, ptr %11, align 8, !tbaa !9
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = getelementptr inbounds %class.Message, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !16
  %74 = icmp eq i32 %73, 3
  br i1 %74, label %75, label %88

75:                                               ; preds = %69
  br label %76

76:                                               ; preds = %86, %75
  %77 = getelementptr inbounds %class.QWorkQueue, ptr %13, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !27
  %79 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP16work_queue_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136) %78, ptr noundef nonnull align 8 dereferenceable(8) %10)
  br i1 %79, label %84, label %80

80:                                               ; preds = %76
  %81 = load ptr, ptr @simulation, align 8, !tbaa !5
  %82 = call noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %81)
  %83 = xor i1 %82, true
  br label %84

84:                                               ; preds = %80, %76
  %85 = phi i1 [ false, %76 ], [ %83, %80 ]
  br i1 %85, label %86, label %87

86:                                               ; preds = %84
  br label %76, !llvm.loop !29

87:                                               ; preds = %84
  br label %101

88:                                               ; preds = %69
  br label %89

89:                                               ; preds = %99, %88
  %90 = getelementptr inbounds %class.QWorkQueue, ptr %13, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !31
  %92 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP16work_queue_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136) %91, ptr noundef nonnull align 8 dereferenceable(8) %10)
  br i1 %92, label %97, label %93

93:                                               ; preds = %89
  %94 = load ptr, ptr @simulation, align 8, !tbaa !5
  %95 = call noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %94)
  %96 = xor i1 %95, true
  br label %97

97:                                               ; preds = %93, %89
  %98 = phi i1 [ false, %89 ], [ %96, %93 ]
  br i1 %98, label %99, label %100

99:                                               ; preds = %97
  br label %89, !llvm.loop !32

100:                                              ; preds = %97
  br label %101

101:                                              ; preds = %100, %87
  %102 = load ptr, ptr @simulation, align 8, !tbaa !5
  %103 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %102)
  br i1 %103, label %104, label %118

104:                                              ; preds = %101
  %105 = call noundef i64 @_Z13get_sys_clockv()
  %106 = load i64, ptr %11, align 8, !tbaa !9
  %107 = sub i64 %105, %106
  %108 = uitofp i64 %107 to double
  %109 = load ptr, ptr @stats, align 8, !tbaa !33
  %110 = load i64, ptr %6, align 8, !tbaa !9
  %111 = getelementptr inbounds ptr, ptr %109, i64 %110
  %112 = load ptr, ptr %111, align 8, !tbaa !5
  %113 = getelementptr inbounds %class.Stats_thd, ptr %112, i32 0, i32 197
  %114 = load ptr, ptr %113, align 8, !tbaa !35
  %115 = getelementptr inbounds double, ptr %114, i64 13
  %116 = load double, ptr %115, align 8, !tbaa !39
  %117 = fadd double %116, %108
  store double %117, ptr %115, align 8, !tbaa !39
  br label %118

118:                                              ; preds = %104, %101
  %119 = load i8, ptr %8, align 1, !tbaa !11, !range !40, !noundef !41
  %120 = trunc i8 %119 to i1
  br i1 %120, label %121, label %133

121:                                              ; preds = %118
  %122 = load ptr, ptr @simulation, align 8, !tbaa !5
  %123 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %122)
  br i1 %123, label %124, label %132

124:                                              ; preds = %121
  %125 = load ptr, ptr @stats, align 8, !tbaa !33
  %126 = load i64, ptr %6, align 8, !tbaa !9
  %127 = getelementptr inbounds ptr, ptr %125, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = getelementptr inbounds %class.Stats_thd, ptr %128, i32 0, i32 49
  %130 = load i64, ptr %129, align 8, !tbaa !42
  %131 = add i64 %130, 1
  store i64 %131, ptr %129, align 8, !tbaa !42
  br label %132

132:                                              ; preds = %124, %121
  br label %133

133:                                              ; preds = %132, %118
  %134 = load ptr, ptr @simulation, align 8, !tbaa !5
  %135 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %134)
  br i1 %135, label %136, label %148

136:                                              ; preds = %133
  %137 = call noundef i64 @_Z13get_sys_clockv()
  %138 = load i64, ptr %9, align 8, !tbaa !9
  %139 = sub i64 %137, %138
  %140 = uitofp i64 %139 to double
  %141 = load ptr, ptr @stats, align 8, !tbaa !33
  %142 = load i64, ptr %6, align 8, !tbaa !9
  %143 = getelementptr inbounds ptr, ptr %141, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  %145 = getelementptr inbounds %class.Stats_thd, ptr %144, i32 0, i32 47
  %146 = load double, ptr %145, align 8, !tbaa !43
  %147 = fadd double %146, %140
  store double %147, ptr %145, align 8, !tbaa !43
  br label %148

148:                                              ; preds = %136, %133
  %149 = load ptr, ptr @simulation, align 8, !tbaa !5
  %150 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %149)
  br i1 %150, label %151, label %159

151:                                              ; preds = %148
  %152 = load ptr, ptr @stats, align 8, !tbaa !33
  %153 = load i64, ptr %6, align 8, !tbaa !9
  %154 = getelementptr inbounds ptr, ptr %152, i64 %153
  %155 = load ptr, ptr %154, align 8, !tbaa !5
  %156 = getelementptr inbounds %class.Stats_thd, ptr %155, i32 0, i32 41
  %157 = load i64, ptr %156, align 8, !tbaa !44
  %158 = add i64 %157, 1
  store i64 %158, ptr %156, align 8, !tbaa !44
  br label %159

159:                                              ; preds = %151, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret void
}

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


; 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_node_cnt = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [69 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@g_node_id = external local_unnamed_addr global i32, align 4
@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8
@__PRETTY_FUNCTION__._ZN10QWorkQueue7enqueueEmP7Messageb = external hidden unnamed_addr constant [52 x i8], align 1
@g_client_node_cnt = external local_unnamed_addr global i32, align 4
@g_repl_cnt = external local_unnamed_addr global i32, align 4
@.str.4 = external hidden unnamed_addr constant [22 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

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

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #1

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN10QWorkQueue7enqueueEmP7Messageb(ptr nocapture noundef nonnull readonly align 8 dereferenceable(56) %0, i64 noundef %1, ptr noundef %2, i1 noundef zeroext %3) local_unnamed_addr #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = tail call noundef i64 @_Z13get_sys_clockv()
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %7, label %8

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

8:                                                ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %9 = tail call noundef ptr @_ZN9mem_alloc11align_allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 40)
  store ptr %9, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = load i32, ptr %10, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %9, i64 24
  store i32 %11, ptr %12, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %2, i64 16
  %14 = getelementptr inbounds i8, ptr %9, i64 8
  %15 = load <2 x i64>, ptr %13, align 8, !tbaa !17
  %16 = shufflevector <2 x i64> %15, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  store <2 x i64> %16, ptr %14, align 8, !tbaa !17
  %17 = tail call noundef i64 @_Z13get_sys_clockv()
  %18 = getelementptr inbounds i8, ptr %9, i64 32
  store i64 %17, ptr %18, align 8, !tbaa !18
  %19 = load i32, ptr @g_node_id, align 4, !tbaa !19
  %20 = load i32, ptr @g_node_cnt, align 4, !tbaa !19
  %21 = icmp ult i32 %19, %20
  br i1 %21, label %.critedge, label %22

22:                                               ; preds = %8
  %23 = load i32, ptr @g_client_node_cnt, align 4, !tbaa !19
  %24 = add i32 %23, %20
  %.not22 = icmp ult i32 %19, %24
  br i1 %.not22, label %.critedge2, label %25

25:                                               ; preds = %22
  %26 = load i32, ptr @g_repl_cnt, align 4, !tbaa !19
  %27 = mul i32 %26, %20
  %28 = add i32 %27, %24
  %29 = icmp ult i32 %19, %28
  br i1 %29, label %.critedge, label %.critedge2

.critedge2:                                       ; preds = %22, %25
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 164, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN10QWorkQueue7enqueueEmP7Messageb) #4
  unreachable

.critedge:                                        ; preds = %8, %25
  %30 = tail call noundef i64 @_Z13get_sys_clockv()
  %31 = load i32, ptr %10, align 8, !tbaa !13
  %32 = icmp eq i32 %31, 3
  br i1 %32, label %.preheader, label %.preheader23

.preheader:                                       ; preds = %.critedge
  %33 = getelementptr inbounds i8, ptr %0, i64 8
  br label %34

34:                                               ; preds = %.preheader, %37
  %35 = load ptr, ptr %33, align 8, !tbaa !21
  %36 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP16work_queue_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136) %35, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %36, label %.critedge4, label %37

37:                                               ; preds = %34
  %38 = load ptr, ptr @simulation, align 8, !tbaa !5
  %39 = call noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %38)
  br i1 %39, label %.critedge4, label %34, !llvm.loop !23

.preheader23:                                     ; preds = %.critedge, %42
  %40 = load ptr, ptr %0, align 8, !tbaa !25
  %41 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP16work_queue_entryJEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(136) %40, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br i1 %41, label %.critedge4, label %42

42:                                               ; preds = %.preheader23
  %43 = load ptr, ptr @simulation, align 8, !tbaa !5
  %44 = call noundef zeroext i1 @_ZN10SimManager7is_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %43)
  br i1 %44, label %.critedge4, label %.preheader23, !llvm.loop !26

.critedge4:                                       ; preds = %42, %.preheader23, %37, %34
  %45 = load ptr, ptr @simulation, align 8, !tbaa !5
  %46 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %45)
  br i1 %46, label %47, label %59

47:                                               ; preds = %.critedge4
  %48 = call noundef i64 @_Z13get_sys_clockv()
  %49 = sub i64 %48, %30
  %50 = uitofp i64 %49 to double
  %51 = load ptr, ptr @stats, align 8, !tbaa !27
  %52 = getelementptr inbounds ptr, ptr %51, i64 %1
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 1888
  %55 = load ptr, ptr %54, align 8, !tbaa !29
  %56 = getelementptr inbounds i8, ptr %55, i64 104
  %57 = load double, ptr %56, align 8, !tbaa !33
  %58 = fadd double %57, %50
  store double %58, ptr %56, align 8, !tbaa !33
  br label %59

59:                                               ; preds = %47, %.critedge4
  br i1 %3, label %60, label %70

60:                                               ; preds = %59
  %61 = load ptr, ptr @simulation, align 8, !tbaa !5
  %62 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %61)
  br i1 %62, label %63, label %70

63:                                               ; preds = %60
  %64 = load ptr, ptr @stats, align 8, !tbaa !27
  %65 = getelementptr inbounds ptr, ptr %64, i64 %1
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 448
  %68 = load i64, ptr %67, align 8, !tbaa !34
  %69 = add i64 %68, 1
  store i64 %69, ptr %67, align 8, !tbaa !34
  br label %70

70:                                               ; preds = %60, %63, %59
  %71 = load ptr, ptr @simulation, align 8, !tbaa !5
  %72 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %71)
  br i1 %72, label %73, label %83

73:                                               ; preds = %70
  %74 = call noundef i64 @_Z13get_sys_clockv()
  %75 = sub i64 %74, %6
  %76 = uitofp i64 %75 to double
  %77 = load ptr, ptr @stats, align 8, !tbaa !27
  %78 = getelementptr inbounds ptr, ptr %77, i64 %1
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 432
  %81 = load double, ptr %80, align 8, !tbaa !35
  %82 = fadd double %81, %76
  store double %82, ptr %80, align 8, !tbaa !35
  br label %83

83:                                               ; preds = %73, %70
  %84 = load ptr, ptr @simulation, align 8, !tbaa !5
  %85 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %84)
  br i1 %85, label %86, label %93

86:                                               ; preds = %83
  %87 = load ptr, ptr @stats, align 8, !tbaa !27
  %88 = getelementptr inbounds ptr, ptr %87, i64 %1
  %89 = load ptr, ptr %88, align 8, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %89, i64 384
  %91 = load i64, ptr %90, align 8, !tbaa !36
  %92 = add i64 %91, 1
  store i64 %92, ptr %90, align 8, !tbaa !36
  br label %93

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

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass