; LLVM IR from mitdbg/deneva :: benchmarks/tpcc_query.ll (ZN9TPCCQuery16get_participantsEP8Workload)

; 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.BaseQuery = type { ptr, i64, %class.Array, %class.Array, %class.Array, %class.Array }
%class.Array = type { ptr, i64, i64 }
%class.TPCCQuery = type { %class.BaseQuery, i32, i64, i64, i64, i64, i64, i64, [16 x i8], double, i8, %class.Array.0, i8, i8, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64 }
%class.Array.0 = type { ptr, i64, i64 }
%struct.Item_no = type { i64, i64, i64 }

@g_node_cnt = external global i32, align 4
@.str.5 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload = external hidden unnamed_addr constant [49 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

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

declare noundef i64 @_Z10wh_to_partm(i64 noundef) #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN9TPCCQuery16get_participantsEP8Workload(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr noundef %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %12 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 0, ptr %6, align 8, !tbaa !9
  %13 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  %14 = call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %13)
  %15 = icmp eq i64 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  br label %19

17:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.5, i32 noundef 268, ptr noundef @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #6
  unreachable

18:                                               ; No predecessors!
  br label %19

19:                                               ; preds = %18, %16
  %20 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 4
  %21 = call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %20)
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %24

23:                                               ; preds = %19
  br label %26

24:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.5, i32 noundef 269, ptr noundef @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #6
  unreachable

25:                                               ; No predecessors!
  br label %26

26:                                               ; preds = %25, %23
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %36, %26
  %28 = load i64, ptr %7, align 8, !tbaa !9
  %29 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %30 = zext i32 %29 to i64
  %31 = icmp ult i64 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %39

33:                                               ; preds = %27
  %34 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  call void @_ZN5ArrayImE3addEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef 0)
  %35 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 4
  call void @_ZN5ArrayImE3addEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef 0)
  br label %36

36:                                               ; preds = %33
  %37 = load i64, ptr %7, align 8, !tbaa !9
  %38 = add i64 %37, 1
  store i64 %38, ptr %7, align 8, !tbaa !9
  br label %27, !llvm.loop !13

39:                                               ; preds = %32
  %40 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  %41 = call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %40)
  %42 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %43 = zext i32 %42 to i64
  %44 = icmp eq i64 %41, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %39
  br label %48

46:                                               ; preds = %39
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.5, i32 noundef 274, ptr noundef @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #6
  unreachable

47:                                               ; No predecessors!
  br label %48

48:                                               ; preds = %47, %45
  %49 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 4
  %50 = call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %49)
  %51 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %52 = zext i32 %51 to i64
  %53 = icmp eq i64 %50, %52
  br i1 %53, label %54, label %55

54:                                               ; preds = %48
  br label %57

55:                                               ; preds = %48
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.5, i32 noundef 275, ptr noundef @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #6
  unreachable

56:                                               ; No predecessors!
  br label %57

57:                                               ; preds = %56, %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %58 = getelementptr inbounds %class.TPCCQuery, ptr %12, i32 0, i32 2
  %59 = load i64, ptr %58, align 8, !tbaa !15
  %60 = call noundef i64 @_Z10wh_to_partm(i64 noundef %59)
  %61 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %62 = zext i32 %61 to i64
  %63 = urem i64 %60, %62
  store i64 %63, ptr %8, align 8, !tbaa !9
  %64 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  %65 = load i64, ptr %8, align 8, !tbaa !9
  call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %65, i64 noundef 1)
  %66 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 4
  %67 = load i64, ptr %8, align 8, !tbaa !9
  call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %66, i64 noundef %67, i64 noundef 1)
  %68 = load i64, ptr %5, align 8, !tbaa !9
  %69 = add i64 %68, 1
  store i64 %69, ptr %5, align 8, !tbaa !9
  %70 = load i64, ptr %6, align 8, !tbaa !9
  %71 = add i64 %70, 1
  store i64 %71, ptr %6, align 8, !tbaa !9
  %72 = getelementptr inbounds %class.TPCCQuery, ptr %12, i32 0, i32 1
  %73 = load i32, ptr %72, align 8, !tbaa !23
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %96

75:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %76 = getelementptr inbounds %class.TPCCQuery, ptr %12, i32 0, i32 6
  %77 = load i64, ptr %76, align 8, !tbaa !24
  %78 = call noundef i64 @_Z10wh_to_partm(i64 noundef %77)
  %79 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %80 = zext i32 %79 to i64
  %81 = urem i64 %78, %80
  store i64 %81, ptr %9, align 8, !tbaa !9
  %82 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  %83 = load i64, ptr %9, align 8, !tbaa !9
  %84 = call noundef i64 @_ZN5ArrayImEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %83)
  %85 = icmp eq i64 %84, 0
  br i1 %85, label %86, label %95

86:                                               ; preds = %75
  %87 = load i64, ptr %5, align 8, !tbaa !9
  %88 = add i64 %87, 1
  store i64 %88, ptr %5, align 8, !tbaa !9
  %89 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  %90 = load i64, ptr %9, align 8, !tbaa !9
  call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %89, i64 noundef %90, i64 noundef 1)
  %91 = load i64, ptr %6, align 8, !tbaa !9
  %92 = add i64 %91, 1
  store i64 %92, ptr %6, align 8, !tbaa !9
  %93 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 4
  %94 = load i64, ptr %9, align 8, !tbaa !9
  call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %94, i64 noundef 1)
  br label %95

95:                                               ; preds = %86, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %136

96:                                               ; preds = %57
  %97 = getelementptr inbounds %class.TPCCQuery, ptr %12, i32 0, i32 1
  %98 = load i32, ptr %97, align 8, !tbaa !23
  %99 = icmp eq i32 %98, 2
  br i1 %99, label %100, label %135

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !9
  br label %101

101:                                              ; preds = %131, %100
  %102 = load i64, ptr %10, align 8, !tbaa !9
  %103 = getelementptr inbounds %class.TPCCQuery, ptr %12, i32 0, i32 14
  %104 = load i64, ptr %103, align 8, !tbaa !25
  %105 = icmp ult i64 %102, %104
  br i1 %105, label %107, label %106

106:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %134

107:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %108 = getelementptr inbounds %class.TPCCQuery, ptr %12, i32 0, i32 11
  %109 = load i64, ptr %10, align 8, !tbaa !9
  %110 = call noundef ptr @_ZN5ArrayIP7Item_noEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %109)
  %111 = getelementptr inbounds %struct.Item_no, ptr %110, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !26
  %113 = call noundef i64 @_Z10wh_to_partm(i64 noundef %112)
  %114 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %115 = zext i32 %114 to i64
  %116 = urem i64 %113, %115
  store i64 %116, ptr %11, align 8, !tbaa !9
  %117 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  %118 = load i64, ptr %11, align 8, !tbaa !9
  %119 = call noundef i64 @_ZN5ArrayImEixEm(ptr noundef nonnull align 8 dereferenceable(24) %117, i64 noundef %118)
  %120 = icmp eq i64 %119, 0
  br i1 %120, label %121, label %130

121:                                              ; preds = %107
  %122 = load i64, ptr %5, align 8, !tbaa !9
  %123 = add i64 %122, 1
  store i64 %123, ptr %5, align 8, !tbaa !9
  %124 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 5
  %125 = load i64, ptr %11, align 8, !tbaa !9
  call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %124, i64 noundef %125, i64 noundef 1)
  %126 = load i64, ptr %6, align 8, !tbaa !9
  %127 = add i64 %126, 1
  store i64 %127, ptr %6, align 8, !tbaa !9
  %128 = getelementptr inbounds %class.BaseQuery, ptr %12, i32 0, i32 4
  %129 = load i64, ptr %11, align 8, !tbaa !9
  call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef %129, i64 noundef 1)
  br label %130

130:                                              ; preds = %121, %107
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %131

131:                                              ; preds = %130
  %132 = load i64, ptr %10, align 8, !tbaa !9
  %133 = add i64 %132, 1
  store i64 %133, ptr %10, align 8, !tbaa !9
  br label %101, !llvm.loop !28

134:                                              ; preds = %106
  br label %135

135:                                              ; preds = %134, %96
  br label %136

136:                                              ; preds = %135, %95
  %137 = load i64, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i64 %137
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN5ArrayImEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 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 = { "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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 120}
!16 = !{!"_ZTS9TPCCQuery", !17, i64 0, !19, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !7, i64 168, !20, i64 184, !21, i64 192, !22, i64 200, !21, i64 224, !21, i64 225, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312}
!17 = !{!"_ZTS9BaseQuery", !10, i64 8, !18, i64 16, !18, i64 40, !18, i64 64, !18, i64 88}
!18 = !{!"_ZTS5ArrayImE", !6, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!"_ZTS11TPCCTxnType", !7, i64 0}
!20 = !{!"double", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTS5ArrayIP7Item_noE", !6, i64 0, !10, i64 8, !10, i64 16}
!23 = !{!16, !19, i64 112}
!24 = !{!16, !10, i64 152}
!25 = !{!16, !10, i64 232}
!26 = !{!27, !10, i64 8}
!27 = !{!"_ZTS7Item_no", !10, i64 0, !10, i64 8, !10, i64 16}
!28 = distinct !{!28, !14}


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

@g_node_cnt = external local_unnamed_addr global i32, align 4
@.str.5 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [28 x i8], align 1
@__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload = external hidden unnamed_addr constant [49 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i8], align 1

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

declare noundef i64 @_Z10wh_to_partm(i64 noundef) local_unnamed_addr #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN9TPCCQuery16get_participantsEP8Workload(ptr noundef nonnull align 8 dereferenceable(320) %0, ptr nocapture noundef readnone %1) local_unnamed_addr #3 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 88
  %4 = tail call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %5 = icmp eq i64 %4, 0
  br i1 %5, label %7, label %6

6:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.5, i32 noundef 268, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #4
  unreachable

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  %9 = tail call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %10 = icmp eq i64 %9, 0
  br i1 %10, label %.preheader25, label %12

.preheader25:                                     ; preds = %7
  %11 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

12:                                               ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.5, i32 noundef 269, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #4
  unreachable

._crit_edge:                                      ; preds = %.lr.ph, %.preheader25
  %13 = tail call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %14 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %15 = zext i32 %14 to i64
  %16 = icmp eq i64 %13, %15
  br i1 %16, label %22, label %21

.lr.ph:                                           ; preds = %.preheader25, %.lr.ph
  %.02326 = phi i64 [ %17, %.lr.ph ], [ 0, %.preheader25 ]
  tail call void @_ZN5ArrayImE3addEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0)
  tail call void @_ZN5ArrayImE3addEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0)
  %17 = add nuw nsw i64 %.02326, 1
  %18 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %19 = zext i32 %18 to i64
  %20 = icmp ult i64 %17, %19
  br i1 %20, label %.lr.ph, label %._crit_edge, !llvm.loop !9

21:                                               ; preds = %._crit_edge
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.5, i32 noundef 274, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #4
  unreachable

22:                                               ; preds = %._crit_edge
  %23 = tail call noundef i64 @_ZN5ArrayImE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %24 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = icmp eq i64 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.5, i32 noundef 275, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9TPCCQuery16get_participantsEP8Workload) #4
  unreachable

28:                                               ; preds = %22
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  %30 = load i64, ptr %29, align 8, !tbaa !11
  %31 = tail call noundef i64 @_Z10wh_to_partm(i64 noundef %30)
  %32 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %33 = zext i32 %32 to i64
  %34 = urem i64 %31, %33
  tail call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %34, i64 noundef 1)
  tail call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %34, i64 noundef 1)
  %35 = getelementptr inbounds i8, ptr %0, i64 112
  %36 = load i32, ptr %35, align 8, !tbaa !21
  switch i32 %36, label %.loopexit [
    i32 1, label %40
    i32 2, label %.preheader
  ]

.preheader:                                       ; preds = %28
  %37 = getelementptr inbounds i8, ptr %0, i64 232
  %38 = load i64, ptr %37, align 8, !tbaa !22
  %.not31 = icmp eq i64 %38, 0
  br i1 %.not31, label %.loopexit, label %.lr.ph30

.lr.ph30:                                         ; preds = %.preheader
  %39 = getelementptr inbounds i8, ptr %0, i64 200
  br label %50

40:                                               ; preds = %28
  %41 = getelementptr inbounds i8, ptr %0, i64 152
  %42 = load i64, ptr %41, align 8, !tbaa !23
  %43 = tail call noundef i64 @_Z10wh_to_partm(i64 noundef %42)
  %44 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %45 = zext i32 %44 to i64
  %46 = urem i64 %43, %45
  %47 = tail call noundef i64 @_ZN5ArrayImEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %46)
  %48 = icmp eq i64 %47, 0
  br i1 %48, label %49, label %.loopexit

49:                                               ; preds = %40
  tail call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %46, i64 noundef 1)
  tail call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %46, i64 noundef 1)
  br label %.loopexit

50:                                               ; preds = %.lr.ph30, %62
  %.129 = phi i64 [ 1, %.lr.ph30 ], [ %.2, %62 ]
  %.02028 = phi i64 [ 0, %.lr.ph30 ], [ %63, %62 ]
  %51 = tail call noundef ptr @_ZN5ArrayIP7Item_noEixEm(ptr noundef nonnull align 8 dereferenceable(24) %39, i64 noundef %.02028)
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i64, ptr %52, align 8, !tbaa !24
  %54 = tail call noundef i64 @_Z10wh_to_partm(i64 noundef %53)
  %55 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %56 = zext i32 %55 to i64
  %57 = urem i64 %54, %56
  %58 = tail call noundef i64 @_ZN5ArrayImEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %57)
  %59 = icmp eq i64 %58, 0
  br i1 %59, label %60, label %62

60:                                               ; preds = %50
  %61 = add i64 %.129, 1
  tail call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %57, i64 noundef 1)
  tail call void @_ZN5ArrayImE3setEmm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %57, i64 noundef 1)
  br label %62

62:                                               ; preds = %60, %50
  %.2 = phi i64 [ %61, %60 ], [ %.129, %50 ]
  %63 = add nuw i64 %.02028, 1
  %64 = load i64, ptr %37, align 8, !tbaa !22
  %65 = icmp ult i64 %63, %64
  br i1 %65, label %50, label %.loopexit, !llvm.loop !26

.loopexit:                                        ; preds = %62, %.preheader, %28, %40, %49
  %.3 = phi i64 [ 2, %49 ], [ 1, %40 ], [ 1, %28 ], [ 1, %.preheader ], [ %.2, %62 ]
  ret i64 %.3
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN5ArrayImEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !14, i64 120}
!12 = !{!"_ZTS9TPCCQuery", !13, i64 0, !17, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !7, i64 168, !18, i64 184, !19, i64 192, !20, i64 200, !19, i64 224, !19, i64 225, !14, i64 232, !14, i64 240, !14, i64 248, !14, i64 256, !14, i64 264, !14, i64 272, !14, i64 280, !14, i64 288, !14, i64 296, !14, i64 304, !14, i64 312}
!13 = !{!"_ZTS9BaseQuery", !14, i64 8, !15, i64 16, !15, i64 40, !15, i64 64, !15, i64 88}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_ZTS5ArrayImE", !16, i64 0, !14, i64 8, !14, i64 16}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"_ZTS11TPCCTxnType", !7, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTS5ArrayIP7Item_noE", !16, i64 0, !14, i64 8, !14, i64 16}
!21 = !{!12, !17, i64 112}
!22 = !{!12, !14, i64 232}
!23 = !{!12, !14, i64 152}
!24 = !{!25, !14, i64 8}
!25 = !{!"_ZTS7Item_no", !14, i64 0, !14, i64 8, !14, i64 16}
!26 = distinct !{!26, !10}


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