; LLVM IR from turi-code/SFrame :: oss_src/graphlab/scheduler (queued_fifo_scheduler)

; 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.graphlab::queued_fifo_scheduler" = type { %"class.graphlab::ischeduler", i64, i64, i64, %"class.graphlab::dense_bitset", %"class.std::deque", %"class.graphlab::mutex", i64, %"class.std::vector.11", %"class.std::vector.13", %"class.std::vector.11", %"class.std::vector.13" }
%"class.graphlab::ischeduler" = type { ptr }
%"class.graphlab::dense_bitset" = type { ptr, i64, i64 }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.graphlab::mutex" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::vector.11" = type { %"struct.std::_Vector_base.12" }
%"struct.std::_Vector_base.12" = type { %"struct.std::_Vector_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::deque<unsigned long>, std::allocator<std::deque<unsigned long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.13" = type { %"struct.std::_Vector_base.14" }
%"struct.std::_Vector_base.14" = type { %"struct.std::_Vector_base<graphlab::mutex, std::allocator<graphlab::mutex>>::_Vector_impl" }
%"struct.std::_Vector_base<graphlab::mutex, std::allocator<graphlab::mutex>>::_Vector_impl" = type { %"struct.std::_Vector_base<graphlab::mutex, std::allocator<graphlab::mutex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<graphlab::mutex, std::allocator<graphlab::mutex>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt5dequeImSaImEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN8graphlab21queued_fifo_scheduler8get_nextEmRm(ptr noundef nonnull align 8 dereferenceable(280) %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %2) unnamed_addr #3 align 2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  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
  %13 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %14 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 10
  %15 = load i64, ptr %6, align 8, !tbaa !9
  %16 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %15) #5
  store ptr %16, ptr %8, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 11
  %18 = load i64, ptr %6, align 8, !tbaa !9
  %19 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %18) #5
  call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %19)
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %20) #5
  br i1 %21, label %22, label %85

22:                                               ; preds = %3
  %23 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 6
  call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %23)
  %24 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 5
  %25 = call noundef zeroext i1 @_ZNKSt5dequeIS_ImSaImEESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %24) #5
  br i1 %25, label %32, label %26

26:                                               ; preds = %22
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 5
  %29 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5dequeIS_ImSaImEESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %28) #5
  call void @_ZNSt5dequeImSaImEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(80) %27, ptr noundef nonnull align 8 dereferenceable(80) %29) #5
  %30 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 5
  call void @_ZNSt5dequeIS_ImSaImEESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %30) #5
  %31 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 6
  call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %31)
  br label %84

32:                                               ; preds = %22
  %33 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 6
  call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %34

34:                                               ; preds = %79, %32
  %35 = load i64, ptr %9, align 8, !tbaa !9
  %36 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 8
  %37 = call noundef i64 @_ZNKSt6vectorISt5dequeImSaImEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %36) #5
  %38 = icmp ult i64 %35, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %34
  store i32 2, ptr %10, align 4
  br label %82

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %41 = load i64, ptr %9, align 8, !tbaa !9
  %42 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 3
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = load i64, ptr %6, align 8, !tbaa !9
  %45 = mul i64 %43, %44
  %46 = add i64 %41, %45
  %47 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 8
  %48 = call noundef i64 @_ZNKSt6vectorISt5dequeImSaImEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #5
  %49 = urem i64 %46, %48
  store i64 %49, ptr %11, align 8, !tbaa !9
  %50 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 8
  %51 = load i64, ptr %11, align 8, !tbaa !9
  %52 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %51) #5
  %53 = call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %52) #5
  br i1 %53, label %75, label %54

54:                                               ; preds = %40
  %55 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 9
  %56 = load i64, ptr %11, align 8, !tbaa !9
  %57 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %56) #5
  call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %57)
  %58 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 8
  %59 = load i64, ptr %11, align 8, !tbaa !9
  %60 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %59) #5
  %61 = call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %60) #5
  br i1 %61, label %67, label %62

62:                                               ; preds = %54
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 8
  %65 = load i64, ptr %11, align 8, !tbaa !9
  %66 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %65) #5
  call void @_ZNSt5dequeImSaImEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(80) %63, ptr noundef nonnull align 8 dereferenceable(80) %66) #5
  br label %67

67:                                               ; preds = %62, %54
  %68 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 9
  %69 = load i64, ptr %11, align 8, !tbaa !9
  %70 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %69) #5
  call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %70)
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %71) #5
  br i1 %72, label %74, label %73

73:                                               ; preds = %67
  store i32 2, ptr %10, align 4
  br label %76

74:                                               ; preds = %67
  br label %75

75:                                               ; preds = %74, %40
  store i32 0, ptr %10, align 4
  br label %76

76:                                               ; preds = %75, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %77 = load i32, ptr %10, align 4
  switch i32 %77, label %82 [
    i32 0, label %78
  ]

78:                                               ; preds = %76
  br label %79

79:                                               ; preds = %78
  %80 = load i64, ptr %9, align 8, !tbaa !9
  %81 = add i64 %80, 1
  store i64 %81, ptr %9, align 8, !tbaa !9
  br label %34, !llvm.loop !29

82:                                               ; preds = %76, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %83

83:                                               ; preds = %82
  br label %84

84:                                               ; preds = %83, %26
  br label %85

85:                                               ; preds = %84, %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #5
  store i8 0, ptr %12, align 1, !tbaa !31
  br label %86

86:                                               ; preds = %111, %85
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %87) #5
  %89 = xor i1 %88, true
  br i1 %89, label %90, label %112

90:                                               ; preds = %86
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeImSaImEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %91) #5
  %93 = load i64, ptr %92, align 8, !tbaa !9
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %93, ptr %94, align 8, !tbaa !9
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZNSt5dequeImSaImEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %95) #5
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = load i64, ptr %96, align 8, !tbaa !9
  %98 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 2
  %99 = load i64, ptr %98, align 8, !tbaa !33
  %100 = icmp ult i64 %97, %99
  br i1 %100, label %101, label %111

101:                                              ; preds = %90
  %102 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 4
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load i64, ptr %103, align 8, !tbaa !9
  %105 = call noundef zeroext i1 @_ZN8graphlab12dense_bitset9clear_bitEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %104)
  %106 = zext i1 %105 to i8
  store i8 %106, ptr %12, align 1, !tbaa !31
  %107 = load i8, ptr %12, align 1, !tbaa !31, !range !34, !noundef !35
  %108 = trunc i8 %107 to i1
  br i1 %108, label %109, label %110

109:                                              ; preds = %101
  br label %112

110:                                              ; preds = %101
  br label %111

111:                                              ; preds = %110, %90
  br label %86, !llvm.loop !36

112:                                              ; preds = %109, %86
  %113 = getelementptr inbounds %"class.graphlab::queued_fifo_scheduler", ptr %13, i32 0, i32 11
  %114 = load i64, ptr %6, align 8, !tbaa !9
  %115 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %113, i64 noundef %114) #5
  call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %115)
  %116 = load i8, ptr %12, align 1, !tbaa !31, !range !34, !noundef !35
  %117 = trunc i8 %116 to i1
  br i1 %117, label %118, label %119

118:                                              ; preds = %112
  store i32 0, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %120

119:                                              ; preds = %112
  store i32 1, ptr %4, align 4
  store i32 1, ptr %10, align 4
  br label %120

120:                                              ; preds = %119, %118
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %121 = load i32, ptr %4, align 4
  ret i32 %121
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8graphlab12dense_bitset9clear_bitEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 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 = { inlinehint 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 #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, !10, i64 24}
!12 = !{!"_ZTSN8graphlab21queued_fifo_schedulerE", !13, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !14, i64 32, !15, i64 56, !20, i64 136, !10, i64 176, !21, i64 184, !25, i64 208, !21, i64 232, !25, i64 256}
!13 = !{!"_ZTSN8graphlab10ischedulerE"}
!14 = !{!"_ZTSN8graphlab12dense_bitsetE", !6, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!"_ZTSSt5dequeIS_ImSaImEESaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt11_Deque_baseISt5dequeImSaImEESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt11_Deque_baseISt5dequeImSaImEESaIS2_EE11_Deque_implE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseISt5dequeImSaImEESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !10, i64 8, !19, i64 16, !19, i64 48}
!19 = !{!"_ZTSSt15_Deque_iteratorISt5dequeImSaImEERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTSN8graphlab5mutexE", !7, i64 0}
!21 = !{!"_ZTSSt6vectorISt5dequeImSaImEESaIS2_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt5dequeImSaImEESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt5dequeImSaImEESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt5dequeImSaImEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorIN8graphlab5mutexESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN8graphlab5mutexESaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN8graphlab5mutexESaIS1_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN8graphlab5mutexESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !32, i64 0}
!32 = !{!"bool", !7, i64 0}
!33 = !{!12, !10, i64 16}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = distinct !{!36, !30}


; 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"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorISt5dequeImSaImEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN8graphlab21queued_fifo_scheduler8get_nextEmRm(ptr noundef nonnull align 8 dereferenceable(280) %0, i64 noundef %1, ptr nocapture noundef nonnull align 8 dereferenceable(8) %2) unnamed_addr #2 align 2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 232
  %5 = tail call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %1) #4
  %6 = getelementptr inbounds i8, ptr %0, i64 256
  %7 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %1) #4
  tail call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %7)
  %8 = tail call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  br i1 %8, label %9, label %.loopexit

9:                                                ; preds = %3
  %10 = getelementptr inbounds i8, ptr %0, i64 136
  tail call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 56
  %12 = tail call noundef zeroext i1 @_ZNKSt5dequeIS_ImSaImEESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #4
  br i1 %12, label %15, label %13

13:                                               ; preds = %9
  %14 = tail call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5dequeIS_ImSaImEESaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #4
  tail call void @_ZNSt5dequeImSaImEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(80) %14) #4
  tail call void @_ZNSt5dequeIS_ImSaImEESaIS1_EE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %11) #4
  tail call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %10)
  br label %.loopexit

15:                                               ; preds = %9
  tail call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %10)
  %16 = getelementptr inbounds i8, ptr %0, i64 184
  %17 = tail call noundef i64 @_ZNKSt6vectorISt5dequeImSaImEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %.not = icmp eq i64 %17, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = getelementptr inbounds i8, ptr %0, i64 208
  br label %20

20:                                               ; preds = %.lr.ph, %.critedge
  %.02830 = phi i64 [ 0, %.lr.ph ], [ %37, %.critedge ]
  %21 = load i64, ptr %18, align 8, !tbaa !5
  %22 = mul i64 %21, %1
  %23 = add i64 %22, %.02830
  %24 = tail call noundef i64 @_ZNKSt6vectorISt5dequeImSaImEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %25 = urem i64 %23, %24
  %26 = tail call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %25) #4
  %27 = tail call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %26) #4
  br i1 %27, label %.critedge, label %28

28:                                               ; preds = %20
  %29 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %25) #4
  tail call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %29)
  %30 = tail call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %25) #4
  %31 = tail call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %30) #4
  br i1 %31, label %34, label %32

32:                                               ; preds = %28
  %33 = tail call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt6vectorISt5dequeImSaImEESaIS2_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %25) #4
  tail call void @_ZNSt5dequeImSaImEE4swapERS1_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(80) %33) #4
  br label %34

34:                                               ; preds = %32, %28
  %35 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %25) #4
  tail call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %35)
  %36 = tail call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  br i1 %36, label %.critedge, label %.loopexit

.critedge:                                        ; preds = %34, %20
  %37 = add nuw i64 %.02830, 1
  %38 = tail call noundef i64 @_ZNKSt6vectorISt5dequeImSaImEESaIS2_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %39 = icmp ult i64 %37, %38
  br i1 %39, label %20, label %.loopexit, !llvm.loop !27

.loopexit:                                        ; preds = %34, %.critedge, %15, %13, %3
  %40 = tail call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  br i1 %40, label %._crit_edge, label %.lr.ph32

.lr.ph32:                                         ; preds = %.loopexit
  %41 = getelementptr inbounds i8, ptr %0, i64 16
  %42 = getelementptr inbounds i8, ptr %0, i64 32
  br label %43

43:                                               ; preds = %.lr.ph32, %51
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5dequeImSaImEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  %45 = load i64, ptr %44, align 8, !tbaa !29
  store i64 %45, ptr %2, align 8, !tbaa !29
  tail call void @_ZNSt5dequeImSaImEE9pop_frontEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  %46 = load i64, ptr %2, align 8, !tbaa !29
  %47 = load i64, ptr %41, align 8, !tbaa !30
  %48 = icmp ult i64 %46, %47
  br i1 %48, label %49, label %51

49:                                               ; preds = %43
  %50 = tail call noundef zeroext i1 @_ZN8graphlab12dense_bitset9clear_bitEm(ptr noundef nonnull align 8 dereferenceable(24) %42, i64 noundef %46)
  br i1 %50, label %._crit_edge, label %51

51:                                               ; preds = %49, %43
  %52 = tail call noundef zeroext i1 @_ZNKSt5dequeImSaImEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5) #4
  br i1 %52, label %._crit_edge, label %43, !llvm.loop !31

._crit_edge:                                      ; preds = %51, %49, %.loopexit
  %.lcssa = phi i32 [ 1, %.loopexit ], [ 0, %49 ], [ 1, %51 ]
  %53 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZNSt6vectorIN8graphlab5mutexESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %1) #4
  tail call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %53)
  ret i32 %.lcssa
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8graphlab12dense_bitset9clear_bitEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { inlinehint 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 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!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, !8, i64 24}
!6 = !{!"_ZTSN8graphlab21queued_fifo_schedulerE", !7, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !11, i64 32, !13, i64 56, !18, i64 136, !8, i64 176, !19, i64 184, !23, i64 208, !19, i64 232, !23, i64 256}
!7 = !{!"_ZTSN8graphlab10ischedulerE"}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN8graphlab12dense_bitsetE", !12, i64 0, !8, i64 8, !8, i64 16}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"_ZTSSt5dequeIS_ImSaImEESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt11_Deque_baseISt5dequeImSaImEESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt11_Deque_baseISt5dequeImSaImEESaIS2_EE11_Deque_implE", !16, i64 0}
!16 = !{!"_ZTSNSt11_Deque_baseISt5dequeImSaImEESaIS2_EE16_Deque_impl_dataE", !12, i64 0, !8, i64 8, !17, i64 16, !17, i64 48}
!17 = !{!"_ZTSSt15_Deque_iteratorISt5dequeImSaImEERS2_PS2_E", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!18 = !{!"_ZTSN8graphlab5mutexE", !9, i64 0}
!19 = !{!"_ZTSSt6vectorISt5dequeImSaImEESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseISt5dequeImSaImEESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt5dequeImSaImEESaIS2_EE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseISt5dequeImSaImEESaIS2_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!23 = !{!"_ZTSSt6vectorIN8graphlab5mutexESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN8graphlab5mutexESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN8graphlab5mutexESaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN8graphlab5mutexESaIS1_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!8, !8, i64 0}
!30 = !{!6, !8, i64 16}
!31 = distinct !{!31, !28}


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