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

; 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 }
%class.QWorkQueue = type { ptr, ptr, ptr, ptr, i64, ptr, i64 }
%struct.work_queue_entry = type { ptr, i64, i64, i32, 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
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@simulation = external global ptr, align 8
@stats = external global %class.Stats, align 8
@__PRETTY_FUNCTION__._ZN10QWorkQueue17sequencer_dequeueEm = external hidden unnamed_addr constant [49 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 zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN10QWorkQueue17sequencer_dequeueEm(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %1) #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %10 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %11 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %11, ptr %5, align 8, !tbaa !9
  %12 = load i32, ptr @g_node_id, align 4, !tbaa !11
  %13 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %14 = icmp ult i32 %12, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %18

16:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 60, ptr noundef @__PRETTY_FUNCTION__._ZN10QWorkQueue17sequencer_dequeueEm) #5
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #4
  %19 = getelementptr inbounds %class.QWorkQueue, ptr %10, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP16work_queue_entryJEE3popERS3_(ptr noundef nonnull align 8 dereferenceable(136) %20, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %22 = zext i1 %21 to i8
  store i8 %22, ptr %8, align 1, !tbaa !15
  %23 = load i8, ptr %8, align 1, !tbaa !15, !range !17, !noundef !18
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %80

25:                                               ; preds = %18
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.work_queue_entry, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  store ptr %28, ptr %6, align 8, !tbaa !5
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %25
  br label %34

32:                                               ; preds = %25
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 67, ptr noundef @__PRETTY_FUNCTION__._ZN10QWorkQueue17sequencer_dequeueEm) #5
  unreachable

33:                                               ; No predecessors!
  br label %34

34:                                               ; preds = %33, %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %35 = call noundef i64 @_Z13get_sys_clockv()
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.work_queue_entry, ptr %36, i32 0, i32 4
  %38 = load i64, ptr %37, align 8, !tbaa !22
  %39 = sub i64 %35, %38
  store i64 %39, ptr %9, align 8, !tbaa !9
  %40 = load ptr, ptr @simulation, align 8, !tbaa !5
  %41 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %40)
  br i1 %41, label %42, label %52

42:                                               ; preds = %34
  %43 = load i64, ptr %9, align 8, !tbaa !9
  %44 = uitofp i64 %43 to double
  %45 = load ptr, ptr @stats, align 8, !tbaa !23
  %46 = load i64, ptr %4, align 8, !tbaa !9
  %47 = getelementptr inbounds ptr, ptr %45, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds %class.Stats_thd, ptr %48, i32 0, i32 108
  %50 = load double, ptr %49, align 8, !tbaa !25
  %51 = fadd double %50, %44
  store double %51, ptr %49, align 8, !tbaa !25
  br label %52

52:                                               ; preds = %42, %34
  %53 = load ptr, ptr @simulation, align 8, !tbaa !5
  %54 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %53)
  br i1 %54, label %55, label %63

55:                                               ; preds = %52
  %56 = load ptr, ptr @stats, align 8, !tbaa !23
  %57 = load i64, ptr %4, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %56, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = getelementptr inbounds %class.Stats_thd, ptr %59, i32 0, i32 109
  %61 = load i64, ptr %60, align 8, !tbaa !30
  %62 = add i64 %61, 1
  store i64 %62, ptr %60, align 8, !tbaa !30
  br label %63

63:                                               ; preds = %55, %52
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef %64, i64 noundef 40)
  %65 = load ptr, ptr @simulation, align 8, !tbaa !5
  %66 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %65)
  br i1 %66, label %67, label %79

67:                                               ; preds = %63
  %68 = call noundef i64 @_Z13get_sys_clockv()
  %69 = load i64, ptr %5, align 8, !tbaa !9
  %70 = sub i64 %68, %69
  %71 = uitofp i64 %70 to double
  %72 = load ptr, ptr @stats, align 8, !tbaa !23
  %73 = load i64, ptr %4, align 8, !tbaa !9
  %74 = getelementptr inbounds ptr, ptr %72, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !5
  %76 = getelementptr inbounds %class.Stats_thd, ptr %75, i32 0, i32 112
  %77 = load double, ptr %76, align 8, !tbaa !31
  %78 = fadd double %77, %71
  store double %78, ptr %76, align 8, !tbaa !31
  br label %79

79:                                               ; preds = %67, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %80

80:                                               ; preds = %79, %18
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret ptr %81
}

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

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


; 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
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8
@__PRETTY_FUNCTION__._ZN10QWorkQueue17sequencer_dequeueEm = external hidden unnamed_addr constant [49 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 zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN10QWorkQueue17sequencer_dequeueEm(ptr nocapture noundef nonnull readonly align 8 dereferenceable(56) %0, i64 noundef %1) local_unnamed_addr #3 align 2 {
  %3 = alloca ptr, align 8
  %4 = tail call noundef i64 @_Z13get_sys_clockv()
  %5 = load i32, ptr @g_node_id, align 4, !tbaa !5
  %6 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %7 = icmp ult i32 %5, %6
  br i1 %7, label %9, label %8

8:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 60, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN10QWorkQueue17sequencer_dequeueEm) #4
  unreachable

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  store ptr null, ptr %3, align 8, !tbaa !9
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !11
  %12 = call noundef zeroext i1 @_ZN5boost8lockfree5queueIP16work_queue_entryJEE3popERS3_(ptr noundef nonnull align 8 dereferenceable(136) %11, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %12, label %13, label %57

13:                                               ; preds = %9
  %14 = load ptr, ptr %3, align 8, !tbaa !9
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %16, label %17

16:                                               ; preds = %13
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 67, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN10QWorkQueue17sequencer_dequeueEm) #4
  unreachable

17:                                               ; preds = %13
  %18 = call noundef i64 @_Z13get_sys_clockv()
  %19 = load ptr, ptr %3, align 8, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %19, i64 32
  %21 = load i64, ptr %20, align 8, !tbaa !17
  %22 = load ptr, ptr @simulation, align 8, !tbaa !9
  %23 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %22)
  br i1 %23, label %24, label %33

24:                                               ; preds = %17
  %25 = sub i64 %18, %21
  %26 = uitofp i64 %25 to double
  %27 = load ptr, ptr @stats, align 8, !tbaa !18
  %28 = getelementptr inbounds ptr, ptr %27, i64 %1
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %29, i64 920
  %31 = load double, ptr %30, align 8, !tbaa !20
  %32 = fadd double %31, %26
  store double %32, ptr %30, align 8, !tbaa !20
  br label %33

33:                                               ; preds = %24, %17
  %34 = load ptr, ptr @simulation, align 8, !tbaa !9
  %35 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %34)
  br i1 %35, label %36, label %43

36:                                               ; preds = %33
  %37 = load ptr, ptr @stats, align 8, !tbaa !18
  %38 = getelementptr inbounds ptr, ptr %37, i64 %1
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %39, i64 928
  %41 = load i64, ptr %40, align 8, !tbaa !25
  %42 = add i64 %41, 1
  store i64 %42, ptr %40, align 8, !tbaa !25
  br label %43

43:                                               ; preds = %36, %33
  %44 = load ptr, ptr %3, align 8, !tbaa !9
  call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef %44, i64 noundef 40)
  %45 = load ptr, ptr @simulation, align 8, !tbaa !9
  %46 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %45)
  br i1 %46, label %47, label %57

47:                                               ; preds = %43
  %48 = call noundef i64 @_Z13get_sys_clockv()
  %49 = sub i64 %48, %4
  %50 = uitofp i64 %49 to double
  %51 = load ptr, ptr @stats, align 8, !tbaa !18
  %52 = getelementptr inbounds ptr, ptr %51, i64 %1
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = getelementptr inbounds i8, ptr %53, i64 952
  %55 = load double, ptr %54, align 8, !tbaa !26
  %56 = fadd double %55, %50
  store double %56, ptr %54, align 8, !tbaa !26
  br label %57

57:                                               ; preds = %43, %47, %9
  %.0 = phi ptr [ null, %9 ], [ %15, %47 ], [ %15, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret ptr %.0
}

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

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

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


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