; LLVM IR from openxrlab/xrsfm :: 3rdparty/apriltag/common (zhash)

; 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.zhash = type { i64, i64, i32, ptr, ptr, i32, ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__.zhash_remove = external hidden unnamed_addr constant [58 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; 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) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @zhash_remove(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #4 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.zhash, ptr %16, i32 0, i32 3
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = call i32 %18(ptr noundef %19)
  store i32 %20, ptr %10, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %21 = load i32, ptr %10, align 4, !tbaa !13
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.zhash, ptr %22, i32 0, i32 7
  %24 = load i32, ptr %23, align 8, !tbaa !14
  %25 = sub nsw i32 %24, 1
  %26 = and i32 %21, %25
  store i32 %26, ptr %11, align 4, !tbaa !13
  br label %27

27:                                               ; preds = %191, %4
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.zhash, ptr %28, i32 0, i32 6
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = load i32, ptr %11, align 4, !tbaa !13
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.zhash, ptr %32, i32 0, i32 2
  %34 = load i32, ptr %33, align 8, !tbaa !16
  %35 = mul i32 %31, %34
  %36 = zext i32 %35 to i64
  %37 = getelementptr inbounds i8, ptr %30, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !17
  %39 = icmp ne i8 %38, 0
  br i1 %39, label %40, label %192

40:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.zhash, ptr %41, i32 0, i32 6
  %43 = load ptr, ptr %42, align 8, !tbaa !15
  %44 = load i32, ptr %11, align 4, !tbaa !13
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.zhash, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !16
  %48 = mul i32 %44, %47
  %49 = add i32 %48, 1
  %50 = zext i32 %49 to i64
  %51 = getelementptr inbounds i8, ptr %43, i64 %50
  store ptr %51, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.zhash, ptr %52, i32 0, i32 6
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = load i32, ptr %11, align 4, !tbaa !13
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.zhash, ptr %56, i32 0, i32 2
  %58 = load i32, ptr %57, align 8, !tbaa !16
  %59 = mul i32 %55, %58
  %60 = add i32 %59, 1
  %61 = zext i32 %60 to i64
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.zhash, ptr %62, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !18
  %65 = add i64 %61, %64
  %66 = getelementptr inbounds i8, ptr %54, i64 %65
  store ptr %66, ptr %13, align 8, !tbaa !5
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.zhash, ptr %67, i32 0, i32 4
  %69 = load ptr, ptr %68, align 8, !tbaa !19
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = call i32 %69(ptr noundef %70, ptr noundef %71)
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %181

74:                                               ; preds = %40
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %83

77:                                               ; preds = %74
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.zhash, ptr %80, i32 0, i32 0
  %82 = load i64, ptr %81, align 8, !tbaa !18
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %78, ptr align 1 %79, i64 %82, i1 false)
  br label %83

83:                                               ; preds = %77, %74
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %86, label %92

86:                                               ; preds = %83
  %87 = load ptr, ptr %9, align 8, !tbaa !5
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.zhash, ptr %89, i32 0, i32 1
  %91 = load i64, ptr %90, align 8, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %87, ptr align 1 %88, i64 %91, i1 false)
  br label %92

92:                                               ; preds = %86, %83
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.zhash, ptr %93, i32 0, i32 6
  %95 = load ptr, ptr %94, align 8, !tbaa !15
  %96 = load i32, ptr %11, align 4, !tbaa !13
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.zhash, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 8, !tbaa !16
  %100 = mul i32 %96, %99
  %101 = zext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %95, i64 %101
  store i8 0, ptr %102, align 1, !tbaa !17
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.zhash, ptr %103, i32 0, i32 5
  %105 = load i32, ptr %104, align 8, !tbaa !21
  %106 = add nsw i32 %105, -1
  store i32 %106, ptr %104, align 8, !tbaa !21
  br label %107

107:                                              ; preds = %179, %92
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %11, align 4, !tbaa !13
  %110 = add i32 %109, 1
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.zhash, ptr %111, i32 0, i32 7
  %113 = load i32, ptr %112, align 8, !tbaa !14
  %114 = sub nsw i32 %113, 1
  %115 = and i32 %110, %114
  store i32 %115, ptr %11, align 4, !tbaa !13
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.zhash, ptr %116, i32 0, i32 6
  %118 = load ptr, ptr %117, align 8, !tbaa !15
  %119 = load i32, ptr %11, align 4, !tbaa !13
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.zhash, ptr %120, i32 0, i32 2
  %122 = load i32, ptr %121, align 8, !tbaa !16
  %123 = mul i32 %119, %122
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds i8, ptr %118, i64 %124
  %126 = load i8, ptr %125, align 1, !tbaa !17
  %127 = icmp ne i8 %126, 0
  br i1 %127, label %128, label %178

128:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.zhash, ptr %129, i32 0, i32 2
  %131 = load i32, ptr %130, align 8, !tbaa !16
  %132 = sext i32 %131 to i64
  %133 = mul i64 1, %132
  %134 = call noalias ptr @malloc(i64 noundef %133) #7
  store ptr %134, ptr %14, align 8, !tbaa !5
  %135 = load ptr, ptr %14, align 8, !tbaa !5
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.zhash, ptr %136, i32 0, i32 6
  %138 = load ptr, ptr %137, align 8, !tbaa !15
  %139 = load i32, ptr %11, align 4, !tbaa !13
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.zhash, ptr %140, i32 0, i32 2
  %142 = load i32, ptr %141, align 8, !tbaa !16
  %143 = mul i32 %139, %142
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds i8, ptr %138, i64 %144
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.zhash, ptr %146, i32 0, i32 2
  %148 = load i32, ptr %147, align 8, !tbaa !16
  %149 = sext i32 %148 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %135, ptr align 1 %145, i64 %149, i1 false)
  %150 = load ptr, ptr %6, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.zhash, ptr %150, i32 0, i32 6
  %152 = load ptr, ptr %151, align 8, !tbaa !15
  %153 = load i32, ptr %11, align 4, !tbaa !13
  %154 = load ptr, ptr %6, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.zhash, ptr %154, i32 0, i32 2
  %156 = load i32, ptr %155, align 8, !tbaa !16
  %157 = mul i32 %153, %156
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds i8, ptr %152, i64 %158
  store i8 0, ptr %159, align 1, !tbaa !17
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.zhash, ptr %160, i32 0, i32 5
  %162 = load i32, ptr %161, align 8, !tbaa !21
  %163 = add nsw i32 %162, -1
  store i32 %163, ptr %161, align 8, !tbaa !21
  %164 = load ptr, ptr %6, align 8, !tbaa !5
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = getelementptr inbounds i8, ptr %165, i64 1
  %167 = load ptr, ptr %14, align 8, !tbaa !5
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.zhash, ptr %168, i32 0, i32 0
  %170 = load i64, ptr %169, align 8, !tbaa !18
  %171 = add i64 1, %170
  %172 = getelementptr inbounds i8, ptr %167, i64 %171
  %173 = call i32 @zhash_put(ptr noundef %164, ptr noundef %166, ptr noundef %172, ptr noundef null, ptr noundef null)
  %174 = icmp ne i32 %173, 0
  br i1 %174, label %175, label %176

175:                                              ; preds = %128
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 231, ptr noundef @__PRETTY_FUNCTION__.zhash_remove) #8
  unreachable

176:                                              ; preds = %128
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %177) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %179

178:                                              ; preds = %108
  br label %180

179:                                              ; preds = %176
  br label %107

180:                                              ; preds = %178
  store i32 1, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %189

181:                                              ; preds = %40
  %182 = load i32, ptr %11, align 4, !tbaa !13
  %183 = add i32 %182, 1
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.zhash, ptr %184, i32 0, i32 7
  %186 = load i32, ptr %185, align 8, !tbaa !14
  %187 = sub nsw i32 %186, 1
  %188 = and i32 %183, %187
  store i32 %188, ptr %11, align 4, !tbaa !13
  store i32 0, ptr %15, align 4
  br label %189

189:                                              ; preds = %181, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %190 = load i32, ptr %15, align 4
  switch i32 %190, label %193 [
    i32 0, label %191
  ]

191:                                              ; preds = %189
  br label %27, !llvm.loop !22

192:                                              ; preds = %27
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %193

193:                                              ; preds = %192, %189
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %194 = load i32, ptr %5, align 4
  ret i32 %194
}

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"zhash", !11, i64 0, !11, i64 8, !12, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !6, i64 48, !12, i64 56}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!10, !12, i64 56}
!15 = !{!10, !6, i64 48}
!16 = !{!10, !12, i64 16}
!17 = !{!7, !7, i64 0}
!18 = !{!10, !11, i64 0}
!19 = !{!10, !6, i64 32}
!20 = !{!10, !11, i64 8}
!21 = !{!10, !12, i64 40}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; 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.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__.zhash_remove = external hidden unnamed_addr constant [58 x i8], align 1

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

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

; Function Attrs: mustprogress 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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @zhash_remove(ptr noundef %0, ptr noundef %1, ptr noundef writeonly %2, ptr noundef writeonly %3) local_unnamed_addr #3 {
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 %6(ptr noundef %1) #5
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  %9 = load i32, ptr %8, align 8, !tbaa !12
  %10 = add nsw i32 %9, -1
  %11 = and i32 %10, %7
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %.not59 = icmp eq ptr %2, null
  %.not60 = icmp eq ptr %3, null
  %15 = getelementptr inbounds i8, ptr %0, i64 8
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  br label %17

17:                                               ; preds = %.loopexit, %4
  %.053 = phi i32 [ %11, %4 ], [ %.255, %.loopexit ]
  %18 = load ptr, ptr %12, align 8, !tbaa !13
  %19 = load i32, ptr %13, align 8, !tbaa !14
  %20 = mul i32 %19, %.053
  %21 = zext i32 %20 to i64
  %22 = getelementptr inbounds i8, ptr %18, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !15
  %.not = icmp eq i8 %23, 0
  br i1 %.not, label %.loopexit.thread, label %24

24:                                               ; preds = %17
  %25 = add i32 %20, 1
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds i8, ptr %18, i64 %26
  %28 = load i64, ptr %0, align 8, !tbaa !16
  %29 = getelementptr i8, ptr %18, i64 %28
  %30 = getelementptr i8, ptr %29, i64 %26
  %31 = load ptr, ptr %14, align 8, !tbaa !17
  %32 = tail call i32 %31(ptr noundef %1, ptr noundef %27) #5
  %.not58 = icmp eq i32 %32, 0
  br i1 %.not58, label %81, label %33

33:                                               ; preds = %24
  br i1 %.not59, label %36, label %34

34:                                               ; preds = %33
  %35 = load i64, ptr %0, align 8, !tbaa !16
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %2, ptr align 1 %27, i64 %35, i1 false)
  br label %36

36:                                               ; preds = %34, %33
  br i1 %.not60, label %39, label %37

37:                                               ; preds = %36
  %38 = load i64, ptr %15, align 8, !tbaa !18
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %3, ptr align 1 %30, i64 %38, i1 false)
  br label %39

39:                                               ; preds = %37, %36
  %40 = load ptr, ptr %12, align 8, !tbaa !13
  %41 = load i32, ptr %13, align 8, !tbaa !14
  %42 = mul i32 %41, %.053
  %43 = zext i32 %42 to i64
  %44 = getelementptr inbounds i8, ptr %40, i64 %43
  store i8 0, ptr %44, align 1, !tbaa !15
  %45 = load i32, ptr %16, align 8, !tbaa !19
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr %16, align 8, !tbaa !19
  %47 = add i32 %.053, 1
  %48 = load i32, ptr %8, align 8, !tbaa !12
  %49 = add nsw i32 %48, -1
  %50 = and i32 %49, %47
  %51 = load ptr, ptr %12, align 8, !tbaa !13
  %52 = load i32, ptr %13, align 8, !tbaa !14
  %53 = mul i32 %50, %52
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %51, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !15
  %.not6164 = icmp eq i8 %56, 0
  br i1 %.not6164, label %.loopexit.thread, label %.lr.ph

.lr.ph:                                           ; preds = %39, %70
  %57 = phi ptr [ %79, %70 ], [ %55, %39 ]
  %58 = phi i32 [ %76, %70 ], [ %52, %39 ]
  %59 = phi i32 [ %74, %70 ], [ %50, %39 ]
  %60 = sext i32 %58 to i64
  %61 = tail call noalias ptr @malloc(i64 noundef %60) #6
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %61, ptr nonnull align 1 %57, i64 %60, i1 false)
  store i8 0, ptr %57, align 1, !tbaa !15
  %62 = load i32, ptr %16, align 8, !tbaa !19
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %16, align 8, !tbaa !19
  %64 = getelementptr inbounds i8, ptr %61, i64 1
  %65 = load i64, ptr %0, align 8, !tbaa !16
  %66 = getelementptr i8, ptr %61, i64 %65
  %67 = getelementptr i8, ptr %66, i64 1
  %68 = tail call i32 @zhash_put(ptr noundef nonnull %0, ptr noundef nonnull %64, ptr noundef %67, ptr noundef null, ptr noundef null)
  %.not62 = icmp eq i32 %68, 0
  br i1 %.not62, label %70, label %69

69:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 231, ptr noundef nonnull @__PRETTY_FUNCTION__.zhash_remove) #7
  unreachable

70:                                               ; preds = %.lr.ph
  tail call void @free(ptr noundef %61) #5
  %71 = add i32 %59, 1
  %72 = load i32, ptr %8, align 8, !tbaa !12
  %73 = add nsw i32 %72, -1
  %74 = and i32 %73, %71
  %75 = load ptr, ptr %12, align 8, !tbaa !13
  %76 = load i32, ptr %13, align 8, !tbaa !14
  %77 = mul i32 %74, %76
  %78 = zext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %75, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !15
  %.not61 = icmp eq i8 %80, 0
  br i1 %.not61, label %.loopexit, label %.lr.ph

81:                                               ; preds = %24
  %82 = add i32 %.053, 1
  %83 = load i32, ptr %8, align 8, !tbaa !12
  %84 = add nsw i32 %83, -1
  %85 = and i32 %84, %82
  br label %.loopexit

.loopexit:                                        ; preds = %70, %81
  %.255 = phi i32 [ %85, %81 ], [ %74, %70 ]
  br i1 %.not58, label %17, label %.loopexit.thread, !llvm.loop !20

.loopexit.thread:                                 ; preds = %39, %17, %.loopexit
  %.2 = phi i32 [ 1, %.loopexit ], [ 0, %17 ], [ 1, %39 ]
  ret i32 %.2
}

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { noreturn nounwind }

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

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


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