; LLVM IR from mitdbg/deneva :: system/logger.ll (ZN6Logger13processRecordEm)

; 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.QWorkQueue = type { ptr, ptr, ptr, ptr, i64, ptr, i64 }
%class.Stats = type { ptr, ptr, i64, i64, i64, i64 }
%class.Logger = type { %union.pthread_mutex_t, i64, %"class.std::queue", ptr, %"class.std::basic_ofstream", i64, %"class.std::set", i64, i64 }
%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.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<LogRecord *, std::allocator<LogRecord *>>::_Deque_impl" }
%"struct.std::_Deque_base<LogRecord *, std::allocator<LogRecord *>>::_Deque_impl" = type { %"struct.std::_Deque_base<LogRecord *, std::allocator<LogRecord *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<LogRecord *, std::allocator<LogRecord *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%class.LogRecord = type <{ %struct.AriesLogRecord, i8, [7 x i8] }>
%struct.AriesLogRecord = type { i32, i64, i32, i32, 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 }

@mem_allocator = external global %class.mem_alloc, align 1
@work_queue = external global %class.QWorkQueue, align 8
@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: nounwind
declare i32 @pthread_mutex_lock(ptr noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Logger13processRecordEm(ptr noundef nonnull align 8 dereferenceable(720) %0, i64 noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %7 = load ptr, ptr %3, align 8
  %8 = getelementptr inbounds %class.Logger, ptr %7, i32 0, i32 2
  %9 = call noundef zeroext i1 @_ZNKSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  br label %64

11:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store ptr null, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %class.Logger, ptr %7, i32 0, i32 0
  %13 = call i32 @pthread_mutex_lock(ptr noundef %12) #5
  %14 = getelementptr inbounds %class.Logger, ptr %7, i32 0, i32 2
  %15 = call noundef zeroext i1 @_ZNKSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %14)
  br i1 %15, label %21, label %16

16:                                               ; preds = %11
  %17 = getelementptr inbounds %class.Logger, ptr %7, i32 0, i32 2
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %17)
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %19, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %class.Logger, ptr %7, i32 0, i32 2
  call void @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %20)
  br label %21

21:                                               ; preds = %16, %11
  %22 = getelementptr inbounds %class.Logger, ptr %7, i32 0, i32 0
  %23 = call i32 @pthread_mutex_unlock(ptr noundef %22) #5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %63

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %27 = call noundef i64 @_Z13get_sys_clockv()
  store i64 %27, ptr %6, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %class.LogRecord, ptr %28, i32 0, i32 0
  %30 = getelementptr inbounds %struct.AriesLogRecord, ptr %29, i32 0, i32 3
  %31 = load i32, ptr %30, align 4, !tbaa !11
  %32 = icmp eq i32 %31, 3
  br i1 %32, label %33, label %41

33:                                               ; preds = %26
  %34 = load i64, ptr %4, align 8, !tbaa !9
  call void @_ZN6Logger11flushBufferEm(ptr noundef nonnull align 8 dereferenceable(720) %7, i64 noundef %34)
  %35 = load i64, ptr %4, align 8, !tbaa !9
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %class.LogRecord, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds %struct.AriesLogRecord, ptr %37, i32 0, i32 4
  %39 = load i64, ptr %38, align 8, !tbaa !18
  %40 = call noundef ptr @_ZN7Message14create_messageEm10RemReqType(i64 noundef %39, i32 noundef 23)
  call void @_ZN10QWorkQueue7enqueueEmP7Messageb(ptr noundef nonnull align 8 dereferenceable(56) @work_queue, i64 noundef %35, ptr noundef %40, i1 noundef zeroext false)
  br label %41

41:                                               ; preds = %33, %26
  %42 = load i64, ptr %4, align 8, !tbaa !9
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN6Logger13writeToBufferEmP9LogRecord(ptr noundef nonnull align 8 dereferenceable(720) %7, i64 noundef %42, ptr noundef %43)
  %44 = getelementptr inbounds %class.Logger, ptr %7, i32 0, i32 8
  %45 = load i64, ptr %44, align 8, !tbaa !19
  %46 = add i64 %45, 1
  store i64 %46, ptr %44, align 8, !tbaa !19
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef %47, i64 noundef 56)
  %48 = load ptr, ptr @simulation, align 8, !tbaa !5
  %49 = call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %48)
  br i1 %49, label %50, label %62

50:                                               ; preds = %41
  %51 = call noundef i64 @_Z13get_sys_clockv()
  %52 = load i64, ptr %6, align 8, !tbaa !9
  %53 = sub i64 %51, %52
  %54 = uitofp i64 %53 to double
  %55 = load ptr, ptr @stats, align 8, !tbaa !43
  %56 = load i64, ptr %4, align 8, !tbaa !9
  %57 = getelementptr inbounds ptr, ptr %55, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = getelementptr inbounds %class.Stats_thd, ptr %58, i32 0, i32 148
  %60 = load double, ptr %59, align 8, !tbaa !45
  %61 = fadd double %60, %54
  store double %61, ptr %59, align 8, !tbaa !45
  br label %62

62:                                               ; preds = %50, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %63

63:                                               ; preds = %62, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %64

64:                                               ; preds = %63, %10
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

declare noundef i64 @_Z13get_sys_clockv() #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Logger11flushBufferEm(ptr noundef nonnull align 8 dereferenceable(720), i64 noundef) #2 align 2

declare void @_ZN10QWorkQueue7enqueueEmP7Messageb(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef, i1 noundef zeroext) #4

declare noundef ptr @_ZN7Message14create_messageEm10RemReqType(i64 noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Logger13writeToBufferEmP9LogRecord(ptr noundef nonnull align 8 dereferenceable(720), i64 noundef, ptr noundef) #2 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 = { 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 = { "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 }

!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, !16, i64 20}
!12 = !{!"_ZTS9LogRecord", !13, i64 0, !17, i64 48}
!13 = !{!"_ZTS14AriesLogRecord", !14, i64 0, !10, i64 8, !15, i64 16, !16, i64 20, !10, i64 24, !14, i64 32, !10, i64 40}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTS10LogRecType", !7, i64 0}
!16 = !{!"_ZTS6LogIUD", !7, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!12, !10, i64 24}
!19 = !{!20, !10, i64 712}
!20 = !{!"_ZTS6Logger", !7, i64 0, !10, i64 40, !21, i64 48, !6, i64 128, !27, i64 136, !10, i64 648, !35, i64 656, !10, i64 704, !10, i64 712}
!21 = !{!"_ZTSSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE", !22, i64 0}
!22 = !{!"_ZTSSt5dequeIP9LogRecordSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt11_Deque_baseIP9LogRecordSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseIP9LogRecordSaIS1_EE11_Deque_implE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseIP9LogRecordSaIS1_EE16_Deque_impl_dataE", !6, i64 0, !10, i64 8, !26, i64 16, !26, i64 48}
!26 = !{!"_ZTSSt15_Deque_iteratorIP9LogRecordRS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!27 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !28, i64 0, !29, i64 8}
!28 = !{!"_ZTSSo"}
!29 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !30, i64 0, !7, i64 64, !32, i64 104, !33, i64 120, !34, i64 124, !34, i64 132, !34, i64 140, !6, i64 152, !10, i64 160, !17, i64 168, !17, i64 169, !17, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !17, i64 192, !6, i64 200, !6, i64 208, !10, i64 216, !6, i64 224, !6, i64 232}
!30 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !31, i64 56}
!31 = !{!"_ZTSSt6locale", !6, i64 0}
!32 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !17, i64 8}
!33 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!34 = !{!"_ZTS11__mbstate_t", !14, i64 0, !7, i64 4}
!35 = !{!"_ZTSSt3setImSt4lessImESaImEE", !36, i64 0}
!36 = !{!"_ZTSSt8_Rb_treeImmSt9_IdentityImESt4lessImESaImEE", !37, i64 0}
!37 = !{!"_ZTSNSt8_Rb_treeImmSt9_IdentityImESt4lessImESaImEE13_Rb_tree_implIS3_Lb1EEE", !38, i64 0, !40, i64 8}
!38 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !39, i64 0}
!39 = !{!"_ZTSSt4lessImE"}
!40 = !{!"_ZTSSt15_Rb_tree_header", !41, i64 0, !10, i64 32}
!41 = !{!"_ZTSSt18_Rb_tree_node_base", !42, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!42 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!43 = !{!44, !6, i64 0}
!44 = !{!"_ZTS5Stats", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!45 = !{!46, !47, i64 1240}
!46 = !{!"_ZTS9Stats_thd", !7, i64 0, !6, i64 64, !6, i64 72, !47, 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, !47, i64 184, !10, i64 192, !47, i64 200, !10, i64 208, !47, i64 216, !10, i64 224, !10, i64 232, !47, i64 240, !47, i64 248, !47, i64 256, !47, i64 264, !47, i64 272, !47, i64 280, !47, i64 288, !47, i64 296, !10, i64 304, !47, i64 312, !47, i64 320, !47, i64 328, !47, i64 336, !47, i64 344, !47, i64 352, !47, i64 360, !47, i64 368, !10, i64 376, !10, i64 384, !47, i64 392, !10, i64 400, !47, i64 408, !10, i64 416, !47, i64 424, !47, i64 432, !47, i64 440, !10, i64 448, !10, i64 456, !10, i64 464, !47, i64 472, !47, i64 480, !47, i64 488, !47, i64 496, !47, i64 504, !47, i64 512, !47, i64 520, !47, i64 528, !47, i64 536, !10, i64 544, !6, i64 552, !6, i64 560, !47, i64 568, !10, i64 576, !10, i64 584, !47, i64 592, !47, i64 600, !47, i64 608, !10, i64 616, !10, i64 624, !10, i64 632, !10, i64 640, !10, i64 648, !10, i64 656, !10, i64 664, !47, i64 672, !47, i64 680, !47, 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, !47, i64 768, !47, i64 776, !47, i64 784, !47, i64 792, !47, i64 800, !10, i64 808, !10, i64 816, !47, i64 824, !47, i64 832, !10, i64 840, !10, i64 848, !10, i64 856, !47, i64 864, !47, i64 872, !10, i64 880, !10, i64 888, !47, i64 896, !47, i64 904, !47, i64 912, !47, i64 920, !10, i64 928, !10, i64 936, !47, i64 944, !47, i64 952, !47, i64 960, !10, i64 968, !10, i64 976, !47, i64 984, !47, i64 992, !47, i64 1000, !47, i64 1008, !47, i64 1016, !10, i64 1024, !47, i64 1032, !47, i64 1040, !47, i64 1048, !47, i64 1056, !47, i64 1064, !47, i64 1072, !47, i64 1080, !47, i64 1088, !10, i64 1096, !10, i64 1104, !10, i64 1112, !47, i64 1120, !10, i64 1128, !47, i64 1136, !47, i64 1144, !10, i64 1152, !10, i64 1160, !10, i64 1168, !10, i64 1176, !10, i64 1184, !47, i64 1192, !10, i64 1200, !10, i64 1208, !47, i64 1216, !10, i64 1224, !47, i64 1232, !47, i64 1240, !10, i64 1248, !10, i64 1256, !10, i64 1264, !10, i64 1272, !10, i64 1280, !47, i64 1288, !47, i64 1296, !47, i64 1304, !48, i64 1312, !48, i64 1384, !48, i64 1456, !48, i64 1528, !47, i64 1600, !47, i64 1608, !47, i64 1616, !47, i64 1624, !47, i64 1632, !47, i64 1640, !47, i64 1648, !47, i64 1656, !47, i64 1664, !47, i64 1672, !47, i64 1680, !47, i64 1688, !47, i64 1696, !47, i64 1704, !47, i64 1712, !47, i64 1720, !47, i64 1728, !47, i64 1736, !47, i64 1744, !47, i64 1752, !47, i64 1760, !47, i64 1768, !47, i64 1776, !47, i64 1784, !47, i64 1792, !47, i64 1800, !47, i64 1808, !47, i64 1816, !47, i64 1824, !47, i64 1832, !47, i64 1840, !47, i64 1848, !47, i64 1856, !47, i64 1864, !47, i64 1872, !47, i64 1880, !6, i64 1888, !7, i64 1896}
!47 = !{!"double", !7, i64 0}
!48 = !{!"_ZTS8StatsArr", !6, i64 0, !10, i64 8, !10, i64 16, !49, i64 24, !7, i64 32}
!49 = !{!"_ZTS12StatsArrType", !7, 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.mem_alloc = type { i8 }
%class.QWorkQueue = type { ptr, ptr, ptr, ptr, i64, ptr, i64 }
%class.Stats = type { ptr, ptr, i64, i64, i64, i64 }

@mem_allocator = external global %class.mem_alloc, align 1
@work_queue = external global %class.QWorkQueue, align 8
@simulation = external local_unnamed_addr global ptr, align 8
@stats = external local_unnamed_addr global %class.Stats, align 8

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Logger13processRecordEm(ptr noundef nonnull align 8 dereferenceable(720) %0, i64 noundef %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 48
  %4 = tail call noundef zeroext i1 @_ZNKSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %4, label %38, label %5

5:                                                ; preds = %2
  %6 = tail call i32 @pthread_mutex_lock(ptr noundef nonnull %0) #4
  %7 = tail call noundef zeroext i1 @_ZNKSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %7, label %.thread, label %9

.thread:                                          ; preds = %5
  %8 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %0) #4
  br label %38

9:                                                ; preds = %5
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %11 = load ptr, ptr %10, align 8, !tbaa !5
  tail call void @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %12 = tail call i32 @pthread_mutex_unlock(ptr noundef nonnull %0) #4
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %38, label %13

13:                                               ; preds = %9
  %14 = tail call noundef i64 @_Z13get_sys_clockv()
  %15 = getelementptr inbounds i8, ptr %11, i64 20
  %16 = load i32, ptr %15, align 4, !tbaa !9
  %17 = icmp eq i32 %16, 3
  br i1 %17, label %18, label %22

18:                                               ; preds = %13
  tail call void @_ZN6Logger11flushBufferEm(ptr noundef nonnull align 8 dereferenceable(720) %0, i64 noundef %1)
  %19 = getelementptr inbounds i8, ptr %11, i64 24
  %20 = load i64, ptr %19, align 8, !tbaa !17
  %21 = tail call noundef ptr @_ZN7Message14create_messageEm10RemReqType(i64 noundef %20, i32 noundef 23)
  tail call void @_ZN10QWorkQueue7enqueueEmP7Messageb(ptr noundef nonnull align 8 dereferenceable(56) @work_queue, i64 noundef %1, ptr noundef %21, i1 noundef zeroext false)
  br label %22

22:                                               ; preds = %18, %13
  tail call void @_ZN6Logger13writeToBufferEmP9LogRecord(ptr noundef nonnull align 8 dereferenceable(720) %0, i64 noundef %1, ptr noundef nonnull %11)
  %23 = getelementptr inbounds i8, ptr %0, i64 712
  %24 = load i64, ptr %23, align 8, !tbaa !18
  %25 = add i64 %24, 1
  store i64 %25, ptr %23, align 8, !tbaa !18
  tail call void @_ZN9mem_alloc4freeEPvm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, ptr noundef nonnull %11, i64 noundef 56)
  %26 = load ptr, ptr @simulation, align 8, !tbaa !5
  %27 = tail call noundef zeroext i1 @_ZN10SimManager14is_warmup_doneEv(ptr noundef nonnull align 8 dereferenceable(96) %26)
  br i1 %27, label %28, label %38

28:                                               ; preds = %22
  %29 = tail call noundef i64 @_Z13get_sys_clockv()
  %30 = sub i64 %29, %14
  %31 = uitofp i64 %30 to double
  %32 = load ptr, ptr @stats, align 8, !tbaa !42
  %33 = getelementptr inbounds ptr, ptr %32, i64 %1
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 1240
  %36 = load double, ptr %35, align 8, !tbaa !44
  %37 = fadd double %36, %31
  store double %37, ptr %35, align 8, !tbaa !44
  br label %38

38:                                               ; preds = %.thread, %9, %28, %22, %2
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Logger11flushBufferEm(ptr noundef nonnull align 8 dereferenceable(720), i64 noundef) local_unnamed_addr #1 align 2

declare void @_ZN10QWorkQueue7enqueueEmP7Messageb(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #3

declare noundef ptr @_ZN7Message14create_messageEm10RemReqType(i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Logger13writeToBufferEmP9LogRecord(ptr noundef nonnull align 8 dereferenceable(720), i64 noundef, ptr noundef) local_unnamed_addr #1 align 2

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

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

attributes #0 = { 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 #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 = { 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 = { "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 }

!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, !15, i64 20}
!10 = !{!"_ZTS9LogRecord", !11, i64 0, !16, i64 48}
!11 = !{!"_ZTS14AriesLogRecord", !12, i64 0, !13, i64 8, !14, i64 16, !15, i64 20, !13, i64 24, !12, i64 32, !13, i64 40}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_ZTS10LogRecType", !7, i64 0}
!15 = !{!"_ZTS6LogIUD", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!10, !13, i64 24}
!18 = !{!19, !13, i64 712}
!19 = !{!"_ZTS6Logger", !7, i64 0, !13, i64 40, !20, i64 48, !6, i64 128, !26, i64 136, !13, i64 648, !34, i64 656, !13, i64 704, !13, i64 712}
!20 = !{!"_ZTSSt5queueIP9LogRecordSt5dequeIS1_SaIS1_EEE", !21, i64 0}
!21 = !{!"_ZTSSt5dequeIP9LogRecordSaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt11_Deque_baseIP9LogRecordSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSNSt11_Deque_baseIP9LogRecordSaIS1_EE11_Deque_implE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseIP9LogRecordSaIS1_EE16_Deque_impl_dataE", !6, i64 0, !13, i64 8, !25, i64 16, !25, i64 48}
!25 = !{!"_ZTSSt15_Deque_iteratorIP9LogRecordRS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!26 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !27, i64 0, !28, i64 8}
!27 = !{!"_ZTSSo"}
!28 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !29, i64 0, !7, i64 64, !31, i64 104, !32, i64 120, !33, i64 124, !33, i64 132, !33, i64 140, !6, i64 152, !13, i64 160, !16, i64 168, !16, i64 169, !16, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !16, i64 192, !6, i64 200, !6, i64 208, !13, i64 216, !6, i64 224, !6, i64 232}
!29 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !30, i64 56}
!30 = !{!"_ZTSSt6locale", !6, i64 0}
!31 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !16, i64 8}
!32 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!33 = !{!"_ZTS11__mbstate_t", !12, i64 0, !7, i64 4}
!34 = !{!"_ZTSSt3setImSt4lessImESaImEE", !35, i64 0}
!35 = !{!"_ZTSSt8_Rb_treeImmSt9_IdentityImESt4lessImESaImEE", !36, i64 0}
!36 = !{!"_ZTSNSt8_Rb_treeImmSt9_IdentityImESt4lessImESaImEE13_Rb_tree_implIS3_Lb1EEE", !37, i64 0, !39, i64 8}
!37 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !38, i64 0}
!38 = !{!"_ZTSSt4lessImE"}
!39 = !{!"_ZTSSt15_Rb_tree_header", !40, i64 0, !13, i64 32}
!40 = !{!"_ZTSSt18_Rb_tree_node_base", !41, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!41 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!42 = !{!43, !6, i64 0}
!43 = !{!"_ZTS5Stats", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40}
!44 = !{!45, !46, i64 1240}
!45 = !{!"_ZTS9Stats_thd", !7, i64 0, !6, i64 64, !6, i64 72, !46, 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, !46, i64 184, !13, i64 192, !46, i64 200, !13, i64 208, !46, i64 216, !13, i64 224, !13, i64 232, !46, i64 240, !46, i64 248, !46, i64 256, !46, i64 264, !46, i64 272, !46, i64 280, !46, i64 288, !46, i64 296, !13, i64 304, !46, i64 312, !46, i64 320, !46, i64 328, !46, i64 336, !46, i64 344, !46, i64 352, !46, i64 360, !46, i64 368, !13, i64 376, !13, i64 384, !46, i64 392, !13, i64 400, !46, i64 408, !13, i64 416, !46, i64 424, !46, i64 432, !46, i64 440, !13, i64 448, !13, i64 456, !13, i64 464, !46, i64 472, !46, i64 480, !46, i64 488, !46, i64 496, !46, i64 504, !46, i64 512, !46, i64 520, !46, i64 528, !46, i64 536, !13, i64 544, !6, i64 552, !6, i64 560, !46, i64 568, !13, i64 576, !13, i64 584, !46, i64 592, !46, i64 600, !46, i64 608, !13, i64 616, !13, i64 624, !13, i64 632, !13, i64 640, !13, i64 648, !13, i64 656, !13, i64 664, !46, i64 672, !46, i64 680, !46, 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, !46, i64 768, !46, i64 776, !46, i64 784, !46, i64 792, !46, i64 800, !13, i64 808, !13, i64 816, !46, i64 824, !46, i64 832, !13, i64 840, !13, i64 848, !13, i64 856, !46, i64 864, !46, i64 872, !13, i64 880, !13, i64 888, !46, i64 896, !46, i64 904, !46, i64 912, !46, i64 920, !13, i64 928, !13, i64 936, !46, i64 944, !46, i64 952, !46, i64 960, !13, i64 968, !13, i64 976, !46, i64 984, !46, i64 992, !46, i64 1000, !46, i64 1008, !46, i64 1016, !13, i64 1024, !46, i64 1032, !46, i64 1040, !46, i64 1048, !46, i64 1056, !46, i64 1064, !46, i64 1072, !46, i64 1080, !46, i64 1088, !13, i64 1096, !13, i64 1104, !13, i64 1112, !46, i64 1120, !13, i64 1128, !46, i64 1136, !46, i64 1144, !13, i64 1152, !13, i64 1160, !13, i64 1168, !13, i64 1176, !13, i64 1184, !46, i64 1192, !13, i64 1200, !13, i64 1208, !46, i64 1216, !13, i64 1224, !46, i64 1232, !46, i64 1240, !13, i64 1248, !13, i64 1256, !13, i64 1264, !13, i64 1272, !13, i64 1280, !46, i64 1288, !46, i64 1296, !46, i64 1304, !47, i64 1312, !47, i64 1384, !47, i64 1456, !47, i64 1528, !46, i64 1600, !46, i64 1608, !46, i64 1616, !46, i64 1624, !46, i64 1632, !46, i64 1640, !46, i64 1648, !46, i64 1656, !46, i64 1664, !46, i64 1672, !46, i64 1680, !46, i64 1688, !46, i64 1696, !46, i64 1704, !46, i64 1712, !46, i64 1720, !46, i64 1728, !46, i64 1736, !46, i64 1744, !46, i64 1752, !46, i64 1760, !46, i64 1768, !46, i64 1776, !46, i64 1784, !46, i64 1792, !46, i64 1800, !46, i64 1808, !46, i64 1816, !46, i64 1824, !46, i64 1832, !46, i64 1840, !46, i64 1848, !46, i64 1856, !46, i64 1864, !46, i64 1872, !46, i64 1880, !6, i64 1888, !7, i64 1896}
!46 = !{!"double", !7, i64 0}
!47 = !{!"_ZTS8StatsArr", !6, i64 0, !13, i64 8, !13, i64 16, !48, i64 24, !7, i64 32}
!48 = !{!"_ZTS12StatsArrType", !7, i64 0}


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