; LLVM IR from maksimandrianov/cdcontainers :: src (hash-table)

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

%struct.cdc_data_info = type { ptr, ptr, ptr, ptr, ptr, i64, i64 }
%struct.cdc_hash_table = type { ptr, ptr, i64, double, i64, ptr }

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@__PRETTY_FUNCTION__.cdc_hash_table_ctor1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @cdc_hash_table_ctor1(ptr noundef %0, ptr noundef %1, double noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !9
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %13, label %14

13:                                               ; preds = %3
  br label %15

14:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 283, ptr noundef @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #6
  unreachable

15:                                               ; preds = %13
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = icmp ne ptr %16, null
  br i1 %17, label %18, label %24

18:                                               ; preds = %15
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.cdc_data_info, ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = icmp ne ptr %21, null
  br i1 %22, label %23, label %24

23:                                               ; preds = %18
  br label %25

24:                                               ; preds = %18, %15
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 284, ptr noundef @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #6
  unreachable

25:                                               ; preds = %23
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %34

28:                                               ; preds = %25
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.cdc_data_info, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  br label %35

34:                                               ; preds = %28, %25
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 285, ptr noundef @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #6
  unreachable

35:                                               ; preds = %33
  %36 = load double, ptr %7, align 8, !tbaa !9
  %37 = fcmp ogt double %36, 0.000000e+00
  br i1 %37, label %38, label %39

38:                                               ; preds = %35
  br label %40

39:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 286, ptr noundef @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #6
  unreachable

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %41 = call noalias ptr @calloc(i64 noundef 48, i64 noundef 1) #8
  store ptr %41, ptr %8, align 8, !tbaa !5
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = icmp ne ptr %42, null
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %76

45:                                               ; preds = %40
  %46 = load double, ptr %7, align 8, !tbaa !9
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.cdc_hash_table, ptr %47, i32 0, i32 3
  store double %46, ptr %48, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !17
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %51, label %58

51:                                               ; preds = %45
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = call ptr @cdc_di_shared_ctorc(ptr noundef %52)
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.cdc_hash_table, ptr %54, i32 0, i32 5
  store ptr %53, ptr %55, align 8, !tbaa !19
  %56 = icmp ne ptr %53, null
  br i1 %56, label %58, label %57

57:                                               ; preds = %51
  store i32 1, ptr %10, align 4, !tbaa !17
  br label %72

58:                                               ; preds = %51, %45
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = call i32 @reallocate(ptr noundef %59, i64 noundef 8)
  store i32 %60, ptr %10, align 4, !tbaa !17
  %61 = load i32, ptr %10, align 4, !tbaa !17
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %64

63:                                               ; preds = %58
  br label %68

64:                                               ; preds = %58
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %65, ptr %66, align 8, !tbaa !5
  %67 = load i32, ptr %10, align 4, !tbaa !17
  store i32 %67, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %75

68:                                               ; preds = %63
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.cdc_hash_table, ptr %69, i32 0, i32 5
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  call void @cdc_di_shared_dtor(ptr noundef %71)
  br label %72

72:                                               ; preds = %68, %57
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %73) #7
  %74 = load i32, ptr %10, align 4, !tbaa !17
  store i32 %74, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %75

75:                                               ; preds = %72, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %76

76:                                               ; preds = %75, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %77 = load i32, ptr %4, align 4
  ret i32 %77
}

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

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #3

declare ptr @cdc_di_shared_ctorc(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @reallocate(ptr noundef, i64 noundef) #0

declare void @cdc_di_shared_dtor(ptr noundef) #4

; Function Attrs: nounwind
declare void @free(ptr noundef) #5

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

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

!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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"cdc_data_info", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !13, i64 40, !13, i64 48}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 16}
!15 = !{!16, !10, i64 24}
!16 = !{!"cdc_hash_table", !6, i64 0, !6, i64 8, !13, i64 16, !10, i64 24, !13, i64 32, !6, i64 40}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!16, !6, i64 40}


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

@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [79 x i8], align 1
@__PRETTY_FUNCTION__.cdc_hash_table_ctor1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @cdc_hash_table_ctor1(ptr noundef writeonly %0, ptr noundef %1, double noundef %2) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 283, ptr noundef nonnull @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #5
  unreachable

5:                                                ; preds = %3
  %.not27 = icmp eq ptr %1, null
  br i1 %.not27, label %9, label %6

6:                                                ; preds = %5
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %.not28 = icmp eq ptr %8, null
  br i1 %.not28, label %9, label %10

9:                                                ; preds = %6, %5
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 284, ptr noundef nonnull @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #5
  unreachable

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %.not29 = icmp eq ptr %12, null
  br i1 %.not29, label %13, label %14

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 285, ptr noundef nonnull @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #5
  unreachable

14:                                               ; preds = %10
  %15 = fcmp ogt double %2, 0.000000e+00
  br i1 %15, label %17, label %16

16:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 286, ptr noundef nonnull @__PRETTY_FUNCTION__.cdc_hash_table_ctor1) #5
  unreachable

17:                                               ; preds = %14
  %18 = tail call noalias dereferenceable_or_null(48) ptr @calloc(i64 noundef 48, i64 noundef 1) #6
  %.not30 = icmp eq ptr %18, null
  br i1 %.not30, label %29, label %19

19:                                               ; preds = %17
  %20 = getelementptr inbounds i8, ptr %18, i64 24
  store double %2, ptr %20, align 8, !tbaa !12
  %21 = tail call ptr @cdc_di_shared_ctorc(ptr noundef nonnull %1) #7
  %22 = getelementptr inbounds i8, ptr %18, i64 40
  store ptr %21, ptr %22, align 8, !tbaa !15
  %.not31 = icmp eq ptr %21, null
  br i1 %.not31, label %28, label %23

23:                                               ; preds = %19
  %24 = tail call i32 @reallocate(ptr noundef nonnull %18, i64 noundef 8)
  %.not32 = icmp eq i32 %24, 0
  br i1 %.not32, label %25, label %26

25:                                               ; preds = %23
  store ptr %18, ptr %0, align 8, !tbaa !16
  br label %29

26:                                               ; preds = %23
  %27 = load ptr, ptr %22, align 8, !tbaa !15
  tail call void @cdc_di_shared_dtor(ptr noundef %27) #7
  br label %28

28:                                               ; preds = %19, %26
  %.0 = phi i32 [ %24, %26 ], [ 1, %19 ]
  tail call void @free(ptr noundef nonnull %18) #7
  br label %29

29:                                               ; preds = %25, %28, %17
  %.1 = phi i32 [ 1, %17 ], [ %.0, %28 ], [ 0, %25 ]
  ret i32 %.1
}

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

declare ptr @cdc_di_shared_ctorc(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @reallocate(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @cdc_di_shared_dtor(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 24}
!6 = !{!"cdc_data_info", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 48}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !7, i64 16}
!12 = !{!13, !14, i64 24}
!13 = !{!"cdc_hash_table", !7, i64 0, !7, i64 8, !10, i64 16, !14, i64 24, !10, i64 32, !7, i64 40}
!14 = !{!"double", !8, i64 0}
!15 = !{!13, !7, i64 40}
!16 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass