; LLVM IR from mitdbg/deneva :: benchmarks/ycsb_wl.ll (ZN12YCSBWorkload16init_table_sliceEv)

; 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.YCSBWorkload = type { %class.Workload, ptr, ptr, %union.pthread_mutex_t }
%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" }
%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.itemid_t = type <{ i32, [4 x i8], ptr, ptr, i8, [7 x i8] }>

@_ZN12YCSBWorkload8next_tidE = external dso_local global i32, align 4
@g_part_cnt = external global i32, align 4
@g_synth_table_size = external global i64, align 8
@g_node_cnt = external global i32, align 4
@g_node_id = external global i32, align 4
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [70 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@g_init_parallelism = external global i32, align 4
@.str.13 = external hidden unnamed_addr constant [45 x i8], align 1
@__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv = external hidden unnamed_addr constant [39 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [29 x i8], align 1
@simulation = external global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [26 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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN12YCSBWorkload11key_to_partEm(ptr noundef nonnull align 8 dereferenceable(176), i64 noundef) #2 align 2

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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; 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 noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN12YCSBWorkload16init_table_sliceEv(ptr noundef nonnull align 8 dereferenceable(176) %0) #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %15 = atomicrmw add ptr @_ZN12YCSBWorkload8next_tidE, i32 1 seq_cst, align 4
  store i32 %15, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %16 = load i64, ptr @g_synth_table_size, align 8, !tbaa !11
  %17 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %18 = zext i32 %17 to i64
  %19 = urem i64 %16, %18
  %20 = icmp eq i64 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %1
  br label %24

22:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.9, i32 noundef 147, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %27 = icmp ult i32 %25, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  br label %31

29:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.9, i32 noundef 148, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

30:                                               ; No predecessors!
  br label %31

31:                                               ; preds = %30, %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !11
  br label %32

32:                                               ; preds = %36, %31
  %33 = atomicrmw add ptr @_ZN12YCSBWorkload8next_tidE, i32 0 seq_cst, align 4
  %34 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %35 = icmp ult i32 %33, %34
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  br label %32, !llvm.loop !13

37:                                               ; preds = %32
  %38 = atomicrmw add ptr @_ZN12YCSBWorkload8next_tidE, i32 0 seq_cst, align 4
  %39 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %40 = icmp eq i32 %38, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  br label %44

42:                                               ; preds = %37
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.9, i32 noundef 151, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

43:                                               ; No predecessors!
  br label %44

44:                                               ; preds = %43, %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %45 = load i64, ptr @g_synth_table_size, align 8, !tbaa !11
  %46 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = udiv i64 %45, %47
  store i64 %48, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %49 = load i64, ptr %6, align 8, !tbaa !11
  %50 = load i32, ptr %3, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = mul i64 %49, %51
  store i64 %52, ptr %7, align 8, !tbaa !11
  br label %53

53:                                               ; preds = %131, %69, %44
  %54 = load i64, ptr %7, align 8, !tbaa !11
  %55 = load i64, ptr %6, align 8, !tbaa !11
  %56 = load i32, ptr %3, align 4, !tbaa !9
  %57 = add i32 %56, 1
  %58 = zext i32 %57 to i64
  %59 = mul i64 %55, %58
  %60 = icmp ult i64 %54, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %53
  %63 = load i64, ptr %7, align 8, !tbaa !11
  %64 = call noundef i32 @_ZN12YCSBWorkload11key_to_partEm(ptr noundef nonnull align 8 dereferenceable(176) %14, i64 noundef %63)
  %65 = load i32, ptr @g_node_cnt, align 4, !tbaa !9
  %66 = urem i32 %64, %65
  %67 = load i32, ptr @g_node_id, align 4, !tbaa !9
  %68 = icmp ne i32 %66, %67
  br i1 %68, label %69, label %72

69:                                               ; preds = %62
  %70 = load i64, ptr %7, align 8, !tbaa !11
  %71 = add i64 %70, 1
  store i64 %71, ptr %7, align 8, !tbaa !11
  br label %53, !llvm.loop !15

72:                                               ; preds = %62
  %73 = load i64, ptr %5, align 8, !tbaa !11
  %74 = add i64 %73, 1
  store i64 %74, ptr %5, align 8, !tbaa !11
  %75 = load i64, ptr %5, align 8, !tbaa !11
  %76 = urem i64 %75, 500000
  %77 = icmp eq i64 %76, 0
  br i1 %77, label %78, label %85

78:                                               ; preds = %72
  %79 = load i32, ptr %3, align 4, !tbaa !9
  %80 = load i64, ptr %5, align 8, !tbaa !11
  %81 = load ptr, ptr @simulation, align 8, !tbaa !5
  %82 = call noundef i64 @_Z13get_sys_clockv()
  %83 = call noundef double @_ZN10SimManager18seconds_from_startEm(ptr noundef nonnull align 8 dereferenceable(96) %81, i64 noundef %82)
  %84 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %79, i64 noundef %80, double noundef %83)
  br label %85

85:                                               ; preds = %78, %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %86 = load i64, ptr %7, align 8, !tbaa !11
  %87 = call noundef i32 @_ZN12YCSBWorkload11key_to_partEm(ptr noundef nonnull align 8 dereferenceable(176) %14, i64 noundef %86)
  store i32 %87, ptr %10, align 4, !tbaa !9
  %88 = getelementptr inbounds %class.YCSBWorkload, ptr %14, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !16
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %89, ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %91, ptr noundef nonnull align 8 dereferenceable(8) %9)
  store i32 %92, ptr %4, align 4, !tbaa !30
  %93 = load i32, ptr %4, align 4, !tbaa !30
  %94 = icmp eq i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %85
  br label %98

96:                                               ; preds = %85
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 171, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

97:                                               ; No predecessors!
  br label %98

98:                                               ; preds = %97, %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %99 = load i64, ptr %7, align 8, !tbaa !11
  store i64 %99, ptr %11, align 8, !tbaa !11
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load i64, ptr %11, align 8, !tbaa !11
  call void @_ZN5row_t15set_primary_keyEm(ptr noundef nonnull align 8 dereferenceable(64) %100, i64 noundef %101)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %102 = call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 32)
  store ptr %102, ptr %12, align 8, !tbaa !5
  %103 = load ptr, ptr %12, align 8, !tbaa !5
  %104 = icmp ne ptr %103, null
  br i1 %104, label %105, label %106

105:                                              ; preds = %98
  br label %108

106:                                              ; preds = %98
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.9, i32 noundef 191, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

107:                                              ; No predecessors!
  br label %108

108:                                              ; preds = %107, %105
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = getelementptr inbounds %class.itemid_t, ptr %109, i32 0, i32 0
  store i32 2, ptr %110, align 8, !tbaa !32
  %111 = load ptr, ptr %8, align 8, !tbaa !5
  %112 = load ptr, ptr %12, align 8, !tbaa !5
  %113 = getelementptr inbounds %class.itemid_t, ptr %112, i32 0, i32 2
  store ptr %111, ptr %113, align 8, !tbaa !36
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = getelementptr inbounds %class.itemid_t, ptr %114, i32 0, i32 4
  store i8 1, ptr %115, align 8, !tbaa !37
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %116 = load i64, ptr %11, align 8, !tbaa !11
  store i64 %116, ptr %13, align 8, !tbaa !11
  %117 = getelementptr inbounds %class.YCSBWorkload, ptr %14, i32 0, i32 1
  %118 = load ptr, ptr %117, align 8, !tbaa !38
  %119 = load i64, ptr %13, align 8, !tbaa !11
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = load ptr, ptr %118, align 8, !tbaa !39
  %123 = getelementptr inbounds ptr, ptr %122, i64 3
  %124 = load ptr, ptr %123, align 8
  %125 = call noundef i32 %124(ptr noundef nonnull align 8 dereferenceable(40) %118, i64 noundef %119, ptr noundef %120, i32 noundef %121)
  store i32 %125, ptr %4, align 4, !tbaa !30
  %126 = load i32, ptr %4, align 4, !tbaa !30
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %108
  br label %131

129:                                              ; preds = %108
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 198, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

130:                                              ; No predecessors!
  br label %131

131:                                              ; preds = %130, %128
  %132 = load i32, ptr @g_part_cnt, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = load i64, ptr %7, align 8, !tbaa !11
  %135 = add i64 %134, %133
  store i64 %135, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %53, !llvm.loop !15

136:                                              ; preds = %61
  %137 = load i32, ptr %3, align 4, !tbaa !9
  %138 = load i64, ptr %5, align 8, !tbaa !11
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, i32 noundef %137, i64 noundef %138)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret ptr null
}

declare noundef double @_ZN10SimManager18seconds_from_startEm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef) #1

declare noundef i64 @_Z13get_sys_clockv() #1

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 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !6, i64 128}
!17 = !{!"_ZTS12YCSBWorkload", !18, i64 0, !6, i64 120, !6, i64 128, !7, i64 136}
!18 = !{!"_ZTS8Workload", !19, i64 8, !27, i64 56, !12, i64 104, !12, i64 112}
!19 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7table_tSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !20, i64 0}
!20 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !21, i64 0}
!21 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !22, i64 0, !24, i64 8}
!22 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !23, i64 0}
!23 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!24 = !{!"_ZTSSt15_Rb_tree_header", !25, i64 0, !12, i64 32}
!25 = !{!"_ZTSSt18_Rb_tree_node_base", !26, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!26 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!27 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP9IndexHashSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !22, i64 0, !24, i64 8}
!30 = !{!31, !31, i64 0}
!31 = !{!"_ZTS2RC", !7, i64 0}
!32 = !{!33, !34, i64 0}
!33 = !{!"_ZTS8itemid_t", !34, i64 0, !6, i64 8, !6, i64 16, !35, i64 24}
!34 = !{!"_ZTS9Data_type", !7, i64 0}
!35 = !{!"bool", !7, i64 0}
!36 = !{!33, !6, i64 8}
!37 = !{!33, !35, i64 24}
!38 = !{!17, !6, i64 120}
!39 = !{!40, !40, i64 0}
!40 = !{!"vtable pointer", !8, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.mem_alloc = type { i8 }

@_ZN12YCSBWorkload8next_tidE = external dso_local global i32, align 4
@g_part_cnt = external local_unnamed_addr global i32, align 4
@g_synth_table_size = external local_unnamed_addr global i64, align 8
@g_node_cnt = external local_unnamed_addr global i32, align 4
@g_node_id = external local_unnamed_addr global i32, align 4
@.str.8 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [70 x i8], align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@g_init_parallelism = external local_unnamed_addr global i32, align 4
@.str.13 = external hidden unnamed_addr constant [45 x i8], align 1
@__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv = external hidden unnamed_addr constant [39 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [29 x i8], align 1
@simulation = external local_unnamed_addr global ptr, align 8
@.str.17 = external hidden unnamed_addr constant [26 x i8], align 1

; 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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN12YCSBWorkload11key_to_partEm(ptr noundef nonnull align 8 dereferenceable(176), i64 noundef) local_unnamed_addr #2 align 2

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 #3

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

; 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 noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN12YCSBWorkload16init_table_sliceEv(ptr noundef nonnull align 8 dereferenceable(176) %0) local_unnamed_addr #5 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = atomicrmw add ptr @_ZN12YCSBWorkload8next_tidE, i32 1 seq_cst, align 4
  %5 = load i64, ptr @g_synth_table_size, align 8, !tbaa !5
  %6 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %7 = zext i32 %6 to i64
  %8 = urem i64 %5, %7
  %9 = icmp eq i64 %8, 0
  br i1 %9, label %11, label %10

10:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.9, i32 noundef 147, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

11:                                               ; preds = %1
  %12 = icmp ult i32 %4, %6
  br i1 %12, label %.preheader, label %13

13:                                               ; preds = %11
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.9, i32 noundef 148, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

.preheader:                                       ; preds = %11, %.preheader
  %14 = atomicrmw or ptr @_ZN12YCSBWorkload8next_tidE, i32 0 seq_cst, align 4
  %15 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %16 = icmp ult i32 %14, %15
  br i1 %16, label %.preheader, label %17, !llvm.loop !11

17:                                               ; preds = %.preheader
  %18 = atomicrmw or ptr @_ZN12YCSBWorkload8next_tidE, i32 0 seq_cst, align 4
  %19 = load i32, ptr @g_init_parallelism, align 4, !tbaa !9
  %20 = icmp eq i32 %18, %19
  br i1 %20, label %22, label %21

21:                                               ; preds = %17
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.9, i32 noundef 151, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

22:                                               ; preds = %17
  %23 = load i64, ptr @g_synth_table_size, align 8, !tbaa !5
  %24 = zext i32 %18 to i64
  %25 = udiv i64 %23, %24
  %26 = zext i32 %4 to i64
  %27 = mul i64 %25, %26
  %28 = add i32 %4, 1
  %29 = zext i32 %28 to i64
  %30 = mul i64 %25, %29
  %31 = icmp ult i64 %27, %30
  br i1 %31, label %.lr.ph.lr.ph, label %.outer._crit_edge

.lr.ph.lr.ph:                                     ; preds = %22
  %32 = getelementptr inbounds i8, ptr %0, i64 128
  %33 = getelementptr inbounds i8, ptr %0, i64 120
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.lr.ph, %.outer
  %.0.ph41 = phi i64 [ 0, %.lr.ph.lr.ph ], [ %44, %.outer ]
  %.029.ph40 = phi i64 [ %27, %.lr.ph.lr.ph ], [ %76, %.outer ]
  br label %35

.outer._crit_edge:                                ; preds = %.outer, %40, %22
  %.0.ph.lcssa37 = phi i64 [ 0, %22 ], [ %.0.ph41, %40 ], [ %44, %.outer ]
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, i32 noundef %4, i64 noundef %.0.ph.lcssa37)
  ret ptr null

35:                                               ; preds = %.lr.ph, %40
  %.02938 = phi i64 [ %.029.ph40, %.lr.ph ], [ %41, %40 ]
  %36 = call noundef i32 @_ZN12YCSBWorkload11key_to_partEm(ptr noundef nonnull align 8 dereferenceable(176) %0, i64 noundef %.02938)
  %37 = load i32, ptr @g_node_cnt, align 4, !tbaa !9
  %38 = urem i32 %36, %37
  %39 = load i32, ptr @g_node_id, align 4, !tbaa !9
  %.not = icmp eq i32 %38, %39
  br i1 %.not, label %43, label %40

40:                                               ; preds = %35
  %41 = add nuw i64 %.02938, 1
  %42 = icmp ult i64 %41, %30
  br i1 %42, label %35, label %.outer._crit_edge, !llvm.loop !13

43:                                               ; preds = %35
  %44 = add i64 %.0.ph41, 1
  %45 = urem i64 %44, 500000
  %46 = icmp eq i64 %45, 0
  br i1 %46, label %47, label %52

47:                                               ; preds = %43
  %48 = load ptr, ptr @simulation, align 8, !tbaa !14
  %49 = call noundef i64 @_Z13get_sys_clockv()
  %50 = call noundef double @_ZN10SimManager18seconds_from_startEm(ptr noundef nonnull align 8 dereferenceable(96) %48, i64 noundef %49)
  %51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %4, i64 noundef %44, double noundef %50)
  br label %52

52:                                               ; preds = %47, %43
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  store ptr null, ptr %2, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %53 = call noundef i32 @_ZN12YCSBWorkload11key_to_partEm(ptr noundef nonnull align 8 dereferenceable(176) %0, i64 noundef %.02938)
  %54 = load ptr, ptr %32, align 8, !tbaa !16
  %55 = sext i32 %53 to i64
  %56 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %54, ptr noundef nonnull align 8 dereferenceable(8) %2, i64 noundef %55, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %52
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 171, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

59:                                               ; preds = %52
  %60 = load ptr, ptr %2, align 8, !tbaa !14
  call void @_ZN5row_t15set_primary_keyEm(ptr noundef nonnull align 8 dereferenceable(64) %60, i64 noundef %.02938)
  %61 = call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 32)
  %.not33 = icmp eq ptr %61, null
  br i1 %.not33, label %62, label %63

62:                                               ; preds = %59
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.9, i32 noundef 191, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

63:                                               ; preds = %59
  store i32 2, ptr %61, align 8, !tbaa !30
  %64 = load ptr, ptr %2, align 8, !tbaa !14
  %65 = getelementptr inbounds i8, ptr %61, i64 8
  store ptr %64, ptr %65, align 8, !tbaa !34
  %66 = getelementptr inbounds i8, ptr %61, i64 24
  store i8 1, ptr %66, align 8, !tbaa !35
  %67 = load ptr, ptr %33, align 8, !tbaa !36
  %68 = load ptr, ptr %67, align 8, !tbaa !37
  %69 = getelementptr inbounds i8, ptr %68, i64 24
  %70 = load ptr, ptr %69, align 8
  %71 = call noundef i32 %70(ptr noundef nonnull align 8 dereferenceable(40) %67, i64 noundef %.02938, ptr noundef nonnull %61, i32 noundef %53)
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %.outer, label %73

73:                                               ; preds = %63
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 198, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload16init_table_sliceEv) #6
  unreachable

.outer:                                           ; preds = %63
  %74 = load i32, ptr @g_part_cnt, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = add i64 %.02938, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  %77 = icmp ult i64 %76, %30
  br i1 %77, label %.lr.ph, label %.outer._crit_edge, !llvm.loop !13
}

declare noundef double @_ZN10SimManager18seconds_from_startEm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef) local_unnamed_addr #3

declare noundef i64 @_Z13get_sys_clockv() local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { noreturn nounwind }
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, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!17, !15, i64 128}
!17 = !{!"_ZTS12YCSBWorkload", !18, i64 0, !15, i64 120, !15, i64 128, !7, i64 136}
!18 = !{!"_ZTS8Workload", !19, i64 8, !27, i64 56, !6, i64 104, !6, i64 112}
!19 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7table_tSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !20, i64 0}
!20 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !21, i64 0}
!21 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !22, i64 0, !24, i64 8}
!22 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !23, i64 0}
!23 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!24 = !{!"_ZTSSt15_Rb_tree_header", !25, i64 0, !6, i64 32}
!25 = !{!"_ZTSSt18_Rb_tree_node_base", !26, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!26 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!27 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP9IndexHashSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !28, i64 0}
!28 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !29, i64 0}
!29 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !22, i64 0, !24, i64 8}
!30 = !{!31, !32, i64 0}
!31 = !{!"_ZTS8itemid_t", !32, i64 0, !15, i64 8, !15, i64 16, !33, i64 24}
!32 = !{!"_ZTS9Data_type", !7, i64 0}
!33 = !{!"bool", !7, i64 0}
!34 = !{!31, !15, i64 8}
!35 = !{!31, !33, i64 24}
!36 = !{!17, !15, i64 120}
!37 = !{!38, !38, i64 0}
!38 = !{!"vtable pointer", !8, i64 0}


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