; LLVM IR from mitdbg/deneva :: client/client_query.ll (ZN18Client_query_queue4initEP8Workload)

; 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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl" }
%"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl" = type { %"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.2" = type { i8 }
%class.Client_query_queue = type { ptr, i64, %"class.std::vector", ptr, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::vector<BaseQuery *>, std::allocator<std::vector<BaseQuery *>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<BaseQuery *>, std::allocator<std::vector<BaseQuery *>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<BaseQuery *>, std::allocator<std::vector<BaseQuery *>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<BaseQuery *>, std::allocator<std::vector<BaseQuery *>>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@g_servers_per_client = external global i32, align 4
@g_max_txn_per_part = external global i32, align 4
@mem_allocator = external global %class.mem_alloc, align 1
@g_init_parallelism = external global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18Client_query_queue4initEP8Workload(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector.0", align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::allocator.2", align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 0
  store ptr %15, ptr %16, align 8, !tbaa !9
  %17 = load i32, ptr @g_servers_per_client, align 4, !tbaa !16
  %18 = zext i32 %17 to i64
  %19 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 1
  store i64 %18, ptr %19, align 8, !tbaa !18
  %20 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 1
  %21 = load i64, ptr %20, align 8, !tbaa !18
  %22 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %21, i64 8)
  %23 = extractvalue { i64, i1 } %22, 1
  %24 = extractvalue { i64, i1 } %22, 0
  %25 = select i1 %23, i64 -1, i64 %24
  %26 = call noalias noundef nonnull ptr @_Znam(i64 noundef %25) #7
  %27 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 3
  store ptr %26, ptr %27, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  store i32 0, ptr %5, align 4, !tbaa !16
  br label %28

28:                                               ; preds = %49, %2
  %29 = load i32, ptr %5, align 4, !tbaa !16
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 1
  %32 = load i64, ptr %31, align 8, !tbaa !18
  %33 = icmp ult i64 %30, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %61

35:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #8
  %36 = load i32, ptr @g_max_txn_per_part, align 4, !tbaa !16
  %37 = add i32 %36, 4
  %38 = zext i32 %37 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #8
  call void @_ZNSaIP9BaseQueryEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  invoke void @_ZNSt6vectorIP9BaseQuerySaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %38, ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 1 dereferenceable(1) %8)
          to label %39 unwind label %52

39:                                               ; preds = %35
  call void @_ZNSt15__new_allocatorIP9BaseQueryED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  %40 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 2
  invoke void @_ZNSt6vectorIS_IP9BaseQuerySaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %41 unwind label %56

41:                                               ; preds = %39
  %42 = invoke noundef ptr @_ZN9mem_alloc11align_allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 8)
          to label %43 unwind label %56

43:                                               ; preds = %41
  %44 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 3
  %45 = load ptr, ptr %44, align 8, !tbaa !19
  %46 = load i32, ptr %5, align 4, !tbaa !16
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds ptr, ptr %45, i64 %47
  store ptr %42, ptr %48, align 8, !tbaa !5
  call void @_ZNSt6vectorIP9BaseQuerySaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  br label %49

49:                                               ; preds = %43
  %50 = load i32, ptr %5, align 4, !tbaa !16
  %51 = add i32 %50, 1
  store i32 %51, ptr %5, align 4, !tbaa !16
  br label %28, !llvm.loop !20

52:                                               ; preds = %35
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %9, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %10, align 4
  call void @_ZNSt15__new_allocatorIP9BaseQueryED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %8) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %60

56:                                               ; preds = %41, %39
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %9, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %10, align 4
  call void @_ZNSt6vectorIP9BaseQuerySaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #8
  br label %60

60:                                               ; preds = %56, %52
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  br label %105

61:                                               ; preds = %34
  %62 = getelementptr inbounds %class.Client_query_queue, ptr %14, i32 0, i32 4
  store volatile i64 0, ptr %62, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %63 = load i32, ptr @g_init_parallelism, align 4, !tbaa !16
  %64 = sub i32 %63, 1
  %65 = zext i32 %64 to i64
  %66 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %65, i64 8)
  %67 = extractvalue { i64, i1 } %66, 1
  %68 = extractvalue { i64, i1 } %66, 0
  %69 = select i1 %67, i64 -1, i64 %68
  %70 = call noalias noundef nonnull ptr @_Znam(i64 noundef %69) #7
  store ptr %70, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !16
  br label %71

71:                                               ; preds = %83, %61
  %72 = load i32, ptr %12, align 4, !tbaa !16
  %73 = load i32, ptr @g_init_parallelism, align 4, !tbaa !16
  %74 = sub i32 %73, 1
  %75 = icmp ult i32 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %86

77:                                               ; preds = %71
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = load i32, ptr %12, align 4, !tbaa !16
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds i64, ptr %78, i64 %80
  %82 = call i32 @pthread_create(ptr noundef %81, ptr noundef null, ptr noundef @_ZN18Client_query_queue17initQueriesHelperEPv, ptr noundef %14) #8
  br label %83

83:                                               ; preds = %77
  %84 = load i32, ptr %12, align 4, !tbaa !16
  %85 = add i32 %84, 1
  store i32 %85, ptr %12, align 4, !tbaa !16
  br label %71, !llvm.loop !23

86:                                               ; preds = %76
  %87 = call noundef ptr @_ZN18Client_query_queue17initQueriesHelperEPv(ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !16
  br label %88

88:                                               ; preds = %101, %86
  %89 = load i32, ptr %13, align 4, !tbaa !16
  %90 = load i32, ptr @g_init_parallelism, align 4, !tbaa !16
  %91 = sub i32 %90, 1
  %92 = icmp ult i32 %89, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %104

94:                                               ; preds = %88
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !16
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds i64, ptr %95, i64 %97
  %99 = load i64, ptr %98, align 8, !tbaa !24
  %100 = call i32 @pthread_join(i64 noundef %99, ptr noundef null)
  br label %101

101:                                              ; preds = %94
  %102 = load i32, ptr %13, align 4, !tbaa !16
  %103 = add i32 %102, 1
  store i32 %103, ptr %13, align 4, !tbaa !16
  br label %88, !llvm.loop !25

104:                                              ; preds = %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  ret void

105:                                              ; preds = %60
  %106 = load ptr, ptr %9, align 8
  %107 = load i32, ptr %10, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIP9BaseQueryEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP9BaseQuerySaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIS_IP9BaseQuerySaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIP9BaseQuerySaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN18Client_query_queue17initQueriesHelperEPv(ptr noundef) #0 align 2

declare i32 @pthread_join(i64 noundef, ptr noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIP9BaseQueryED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { "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 #6 = { 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTS18Client_query_queue", !6, i64 0, !11, i64 8, !12, i64 16, !6, i64 40, !11, i64 48}
!11 = !{!"long", !7, i64 0}
!12 = !{!"_ZTSSt6vectorIS_IP9BaseQuerySaIS1_EESaIS3_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseISt6vectorIP9BaseQuerySaIS2_EESaIS4_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9BaseQuerySaIS2_EESaIS4_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9BaseQuerySaIS2_EESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!10, !11, i64 8}
!19 = !{!10, !6, i64 40}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!10, !11, i64 48}
!23 = distinct !{!23, !21}
!24 = !{!11, !11, i64 0}
!25 = distinct !{!25, !21}


; 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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl" }
%"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl" = type { %"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<BaseQuery *, std::allocator<BaseQuery *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.2" = type { i8 }

@g_servers_per_client = external local_unnamed_addr global i32, align 4
@g_max_txn_per_part = external local_unnamed_addr global i32, align 4
@mem_allocator = external global %class.mem_alloc, align 1
@g_init_parallelism = external local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18Client_query_queue4initEP8Workload(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::vector.0", align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::allocator.2", align 1
  store ptr %1, ptr %0, align 8, !tbaa !5
  %6 = load i32, ptr @g_servers_per_client, align 4, !tbaa !15
  %7 = zext i32 %6 to i64
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %7, ptr %8, align 8, !tbaa !17
  %9 = shl nuw nsw i64 %7, 3
  %10 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %9) #6
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %10, ptr %11, align 8, !tbaa !18
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  br label %19

._crit_edge:                                      ; preds = %27, %2
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  store volatile i64 0, ptr %13, align 8, !tbaa !19
  %14 = load i32, ptr @g_init_parallelism, align 4, !tbaa !15
  %15 = add i32 %14, -1
  %16 = zext i32 %15 to i64
  %17 = shl nuw nsw i64 %16, 3
  %18 = call noalias noundef nonnull ptr @_Znam(i64 noundef %17) #6
  %.not29 = icmp eq i32 %14, 1
  br i1 %.not29, label %._crit_edge24, label %.lr.ph23

19:                                               ; preds = %.lr.ph, %27
  %20 = phi i64 [ 0, %.lr.ph ], [ %31, %27 ]
  %.01520 = phi i32 [ 0, %.lr.ph ], [ %30, %27 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #7
  %21 = load i32, ptr @g_max_txn_per_part, align 4, !tbaa !15
  %22 = add i32 %21, 4
  %23 = zext i32 %22 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store ptr null, ptr %4, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #7
  call void @_ZNSaIP9BaseQueryEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorIP9BaseQuerySaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %23, ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %24 unwind label %34

24:                                               ; preds = %19
  call void @_ZNSt15__new_allocatorIP9BaseQueryED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  invoke void @_ZNSt6vectorIS_IP9BaseQuerySaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(24) %3)
          to label %25 unwind label %36

25:                                               ; preds = %24
  %26 = invoke noundef ptr @_ZN9mem_alloc11align_allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 8)
          to label %27 unwind label %36

27:                                               ; preds = %25
  %28 = load ptr, ptr %11, align 8, !tbaa !18
  %29 = getelementptr inbounds ptr, ptr %28, i64 %20
  store ptr %26, ptr %29, align 8, !tbaa !20
  call void @_ZNSt6vectorIP9BaseQuerySaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  %30 = add i32 %.01520, 1
  %31 = zext i32 %30 to i64
  %32 = load i64, ptr %8, align 8, !tbaa !17
  %33 = icmp ugt i64 %32, %31
  br i1 %33, label %19, label %._crit_edge, !llvm.loop !21

34:                                               ; preds = %19
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIP9BaseQueryED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %38

36:                                               ; preds = %25, %24
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIP9BaseQuerySaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn

._crit_edge24:                                    ; preds = %.lr.ph23, %._crit_edge
  %39 = call noundef ptr @_ZN18Client_query_queue17initQueriesHelperEPv(ptr noundef nonnull %0)
  %40 = load i32, ptr @g_init_parallelism, align 4, !tbaa !15
  %.not30 = icmp eq i32 %40, 1
  br i1 %.not30, label %._crit_edge28, label %.lr.ph27

.lr.ph23:                                         ; preds = %._crit_edge, %.lr.ph23
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph23 ], [ 0, %._crit_edge ]
  %41 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv
  %42 = call i32 @pthread_create(ptr noundef nonnull %41, ptr noundef null, ptr noundef nonnull @_ZN18Client_query_queue17initQueriesHelperEPv, ptr noundef nonnull %0) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %43 = load i32, ptr @g_init_parallelism, align 4, !tbaa !15
  %44 = add i32 %43, -1
  %45 = zext i32 %44 to i64
  %46 = icmp ult i64 %indvars.iv.next, %45
  br i1 %46, label %.lr.ph23, label %._crit_edge24, !llvm.loop !23

._crit_edge28:                                    ; preds = %.lr.ph27, %._crit_edge24
  ret void

.lr.ph27:                                         ; preds = %._crit_edge24, %.lr.ph27
  %indvars.iv32 = phi i64 [ %indvars.iv.next33, %.lr.ph27 ], [ 0, %._crit_edge24 ]
  %47 = getelementptr inbounds i64, ptr %18, i64 %indvars.iv32
  %48 = load i64, ptr %47, align 8, !tbaa !24
  %49 = call i32 @pthread_join(i64 noundef %48, ptr noundef null)
  %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
  %50 = load i32, ptr @g_init_parallelism, align 4, !tbaa !15
  %51 = add i32 %50, -1
  %52 = zext i32 %51 to i64
  %53 = icmp ult i64 %indvars.iv.next33, %52
  br i1 %53, label %.lr.ph27, label %._crit_edge28, !llvm.loop !25
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIP9BaseQueryEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIP9BaseQuerySaIS1_EEC2EmRKS1_RKS2_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN18Client_query_queue17initQueriesHelperEPv(ptr noundef) #0 align 2

declare i32 @pthread_join(i64 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIP9BaseQueryED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

attributes #0 = { 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 #1 = { nobuiltin allocsize(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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 #6 = { builtin allocsize(0) }
attributes #7 = { 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, !7, i64 0}
!6 = !{!"_ZTS18Client_query_queue", !7, i64 0, !10, i64 8, !11, i64 16, !7, i64 40, !10, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIS_IP9BaseQuerySaIS1_EESaIS3_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseISt6vectorIP9BaseQuerySaIS2_EESaIS4_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9BaseQuerySaIS2_EESaIS4_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseISt6vectorIP9BaseQuerySaIS2_EESaIS4_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !8, i64 0}
!17 = !{!6, !10, i64 8}
!18 = !{!6, !7, i64 40}
!19 = !{!6, !10, i64 48}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!10, !10, i64 0}
!25 = distinct !{!25, !22}


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