; LLVM IR from mitdbg/deneva :: benchmarks/tpcc_wl.ll (ZN12TPCCWorkload14init_tab_orderEimm)

; 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.TPCCWorkload = type { %class.Workload, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, ptr }
%class.Workload = type { ptr, %"class.std::map", %"class.std::map.0", i64, i64 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, table_t *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, table_t *>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, table_t *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, table_t *>>, std::less<std::__cxx11::basic_string<char>>>::_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.std::map.0" = type { %"class.std::_Rb_tree.1" }
%"class.std::_Rb_tree.1" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, IndexHash *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, IndexHash *>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, IndexHash *>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, IndexHash *>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }

@g_init_parallelism = external global i32, align 4
@g_cust_per_dist = external global i32, align 4

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

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

declare noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) #1

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

declare void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef) #1

declare void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i64 noundef) #1

declare noundef i64 @_Z5URandmm(i64 noundef, i64 noundef) #1

declare void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, ptr noundef) #1

declare noundef i64 @_Z15MakeAlphaStringiiPc(i32 noundef, i32 noundef, ptr noundef) #1

declare void @_ZN5row_t9set_valueEid(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, double noundef) #1

declare void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TPCCWorkload14init_tab_orderEimm(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i64 noundef %2, i64 noundef %3) #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca [24 x i8], align 16
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !11
  store i64 %3, ptr %8, align 8, !tbaa !11
  %18 = load ptr, ptr %5, align 8
  call void @_ZN12TPCCWorkload16init_permutationEv(ptr noundef nonnull align 8 dereferenceable(296) %18)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %9, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %112, %4
  %22 = load i32, ptr %9, align 4, !tbaa !9
  %23 = load i32, ptr @g_cust_per_dist, align 4, !tbaa !9
  %24 = icmp ule i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 2, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %116

26:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %27 = getelementptr inbounds %class.TPCCWorkload, ptr %18, i32 0, i32 6
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %28, ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %30 = load ptr, ptr %11, align 8, !tbaa !5
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = zext i32 %31 to i64
  call void @_ZN5row_t15set_primary_keyEm(ptr noundef nonnull align 8 dereferenceable(64) %30, i64 noundef %32)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store i64 1, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %33 = call noundef i64 @_ZN12TPCCWorkload15get_permutationEv(ptr noundef nonnull align 8 dereferenceable(296) %18)
  store i64 %33, ptr %14, align 8, !tbaa !11
  %34 = load ptr, ptr %11, align 8, !tbaa !5
  %35 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64) %34, i32 noundef 0, i32 noundef %35)
  %36 = load ptr, ptr %11, align 8, !tbaa !5
  %37 = load i64, ptr %14, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %36, i32 noundef 1, i64 noundef %37)
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = load i64, ptr %7, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %38, i32 noundef 2, i64 noundef %39)
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %40, i32 noundef 3, i64 noundef %41)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  store i64 2013, ptr %15, align 8, !tbaa !11
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load i64, ptr %15, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %42, i32 noundef 4, i64 noundef %43)
  %44 = load i32, ptr %9, align 4, !tbaa !9
  %45 = icmp ult i32 %44, 2101
  br i1 %45, label %46, label %49

46:                                               ; preds = %26
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = call noundef i64 @_Z5URandmm(i64 noundef 1, i64 noundef 10)
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %47, i32 noundef 5, i64 noundef %48)
  br label %51

49:                                               ; preds = %26
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %50, i32 noundef 5, i32 noundef 0)
  br label %51

51:                                               ; preds = %49, %46
  %52 = call noundef i64 @_Z5URandmm(i64 noundef 5, i64 noundef 15)
  store i64 %52, ptr %13, align 8, !tbaa !11
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = load i64, ptr %13, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %53, i32 noundef 6, i64 noundef %54)
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %55, i32 noundef 7, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 1, ptr %16, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %95, %51
  %57 = load i64, ptr %16, align 8, !tbaa !11
  %58 = load i64, ptr %13, align 8, !tbaa !11
  %59 = icmp ule i64 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %98

61:                                               ; preds = %56
  %62 = getelementptr inbounds %class.TPCCWorkload, ptr %18, i32 0, i32 7
  %63 = load ptr, ptr %62, align 8, !tbaa !27
  %64 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %63, ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %65 = load ptr, ptr %11, align 8, !tbaa !5
  %66 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64) %65, i32 noundef 0, i32 noundef %66)
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = load i64, ptr %7, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %67, i32 noundef 1, i64 noundef %68)
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %69, i32 noundef 2, i64 noundef %70)
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = load i64, ptr %16, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %71, i32 noundef 3, i64 noundef %72)
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = call noundef i64 @_Z5URandmm(i64 noundef 1, i64 noundef 100000)
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %73, i32 noundef 4, i64 noundef %74)
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %75, i32 noundef 5, i64 noundef %76)
  %77 = load i32, ptr %9, align 4, !tbaa !9
  %78 = icmp ult i32 %77, 2101
  br i1 %78, label %79, label %83

79:                                               ; preds = %61
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load i64, ptr %15, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %80, i32 noundef 6, i64 noundef %81)
  %82 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %82, i32 noundef 8, i32 noundef 0)
  br label %89

83:                                               ; preds = %61
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %84, i32 noundef 6, i32 noundef 0)
  %85 = load ptr, ptr %11, align 8, !tbaa !5
  %86 = call noundef i64 @_Z5URandmm(i64 noundef 1, i64 noundef 999999)
  %87 = uitofp i64 %86 to double
  %88 = fdiv double %87, 1.000000e+02
  call void @_ZN5row_t9set_valueEid(ptr noundef nonnull align 8 dereferenceable(64) %85, i32 noundef 8, double noundef %88)
  br label %89

89:                                               ; preds = %83, %79
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %90, i32 noundef 7, i32 noundef 5)
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #4
  %91 = getelementptr inbounds [24 x i8], ptr %17, i64 0, i64 0
  %92 = call noundef i64 @_Z15MakeAlphaStringiiPc(i32 noundef 24, i32 noundef 24, ptr noundef %91)
  %93 = load ptr, ptr %11, align 8, !tbaa !5
  %94 = getelementptr inbounds [24 x i8], ptr %17, i64 0, i64 0
  call void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64) %93, i32 noundef 9, ptr noundef %94)
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #4
  br label %95

95:                                               ; preds = %89
  %96 = load i64, ptr %16, align 8, !tbaa !11
  %97 = add i64 %96, 1
  store i64 %97, ptr %16, align 8, !tbaa !11
  br label %56, !llvm.loop !28

98:                                               ; preds = %60
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = icmp ugt i32 %99, 2100
  br i1 %100, label %101, label %111

101:                                              ; preds = %98
  %102 = getelementptr inbounds %class.TPCCWorkload, ptr %18, i32 0, i32 5
  %103 = load ptr, ptr %102, align 8, !tbaa !30
  %104 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %103, ptr noundef nonnull align 8 dereferenceable(8) %11, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = load i32, ptr %9, align 4, !tbaa !9
  call void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64) %105, i32 noundef 0, i32 noundef %106)
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = load i64, ptr %7, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %107, i32 noundef 1, i64 noundef %108)
  %109 = load ptr, ptr %11, align 8, !tbaa !5
  %110 = load i64, ptr %8, align 8, !tbaa !11
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %109, i32 noundef 2, i64 noundef %110)
  br label %111

111:                                              ; preds = %101, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %114 = load i32, ptr %9, align 4, !tbaa !9
  %115 = add i32 %114, %113
  store i32 %115, ptr %9, align 4, !tbaa !9
  br label %21, !llvm.loop !31

116:                                              ; preds = %25
  ret void
}

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

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

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 160}
!14 = !{!"_ZTS12TPCCWorkload", !15, i64 0, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !12, i64 272, !10, i64 280, !6, i64 288}
!15 = !{!"_ZTS8Workload", !16, i64 8, !24, i64 56, !12, i64 104, !12, i64 112}
!16 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7table_tSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !17, i64 0}
!17 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !18, i64 0}
!18 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !19, i64 0, !21, i64 8}
!19 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !20, i64 0}
!20 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!21 = !{!"_ZTSSt15_Rb_tree_header", !22, i64 0, !12, i64 32}
!22 = !{!"_ZTSSt18_Rb_tree_node_base", !23, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!24 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP9IndexHashSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !25, i64 0}
!25 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !26, i64 0}
!26 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !19, i64 0, !21, i64 8}
!27 = !{!14, !6, i64 168}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!14, !6, i64 152}
!31 = distinct !{!31, !29}


; 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_init_parallelism = external local_unnamed_addr global i32, align 4
@g_cust_per_dist = external local_unnamed_addr global i32, align 4

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

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

declare noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68), ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

declare void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i64 noundef) local_unnamed_addr #1

declare noundef i64 @_Z5URandmm(i64 noundef, i64 noundef) local_unnamed_addr #1

declare void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, ptr noundef) local_unnamed_addr #1

declare noundef i64 @_Z15MakeAlphaStringiiPc(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN5row_t9set_valueEid(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, double noundef) local_unnamed_addr #1

declare void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64), i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TPCCWorkload14init_tab_orderEimm(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #3 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca [24 x i8], align 16
  tail call void @_ZN12TPCCWorkload16init_permutationEv(ptr noundef nonnull align 8 dereferenceable(296) %0)
  %8 = add nsw i32 %1, 1
  %9 = load i32, ptr @g_cust_per_dist, align 4, !tbaa !5
  %.not29 = icmp ugt i32 %8, %9
  br i1 %.not29, label %._crit_edge33, label %.lr.ph32

.lr.ph32:                                         ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 160
  %11 = getelementptr inbounds i8, ptr %0, i64 168
  %12 = getelementptr inbounds i8, ptr %0, i64 152
  br label %13

._crit_edge33:                                    ; preds = %62, %4
  ret void

13:                                               ; preds = %.lr.ph32, %62
  %.02530 = phi i32 [ %8, %.lr.ph32 ], [ %64, %62 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %14 = load ptr, ptr %10, align 8, !tbaa !9
  %15 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %14, ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %16 = load ptr, ptr %5, align 8, !tbaa !25
  %17 = zext i32 %.02530 to i64
  call void @_ZN5row_t15set_primary_keyEm(ptr noundef nonnull align 8 dereferenceable(64) %16, i64 noundef %17)
  %18 = call noundef i64 @_ZN12TPCCWorkload15get_permutationEv(ptr noundef nonnull align 8 dereferenceable(296) %0)
  %19 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64) %19, i32 noundef 0, i32 noundef %.02530)
  %20 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %20, i32 noundef 1, i64 noundef %18)
  %21 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %21, i32 noundef 2, i64 noundef %2)
  %22 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %22, i32 noundef 3, i64 noundef %3)
  %23 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %23, i32 noundef 4, i64 noundef 2013)
  %24 = icmp ult i32 %.02530, 2101
  %25 = load ptr, ptr %5, align 8, !tbaa !25
  br i1 %24, label %26, label %28

26:                                               ; preds = %13
  %27 = call noundef i64 @_Z5URandmm(i64 noundef 1, i64 noundef 10)
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %25, i32 noundef 5, i64 noundef %27)
  br label %29

28:                                               ; preds = %13
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %25, i32 noundef 5, i32 noundef 0)
  br label %29

29:                                               ; preds = %28, %26
  %30 = call noundef i64 @_Z5URandmm(i64 noundef 5, i64 noundef 15)
  %31 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %31, i32 noundef 6, i64 noundef %30)
  %32 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %32, i32 noundef 7, i32 noundef 1)
  %.not2627 = icmp eq i64 %30, 0
  br i1 %.not2627, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %51, %29
  %33 = icmp ugt i32 %.02530, 2100
  br i1 %33, label %56, label %62

.lr.ph:                                           ; preds = %29, %51
  %.028 = phi i64 [ %55, %51 ], [ 1, %29 ]
  %34 = load ptr, ptr %11, align 8, !tbaa !26
  %35 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %34, ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %36 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64) %36, i32 noundef 0, i32 noundef %.02530)
  %37 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %37, i32 noundef 1, i64 noundef %2)
  %38 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %38, i32 noundef 2, i64 noundef %3)
  %39 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %39, i32 noundef 3, i64 noundef %.028)
  %40 = load ptr, ptr %5, align 8, !tbaa !25
  %41 = call noundef i64 @_Z5URandmm(i64 noundef 1, i64 noundef 100000)
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %40, i32 noundef 4, i64 noundef %41)
  %42 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %42, i32 noundef 5, i64 noundef %3)
  %43 = load ptr, ptr %5, align 8, !tbaa !25
  br i1 %24, label %44, label %46

44:                                               ; preds = %.lr.ph
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %43, i32 noundef 6, i64 noundef 2013)
  %45 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %45, i32 noundef 8, i32 noundef 0)
  br label %51

46:                                               ; preds = %.lr.ph
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %43, i32 noundef 6, i32 noundef 0)
  %47 = load ptr, ptr %5, align 8, !tbaa !25
  %48 = call noundef i64 @_Z5URandmm(i64 noundef 1, i64 noundef 999999)
  %49 = uitofp i64 %48 to double
  %50 = fdiv double %49, 1.000000e+02
  call void @_ZN5row_t9set_valueEid(ptr noundef nonnull align 8 dereferenceable(64) %47, i32 noundef 8, double noundef %50)
  br label %51

51:                                               ; preds = %46, %44
  %52 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEii(ptr noundef nonnull align 8 dereferenceable(64) %52, i32 noundef 7, i32 noundef 5)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  %53 = call noundef i64 @_Z15MakeAlphaStringiiPc(i32 noundef 24, i32 noundef 24, ptr noundef nonnull %7)
  %54 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64) %54, i32 noundef 9, ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %55 = add i64 %.028, 1
  %.not26 = icmp ugt i64 %55, %30
  br i1 %.not26, label %._crit_edge, label %.lr.ph, !llvm.loop !27

56:                                               ; preds = %._crit_edge
  %57 = load ptr, ptr %12, align 8, !tbaa !29
  %58 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %57, ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef 0, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %59 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEij(ptr noundef nonnull align 8 dereferenceable(64) %59, i32 noundef 0, i32 noundef %.02530)
  %60 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %60, i32 noundef 1, i64 noundef %2)
  %61 = load ptr, ptr %5, align 8, !tbaa !25
  call void @_ZN5row_t9set_valueEim(ptr noundef nonnull align 8 dereferenceable(64) %61, i32 noundef 2, i64 noundef %3)
  br label %62

62:                                               ; preds = %56, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %63 = load i32, ptr @g_init_parallelism, align 4, !tbaa !5
  %64 = add i32 %63, %.02530
  %65 = load i32, ptr @g_cust_per_dist, align 4, !tbaa !5
  %.not = icmp ugt i32 %64, %65
  br i1 %.not, label %._crit_edge33, label %13, !llvm.loop !30
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12TPCCWorkload16init_permutationEv(ptr noundef nonnull align 8 dereferenceable(296)) local_unnamed_addr #3 align 2

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !20, i64 160}
!10 = !{!"_ZTS12TPCCWorkload", !11, i64 0, !20, i64 120, !20, i64 128, !20, i64 136, !20, i64 144, !20, i64 152, !20, i64 160, !20, i64 168, !20, i64 176, !20, i64 184, !20, i64 192, !20, i64 200, !20, i64 208, !20, i64 216, !20, i64 224, !20, i64 232, !20, i64 240, !20, i64 248, !20, i64 256, !20, i64 264, !21, i64 272, !6, i64 280, !20, i64 288}
!11 = !{!"_ZTS8Workload", !12, i64 8, !22, i64 56, !21, i64 104, !21, i64 112}
!12 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7table_tSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !13, i64 0}
!13 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !14, i64 0}
!14 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !15, i64 0, !17, i64 8}
!15 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !16, i64 0}
!16 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!17 = !{!"_ZTSSt15_Rb_tree_header", !18, i64 0, !21, i64 32}
!18 = !{!"_ZTSSt18_Rb_tree_node_base", !19, i64 0, !20, i64 8, !20, i64 16, !20, i64 24}
!19 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP9IndexHashSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !15, i64 0, !17, i64 8}
!25 = !{!20, !20, i64 0}
!26 = !{!10, !20, i64 168}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!10, !20, i64 152}
!30 = distinct !{!30, !28}


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