; LLVM IR from cvitatma/DSA :: 09-Hashing (test)

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

@__const.main.ielement = external hidden unnamed_addr constant [10 x i32], align 16
@__const.main.isearchfor = external hidden unnamed_addr constant [5 x i32], align 16
@__const.main.idelete = external hidden unnamed_addr constant [5 x i32], align 16
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca [10 x i32], align 16
  %3 = alloca i32, align 4
  %4 = alloca [5 x i32], align 16
  %5 = alloca [5 x i32], align 16
  %6 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 40, ptr %2) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.main.ielement, i64 40, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 20, ptr %4) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.main.isearchfor, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr %5) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const.main.idelete, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %7 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %8 = call ptr @CreateHashTable(i32 noundef 15000)
  store ptr %8, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %17, %0
  %10 = load i32, ptr %3, align 4, !tbaa !9
  %11 = icmp slt i32 %10, 1000
  br i1 %11, label %12, label %20

12:                                               ; preds = %9
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %13)
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  call void @InsertElement(i32 noundef %15, ptr noundef %16)
  br label %17

17:                                               ; preds = %12
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %3, align 4, !tbaa !9
  br label %9, !llvm.loop !11

20:                                               ; preds = %9
  %21 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %43, %20
  %23 = load i32, ptr %3, align 4, !tbaa !9
  %24 = icmp slt i32 %23, 5
  br i1 %24, label %25, label %46

25:                                               ; preds = %22
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %29)
  %31 = load i32, ptr %3, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = call ptr @FindInTable(i32 noundef %34, ptr noundef %35)
  %37 = icmp ne ptr %36, null
  br i1 %37, label %38, label %40

38:                                               ; preds = %25
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %42

40:                                               ; preds = %25
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %42

42:                                               ; preds = %40, %38
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %3, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %3, align 4, !tbaa !9
  br label %22, !llvm.loop !13

46:                                               ; preds = %22
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %75, %46
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = icmp slt i32 %49, 5
  br i1 %50, label %51, label %78

51:                                               ; preds = %48
  %52 = load i32, ptr %3, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %55)
  %57 = load i32, ptr %3, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !9
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  call void @DeleteElement(i32 noundef %60, ptr noundef %61)
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  %63 = load i32, ptr %3, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = call ptr @FindInTable(i32 noundef %66, ptr noundef %67)
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %72

70:                                               ; preds = %51
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %74

72:                                               ; preds = %51
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  br label %74

74:                                               ; preds = %72, %70
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %3, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %3, align 4, !tbaa !9
  br label %48, !llvm.loop !14

78:                                               ; preds = %48
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  call void @DeleteHashTable(ptr noundef %80)
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %2) #4
  ret i32 0
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

declare ptr @CreateHashTable(i32 noundef) #3

declare void @InsertElement(i32 noundef, ptr noundef) #3

declare ptr @FindInTable(i32 noundef, ptr noundef) #3

declare void @DeleteElement(i32 noundef, ptr noundef) #3

declare void @DeleteHashTable(ptr noundef) #3

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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/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 = distinct !{!14, !12}


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

@__const.main.isearchfor = external hidden unnamed_addr constant [5 x i32], align 16
@__const.main.idelete = external hidden unnamed_addr constant [5 x i32], align 16
@.str = external hidden unnamed_addr constant [40 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %2 = tail call ptr @CreateHashTable(i32 noundef 15000) #3
  br label %3

3:                                                ; preds = %0, %3
  %.018 = phi i32 [ 0, %0 ], [ %5, %3 ]
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.018)
  tail call void @InsertElement(i32 noundef %.018, ptr noundef %2) #3
  %5 = add nuw nsw i32 %.018, 1
  %exitcond.not = icmp eq i32 %5, 1000
  br i1 %exitcond.not, label %6, label %3, !llvm.loop !5

6:                                                ; preds = %3
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %8 = load i32, ptr @__const.main.isearchfor, align 16, !tbaa !7
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %8)
  %10 = tail call ptr @FindInTable(i32 noundef %8, ptr noundef %2) #3
  %.not17 = icmp eq ptr %10, null
  %.str.5..str.4 = select i1 %.not17, ptr @.str.5, ptr @.str.4
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5..str.4)
  %12 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.isearchfor, i64 4), align 4, !tbaa !7
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %12)
  %14 = tail call ptr @FindInTable(i32 noundef %12, ptr noundef %2) #3
  %.not17.1 = icmp eq ptr %14, null
  %.str.5.sink = select i1 %.not17.1, ptr @.str.5, ptr @.str.4
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink)
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.isearchfor, i64 8), align 8, !tbaa !7
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %16)
  %18 = tail call ptr @FindInTable(i32 noundef %16, ptr noundef %2) #3
  %.not17.2 = icmp eq ptr %18, null
  %.str.5.sink25 = select i1 %.not17.2, ptr @.str.5, ptr @.str.4
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink25)
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.isearchfor, i64 12), align 4, !tbaa !7
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %20)
  %22 = tail call ptr @FindInTable(i32 noundef %20, ptr noundef %2) #3
  %.not17.3 = icmp eq ptr %22, null
  %.str.5.sink26 = select i1 %.not17.3, ptr @.str.5, ptr @.str.4
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink26)
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.isearchfor, i64 16), align 16, !tbaa !7
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %24)
  %26 = tail call ptr @FindInTable(i32 noundef %24, ptr noundef %2) #3
  %.not17.4 = icmp eq ptr %26, null
  %.str.5.sink27 = select i1 %.not17.4, ptr @.str.5, ptr @.str.4
  %27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink27)
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %29 = load i32, ptr @__const.main.idelete, align 16, !tbaa !7
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %29)
  tail call void @DeleteElement(i32 noundef %29, ptr noundef %2) #3
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %32 = tail call ptr @FindInTable(i32 noundef %29, ptr noundef %2) #3
  %.not = icmp eq ptr %32, null
  %.str.4.sink28 = select i1 %.not, ptr @.str.5, ptr @.str.4
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4.sink28)
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.idelete, i64 4), align 4, !tbaa !7
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %34)
  tail call void @DeleteElement(i32 noundef %34, ptr noundef %2) #3
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %37 = tail call ptr @FindInTable(i32 noundef %34, ptr noundef %2) #3
  %.not.1 = icmp eq ptr %37, null
  %.str.5.sink29 = select i1 %.not.1, ptr @.str.5, ptr @.str.4
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink29)
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.idelete, i64 8), align 8, !tbaa !7
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %39)
  tail call void @DeleteElement(i32 noundef %39, ptr noundef %2) #3
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %42 = tail call ptr @FindInTable(i32 noundef %39, ptr noundef %2) #3
  %.not.2 = icmp eq ptr %42, null
  %.str.5.sink30 = select i1 %.not.2, ptr @.str.5, ptr @.str.4
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink30)
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.idelete, i64 12), align 4, !tbaa !7
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %44)
  tail call void @DeleteElement(i32 noundef %44, ptr noundef %2) #3
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %47 = tail call ptr @FindInTable(i32 noundef %44, ptr noundef %2) #3
  %.not.3 = icmp eq ptr %47, null
  %.str.5.sink31 = select i1 %.not.3, ptr @.str.5, ptr @.str.4
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink31)
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @__const.main.idelete, i64 16), align 16, !tbaa !7
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %49)
  tail call void @DeleteElement(i32 noundef %49, ptr noundef %2) #3
  %51 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  %52 = tail call ptr @FindInTable(i32 noundef %49, ptr noundef %2) #3
  %.not.4 = icmp eq ptr %52, null
  %.str.5.sink32 = select i1 %.not.4, ptr @.str.5, ptr @.str.4
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink32)
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  tail call void @DeleteHashTable(ptr noundef %2) #3
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  ret i32 0
}

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

declare ptr @CreateHashTable(i32 noundef) local_unnamed_addr #2

declare void @InsertElement(i32 noundef, ptr noundef) local_unnamed_addr #2

declare ptr @FindInTable(i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @DeleteElement(i32 noundef, ptr noundef) local_unnamed_addr #2

declare void @DeleteHashTable(ptr noundef) local_unnamed_addr #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 = { 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 = { "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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass