; LLVM IR from MostafaTwfiq/C-DataStructures-And-Algorithms :: DataStructure/Tables/Sources (HashMap)

; 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.HashMap = type { ptr, i32, i32, i32, ptr, ptr, ptr, ptr }
%struct.Entry = type { ptr, ptr, ptr, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [10 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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @getNextPrime(i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @calBPrime(i32 noundef) #4

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

16:                                               ; preds = %3
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.9, ptr noundef @.str.7, ptr noundef @.str.2) #6
  call void @exit(i32 noundef -83386157) #7
  unreachable

19:                                               ; preds = %3
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %19
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str, ptr noundef @.str.10, ptr noundef @.str.2) #6
  call void @exit(i32 noundef -83384987) #7
  unreachable

25:                                               ; preds = %19
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str, ptr noundef @.str.11, ptr noundef @.str.2) #6
  call void @exit(i32 noundef -83384987) #7
  unreachable

31:                                               ; preds = %25
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.HashMap, ptr %34, i32 0, i32 2
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.HashMap, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !12
  %40 = icmp eq i32 %36, %39
  br i1 %40, label %41, label %95

41:                                               ; preds = %33
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.HashMap, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 8, !tbaa !12
  %45 = mul nsw i32 %44, 2
  %46 = call i32 @getNextPrime(i32 noundef %45)
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.HashMap, ptr %47, i32 0, i32 1
  store i32 %46, ptr %48, align 8, !tbaa !12
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.HashMap, ptr %49, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !13
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.HashMap, ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 8, !tbaa !12
  %55 = sext i32 %54 to i64
  %56 = mul i64 8, %55
  %57 = call ptr @realloc(ptr noundef %51, i64 noundef %56) #8
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.HashMap, ptr %58, i32 0, i32 0
  store ptr %57, ptr %59, align 8, !tbaa !13
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.HashMap, ptr %60, i32 0, i32 0
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %67

64:                                               ; preds = %41
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.12, ptr noundef @.str.13, ptr noundef @.str.2) #6
  call void @exit(i32 noundef -833814245) #7
  unreachable

67:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.HashMap, ptr %68, i32 0, i32 2
  %70 = load i32, ptr %69, align 4, !tbaa !9
  store i32 %70, ptr %7, align 4, !tbaa !14
  br label %71

71:                                               ; preds = %85, %67
  %72 = load i32, ptr %7, align 4, !tbaa !14
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.HashMap, ptr %73, i32 0, i32 1
  %75 = load i32, ptr %74, align 8, !tbaa !12
  %76 = icmp slt i32 %72, %75
  br i1 %76, label %78, label %77

77:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %88

78:                                               ; preds = %71
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.HashMap, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !13
  %82 = load i32, ptr %7, align 4, !tbaa !14
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %81, i64 %83
  store ptr null, ptr %84, align 8, !tbaa !5
  br label %85

85:                                               ; preds = %78
  %86 = load i32, ptr %7, align 4, !tbaa !14
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %7, align 4, !tbaa !14
  br label %71, !llvm.loop !15

88:                                               ; preds = %77
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.HashMap, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !12
  %92 = call i32 @calBPrime(i32 noundef %91)
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.HashMap, ptr %93, i32 0, i32 3
  store i32 %92, ptr %94, align 8, !tbaa !17
  br label %95

95:                                               ; preds = %88, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.HashMap, ptr %96, i32 0, i32 7
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.HashMap, ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 8, !tbaa !12
  %103 = call i32 @hashMapFHashCal(ptr noundef %98, ptr noundef %99, i32 noundef %102)
  store i32 %103, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.HashMap, ptr %104, i32 0, i32 7
  %106 = load ptr, ptr %105, align 8, !tbaa !18
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.HashMap, ptr %108, i32 0, i32 3
  %110 = load i32, ptr %109, align 8, !tbaa !17
  %111 = call i32 @hashMapSHashCal(ptr noundef %106, ptr noundef %107, i32 noundef %110)
  store i32 %111, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %112 = load i32, ptr %8, align 4, !tbaa !14
  %113 = load i32, ptr %9, align 4, !tbaa !14
  %114 = load i32, ptr %10, align 4, !tbaa !14
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.HashMap, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 8, !tbaa !12
  %118 = call i32 @calIndex(i32 noundef %112, i32 noundef %113, i32 noundef %114, i32 noundef %117)
  store i32 %118, ptr %11, align 4, !tbaa !14
  br label %119

119:                                              ; preds = %187, %95
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.HashMap, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !13
  %123 = load i32, ptr %11, align 4, !tbaa !14
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds ptr, ptr %122, i64 %124
  %126 = load ptr, ptr %125, align 8, !tbaa !5
  %127 = icmp ne ptr %126, null
  br i1 %127, label %128, label %197

128:                                              ; preds = %119
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.HashMap, ptr %129, i32 0, i32 6
  %131 = load ptr, ptr %130, align 8, !tbaa !19
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.HashMap, ptr %133, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !13
  %136 = load i32, ptr %11, align 4, !tbaa !14
  %137 = zext i32 %136 to i64
  %138 = getelementptr inbounds ptr, ptr %135, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.Entry, ptr %139, i32 0, i32 0
  %141 = load ptr, ptr %140, align 8, !tbaa !20
  %142 = call i32 %131(ptr noundef %132, ptr noundef %141)
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %144, label %187

144:                                              ; preds = %128
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.HashMap, ptr %145, i32 0, i32 4
  %147 = load ptr, ptr %146, align 8, !tbaa !22
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.HashMap, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !13
  %151 = load i32, ptr %11, align 4, !tbaa !14
  %152 = zext i32 %151 to i64
  %153 = getelementptr inbounds ptr, ptr %150, i64 %152
  %154 = load ptr, ptr %153, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.Entry, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !23
  call void %147(ptr noundef %156)
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.HashMap, ptr %157, i32 0, i32 5
  %159 = load ptr, ptr %158, align 8, !tbaa !24
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.HashMap, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !13
  %163 = load i32, ptr %11, align 4, !tbaa !14
  %164 = zext i32 %163 to i64
  %165 = getelementptr inbounds ptr, ptr %162, i64 %164
  %166 = load ptr, ptr %165, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.Entry, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !20
  call void %159(ptr noundef %168)
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.HashMap, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !13
  %173 = load i32, ptr %11, align 4, !tbaa !14
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds ptr, ptr %172, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.Entry, ptr %176, i32 0, i32 0
  store ptr %169, ptr %177, align 8, !tbaa !20
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.HashMap, ptr %179, i32 0, i32 0
  %181 = load ptr, ptr %180, align 8, !tbaa !13
  %182 = load i32, ptr %11, align 4, !tbaa !14
  %183 = zext i32 %182 to i64
  %184 = getelementptr inbounds ptr, ptr %181, i64 %183
  %185 = load ptr, ptr %184, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.Entry, ptr %185, i32 0, i32 1
  store ptr %178, ptr %186, align 8, !tbaa !23
  store i32 1, ptr %12, align 4
  br label %232

187:                                              ; preds = %128
  %188 = load i32, ptr %10, align 4, !tbaa !14
  %189 = add i32 %188, 1
  store i32 %189, ptr %10, align 4, !tbaa !14
  %190 = load i32, ptr %8, align 4, !tbaa !14
  %191 = load i32, ptr %9, align 4, !tbaa !14
  %192 = load i32, ptr %10, align 4, !tbaa !14
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.HashMap, ptr %193, i32 0, i32 1
  %195 = load i32, ptr %194, align 8, !tbaa !12
  %196 = call i32 @calIndex(i32 noundef %190, i32 noundef %191, i32 noundef %192, i32 noundef %195)
  store i32 %196, ptr %11, align 4, !tbaa !14
  br label %119, !llvm.loop !25

197:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %198 = call noalias ptr @malloc(i64 noundef 32) #9
  store ptr %198, ptr %13, align 8, !tbaa !5
  %199 = load ptr, ptr %13, align 8, !tbaa !5
  %200 = icmp eq ptr %199, null
  br i1 %200, label %201, label %204

201:                                              ; preds = %197
  %202 = load ptr, ptr @stderr, align 8, !tbaa !5
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %202, ptr noundef @.str.6, ptr noundef @.str.14, ptr noundef @.str.2) #6
  call void @exit(i32 noundef -833811484) #7
  unreachable

204:                                              ; preds = %197
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = load ptr, ptr %13, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.Entry, ptr %206, i32 0, i32 0
  store ptr %205, ptr %207, align 8, !tbaa !20
  %208 = load ptr, ptr %6, align 8, !tbaa !5
  %209 = load ptr, ptr %13, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.Entry, ptr %209, i32 0, i32 1
  store ptr %208, ptr %210, align 8, !tbaa !23
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.HashMap, ptr %211, i32 0, i32 4
  %213 = load ptr, ptr %212, align 8, !tbaa !22
  %214 = load ptr, ptr %13, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.Entry, ptr %214, i32 0, i32 2
  store ptr %213, ptr %215, align 8, !tbaa !26
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.HashMap, ptr %216, i32 0, i32 5
  %218 = load ptr, ptr %217, align 8, !tbaa !24
  %219 = load ptr, ptr %13, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.Entry, ptr %219, i32 0, i32 3
  store ptr %218, ptr %220, align 8, !tbaa !27
  %221 = load ptr, ptr %13, align 8, !tbaa !5
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.HashMap, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !13
  %225 = load i32, ptr %11, align 4, !tbaa !14
  %226 = zext i32 %225 to i64
  %227 = getelementptr inbounds ptr, ptr %224, i64 %226
  store ptr %221, ptr %227, align 8, !tbaa !5
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.HashMap, ptr %228, i32 0, i32 2
  %230 = load i32, ptr %229, align 4, !tbaa !9
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %229, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  store i32 0, ptr %12, align 4
  br label %232

232:                                              ; preds = %204, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %233 = load i32, ptr %12, align 4
  switch i32 %233, label %235 [
    i32 0, label %234
    i32 1, label %234
  ]

234:                                              ; preds = %232, %232
  ret void

235:                                              ; preds = %232
  unreachable
}

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @hashMapFHashCal(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @hashMapSHashCal(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @calIndex(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #4

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

!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, !11, i64 12}
!10 = !{!"HashMap", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !6, i64 0}
!14 = !{!11, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!10, !11, i64 16}
!18 = !{!10, !6, i64 48}
!19 = !{!10, !6, i64 40}
!20 = !{!21, !6, i64 0}
!21 = !{!"Entry", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!10, !6, i64 24}
!23 = !{!21, !6, i64 8}
!24 = !{!10, !6, i64 32}
!25 = distinct !{!25, !16}
!26 = !{!21, !6, i64 16}
!27 = !{!21, !6, i64 24}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @getNextPrime(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @calBPrime(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @hashMapInsert(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %5, label %8

5:                                                ; preds = %3
  %6 = load ptr, ptr @stderr, align 8, !tbaa !5
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2) #5
  tail call void @exit(i32 noundef -83386157) #6
  unreachable

8:                                                ; preds = %3
  %9 = icmp eq ptr %1, null
  br i1 %9, label %10, label %13

10:                                               ; preds = %8
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.2) #5
  tail call void @exit(i32 noundef -83384987) #6
  unreachable

13:                                               ; preds = %8
  %14 = icmp eq ptr %2, null
  br i1 %14, label %15, label %18

15:                                               ; preds = %13
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.2) #5
  tail call void @exit(i32 noundef -83384987) #6
  unreachable

18:                                               ; preds = %13
  %19 = getelementptr inbounds i8, ptr %0, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %0, i64 8
  %22 = load i32, ptr %21, align 8, !tbaa !12
  %23 = icmp eq i32 %20, %22
  br i1 %23, label %24, label %58

24:                                               ; preds = %18
  %25 = shl nsw i32 %20, 1
  %26 = tail call i32 @getNextPrime(i32 noundef %25)
  store i32 %26, ptr %21, align 8, !tbaa !12
  %27 = load ptr, ptr %0, align 8, !tbaa !13
  %28 = sext i32 %26 to i64
  %29 = shl nsw i64 %28, 3
  %30 = tail call ptr @realloc(ptr noundef %27, i64 noundef %29) #7
  store ptr %30, ptr %0, align 8, !tbaa !13
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %35

32:                                               ; preds = %24
  %33 = load ptr, ptr @stderr, align 8, !tbaa !5
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.2) #5
  tail call void @exit(i32 noundef -833814245) #6
  unreachable

35:                                               ; preds = %24
  %36 = load i32, ptr %19, align 4, !tbaa !9
  %37 = load i32, ptr %21, align 8, !tbaa !12
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %35
  %39 = sext i32 %36 to i64
  %wide.trip.count = sext i32 %37 to i64
  %40 = sub nsw i64 %wide.trip.count, %39
  %xtraiter = and i64 %40, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %39, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %41 = load ptr, ptr %0, align 8, !tbaa !13
  %42 = getelementptr inbounds ptr, ptr %41, i64 %indvars.iv.prol
  store ptr null, ptr %42, align 8, !tbaa !5
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !14

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ %39, %.lr.ph.preheader ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %43 = sub nsw i64 %39, %wide.trip.count
  %44 = icmp ugt i64 %43, -4
  br i1 %44, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %35
  %45 = tail call i32 @calBPrime(i32 noundef %37)
  %46 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %45, ptr %46, align 8, !tbaa !16
  %.pre = load i32, ptr %21, align 8, !tbaa !12
  br label %58

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %47 = load ptr, ptr %0, align 8, !tbaa !13
  %48 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv
  store ptr null, ptr %48, align 8, !tbaa !5
  %49 = load ptr, ptr %0, align 8, !tbaa !13
  %50 = getelementptr ptr, ptr %49, i64 %indvars.iv
  %51 = getelementptr i8, ptr %50, i64 8
  store ptr null, ptr %51, align 8, !tbaa !5
  %52 = load ptr, ptr %0, align 8, !tbaa !13
  %53 = getelementptr ptr, ptr %52, i64 %indvars.iv
  %54 = getelementptr i8, ptr %53, i64 16
  store ptr null, ptr %54, align 8, !tbaa !5
  %55 = load ptr, ptr %0, align 8, !tbaa !13
  %56 = getelementptr ptr, ptr %55, i64 %indvars.iv
  %57 = getelementptr i8, ptr %56, i64 24
  store ptr null, ptr %57, align 8, !tbaa !5
  %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !17

58:                                               ; preds = %._crit_edge, %18
  %59 = phi i32 [ %.pre, %._crit_edge ], [ %22, %18 ]
  %60 = getelementptr inbounds i8, ptr %0, i64 48
  %61 = load ptr, ptr %60, align 8, !tbaa !19
  %62 = tail call i32 @hashMapFHashCal(ptr noundef %61, ptr noundef nonnull %1, i32 noundef %59)
  %63 = load ptr, ptr %60, align 8, !tbaa !19
  %64 = getelementptr inbounds i8, ptr %0, i64 16
  %65 = load i32, ptr %64, align 8, !tbaa !16
  %66 = tail call i32 @hashMapSHashCal(ptr noundef %63, ptr noundef nonnull %1, i32 noundef %65)
  %67 = load i32, ptr %21, align 8, !tbaa !12
  %68 = tail call i32 @calIndex(i32 noundef %62, i32 noundef %66, i32 noundef 0, i32 noundef %67)
  %69 = load ptr, ptr %0, align 8, !tbaa !13
  %70 = zext i32 %68 to i64
  %71 = getelementptr inbounds ptr, ptr %69, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %.not80 = icmp eq ptr %72, null
  br i1 %.not80, label %._crit_edge84, label %.lr.ph83

.lr.ph83:                                         ; preds = %58
  %73 = getelementptr inbounds i8, ptr %0, i64 40
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = load ptr, ptr %72, align 8, !tbaa !21
  %76 = tail call i32 %74(ptr noundef nonnull %1, ptr noundef %75) #8
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %._crit_edge99, label %.lr.ph98

78:                                               ; preds = %.lr.ph98
  %79 = load ptr, ptr %73, align 8, !tbaa !20
  %80 = load ptr, ptr %107, align 8, !tbaa !21
  %81 = tail call i32 %79(ptr noundef nonnull %1, ptr noundef %80) #8
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %._crit_edge99, label %.lr.ph98, !llvm.loop !23

._crit_edge99:                                    ; preds = %78, %.lr.ph83
  %.lcssa = phi i64 [ %70, %.lr.ph83 ], [ %105, %78 ]
  %83 = getelementptr inbounds i8, ptr %0, i64 24
  %84 = load ptr, ptr %83, align 8, !tbaa !24
  %85 = load ptr, ptr %0, align 8, !tbaa !13
  %86 = getelementptr inbounds ptr, ptr %85, i64 %.lcssa
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i64 8
  %89 = load ptr, ptr %88, align 8, !tbaa !25
  tail call void %84(ptr noundef %89) #8
  %90 = getelementptr inbounds i8, ptr %0, i64 32
  %91 = load ptr, ptr %90, align 8, !tbaa !26
  %92 = load ptr, ptr %0, align 8, !tbaa !13
  %93 = getelementptr inbounds ptr, ptr %92, i64 %.lcssa
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = load ptr, ptr %94, align 8, !tbaa !21
  tail call void %91(ptr noundef %95) #8
  %96 = load ptr, ptr %0, align 8, !tbaa !13
  %97 = getelementptr inbounds ptr, ptr %96, i64 %.lcssa
  %98 = load ptr, ptr %97, align 8, !tbaa !5
  store ptr %1, ptr %98, align 8, !tbaa !21
  %99 = load ptr, ptr %97, align 8, !tbaa !5
  %100 = getelementptr inbounds i8, ptr %99, i64 8
  store ptr %2, ptr %100, align 8, !tbaa !25
  br label %121

.lr.ph98:                                         ; preds = %.lr.ph83, %78
  %.0658197 = phi i32 [ %101, %78 ], [ 0, %.lr.ph83 ]
  %101 = add i32 %.0658197, 1
  %102 = load i32, ptr %21, align 8, !tbaa !12
  %103 = tail call i32 @calIndex(i32 noundef %62, i32 noundef %66, i32 noundef %101, i32 noundef %102)
  %104 = load ptr, ptr %0, align 8, !tbaa !13
  %105 = zext i32 %103 to i64
  %106 = getelementptr inbounds ptr, ptr %104, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %.not = icmp eq ptr %107, null
  br i1 %.not, label %._crit_edge84, label %78, !llvm.loop !23

._crit_edge84:                                    ; preds = %.lr.ph98, %58
  %.lcssa79 = phi i64 [ %70, %58 ], [ %105, %.lr.ph98 ]
  %.lcssa78 = phi ptr [ %69, %58 ], [ %104, %.lr.ph98 ]
  %108 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %113

110:                                              ; preds = %._crit_edge84
  %111 = load ptr, ptr @stderr, align 8, !tbaa !5
  %112 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.2) #5
  tail call void @exit(i32 noundef -833811484) #6
  unreachable

113:                                              ; preds = %._crit_edge84
  %114 = getelementptr inbounds ptr, ptr %.lcssa78, i64 %.lcssa79
  store ptr %1, ptr %108, align 8, !tbaa !21
  %115 = getelementptr inbounds i8, ptr %108, i64 8
  store ptr %2, ptr %115, align 8, !tbaa !25
  %116 = getelementptr inbounds i8, ptr %0, i64 24
  %117 = getelementptr inbounds i8, ptr %108, i64 16
  %118 = load <2 x ptr>, ptr %116, align 8, !tbaa !5
  store <2 x ptr> %118, ptr %117, align 8, !tbaa !5
  store ptr %108, ptr %114, align 8, !tbaa !5
  %119 = load i32, ptr %19, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %19, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %113, %._crit_edge99
  ret void
}

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @hashMapFHashCal(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @hashMapSHashCal(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @calIndex(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { 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 #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,uninitialized") allocsize(0) 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 = { 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 #4 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 = { cold nounwind }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind allocsize(1) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }

!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, !11, i64 12}
!10 = !{!"HashMap", !6, i64 0, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = !{!10, !11, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !6, i64 48}
!20 = !{!10, !6, i64 40}
!21 = !{!22, !6, i64 0}
!22 = !{!"Entry", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!23 = distinct !{!23, !18}
!24 = !{!10, !6, i64 24}
!25 = !{!22, !6, i64 8}
!26 = !{!10, !6, i64 32}


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