; LLVM IR from jingweizhanghuai/Morn :: src/util (morn_map)

; 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.MObject = type { i32, %union.anon }
%union.anon = type { ptr }
%struct.MChainNode = type { ptr, ptr, ptr }
%struct.OverWriteChain = type { ptr, i32, [0 x i8] }

@.str = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__.mornMapNodeOperate = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @mornMapNodeOperate(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca [1024 x i8], align 16
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %26, label %22

22:                                               ; preds = %3
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = ptrtoint ptr %23 to i64
  %25 = icmp eq i64 %24, -1
  br i1 %25, label %26, label %27

26:                                               ; preds = %22, %3
  store i32 0, ptr %4, align 4
  br label %216

27:                                               ; preds = %22
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.MObject, ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %27
  store i32 0, ptr %4, align 4
  br label %216

33:                                               ; preds = %27
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %41, label %37

37:                                               ; preds = %34
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = ptrtoint ptr %38 to i64
  %40 = icmp eq i64 %39, -1
  br label %41

41:                                               ; preds = %37, %34
  %42 = phi i1 [ true, %34 ], [ %40, %37 ]
  %43 = zext i1 %42 to i32
  store i32 %43, ptr %8, align 4, !tbaa !10
  %44 = load i32, ptr %8, align 4, !tbaa !10
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %41
  %47 = load i32, ptr %8, align 4, !tbaa !10
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %47, i32 noundef -1, ptr noundef @.str, i32 noundef 286, ptr noundef @__FUNCTION__.mornMapNodeOperate, ptr noundef @.str.6)
  br label %48

48:                                               ; preds = %46, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %50, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.MObject, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.MChainNode, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !12
  store ptr %55, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %11) #5
  br label %56

56:                                               ; preds = %213, %49
  %57 = load ptr, ptr %10, align 8, !tbaa !5
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MObject, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = icmp ne ptr %57, %60
  br i1 %61, label %62, label %214

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %63 = load ptr, ptr %10, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.MChainNode, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  store ptr %65, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds i32, ptr %66, i64 0
  %68 = load i32, ptr %67, align 4, !tbaa !10
  %69 = add nsw i32 %68, 7
  %70 = ashr i32 %69, 3
  %71 = sext i32 %70 to i64
  %72 = mul i64 %71, 2
  %73 = trunc i64 %72 to i32
  store i32 %73, ptr %13, align 4, !tbaa !10
  %74 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds i32, ptr %75, i64 2
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = getelementptr inbounds i32, ptr %77, i64 0
  %79 = load i32, ptr %78, align 4, !tbaa !10
  %80 = icmp slt i32 1024, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %62
  br label %86

82:                                               ; preds = %62
  %83 = load ptr, ptr %12, align 8, !tbaa !5
  %84 = getelementptr inbounds i32, ptr %83, i64 0
  %85 = load i32, ptr %84, align 4, !tbaa !10
  br label %86

86:                                               ; preds = %82, %81
  %87 = phi i32 [ 1024, %81 ], [ %85, %82 ]
  %88 = sext i32 %87 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %74, ptr align 4 %76, i64 %88, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = getelementptr inbounds i32, ptr %89, i64 1
  %91 = load i32, ptr %90, align 4, !tbaa !10
  %92 = icmp slt i32 %91, 0
  br i1 %92, label %93, label %160

93:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %94 = load ptr, ptr %12, align 8, !tbaa !5
  %95 = getelementptr inbounds i32, ptr %94, i64 2
  %96 = load i32, ptr %13, align 4, !tbaa !10
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i32, ptr %95, i64 %97
  store ptr %98, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %99 = load ptr, ptr %15, align 8, !tbaa !5
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.OverWriteChain, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !15
  store ptr %102, ptr %16, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %151, %93
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds i32, ptr %105, i64 2
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = getelementptr inbounds i32, ptr %107, i64 0
  %109 = load i32, ptr %108, align 4, !tbaa !10
  %110 = load ptr, ptr %16, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.OverWriteChain, ptr %110, i32 0, i32 2
  %112 = getelementptr inbounds [0 x i8], ptr %111, i64 0, i64 0
  %113 = load ptr, ptr %16, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.OverWriteChain, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 8, !tbaa !17
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = call i32 %104(ptr noundef %106, i32 noundef %109, ptr noundef %112, i32 noundef %115, ptr noundef %116)
  store i32 %117, ptr %14, align 4, !tbaa !10
  br label %118

118:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %119 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %120 = load ptr, ptr %12, align 8, !tbaa !5
  %121 = getelementptr inbounds i32, ptr %120, i64 2
  %122 = load ptr, ptr %12, align 8, !tbaa !5
  %123 = getelementptr inbounds i32, ptr %122, i64 0
  %124 = load i32, ptr %123, align 4, !tbaa !10
  %125 = icmp slt i32 1024, %124
  br i1 %125, label %126, label %127

126:                                              ; preds = %118
  br label %131

127:                                              ; preds = %118
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = getelementptr inbounds i32, ptr %128, i64 0
  %130 = load i32, ptr %129, align 4, !tbaa !10
  br label %131

131:                                              ; preds = %127, %126
  %132 = phi i32 [ 1024, %126 ], [ %130, %127 ]
  %133 = sext i32 %132 to i64
  %134 = call i32 @memcmp(ptr noundef %119, ptr noundef %121, i64 noundef %133) #6
  %135 = icmp ne i32 %134, 0
  %136 = zext i1 %135 to i32
  store i32 %136, ptr %17, align 4, !tbaa !10
  %137 = load i32, ptr %17, align 4, !tbaa !10
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %141

139:                                              ; preds = %131
  %140 = load i32, ptr %17, align 4, !tbaa !10
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %140, i32 noundef -1, ptr noundef @.str, i32 noundef 304, ptr noundef @__FUNCTION__.mornMapNodeOperate, ptr noundef @.str.7)
  br label %141

141:                                              ; preds = %139, %131
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %142

142:                                              ; preds = %141
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr %14, align 4, !tbaa !10
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %147

146:                                              ; preds = %143
  store i32 1, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %157

147:                                              ; preds = %143
  %148 = load ptr, ptr %16, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.OverWriteChain, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !15
  store ptr %150, ptr %16, align 8, !tbaa !5
  br label %151

151:                                              ; preds = %147
  %152 = load ptr, ptr %16, align 8, !tbaa !5
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = load ptr, ptr %153, align 8, !tbaa !5
  %155 = icmp ne ptr %152, %154
  br i1 %155, label %103, label %156, !llvm.loop !18

156:                                              ; preds = %151
  store i32 0, ptr %18, align 4
  br label %157

157:                                              ; preds = %156, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  %158 = load i32, ptr %18, align 4
  switch i32 %158, label %211 [
    i32 0, label %159
  ]

159:                                              ; preds = %157
  br label %207

160:                                              ; preds = %86
  %161 = load ptr, ptr %9, align 8, !tbaa !5
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = getelementptr inbounds i32, ptr %162, i64 2
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  %165 = getelementptr inbounds i32, ptr %164, i64 0
  %166 = load i32, ptr %165, align 4, !tbaa !10
  %167 = load ptr, ptr %12, align 8, !tbaa !5
  %168 = getelementptr inbounds i32, ptr %167, i64 2
  %169 = load i32, ptr %13, align 4, !tbaa !10
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds i32, ptr %168, i64 %170
  %172 = load ptr, ptr %12, align 8, !tbaa !5
  %173 = getelementptr inbounds i32, ptr %172, i64 1
  %174 = load i32, ptr %173, align 4, !tbaa !10
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = call i32 %161(ptr noundef %163, i32 noundef %166, ptr noundef %171, i32 noundef %174, ptr noundef %175)
  store i32 %176, ptr %14, align 4, !tbaa !10
  br label %177

177:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %178 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %179 = load ptr, ptr %12, align 8, !tbaa !5
  %180 = getelementptr inbounds i32, ptr %179, i64 2
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = getelementptr inbounds i32, ptr %181, i64 0
  %183 = load i32, ptr %182, align 4, !tbaa !10
  %184 = icmp slt i32 1024, %183
  br i1 %184, label %185, label %186

185:                                              ; preds = %177
  br label %190

186:                                              ; preds = %177
  %187 = load ptr, ptr %12, align 8, !tbaa !5
  %188 = getelementptr inbounds i32, ptr %187, i64 0
  %189 = load i32, ptr %188, align 4, !tbaa !10
  br label %190

190:                                              ; preds = %186, %185
  %191 = phi i32 [ 1024, %185 ], [ %189, %186 ]
  %192 = sext i32 %191 to i64
  %193 = call i32 @memcmp(ptr noundef %178, ptr noundef %180, i64 noundef %192) #6
  %194 = icmp ne i32 %193, 0
  %195 = zext i1 %194 to i32
  store i32 %195, ptr %19, align 4, !tbaa !10
  %196 = load i32, ptr %19, align 4, !tbaa !10
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %200

198:                                              ; preds = %190
  %199 = load i32, ptr %19, align 4, !tbaa !10
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %199, i32 noundef -1, ptr noundef @.str, i32 noundef 312, ptr noundef @__FUNCTION__.mornMapNodeOperate, ptr noundef @.str.7)
  br label %200

200:                                              ; preds = %198, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %201

201:                                              ; preds = %200
  br label %202

202:                                              ; preds = %201
  %203 = load i32, ptr %14, align 4, !tbaa !10
  %204 = icmp ne i32 %203, 0
  br i1 %204, label %205, label %206

205:                                              ; preds = %202
  store i32 1, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %211

206:                                              ; preds = %202
  br label %207

207:                                              ; preds = %206, %159
  %208 = load ptr, ptr %10, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.MChainNode, ptr %208, i32 0, i32 2
  %210 = load ptr, ptr %209, align 8, !tbaa !12
  store ptr %210, ptr %10, align 8, !tbaa !5
  store i32 0, ptr %18, align 4
  br label %211

211:                                              ; preds = %207, %205, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %212 = load i32, ptr %18, align 4
  switch i32 %212, label %215 [
    i32 0, label %213
  ]

213:                                              ; preds = %211
  br label %56, !llvm.loop !20

214:                                              ; preds = %56
  store i32 0, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %215

215:                                              ; preds = %214, %211
  call void @llvm.lifetime.end.p0(i64 1024, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %216

216:                                              ; preds = %215, %32, %26
  %217 = load i32, ptr %4, align 4
  ret i32 %217
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #2 = { 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 = { 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 }
attributes #6 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 16}
!13 = !{!"MChainNode", !6, i64 0, !6, i64 8, !6, i64 16}
!14 = !{!13, !6, i64 0}
!15 = !{!16, !6, i64 0}
!16 = !{!"OverWriteChain", !6, i64 0, !11, i64 8, !7, i64 12}
!17 = !{!16, !11, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__.mornMapNodeOperate = external hidden unnamed_addr constant [19 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1

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

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr 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
define dso_local noundef i32 @mornMapNodeOperate(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca [1024 x i8], align 16
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %5 [
    i64 -1, label %56
    i64 0, label %56
  ]

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %56, label %9

9:                                                ; preds = %5
  %magicptr69 = ptrtoint ptr %1 to i64
  switch i64 %magicptr69, label %15 [
    i64 -1, label %10
    i64 0, label %10
  ]

10:                                               ; preds = %9, %9
  %11 = icmp eq ptr %1, null
  %12 = icmp eq ptr %1, inttoptr (i64 -1 to ptr)
  %13 = or i1 %11, %12
  %14 = zext i1 %13 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %14, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 286, ptr noundef nonnull @__FUNCTION__.mornMapNodeOperate, ptr noundef nonnull @.str.6) #6
  %.pre = load ptr, ptr %6, align 8, !tbaa !5
  br label %15

15:                                               ; preds = %9, %10
  %16 = phi ptr [ %7, %9 ], [ %.pre, %10 ]
  %17 = getelementptr inbounds i8, ptr %16, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #6
  %.not77 = icmp eq ptr %18, %16
  br i1 %.not77, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %15, %.critedge
  %.05678 = phi ptr [ %54, %.critedge ], [ %18, %15 ]
  %19 = load ptr, ptr %.05678, align 8, !tbaa !11
  %20 = load i32, ptr %19, align 4, !tbaa !12
  %21 = add nsw i32 %20, 7
  %22 = ashr i32 %21, 2
  %23 = and i32 %22, -2
  %24 = getelementptr inbounds i8, ptr %19, i64 8
  %spec.select = tail call i32 @llvm.smin.i32(i32 %20, i32 1024)
  %25 = sext i32 %spec.select to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %4, ptr nonnull align 4 %24, i64 %25, i1 false)
  %26 = getelementptr inbounds i8, ptr %19, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !12
  %28 = icmp slt i32 %27, 0
  %29 = sext i32 %23 to i64
  %30 = getelementptr inbounds i32, ptr %24, i64 %29
  br i1 %28, label %31, label %47

31:                                               ; preds = %.lr.ph
  %32 = load ptr, ptr %30, align 8, !tbaa !14
  %33 = load ptr, ptr %32, align 8, !tbaa !15
  br label %34

34:                                               ; preds = %44, %31
  %.058 = phi ptr [ %33, %31 ], [ %45, %44 ]
  %35 = load i32, ptr %19, align 4, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %.058, i64 12
  %37 = getelementptr inbounds i8, ptr %.058, i64 8
  %38 = load i32, ptr %37, align 8, !tbaa !17
  %39 = tail call i32 %1(ptr noundef nonnull %24, i32 noundef %35, ptr noundef nonnull %36, i32 noundef %38, ptr noundef %2) #6
  %40 = load i32, ptr %19, align 4, !tbaa !12
  %spec.select70 = tail call i32 @llvm.smin.i32(i32 %40, i32 1024)
  %41 = sext i32 %spec.select70 to i64
  %bcmp66 = call i32 @bcmp(ptr nonnull %4, ptr nonnull %24, i64 %41)
  %.not75 = icmp eq i32 %bcmp66, 0
  br i1 %.not75, label %43, label %42

42:                                               ; preds = %34
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 304, ptr noundef nonnull @__FUNCTION__.mornMapNodeOperate, ptr noundef nonnull @.str.7) #6
  br label %43

43:                                               ; preds = %42, %34
  %.not67 = icmp eq i32 %39, 0
  br i1 %.not67, label %44, label %.critedge.thread

44:                                               ; preds = %43
  %45 = load ptr, ptr %.058, align 8, !tbaa !15
  %46 = load ptr, ptr %30, align 8, !tbaa !14
  %.not68 = icmp eq ptr %45, %46
  br i1 %.not68, label %.critedge, label %34, !llvm.loop !18

47:                                               ; preds = %.lr.ph
  %48 = tail call i32 %1(ptr noundef nonnull %24, i32 noundef %20, ptr noundef nonnull %30, i32 noundef %27, ptr noundef %2) #6
  %49 = load i32, ptr %19, align 4, !tbaa !12
  %spec.select71 = tail call i32 @llvm.smin.i32(i32 %49, i32 1024)
  %50 = sext i32 %spec.select71 to i64
  %bcmp = call i32 @bcmp(ptr nonnull %4, ptr nonnull %24, i64 %50)
  %.not74 = icmp eq i32 %bcmp, 0
  br i1 %.not74, label %52, label %51

51:                                               ; preds = %47
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 312, ptr noundef nonnull @__FUNCTION__.mornMapNodeOperate, ptr noundef nonnull @.str.7) #6
  br label %52

52:                                               ; preds = %51, %47
  %.not65 = icmp eq i32 %48, 0
  br i1 %.not65, label %.critedge, label %.critedge.thread

.critedge:                                        ; preds = %44, %52
  %53 = getelementptr inbounds i8, ptr %.05678, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !8
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %.not = icmp eq ptr %54, %55
  br i1 %.not, label %.critedge.thread, label %.lr.ph, !llvm.loop !20

.critedge.thread:                                 ; preds = %.critedge, %52, %43, %15
  %.4 = phi i32 [ 0, %15 ], [ 1, %43 ], [ 0, %.critedge ], [ 1, %52 ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #6
  br label %56

56:                                               ; preds = %5, %3, %3, %.critedge.thread
  %.5 = phi i32 [ %.4, %.critedge.thread ], [ 0, %3 ], [ 0, %3 ], [ 0, %5 ]
  ret i32 %.5
}

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 16}
!9 = !{!"MChainNode", !10, i64 0, !10, i64 8, !10, i64 16}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!9, !10, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !6, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"OverWriteChain", !10, i64 0, !13, i64 8, !6, i64 12}
!17 = !{!16, !13, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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