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

; 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.HandleList = type { %struct.MList, i32, i32, i32, i32 }
%struct.MList = type { i32, ptr }
%struct.MHandle = type { i32, i32, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.GetHandle = external hidden unnamed_addr constant [10 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #1

declare void @m_Free(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @GetHandle(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  br label %20

20:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = icmp eq ptr %21, null
  br i1 %22, label %29, label %23

23:                                               ; preds = %20
  %24 = load i32, ptr %7, align 4, !tbaa !9
  %25 = icmp sle i32 %24, 0
  br i1 %25, label %29, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br label %29

29:                                               ; preds = %26, %23, %20
  %30 = phi i1 [ true, %23 ], [ true, %20 ], [ %28, %26 ]
  %31 = zext i1 %30 to i32
  store i32 %31, ptr %10, align 4, !tbaa !9
  %32 = load i32, ptr %10, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %29
  %35 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %35, i32 noundef -1, ptr noundef @.str.1, i32 noundef 513, ptr noundef @__FUNCTION__.GetHandle, ptr noundef @.str.2)
  br label %36

36:                                               ; preds = %34, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %37

37:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.HandleList, ptr %38, i64 -1
  store ptr %39, ptr %11, align 8, !tbaa !5
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.HandleList, ptr %40, i32 0, i32 1
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = load i32, ptr %8, align 4, !tbaa !9
  %44 = icmp eq i32 %42, %43
  br i1 %44, label %45, label %56

45:                                               ; preds = %37
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.HandleList, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %struct.MList, ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.HandleList, ptr %50, i32 0, i32 2
  %52 = load i32, ptr %51, align 4, !tbaa !15
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds ptr, ptr %49, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  store ptr %55, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %200

56:                                               ; preds = %37
  br label %57

57:                                               ; preds = %79, %56
  br label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.HandleList, ptr %59, i32 0, i32 3
  %61 = cmpxchg ptr %60, i32 0, i32 1 seq_cst seq_cst, align 8
  %62 = extractvalue { i32, i1 } %61, 1
  %63 = zext i1 %62 to i32
  store i32 %63, ptr %13, align 4, !tbaa !9
  %64 = load i32, ptr %13, align 4, !tbaa !9
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %66, label %67

66:                                               ; preds = %58
  store i32 5, ptr %12, align 4
  br label %77

67:                                               ; preds = %58
  br label %68

68:                                               ; preds = %75, %67
  br label %69

69:                                               ; preds = %68
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.HandleList, ptr %70, i32 0, i32 3
  %72 = load volatile i32, ptr %71, align 8, !tbaa !16
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %75

74:                                               ; preds = %69
  br label %76

75:                                               ; preds = %69
  br label %68

76:                                               ; preds = %74
  store i32 0, ptr %12, align 4
  br label %77

77:                                               ; preds = %76, %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  %78 = load i32, ptr %12, align 4
  switch i32 %78, label %202 [
    i32 0, label %79
    i32 5, label %80
  ]

79:                                               ; preds = %77
  br label %57

80:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %81, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.MList, ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 8, !tbaa !17
  store i32 %84, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %117, %80
  %86 = load i32, ptr %16, align 4, !tbaa !9
  %87 = load i32, ptr %15, align 4, !tbaa !9
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 8, ptr %12, align 4
  br label %120

90:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.MList, ptr %91, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = load i32, ptr %16, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds ptr, ptr %93, i64 %95
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  store ptr %97, ptr %17, align 8, !tbaa !5
  %98 = load ptr, ptr %17, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.MHandle, ptr %98, i32 0, i32 0
  %100 = load volatile i32, ptr %99, align 8, !tbaa !19
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = icmp eq i32 %100, %101
  br i1 %102, label %103, label %113

103:                                              ; preds = %90
  %104 = load i32, ptr %16, align 4, !tbaa !9
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.HandleList, ptr %105, i32 0, i32 2
  store i32 %104, ptr %106, align 4, !tbaa !15
  %107 = load i32, ptr %8, align 4, !tbaa !9
  %108 = load ptr, ptr %11, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.HandleList, ptr %108, i32 0, i32 1
  store i32 %107, ptr %109, align 8, !tbaa !11
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.HandleList, ptr %110, i32 0, i32 3
  store volatile i32 0, ptr %111, align 8, !tbaa !16
  %112 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %112, ptr %5, align 8
  store i32 1, ptr %12, align 4
  br label %114

113:                                              ; preds = %90
  store i32 0, ptr %12, align 4
  br label %114

114:                                              ; preds = %113, %103
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  %115 = load i32, ptr %12, align 4
  switch i32 %115, label %120 [
    i32 0, label %116
  ]

116:                                              ; preds = %114
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %16, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %16, align 4, !tbaa !9
  br label %85, !llvm.loop !21

120:                                              ; preds = %114, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %121 = load i32, ptr %12, align 4
  switch i32 %121, label %199 [
    i32 8, label %122
  ]

122:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = add i64 24, %124
  %126 = trunc i64 %125 to i32
  %127 = call ptr @m_Malloc(i32 noundef %126)
  store ptr %127, ptr %18, align 8, !tbaa !5
  %128 = load i32, ptr %8, align 4, !tbaa !9
  %129 = load ptr, ptr %18, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.MHandle, ptr %129, i32 0, i32 0
  store volatile i32 %128, ptr %130, align 8, !tbaa !19
  %131 = load ptr, ptr %18, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.MHandle, ptr %131, i32 0, i32 1
  store volatile i32 0, ptr %132, align 4, !tbaa !23
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.MHandle, ptr %133, i64 1
  %135 = load ptr, ptr %18, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.MHandle, ptr %135, i32 0, i32 3
  store ptr %134, ptr %136, align 8, !tbaa !24
  %137 = load ptr, ptr %18, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.MHandle, ptr %137, i32 0, i32 3
  %139 = load ptr, ptr %138, align 8, !tbaa !24
  %140 = load i32, ptr %7, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %139, i8 0, i64 %141, i1 false)
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.MHandle, ptr %143, i32 0, i32 2
  store ptr %142, ptr %144, align 8, !tbaa !25
  %145 = load i32, ptr %15, align 4, !tbaa !9
  %146 = srem i32 %145, 16
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %148, label %172

148:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %149 = load i32, ptr %15, align 4, !tbaa !9
  %150 = add nsw i32 %149, 16
  %151 = sext i32 %150 to i64
  %152 = mul i64 %151, 8
  %153 = trunc i64 %152 to i32
  %154 = call ptr @m_Malloc(i32 noundef %153)
  store ptr %154, ptr %19, align 8, !tbaa !5
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = icmp sgt i32 %155, 0
  br i1 %156, label %157, label %168

157:                                              ; preds = %148
  %158 = load ptr, ptr %19, align 8, !tbaa !5
  %159 = load ptr, ptr %14, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.MList, ptr %159, i32 0, i32 1
  %161 = load ptr, ptr %160, align 8, !tbaa !18
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = sext i32 %162 to i64
  %164 = mul i64 %163, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %158, ptr align 8 %161, i64 %164, i1 false)
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.MList, ptr %165, i32 0, i32 1
  %167 = load ptr, ptr %166, align 8, !tbaa !18
  call void @m_Free(ptr noundef %167)
  br label %168

168:                                              ; preds = %157, %148
  %169 = load ptr, ptr %19, align 8, !tbaa !5
  %170 = load ptr, ptr %14, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.MList, ptr %170, i32 0, i32 1
  store ptr %169, ptr %171, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %172

172:                                              ; preds = %168, %122
  %173 = load ptr, ptr %18, align 8, !tbaa !5
  %174 = load ptr, ptr %14, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.MList, ptr %174, i32 0, i32 1
  %176 = load ptr, ptr %175, align 8, !tbaa !18
  %177 = load i32, ptr %15, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds ptr, ptr %176, i64 %178
  store ptr %173, ptr %179, align 8, !tbaa !5
  %180 = load i32, ptr %15, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  %182 = load ptr, ptr %14, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.MList, ptr %182, i32 0, i32 0
  store i32 %181, ptr %183, align 8, !tbaa !17
  %184 = load i32, ptr %15, align 4, !tbaa !9
  %185 = load ptr, ptr %11, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.HandleList, ptr %185, i32 0, i32 2
  store i32 %184, ptr %186, align 4, !tbaa !15
  %187 = load i32, ptr %8, align 4, !tbaa !9
  %188 = load ptr, ptr %11, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.HandleList, ptr %188, i32 0, i32 1
  store i32 %187, ptr %189, align 8, !tbaa !11
  %190 = load ptr, ptr %11, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.HandleList, ptr %190, i32 0, i32 3
  store volatile i32 0, ptr %191, align 8, !tbaa !16
  %192 = load ptr, ptr %14, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.MList, ptr %192, i32 0, i32 1
  %194 = load ptr, ptr %193, align 8, !tbaa !18
  %195 = load i32, ptr %15, align 4, !tbaa !9
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds ptr, ptr %194, i64 %196
  %198 = load ptr, ptr %197, align 8, !tbaa !5
  store ptr %198, ptr %5, align 8
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %199

199:                                              ; preds = %172, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %200

200:                                              ; preds = %199, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %201 = load ptr, ptr %5, align 8
  ret ptr %201

202:                                              ; preds = %77
  unreachable
}

declare ptr @m_Malloc(i32 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"HandleList", !13, i64 0, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!13 = !{!"MList", !10, i64 0, !6, i64 8}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !10, i64 20}
!16 = !{!12, !10, i64 24}
!17 = !{!13, !10, i64 0}
!18 = !{!13, !6, i64 8}
!19 = !{!20, !10, i64 0}
!20 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!20, !10, i64 4}
!24 = !{!20, !6, i64 16}
!25 = !{!20, !6, i64 8}


; 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 [81 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@__FUNCTION__.GetHandle = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #0

declare void @m_Free(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @GetHandle(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = icmp eq ptr %0, null
  %6 = icmp slt i32 %1, 1
  %or.cond = or i1 %5, %6
  %7 = icmp eq ptr %3, null
  %spec.select = or i1 %or.cond, %7
  br i1 %spec.select, label %8, label %9

8:                                                ; preds = %4
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 513, ptr noundef nonnull @__FUNCTION__.GetHandle, ptr noundef nonnull @.str.2)
  br label %9

9:                                                ; preds = %8, %4
  %10 = getelementptr inbounds i8, ptr %0, i64 -32
  %11 = getelementptr inbounds i8, ptr %0, i64 -16
  %12 = load i32, ptr %11, align 8, !tbaa !5
  %13 = icmp eq i32 %12, %2
  br i1 %13, label %17, label %.preheader77

.preheader77:                                     ; preds = %9
  %14 = getelementptr inbounds i8, ptr %0, i64 -8
  %15 = cmpxchg ptr %14, i32 0, i32 1 seq_cst seq_cst, align 8
  %16 = extractvalue { i32, i1 } %15, 1
  br i1 %16, label %._crit_edge, label %.preheader

17:                                               ; preds = %9
  %18 = getelementptr inbounds i8, ptr %0, i64 -24
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  %20 = getelementptr inbounds i8, ptr %0, i64 -12
  %21 = load i32, ptr %20, align 4, !tbaa !13
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds ptr, ptr %19, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  br label %70

.loopexit:                                        ; preds = %.preheader
  %25 = cmpxchg ptr %14, i32 0, i32 1 seq_cst seq_cst, align 8
  %26 = extractvalue { i32, i1 } %25, 1
  br i1 %26, label %._crit_edge, label %.preheader.backedge

.preheader:                                       ; preds = %.preheader77, %.preheader.backedge
  %27 = load volatile i32, ptr %14, align 8, !tbaa !15
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %.loopexit, label %.preheader.backedge

.preheader.backedge:                              ; preds = %.preheader, %.loopexit
  br label %.preheader

._crit_edge:                                      ; preds = %.loopexit, %.preheader77
  %29 = load i32, ptr %10, align 8, !tbaa !16
  %.not7080 = icmp sgt i32 %29, 0
  br i1 %.not7080, label %.lr.ph, label %._crit_edge83

.lr.ph:                                           ; preds = %._crit_edge
  %30 = getelementptr inbounds i8, ptr %0, i64 -24
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %wide.trip.count = zext nneg i32 %29 to i64
  br label %32

32:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %33 = getelementptr inbounds ptr, ptr %31, i64 %indvars.iv
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = load volatile i32, ptr %34, align 8, !tbaa !18
  %.not = icmp eq i32 %35, %2
  br i1 %.not, label %.thread75, label %38

.thread75:                                        ; preds = %32
  %36 = trunc nuw nsw i64 %indvars.iv to i32
  %37 = getelementptr inbounds i8, ptr %0, i64 -12
  store i32 %36, ptr %37, align 4, !tbaa !13
  store i32 %2, ptr %11, align 8, !tbaa !5
  store volatile i32 0, ptr %14, align 8, !tbaa !15
  br label %70

38:                                               ; preds = %32
  %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_edge83, label %32, !llvm.loop !20

._crit_edge83:                                    ; preds = %38, %._crit_edge
  %39 = sext i32 %1 to i64
  %40 = add i32 %1, 24
  %41 = tail call ptr @m_Malloc(i32 noundef %40) #4
  store volatile i32 %2, ptr %41, align 8, !tbaa !18
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  store volatile i32 0, ptr %42, align 4, !tbaa !22
  %43 = getelementptr inbounds i8, ptr %41, i64 24
  %44 = getelementptr inbounds i8, ptr %41, i64 16
  store ptr %43, ptr %44, align 8, !tbaa !23
  tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %43, i8 0, i64 %39, i1 false)
  %45 = getelementptr inbounds i8, ptr %41, i64 8
  store ptr %3, ptr %45, align 8, !tbaa !24
  %46 = and i32 %29, 15
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %._crit_edge83._crit_edge

._crit_edge83._crit_edge:                         ; preds = %._crit_edge83
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 -24
  %.pre = load ptr, ptr %.phi.trans.insert, align 8, !tbaa !17
  br label %60

48:                                               ; preds = %._crit_edge83
  %49 = shl i32 %29, 3
  %50 = add i32 %49, 128
  %51 = tail call ptr @m_Malloc(i32 noundef %50) #4
  br i1 %.not7080, label %52, label %58

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %0, i64 -24
  %54 = load ptr, ptr %53, align 8, !tbaa !17
  %55 = zext nneg i32 %29 to i64
  %56 = shl nuw nsw i64 %55, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %51, ptr align 8 %54, i64 %56, i1 false)
  %57 = load ptr, ptr %53, align 8, !tbaa !17
  tail call void @m_Free(ptr noundef %57) #4
  br label %58

58:                                               ; preds = %52, %48
  %59 = getelementptr inbounds i8, ptr %0, i64 -24
  store ptr %51, ptr %59, align 8, !tbaa !17
  br label %60

60:                                               ; preds = %._crit_edge83._crit_edge, %58
  %61 = phi ptr [ %.pre, %._crit_edge83._crit_edge ], [ %51, %58 ]
  %62 = getelementptr inbounds i8, ptr %0, i64 -24
  %63 = sext i32 %29 to i64
  %64 = getelementptr inbounds ptr, ptr %61, i64 %63
  store ptr %41, ptr %64, align 8, !tbaa !14
  %65 = add nsw i32 %29, 1
  store i32 %65, ptr %10, align 8, !tbaa !16
  %66 = getelementptr inbounds i8, ptr %0, i64 -12
  store i32 %29, ptr %66, align 4, !tbaa !13
  store i32 %2, ptr %11, align 8, !tbaa !5
  store volatile i32 0, ptr %14, align 8, !tbaa !15
  %67 = load ptr, ptr %62, align 8, !tbaa !17
  %68 = getelementptr inbounds ptr, ptr %67, i64 %63
  %69 = load ptr, ptr %68, align 8, !tbaa !14
  br label %70

70:                                               ; preds = %.thread75, %60, %17
  %.4 = phi ptr [ %24, %17 ], [ %69, %60 ], [ %34, %.thread75 ]
  ret ptr %.4
}

declare ptr @m_Malloc(i32 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) #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 = { "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: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !8, i64 16}
!6 = !{!"HandleList", !7, i64 0, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!7 = !{!"MList", !8, i64 0, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!6, !11, i64 8}
!13 = !{!6, !8, i64 20}
!14 = !{!11, !11, i64 0}
!15 = !{!6, !8, i64 24}
!16 = !{!7, !8, i64 0}
!17 = !{!7, !11, i64 8}
!18 = !{!19, !8, i64 0}
!19 = !{!"MHandle", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!19, !8, i64 4}
!23 = !{!19, !11, i64 16}
!24 = !{!19, !11, i64 8}


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