; LLVM IR from begeekmyfriend/leetcode :: 0049_group_anagrams (anagrams)

; 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.word_hash = type { ptr, i32, [10 x i32] }

; Function Attrs: nounwind uwtable
define dso_local ptr @groupAnagrams(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %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
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %20 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %20, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %21 = load i32, ptr %12, align 4, !tbaa !9
  %22 = sext i32 %21 to i64
  %23 = call noalias ptr @calloc(i64 noundef %22, i64 noundef 56) #9
  store ptr %23, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = mul i64 %25, 8
  %27 = call noalias ptr @malloc(i64 noundef %26) #10
  store ptr %27, ptr %14, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %142, %4
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %32, label %145

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds ptr, ptr %33, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = call i64 @strlen(ptr noundef %37) #11
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr %15, align 4, !tbaa !9
  %40 = load i32, ptr %15, align 4, !tbaa !9
  %41 = add nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = call noalias ptr @malloc(i64 noundef %42) #10
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds ptr, ptr %44, i64 %46
  store ptr %43, ptr %47, align 8, !tbaa !5
  %48 = load ptr, ptr %14, align 8, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds ptr, ptr %53, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  %58 = call ptr @strcpy(ptr noundef %52, ptr noundef %57) #8
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds ptr, ptr %59, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  %64 = load i32, ptr %15, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  call void @qsort(ptr noundef %63, i64 noundef %65, i64 noundef 1, ptr noundef @compare)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds ptr, ptr %66, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !5
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = call i32 @BKDRHash(ptr noundef %70, i64 noundef %72)
  store i32 %73, ptr %16, align 4, !tbaa !9
  %74 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %74, ptr %10, align 4, !tbaa !9
  br label %75

75:                                               ; preds = %100, %32
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.word_hash, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.word_hash, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 8, !tbaa !11
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %83, label %97

83:                                               ; preds = %75
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds %struct.word_hash, ptr %84, i64 %86
  %88 = getelementptr inbounds %struct.word_hash, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !13
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  %95 = call i32 @strcmp(ptr noundef %89, ptr noundef %94) #11
  %96 = icmp ne i32 %95, 0
  br label %97

97:                                               ; preds = %83, %75
  %98 = phi i1 [ false, %75 ], [ %96, %83 ]
  br i1 %98, label %99, label %105

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  %103 = load i32, ptr %12, align 4, !tbaa !9
  %104 = srem i32 %102, %103
  store i32 %104, ptr %10, align 4, !tbaa !9
  br label %75, !llvm.loop !14

105:                                              ; preds = %97
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load i32, ptr %10, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds %struct.word_hash, ptr %106, i64 %108
  %110 = getelementptr inbounds %struct.word_hash, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 8, !tbaa !11
  %112 = icmp eq i32 %111, 0
  br i1 %112, label %113, label %126

113:                                              ; preds = %105
  %114 = load ptr, ptr %14, align 8, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds ptr, ptr %114, i64 %116
  %118 = load ptr, ptr %117, align 8, !tbaa !5
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = load i32, ptr %10, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %struct.word_hash, ptr %119, i64 %121
  %123 = getelementptr inbounds %struct.word_hash, ptr %122, i32 0, i32 0
  store ptr %118, ptr %123, align 8, !tbaa !13
  %124 = load i32, ptr %11, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %11, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %113, %105
  %127 = load i32, ptr %9, align 4, !tbaa !9
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = load i32, ptr %10, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds %struct.word_hash, ptr %128, i64 %130
  %132 = getelementptr inbounds %struct.word_hash, ptr %131, i32 0, i32 2
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds %struct.word_hash, ptr %133, i64 %135
  %137 = getelementptr inbounds %struct.word_hash, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 8, !tbaa !11
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %137, align 8, !tbaa !11
  %140 = sext i32 %138 to i64
  %141 = getelementptr inbounds [10 x i32], ptr %132, i64 0, i64 %140
  store i32 %127, ptr %141, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %142

142:                                              ; preds = %126
  %143 = load i32, ptr %9, align 4, !tbaa !9
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %9, align 4, !tbaa !9
  br label %28, !llvm.loop !16

145:                                              ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %146 = load i32, ptr %11, align 4, !tbaa !9
  %147 = sext i32 %146 to i64
  %148 = mul i64 %147, 8
  %149 = call noalias ptr @malloc(i64 noundef %148) #10
  store ptr %149, ptr %18, align 8, !tbaa !5
  %150 = load i32, ptr %11, align 4, !tbaa !9
  %151 = sext i32 %150 to i64
  %152 = mul i64 %151, 4
  %153 = call noalias ptr @malloc(i64 noundef %152) #10
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %153, ptr %154, align 8, !tbaa !5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %155

155:                                              ; preds = %231, %145
  %156 = load i32, ptr %9, align 4, !tbaa !9
  %157 = load i32, ptr %12, align 4, !tbaa !9
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %159, label %234

159:                                              ; preds = %155
  %160 = load ptr, ptr %13, align 8, !tbaa !5
  %161 = load i32, ptr %9, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds %struct.word_hash, ptr %160, i64 %162
  %164 = getelementptr inbounds %struct.word_hash, ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 8, !tbaa !11
  %166 = icmp sgt i32 %165, 0
  br i1 %166, label %167, label %230

167:                                              ; preds = %159
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = load i32, ptr %9, align 4, !tbaa !9
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds %struct.word_hash, ptr %168, i64 %170
  %172 = getelementptr inbounds %struct.word_hash, ptr %171, i32 0, i32 1
  %173 = load i32, ptr %172, align 8, !tbaa !11
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = load ptr, ptr %174, align 8, !tbaa !5
  %176 = load i32, ptr %17, align 4, !tbaa !9
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds i32, ptr %175, i64 %177
  store i32 %173, ptr %178, align 4, !tbaa !9
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  %180 = load i32, ptr %9, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds %struct.word_hash, ptr %179, i64 %181
  %183 = getelementptr inbounds %struct.word_hash, ptr %182, i32 0, i32 1
  %184 = load i32, ptr %183, align 8, !tbaa !11
  %185 = sext i32 %184 to i64
  %186 = mul i64 %185, 8
  %187 = call noalias ptr @malloc(i64 noundef %186) #10
  %188 = load ptr, ptr %18, align 8, !tbaa !5
  %189 = load i32, ptr %17, align 4, !tbaa !9
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds ptr, ptr %188, i64 %190
  store ptr %187, ptr %191, align 8, !tbaa !5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %192

192:                                              ; preds = %224, %167
  %193 = load i32, ptr %10, align 4, !tbaa !9
  %194 = load ptr, ptr %13, align 8, !tbaa !5
  %195 = load i32, ptr %9, align 4, !tbaa !9
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds %struct.word_hash, ptr %194, i64 %196
  %198 = getelementptr inbounds %struct.word_hash, ptr %197, i32 0, i32 1
  %199 = load i32, ptr %198, align 8, !tbaa !11
  %200 = icmp slt i32 %193, %199
  br i1 %200, label %201, label %227

201:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  %203 = load i32, ptr %9, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds %struct.word_hash, ptr %202, i64 %204
  %206 = getelementptr inbounds %struct.word_hash, ptr %205, i32 0, i32 2
  %207 = load i32, ptr %10, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [10 x i32], ptr %206, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !9
  store i32 %210, ptr %19, align 4, !tbaa !9
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  %212 = load i32, ptr %19, align 4, !tbaa !9
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds ptr, ptr %211, i64 %213
  %215 = load ptr, ptr %214, align 8, !tbaa !5
  %216 = load ptr, ptr %18, align 8, !tbaa !5
  %217 = load i32, ptr %17, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds ptr, ptr %216, i64 %218
  %220 = load ptr, ptr %219, align 8, !tbaa !5
  %221 = load i32, ptr %10, align 4, !tbaa !9
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds ptr, ptr %220, i64 %222
  store ptr %215, ptr %223, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %224

224:                                              ; preds = %201
  %225 = load i32, ptr %10, align 4, !tbaa !9
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %10, align 4, !tbaa !9
  br label %192, !llvm.loop !17

227:                                              ; preds = %192
  %228 = load i32, ptr %17, align 4, !tbaa !9
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %17, align 4, !tbaa !9
  br label %230

230:                                              ; preds = %227, %159
  br label %231

231:                                              ; preds = %230
  %232 = load i32, ptr %9, align 4, !tbaa !9
  %233 = add nsw i32 %232, 1
  store i32 %233, ptr %9, align 4, !tbaa !9
  br label %155, !llvm.loop !18

234:                                              ; preds = %155
  %235 = load i32, ptr %11, align 4, !tbaa !9
  %236 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 %235, ptr %236, align 4, !tbaa !9
  %237 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  ret ptr %237
}

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #5

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #6

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @BKDRHash(ptr noundef, i64 noundef) #7

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #4

; 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 = { 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 #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 willreturn memory(read) "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 = { "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 = { inlinehint 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { nounwind willreturn memory(read) }

!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 = !{!12, !10, i64 8}
!12 = !{!"word_hash", !6, i64 0, !10, i64 8, !7, i64 12}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}


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

%struct.word_hash = type { ptr, i32, [10 x i32] }

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @groupAnagrams(ptr nocapture noundef readonly %0, i32 noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #0 {
  %5 = sext i32 %1 to i64
  %6 = tail call noalias ptr @calloc(i64 noundef %5, i64 noundef 56) #7
  %7 = icmp sgt i32 %1, 0
  br i1 %7, label %.lr.ph95.preheader, label %._crit_edge

.lr.ph95.preheader:                               ; preds = %4
  %wide.trip.count = zext nneg i32 %1 to i64
  br label %.lr.ph95

.lr.ph95:                                         ; preds = %.lr.ph95.preheader, %.critedge.thread
  %indvars.iv = phi i64 [ 0, %.lr.ph95.preheader ], [ %indvars.iv.next, %.critedge.thread ]
  %.07793 = phi i32 [ 0, %.lr.ph95.preheader ], [ %.178, %.critedge.thread ]
  %8 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %9) #8
  %11 = shl i64 %10, 32
  %sext = add i64 %11, 4294967296
  %12 = ashr exact i64 %sext, 32
  %13 = tail call noalias ptr @malloc(i64 noundef %12) #9
  %14 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %13, ptr noundef nonnull dereferenceable(1) %9) #10
  %15 = ashr exact i64 %11, 32
  tail call void @qsort(ptr noundef %13, i64 noundef %15, i64 noundef 1, ptr noundef nonnull @compare) #10
  %16 = tail call i32 @BKDRHash(ptr noundef %13, i64 noundef %5)
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds %struct.word_hash, ptr %6, i64 %17
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !9
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph.preheader, label %.critedge

.lr.ph.preheader:                                 ; preds = %.lr.ph95
  %22 = load ptr, ptr %18, align 8, !tbaa !12
  %23 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) %13) #8
  %.not132 = icmp eq i32 %23, 0
  br i1 %.not132, label %.critedge.thread, label %.lr.ph134

.lr.ph:                                           ; preds = %.lr.ph134
  %24 = load ptr, ptr %29, align 8, !tbaa !12
  %25 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %24, ptr noundef nonnull dereferenceable(1) %13) #8
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %.critedge.thread, label %.lr.ph134, !llvm.loop !13

.lr.ph134:                                        ; preds = %.lr.ph.preheader, %.lr.ph
  %.07390133 = phi i32 [ %27, %.lr.ph ], [ %16, %.lr.ph.preheader ]
  %26 = add nsw i32 %.07390133, 1
  %27 = srem i32 %26, %1
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct.word_hash, ptr %6, i64 %28
  %30 = getelementptr inbounds i8, ptr %29, i64 8
  %31 = load i32, ptr %30, align 8, !tbaa !9
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph, label %.critedge, !llvm.loop !13

.critedge:                                        ; preds = %.lr.ph134, %.lr.ph95
  %.lcssa89 = phi ptr [ %18, %.lr.ph95 ], [ %29, %.lr.ph134 ]
  %.lcssa = phi i32 [ %20, %.lr.ph95 ], [ %31, %.lr.ph134 ]
  %33 = icmp eq i32 %.lcssa, 0
  br i1 %33, label %34, label %.critedge.thread

34:                                               ; preds = %.critedge
  store ptr %13, ptr %.lcssa89, align 8, !tbaa !12
  %35 = add nsw i32 %.07793, 1
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %.lr.ph, %.lr.ph.preheader, %34, %.critedge
  %36 = phi ptr [ %.lcssa89, %34 ], [ %.lcssa89, %.critedge ], [ %18, %.lr.ph.preheader ], [ %29, %.lr.ph ]
  %37 = phi i32 [ 0, %34 ], [ %.lcssa, %.critedge ], [ %20, %.lr.ph.preheader ], [ %31, %.lr.ph ]
  %.178 = phi i32 [ %35, %34 ], [ %.07793, %.critedge ], [ %.07793, %.lr.ph.preheader ], [ %.07793, %.lr.ph ]
  %38 = getelementptr inbounds i8, ptr %36, i64 8
  %39 = getelementptr inbounds i8, ptr %36, i64 12
  %40 = add nsw i32 %37, 1
  store i32 %40, ptr %38, align 8, !tbaa !9
  %41 = sext i32 %37 to i64
  %42 = getelementptr inbounds [10 x i32], ptr %39, i64 0, i64 %41
  %43 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %43, ptr %42, align 4, !tbaa !15
  %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.ph95, !llvm.loop !16

._crit_edge:                                      ; preds = %.critedge.thread, %4
  %.077.lcssa = phi i32 [ 0, %4 ], [ %.178, %.critedge.thread ]
  %44 = sext i32 %.077.lcssa to i64
  %45 = shl nsw i64 %44, 3
  %46 = tail call noalias ptr @malloc(i64 noundef %45) #9
  %47 = shl nsw i64 %44, 2
  %48 = tail call noalias ptr @malloc(i64 noundef %47) #9
  store ptr %48, ptr %3, align 8, !tbaa !5
  br i1 %7, label %.lr.ph101.preheader, label %._crit_edge102

.lr.ph101.preheader:                              ; preds = %._crit_edge
  %wide.trip.count118 = zext nneg i32 %1 to i64
  br label %.lr.ph101

.lr.ph101:                                        ; preds = %.lr.ph101.preheader, %94
  %indvars.iv115 = phi i64 [ 0, %.lr.ph101.preheader ], [ %indvars.iv.next116, %94 ]
  %.07598 = phi i32 [ 0, %.lr.ph101.preheader ], [ %.176, %94 ]
  %49 = getelementptr inbounds %struct.word_hash, ptr %6, i64 %indvars.iv115
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load i32, ptr %50, align 8, !tbaa !9
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %53, label %94

53:                                               ; preds = %.lr.ph101
  %54 = sext i32 %.07598 to i64
  %55 = getelementptr inbounds i32, ptr %48, i64 %54
  store i32 %51, ptr %55, align 4, !tbaa !15
  %56 = zext nneg i32 %51 to i64
  %57 = shl nuw nsw i64 %56, 3
  %58 = tail call noalias ptr @malloc(i64 noundef %57) #9
  %59 = getelementptr inbounds ptr, ptr %46, i64 %54
  store ptr %58, ptr %59, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %49, i64 12
  %xtraiter = and i64 %56, 3
  %61 = icmp ult i32 %51, 4
  br i1 %61, label %.unr-lcssa, label %.new

.new:                                             ; preds = %53
  %unroll_iter = and i64 %56, 2147483644
  br label %62

62:                                               ; preds = %62, %.new
  %indvars.iv110 = phi i64 [ 0, %.new ], [ %indvars.iv.next111.3, %62 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.3, %62 ]
  %63 = getelementptr inbounds [10 x i32], ptr %60, i64 0, i64 %indvars.iv110
  %64 = load i32, ptr %63, align 4, !tbaa !15
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %0, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv110
  store ptr %67, ptr %68, align 8, !tbaa !5
  %indvars.iv.next111 = or disjoint i64 %indvars.iv110, 1
  %69 = getelementptr inbounds [10 x i32], ptr %60, i64 0, i64 %indvars.iv.next111
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds ptr, ptr %0, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv.next111
  store ptr %73, ptr %74, align 8, !tbaa !5
  %indvars.iv.next111.1 = or disjoint i64 %indvars.iv110, 2
  %75 = getelementptr inbounds [10 x i32], ptr %60, i64 0, i64 %indvars.iv.next111.1
  %76 = load i32, ptr %75, align 4, !tbaa !15
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %0, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv.next111.1
  store ptr %79, ptr %80, align 8, !tbaa !5
  %indvars.iv.next111.2 = or disjoint i64 %indvars.iv110, 3
  %81 = getelementptr inbounds [10 x i32], ptr %60, i64 0, i64 %indvars.iv.next111.2
  %82 = load i32, ptr %81, align 4, !tbaa !15
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %0, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv.next111.2
  store ptr %85, ptr %86, align 8, !tbaa !5
  %indvars.iv.next111.3 = add nuw nsw i64 %indvars.iv110, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.unr-lcssa, label %62, !llvm.loop !17

.unr-lcssa:                                       ; preds = %62, %53
  %indvars.iv110.unr = phi i64 [ 0, %53 ], [ %indvars.iv.next111.3, %62 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.epilog-lcssa, label %.epil.preheader

.epil.preheader:                                  ; preds = %.unr-lcssa, %.epil.preheader
  %indvars.iv110.epil = phi i64 [ %indvars.iv.next111.epil, %.epil.preheader ], [ %indvars.iv110.unr, %.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %.unr-lcssa ]
  %87 = getelementptr inbounds [10 x i32], ptr %60, i64 0, i64 %indvars.iv110.epil
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds ptr, ptr %0, i64 %89
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  %92 = getelementptr inbounds ptr, ptr %58, i64 %indvars.iv110.epil
  store ptr %91, ptr %92, align 8, !tbaa !5
  %indvars.iv.next111.epil = add nuw nsw i64 %indvars.iv110.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.epilog-lcssa, label %.epil.preheader, !llvm.loop !18

.epilog-lcssa:                                    ; preds = %.epil.preheader, %.unr-lcssa
  %93 = add nsw i32 %.07598, 1
  br label %94

94:                                               ; preds = %.lr.ph101, %.epilog-lcssa
  %.176 = phi i32 [ %93, %.epilog-lcssa ], [ %.07598, %.lr.ph101 ]
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
  br i1 %exitcond119.not, label %._crit_edge102, label %.lr.ph101, !llvm.loop !20

._crit_edge102:                                   ; preds = %94, %._crit_edge
  store i32 %.077.lcssa, ptr %2, align 4, !tbaa !15
  ret ptr %46
}

; 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 #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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @BKDRHash(ptr noundef, i64 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

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 = { 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 #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 nofree nounwind willreturn memory(argmem: readwrite) "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 = { nofree "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 = { inlinehint 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 #7 = { nounwind allocsize(0,1) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { 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, !11, i64 8}
!10 = !{!"word_hash", !6, i64 0, !11, i64 8, !7, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!11, !11, i64 0}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.unroll.disable"}
!20 = distinct !{!20, !14}


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