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

; 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] }>

@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
@__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv = external hidden unnamed_addr constant [38 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
@.str.11 = external hidden unnamed_addr constant [40 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 uwtable
define dso_local noundef i32 @_ZN12YCSBWorkload10init_tableEv(ptr noundef nonnull align 8 dereferenceable(176) %0) unnamed_addr #2 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %19 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !9
  br label %20

20:                                               ; preds = %138, %1
  br label %21

21:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %22

22:                                               ; preds = %133, %21
  %23 = load i32, ptr %6, align 4, !tbaa !11
  %24 = load i32, ptr @g_part_cnt, align 4, !tbaa !11
  %25 = icmp ult i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 4, ptr %7, align 4
  br label %136

27:                                               ; preds = %22
  %28 = load i64, ptr %5, align 8, !tbaa !9
  %29 = load i64, ptr @g_synth_table_size, align 8, !tbaa !9
  %30 = icmp ugt i64 %28, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %27
  store i32 7, ptr %7, align 4
  br label %136

32:                                               ; preds = %27
  %33 = load i32, ptr @g_part_cnt, align 4, !tbaa !11
  %34 = load i32, ptr @g_node_cnt, align 4, !tbaa !11
  %35 = urem i32 %33, %34
  %36 = load i32, ptr @g_node_id, align 4, !tbaa !11
  %37 = icmp ne i32 %35, %36
  br i1 %37, label %38, label %41

38:                                               ; preds = %32
  %39 = load i64, ptr %5, align 8, !tbaa !9
  %40 = add i64 %39, 1
  store i64 %40, ptr %5, align 8, !tbaa !9
  br label %133

41:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %42 = getelementptr inbounds %class.YCSBWorkload, ptr %19, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = load i32, ptr %6, align 4, !tbaa !11
  %45 = zext i32 %44 to i64
  %46 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %43, ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %45, ptr noundef nonnull align 8 dereferenceable(8) %9)
  store i32 %46, ptr %4, align 4, !tbaa !27
  %47 = load i32, ptr %4, align 4, !tbaa !27
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %41
  br label %52

50:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv) #8
  unreachable

51:                                               ; No predecessors!
  br label %52

52:                                               ; preds = %51, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %53 = load i64, ptr %5, align 8, !tbaa !9
  store i64 %53, ptr %10, align 8, !tbaa !9
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load i64, ptr %10, align 8, !tbaa !9
  call void @_ZN5row_t15set_primary_keyEm(ptr noundef nonnull align 8 dereferenceable(64) %54, i64 noundef %55)
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64) %56, i32 noundef 0, ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %57 = getelementptr inbounds %class.YCSBWorkload, ptr %19, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  %59 = call noundef ptr @_ZN7table_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(68) %58)
  store ptr %59, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %60

60:                                               ; preds = %97, %52
  %61 = load i32, ptr %12, align 4, !tbaa !11
  %62 = zext i32 %61 to i64
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = call noundef i64 @_ZN7Catalog13get_field_cntEv(ptr noundef nonnull align 8 dereferenceable(60) %63)
  %65 = icmp ult i64 %62, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %60
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %100

67:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = load i32, ptr %12, align 4, !tbaa !11
  %70 = call noundef i64 @_ZN7Catalog14get_field_sizeEi(ptr noundef nonnull align 8 dereferenceable(60) %68, i32 noundef %69)
  %71 = trunc i64 %70 to i32
  store i32 %71, ptr %13, align 4, !tbaa !11
  %72 = load i32, ptr %13, align 4, !tbaa !11
  %73 = zext i32 %72 to i64
  %74 = call ptr @llvm.stacksave.p0()
  store ptr %74, ptr %14, align 8
  %75 = alloca i8, i64 %73, align 16
  store i64 %73, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %76

76:                                               ; preds = %90, %67
  %77 = load i32, ptr %16, align 4, !tbaa !11
  %78 = load i32, ptr %13, align 4, !tbaa !11
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %93

81:                                               ; preds = %76
  %82 = call i32 @rand() #7
  %83 = trunc i32 %82 to i8
  %84 = sext i8 %83 to i32
  %85 = srem i32 %84, 256
  %86 = trunc i32 %85 to i8
  %87 = load i32, ptr %16, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %75, i64 %88
  store i8 %86, ptr %89, align 1, !tbaa !29
  br label %90

90:                                               ; preds = %81
  %91 = load i32, ptr %16, align 4, !tbaa !11
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %16, align 4, !tbaa !11
  br label %76, !llvm.loop !30

93:                                               ; preds = %80
  %94 = load ptr, ptr %8, align 8, !tbaa !5
  %95 = load i32, ptr %12, align 4, !tbaa !11
  call void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64) %94, i32 noundef %95, ptr noundef %75)
  %96 = load ptr, ptr %14, align 8
  call void @llvm.stackrestore.p0(ptr %96)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %97

97:                                               ; preds = %93
  %98 = load i32, ptr %12, align 4, !tbaa !11
  %99 = add i32 %98, 1
  store i32 %99, ptr %12, align 4, !tbaa !11
  br label %60, !llvm.loop !32

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

104:                                              ; preds = %100
  br label %107

105:                                              ; preds = %100
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.9, i32 noundef 108, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv) #8
  unreachable

106:                                              ; No predecessors!
  br label %107

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

127:                                              ; preds = %107
  br label %130

128:                                              ; preds = %107
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.9, i32 noundef 114, ptr noundef @__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv) #8
  unreachable

129:                                              ; No predecessors!
  br label %130

130:                                              ; preds = %129, %127
  %131 = load i64, ptr %5, align 8, !tbaa !9
  %132 = add i64 %131, 1
  store i64 %132, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %133

133:                                              ; preds = %130, %38
  %134 = load i32, ptr %6, align 4, !tbaa !11
  %135 = add i32 %134, 1
  store i32 %135, ptr %6, align 4, !tbaa !11
  br label %22, !llvm.loop !42

136:                                              ; preds = %31, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %137 = load i32, ptr %7, align 4
  switch i32 %137, label %141 [
    i32 4, label %138
    i32 7, label %139
  ]

138:                                              ; preds = %136
  br label %20, !llvm.loop !43

139:                                              ; preds = %136
  %140 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 0, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %141

141:                                              ; preds = %139, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %142 = load i32, ptr %2, align 4
  ret i32 %142
}

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) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7table_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(68)) #4 align 2

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

; Function Attrs: nounwind
declare i32 @rand() #6

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) #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 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!14, !6, i64 128}
!14 = !{!"_ZTS12YCSBWorkload", !15, i64 0, !6, i64 120, !6, i64 128, !7, i64 136}
!15 = !{!"_ZTS8Workload", !16, i64 8, !24, i64 56, !10, i64 104, !10, 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, !10, 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 = !{!28, !28, i64 0}
!28 = !{!"_ZTS2RC", !7, i64 0}
!29 = !{!7, !7, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = distinct !{!32, !31}
!33 = !{!34, !35, i64 0}
!34 = !{!"_ZTS8itemid_t", !35, i64 0, !6, i64 8, !6, i64 16, !36, i64 24}
!35 = !{!"_ZTS9Data_type", !7, i64 0}
!36 = !{!"bool", !7, i64 0}
!37 = !{!34, !6, i64 8}
!38 = !{!34, !36, i64 24}
!39 = !{!14, !6, i64 120}
!40 = !{!41, !41, i64 0}
!41 = !{!"vtable pointer", !8, i64 0}
!42 = distinct !{!42, !31}
!43 = distinct !{!43, !31}


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

@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
@__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv = external hidden unnamed_addr constant [38 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
@.str.11 = external hidden unnamed_addr constant [40 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 uwtable
define dso_local noundef i32 @_ZN12YCSBWorkload10init_tableEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(176) %0) unnamed_addr #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 128
  %6 = getelementptr inbounds i8, ptr %0, i64 120
  %7 = load i32, ptr @g_part_cnt, align 4, !tbaa !5
  %.not51 = icmp ne i32 %7, 0
  tail call void @llvm.assume(i1 %.not51)
  br label %.split

.loopexit:                                        ; preds = %61, %.split
  %8 = phi i32 [ %10, %.split ], [ %62, %61 ]
  %9 = phi i32 [ 0, %.split ], [ %62, %61 ]
  %.1.lcssa = phi i64 [ %.0, %.split ], [ %.2, %61 ]
  br label %.split, !llvm.loop !9

.split:                                           ; preds = %1, %.loopexit
  %10 = phi i32 [ %8, %.loopexit ], [ %7, %1 ]
  %11 = phi i32 [ %9, %.loopexit ], [ %7, %1 ]
  %.0 = phi i64 [ %.1.lcssa, %.loopexit ], [ 0, %1 ]
  %.not52 = icmp eq i32 %11, 0
  br i1 %.not52, label %.loopexit, label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %.split
  %.pre58 = load i64, ptr @g_synth_table_size, align 8, !tbaa !11
  br label %.lr.ph50

.lr.ph50:                                         ; preds = %.lr.ph50.preheader, %61
  %12 = phi i32 [ %10, %.lr.ph50.preheader ], [ %62, %61 ]
  %13 = phi i64 [ %.pre58, %.lr.ph50.preheader ], [ %63, %61 ]
  %indvars.iv55 = phi i64 [ 0, %.lr.ph50.preheader ], [ %indvars.iv.next56, %61 ]
  %14 = phi i32 [ %11, %.lr.ph50.preheader ], [ %62, %61 ]
  %.148 = phi i64 [ %.0, %.lr.ph50.preheader ], [ %.2, %61 ]
  %15 = icmp ugt i64 %.148, %13
  br i1 %15, label %66, label %16

16:                                               ; preds = %.lr.ph50
  %17 = load i32, ptr @g_node_cnt, align 4, !tbaa !5
  %18 = urem i32 %14, %17
  %19 = load i32, ptr @g_node_id, align 4, !tbaa !5
  %.not = icmp eq i32 %18, %19
  br i1 %.not, label %20, label %61

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  store ptr null, ptr %2, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  %21 = load ptr, ptr %5, align 8, !tbaa !15
  %22 = call noundef i32 @_ZN7table_t11get_new_rowERP5row_tmRm(ptr noundef nonnull align 8 dereferenceable(68) %21, ptr noundef nonnull align 8 dereferenceable(8) %2, i64 noundef %indvars.iv55, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 93, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv) #10
  unreachable

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store i64 %.148, ptr %4, align 8, !tbaa !11
  %26 = load ptr, ptr %2, align 8, !tbaa !13
  call void @_ZN5row_t15set_primary_keyEm(ptr noundef nonnull align 8 dereferenceable(64) %26, i64 noundef %.148)
  %27 = load ptr, ptr %2, align 8, !tbaa !13
  call void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64) %27, i32 noundef 0, ptr noundef nonnull %4)
  %28 = load ptr, ptr %5, align 8, !tbaa !15
  %29 = call noundef ptr @_ZN7table_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(68) %28)
  %30 = call noundef i64 @_ZN7Catalog13get_field_cntEv(ptr noundef nonnull align 8 dereferenceable(60) %29)
  %.not53 = icmp eq i64 %30, 0
  br i1 %.not53, label %._crit_edge46, label %.lr.ph45

._crit_edge46:                                    ; preds = %._crit_edge, %25
  %31 = call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef 32)
  %.not36 = icmp eq ptr %31, null
  br i1 %.not36, label %46, label %47

.lr.ph45:                                         ; preds = %25, %._crit_edge
  %.03343 = phi i32 [ %39, %._crit_edge ], [ 0, %25 ]
  %32 = call noundef i64 @_ZN7Catalog14get_field_sizeEi(ptr noundef nonnull align 8 dereferenceable(60) %29, i32 noundef %.03343)
  %33 = trunc i64 %32 to i32
  %34 = and i64 %32, 4294967295
  %35 = call ptr @llvm.stacksave.p0()
  %36 = alloca i8, i64 %34, align 16
  %37 = icmp sgt i32 %33, 0
  br i1 %37, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph45
  %wide.trip.count = and i64 %32, 2147483647
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph45
  %38 = load ptr, ptr %2, align 8, !tbaa !13
  call void @_ZN5row_t9set_valueEiPv(ptr noundef nonnull align 8 dereferenceable(64) %38, i32 noundef %.03343, ptr noundef nonnull %36)
  call void @llvm.stackrestore.p0(ptr %35)
  %39 = add i32 %.03343, 1
  %40 = zext i32 %39 to i64
  %41 = call noundef i64 @_ZN7Catalog13get_field_cntEv(ptr noundef nonnull align 8 dereferenceable(60) %29)
  %42 = icmp ugt i64 %41, %40
  br i1 %42, label %.lr.ph45, label %._crit_edge46, !llvm.loop !29

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %43 = call i32 @rand() #9
  %44 = trunc i32 %43 to i8
  %45 = getelementptr inbounds i8, ptr %36, i64 %indvars.iv
  store i8 %44, ptr %45, align 1, !tbaa !31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !32

46:                                               ; preds = %._crit_edge46
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.9, i32 noundef 108, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv) #10
  unreachable

47:                                               ; preds = %._crit_edge46
  store i32 2, ptr %31, align 8, !tbaa !33
  %48 = load ptr, ptr %2, align 8, !tbaa !13
  %49 = getelementptr inbounds i8, ptr %31, i64 8
  store ptr %48, ptr %49, align 8, !tbaa !37
  %50 = getelementptr inbounds i8, ptr %31, i64 24
  store i8 1, ptr %50, align 8, !tbaa !38
  %51 = load i64, ptr %4, align 8, !tbaa !11
  %52 = load ptr, ptr %6, align 8, !tbaa !39
  %53 = load ptr, ptr %52, align 8, !tbaa !40
  %54 = getelementptr inbounds i8, ptr %53, i64 24
  %55 = load ptr, ptr %54, align 8
  %56 = trunc nuw i64 %indvars.iv55 to i32
  %57 = call noundef i32 %55(ptr noundef nonnull align 8 dereferenceable(40) %52, i64 noundef %51, ptr noundef nonnull %31, i32 noundef %56)
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %47
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, i32 noundef 114, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN12YCSBWorkload10init_tableEv) #10
  unreachable

60:                                               ; preds = %47
  %.pre = load i64, ptr @g_synth_table_size, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  %.pre59 = load i32, ptr @g_part_cnt, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %16, %60
  %62 = phi i32 [ %12, %16 ], [ %.pre59, %60 ]
  %63 = phi i64 [ %13, %16 ], [ %.pre, %60 ]
  %.2 = add i64 %.148, 1
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %64 = zext i32 %62 to i64
  %65 = icmp ult i64 %indvars.iv.next56, %64
  br i1 %65, label %.lr.ph50, label %.loopexit, !llvm.loop !42

66:                                               ; preds = %.lr.ph50
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  ret i32 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 #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 #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN7table_t10get_schemaEv(ptr noundef nonnull align 8 dereferenceable(68)) local_unnamed_addr #5 align 2

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #7

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #8

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 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 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 #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { 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 #8 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #9 = { nounwind }
attributes #10 = { 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.unswitch.partial.disable"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !14, i64 128}
!16 = !{!"_ZTS12YCSBWorkload", !17, i64 0, !14, i64 120, !14, i64 128, !7, i64 136}
!17 = !{!"_ZTS8Workload", !18, i64 8, !26, i64 56, !12, i64 104, !12, i64 112}
!18 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP7table_tSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !19, i64 0}
!19 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !20, i64 0}
!20 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P7table_tESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !21, i64 0, !23, i64 8}
!21 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE", !22, i64 0}
!22 = !{!"_ZTSSt4lessINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE"}
!23 = !{!"_ZTSSt15_Rb_tree_header", !24, i64 0, !12, i64 32}
!24 = !{!"_ZTSSt18_Rb_tree_node_base", !25, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!25 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!26 = !{!"_ZTSSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEP9IndexHashSt4lessIS5_ESaISt4pairIKS5_S7_EEE", !27, i64 0}
!27 = !{!"_ZTSSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE", !28, i64 0}
!28 = !{!"_ZTSNSt8_Rb_treeINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_P9IndexHashESt10_Select1stISA_ESt4lessIS5_ESaISA_EE13_Rb_tree_implISE_Lb1EEE", !21, i64 0, !23, i64 8}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!7, !7, i64 0}
!32 = distinct !{!32, !30}
!33 = !{!34, !35, i64 0}
!34 = !{!"_ZTS8itemid_t", !35, i64 0, !14, i64 8, !14, i64 16, !36, i64 24}
!35 = !{!"_ZTS9Data_type", !7, i64 0}
!36 = !{!"bool", !7, i64 0}
!37 = !{!34, !14, i64 8}
!38 = !{!34, !36, i64 24}
!39 = !{!16, !14, i64 120}
!40 = !{!41, !41, i64 0}
!41 = !{!"vtable pointer", !8, i64 0}
!42 = distinct !{!42, !30}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass