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

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

@.str.3 = external hidden unnamed_addr constant [82 x i8], align 1
@__FUNCTION__.m_DictionaryRead = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @DictionaryInit() #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 uwtable
define dso_local ptr @m_DictionaryRead(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  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 8, ptr %10) #5
  %25 = call ptr @DictionaryInit()
  store ptr %25, ptr %10, align 8, !tbaa !5
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %28, label %32

28:                                               ; preds = %4
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = call i64 @strlen(ptr noundef %29) #6
  %31 = trunc i64 %30 to i32
  store i32 %31, ptr %7, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %28, %4
  br label %33

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = icmp sgt i32 %34, 32768
  %36 = zext i1 %35 to i32
  store i32 %36, ptr %11, align 4, !tbaa !9
  %37 = load i32, ptr %11, align 4, !tbaa !9
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %41

39:                                               ; preds = %33
  %40 = load i32, ptr %11, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %40, i32 noundef -1, ptr noundef @.str.3, i32 noundef 67, ptr noundef @__FUNCTION__.m_DictionaryRead, ptr noundef @.str.4)
  br label %41

41:                                               ; preds = %39, %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %44, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = sub nsw i32 %45, 1
  store i32 %46, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %47 = load i32, ptr %14, align 4, !tbaa !9
  %48 = ashr i32 %47, 1
  store i32 %48, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %49 = load i32, ptr %15, align 4, !tbaa !9
  %50 = ashr i32 %49, 1
  store i32 %50, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %51 = load i32, ptr %15, align 4, !tbaa !9
  %52 = load i32, ptr %16, align 4, !tbaa !9
  %53 = add nsw i32 %51, %52
  store i32 %53, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i8, ptr %54, i64 %56
  %58 = load i8, ptr %57, align 1, !tbaa !11
  %59 = sext i8 %58 to i32
  %60 = shl i32 %59, 16
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  %62 = load i32, ptr %16, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %61, i64 %63
  %65 = load i8, ptr %64, align 1, !tbaa !11
  %66 = sext i8 %65 to i32
  %67 = shl i32 %66, 12
  %68 = add nsw i32 %60, %67
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = load i32, ptr %15, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %69, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = sext i8 %73 to i32
  %75 = shl i32 %74, 8
  %76 = add nsw i32 %68, %75
  %77 = load ptr, ptr %12, align 8, !tbaa !5
  %78 = load i32, ptr %17, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds i8, ptr %77, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !11
  %82 = sext i8 %81 to i32
  %83 = shl i32 %82, 4
  %84 = add nsw i32 %76, %83
  %85 = load ptr, ptr %12, align 8, !tbaa !5
  %86 = load i32, ptr %14, align 4, !tbaa !9
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i8, ptr %85, i64 %87
  %89 = load i8, ptr %88, align 1, !tbaa !11
  %90 = sext i8 %89 to i32
  %91 = add nsw i32 %84, %90
  %92 = and i32 %91, 16777215
  store i32 %92, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.HandleDictionary, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !12
  %96 = load i32, ptr %18, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %95, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  store ptr %99, ptr %19, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %184, %43
  %101 = load ptr, ptr %19, align 8, !tbaa !5
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %188

103:                                              ; preds = %100
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.DicNode, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 8, !tbaa !14
  %107 = load i32, ptr %7, align 4, !tbaa !9
  %108 = icmp eq i32 %106, %107
  br i1 %108, label %109, label %184

109:                                              ; preds = %103
  %110 = load ptr, ptr %19, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.DicNode, ptr %110, i32 0, i32 3
  %112 = getelementptr inbounds [0 x i8], ptr %111, i64 0, i64 0
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = load i32, ptr %7, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = call i32 @memcmp(ptr noundef %112, ptr noundef %113, i64 noundef %115) #6
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %183

118:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %119 = load ptr, ptr %19, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.DicNode, ptr %119, i32 0, i32 2
  %121 = load i32, ptr %120, align 4, !tbaa !16
  store i32 %121, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = add nsw i32 %122, 7
  %124 = ashr i32 %123, 3
  %125 = shl i32 %124, 3
  store i32 %125, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %126 = load ptr, ptr %19, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.DicNode, ptr %126, i32 0, i32 3
  %128 = getelementptr inbounds [0 x i8], ptr %127, i64 0, i64 0
  %129 = load i32, ptr %21, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i8, ptr %128, i64 %130
  store ptr %131, ptr %22, align 8, !tbaa !5
  %132 = load i32, ptr %20, align 4, !tbaa !9
  %133 = icmp slt i32 %132, 0
  br i1 %133, label %134, label %149

134:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %135 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %135, ptr %23, align 8, !tbaa !5
  %136 = load ptr, ptr %23, align 8, !tbaa !5
  %137 = load ptr, ptr %136, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.OverWriteChain, ptr %137, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !17
  %140 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %139, ptr %140, align 8, !tbaa !5
  %141 = load ptr, ptr %23, align 8, !tbaa !5
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.OverWriteChain, ptr %142, i32 0, i32 2
  %144 = getelementptr inbounds [0 x i8], ptr %143, i64 0, i64 0
  store ptr %144, ptr %22, align 8, !tbaa !5
  %145 = load ptr, ptr %23, align 8, !tbaa !5
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.OverWriteChain, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 8, !tbaa !19
  store i32 %148, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %149

149:                                              ; preds = %134, %118
  %150 = load ptr, ptr %9, align 8, !tbaa !5
  %151 = icmp ne ptr %150, null
  br i1 %151, label %152, label %173

152:                                              ; preds = %149
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = icmp sgt i32 %154, 0
  br i1 %155, label %156, label %168

156:                                              ; preds = %152
  %157 = load i32, ptr %20, align 4, !tbaa !9
  %158 = load ptr, ptr %9, align 8, !tbaa !5
  %159 = load i32, ptr %158, align 4, !tbaa !9
  %160 = icmp slt i32 %157, %159
  br i1 %160, label %161, label %163

161:                                              ; preds = %156
  %162 = load i32, ptr %20, align 4, !tbaa !9
  br label %166

163:                                              ; preds = %156
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  %165 = load i32, ptr %164, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %163, %161
  %167 = phi i32 [ %162, %161 ], [ %165, %163 ]
  store i32 %167, ptr %20, align 4, !tbaa !9
  br label %168

168:                                              ; preds = %166, %152
  %169 = load ptr, ptr %19, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.DicNode, ptr %169, i32 0, i32 2
  %171 = load i32, ptr %170, align 4, !tbaa !16
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  store i32 %171, ptr %172, align 4, !tbaa !9
  br label %173

173:                                              ; preds = %168, %149
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = icmp ne ptr %174, null
  br i1 %175, label %176, label %181

176:                                              ; preds = %173
  %177 = load ptr, ptr %8, align 8, !tbaa !5
  %178 = load ptr, ptr %22, align 8, !tbaa !5
  %179 = load i32, ptr %20, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %177, ptr align 1 %178, i64 %180, i1 false)
  br label %181

181:                                              ; preds = %176, %173
  %182 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %182, ptr %5, align 8
  store i32 1, ptr %24, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %189

183:                                              ; preds = %109
  br label %184

184:                                              ; preds = %183, %103
  %185 = load ptr, ptr %19, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.DicNode, ptr %185, i32 0, i32 0
  %187 = load ptr, ptr %186, align 8, !tbaa !20
  store ptr %187, ptr %19, align 8, !tbaa !5
  br label %100, !llvm.loop !21

188:                                              ; preds = %100
  store ptr null, ptr %5, align 8
  store i32 1, ptr %24, align 4
  br label %189

189:                                              ; preds = %188, %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %190 = load ptr, ptr %5, align 8
  ret ptr %190
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 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) #4

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 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"HandleDictionary", !6, i64 0, !6, i64 8, !10, i64 16}
!14 = !{!15, !10, i64 8}
!15 = !{!"DicNode", !6, i64 0, !10, i64 8, !10, i64 12, !7, i64 16}
!16 = !{!15, !10, i64 12}
!17 = !{!18, !6, i64 0}
!18 = !{!"OverWriteChain", !6, i64 0, !10, i64 8, !7, i64 12}
!19 = !{!18, !10, i64 8}
!20 = !{!15, !6, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"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.3 = external hidden unnamed_addr constant [82 x i8], align 1
@__FUNCTION__.m_DictionaryRead = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @DictionaryInit() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @m_DictionaryRead(ptr nocapture noundef readonly %0, i32 noundef %1, ptr noundef writeonly %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = tail call ptr @DictionaryInit()
  %6 = icmp slt i32 %1, 0
  br i1 %6, label %7, label %10

7:                                                ; preds = %4
  %8 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #6
  %9 = trunc i64 %8 to i32
  br label %10

10:                                               ; preds = %4, %7
  %.054 = phi i32 [ %9, %7 ], [ %1, %4 ]
  %11 = icmp sgt i32 %.054, 32768
  br i1 %11, label %12, label %13

12:                                               ; preds = %10
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.3, i32 noundef 67, ptr noundef nonnull @__FUNCTION__.m_DictionaryRead, ptr noundef nonnull @.str.4) #7
  br label %13

13:                                               ; preds = %12, %10
  %14 = add nsw i32 %.054, -1
  %15 = ashr i32 %14, 1
  %16 = ashr i32 %14, 2
  %17 = add nsw i32 %15, %16
  %18 = load i8, ptr %0, align 1, !tbaa !5
  %19 = sext i8 %18 to i64
  %20 = shl nsw i64 %19, 16
  %21 = sext i32 %16 to i64
  %22 = getelementptr inbounds i8, ptr %0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = sext i8 %23 to i64
  %25 = shl nsw i64 %24, 12
  %26 = add nsw i64 %25, %20
  %27 = sext i32 %15 to i64
  %28 = getelementptr inbounds i8, ptr %0, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = sext i8 %29 to i64
  %31 = shl nsw i64 %30, 8
  %32 = add nsw i64 %26, %31
  %33 = sext i32 %17 to i64
  %34 = getelementptr inbounds i8, ptr %0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !5
  %36 = sext i8 %35 to i64
  %37 = shl nsw i64 %36, 4
  %38 = add nsw i64 %32, %37
  %39 = sext i32 %14 to i64
  %40 = getelementptr inbounds i8, ptr %0, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !5
  %42 = sext i8 %41 to i64
  %43 = add nsw i64 %38, %42
  %44 = and i64 %43, 16777215
  %45 = load ptr, ptr %5, align 8, !tbaa !8
  %46 = getelementptr inbounds ptr, ptr %45, i64 %44
  %.05665 = load ptr, ptr %46, align 8, !tbaa !12
  %.not66 = icmp eq ptr %.05665, null
  br i1 %.not66, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %13
  %47 = sext i32 %.054 to i64
  br label %48

48:                                               ; preds = %.lr.ph, %76
  %.05667 = phi ptr [ %.05665, %.lr.ph ], [ %.056, %76 ]
  %49 = getelementptr inbounds i8, ptr %.05667, i64 8
  %50 = load i32, ptr %49, align 8, !tbaa !13
  %51 = icmp eq i32 %50, %.054
  br i1 %51, label %52, label %76

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %.05667, i64 16
  %bcmp = tail call i32 @bcmp(ptr nonnull %53, ptr nonnull %0, i64 %47)
  %54 = icmp eq i32 %bcmp, 0
  br i1 %54, label %55, label %76

55:                                               ; preds = %52
  %56 = getelementptr inbounds i8, ptr %.05667, i64 12
  %57 = load i32, ptr %56, align 4, !tbaa !15
  %58 = add nsw i32 %.054, 7
  %59 = and i32 %58, -8
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %53, i64 %60
  %62 = icmp slt i32 %57, 0
  br i1 %62, label %63, label %69

63:                                               ; preds = %55
  %64 = load ptr, ptr %61, align 8, !tbaa !12
  %65 = load ptr, ptr %64, align 8, !tbaa !16
  store ptr %65, ptr %61, align 8, !tbaa !12
  %66 = getelementptr inbounds i8, ptr %65, i64 12
  %67 = getelementptr inbounds i8, ptr %65, i64 8
  %68 = load i32, ptr %67, align 8, !tbaa !18
  br label %69

69:                                               ; preds = %63, %55
  %.055 = phi i32 [ %68, %63 ], [ %57, %55 ]
  %.053 = phi ptr [ %66, %63 ], [ %61, %55 ]
  %.not62 = icmp eq ptr %3, null
  br i1 %.not62, label %73, label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %3, align 4, !tbaa !19
  %72 = icmp sgt i32 %71, 0
  %.055. = tail call i32 @llvm.smin.i32(i32 %.055, i32 %71)
  %.1 = select i1 %72, i32 %.055., i32 %.055
  store i32 %57, ptr %3, align 4, !tbaa !19
  br label %73

73:                                               ; preds = %70, %69
  %.2 = phi i32 [ %.1, %70 ], [ %.055, %69 ]
  %.not63 = icmp eq ptr %2, null
  br i1 %.not63, label %.loopexit, label %74

74:                                               ; preds = %73
  %75 = sext i32 %.2 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %2, ptr nonnull align 1 %.053, i64 %75, i1 false)
  br label %.loopexit

76:                                               ; preds = %52, %48
  %.056 = load ptr, ptr %.05667, align 8, !tbaa !12
  %.not = icmp eq ptr %.056, null
  br i1 %.not, label %.loopexit, label %48, !llvm.loop !20

.loopexit:                                        ; preds = %76, %13, %73, %74
  %.0 = phi ptr [ %.053, %74 ], [ %.053, %73 ], [ null, %13 ], [ null, %76 ]
  ret ptr %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

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

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

; 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 = { 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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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 0}
!9 = !{!"HandleDictionary", !10, i64 0, !10, i64 8, !11, i64 16}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !11, i64 8}
!14 = !{!"DicNode", !10, i64 0, !11, i64 8, !11, i64 12, !6, i64 16}
!15 = !{!14, !11, i64 12}
!16 = !{!17, !10, i64 0}
!17 = !{!"OverWriteChain", !10, i64 0, !11, i64 8, !6, i64 12}
!18 = !{!17, !11, i64 8}
!19 = !{!11, !11, i64 0}
!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