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

; 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 }
%struct.HandleGraphCreate = type { ptr, i32, i32, ptr, i32, ptr, ptr }
%struct.GraphNode = type { ptr, ptr, ptr, i32, i32, i32, ptr }
%struct.MObject = type { i32, %union.anon }
%union.anon = type { ptr }

@.str.2 = external hidden unnamed_addr constant [77 x i8], align 1
@__FUNCTION__.m_GraphNode = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 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

declare void @m_Free(ptr noundef) #1

; 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
define dso_local ptr @m_GraphNode(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.HandleList, ptr %16, i64 -1
  %18 = getelementptr inbounds %struct.HandleList, ptr %17, i32 0, i32 0
  %19 = getelementptr inbounds %struct.MList, ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds ptr, ptr %20, i64 1
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %22, ptr %8, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.MHandle, ptr %24, i32 0, i32 0
  %26 = load volatile i32, ptr %25, align 8, !tbaa !14
  %27 = icmp ne i32 %26, -562223887
  %28 = zext i1 %27 to i32
  store i32 %28, ptr %9, align 4, !tbaa !9
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %33

31:                                               ; preds = %23
  %32 = load i32, ptr %9, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %32, i32 noundef -1, ptr noundef @.str.2, i32 noundef 59, ptr noundef @__FUNCTION__.m_GraphNode, ptr noundef @.str.3)
  br label %33

33:                                               ; preds = %31, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.MHandle, ptr %36, i32 0, i32 3
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  store ptr %38, ptr %10, align 8, !tbaa !5
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.HandleGraphCreate, ptr %39, i32 0, i32 3
  %41 = load ptr, ptr %40, align 8, !tbaa !17
  %42 = icmp eq ptr %41, null
  br i1 %42, label %43, label %47

43:                                               ; preds = %35
  %44 = call ptr @mMemoryCreate(i32 noundef -1, i32 noundef -1, i32 noundef 0)
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.HandleGraphCreate, ptr %45, i32 0, i32 3
  store ptr %44, ptr %46, align 8, !tbaa !17
  br label %47

47:                                               ; preds = %43, %35
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.HandleGraphCreate, ptr %48, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !19
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.HandleGraphCreate, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 8, !tbaa !20
  %54 = icmp eq i32 %50, %53
  br i1 %54, label %55, label %103

55:                                               ; preds = %47
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.HandleGraphCreate, ptr %56, i32 0, i32 2
  %58 = load i32, ptr %57, align 4, !tbaa !19
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.HandleGraphCreate, ptr %59, i32 0, i32 2
  %61 = load i32, ptr %60, align 4, !tbaa !19
  %62 = sdiv i32 %61, 2
  %63 = icmp sgt i32 %62, 8
  br i1 %63, label %64, label %69

64:                                               ; preds = %55
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.HandleGraphCreate, ptr %65, i32 0, i32 2
  %67 = load i32, ptr %66, align 4, !tbaa !19
  %68 = sdiv i32 %67, 2
  br label %70

69:                                               ; preds = %55
  br label %70

70:                                               ; preds = %69, %64
  %71 = phi i32 [ %68, %64 ], [ 8, %69 ]
  %72 = add nsw i32 %58, %71
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.HandleGraphCreate, ptr %73, i32 0, i32 2
  store i32 %72, ptr %74, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.HandleGraphCreate, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %76, align 4, !tbaa !19
  %78 = sext i32 %77 to i64
  %79 = mul i64 %78, 8
  %80 = trunc i64 %79 to i32
  %81 = call ptr @m_Malloc(i32 noundef %80)
  store ptr %81, ptr %11, align 8, !tbaa !5
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.HandleGraphCreate, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 8, !tbaa !20
  %85 = icmp sgt i32 %84, 0
  br i1 %85, label %86, label %99

86:                                               ; preds = %70
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = load ptr, ptr %10, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.HandleGraphCreate, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !21
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.HandleGraphCreate, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !20
  %94 = sext i32 %93 to i64
  %95 = mul i64 %94, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %87, ptr align 8 %90, i64 %95, i1 false)
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.HandleGraphCreate, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !21
  call void @m_Free(ptr noundef %98)
  br label %99

99:                                               ; preds = %86, %70
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.HandleGraphCreate, ptr %101, i32 0, i32 0
  store ptr %100, ptr %102, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %103

103:                                              ; preds = %99, %47
  %104 = load i32, ptr %7, align 4, !tbaa !9
  %105 = icmp sle i32 %104, 0
  br i1 %105, label %106, label %117

106:                                              ; preds = %103
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = icmp ne ptr %107, null
  br i1 %108, label %109, label %113

109:                                              ; preds = %106
  %110 = load ptr, ptr %6, align 8, !tbaa !5
  %111 = call i64 @strlen(ptr noundef %110) #7
  %112 = add i64 %111, 1
  br label %114

113:                                              ; preds = %106
  br label %114

114:                                              ; preds = %113, %109
  %115 = phi i64 [ %112, %109 ], [ 0, %113 ]
  %116 = trunc i64 %115 to i32
  store i32 %116, ptr %7, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %114, %103
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = icmp ne ptr %118, null
  br i1 %119, label %120, label %156

120:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %150, %120
  %122 = load i32, ptr %12, align 4, !tbaa !9
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.HandleGraphCreate, ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 8, !tbaa !20
  %126 = icmp slt i32 %122, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %121
  store i32 4, ptr %13, align 4
  br label %153

128:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %129 = load ptr, ptr %10, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.HandleGraphCreate, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !21
  %132 = load i32, ptr %12, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds ptr, ptr %131, i64 %133
  %135 = load ptr, ptr %134, align 8, !tbaa !5
  store ptr %135, ptr %14, align 8, !tbaa !5
  %136 = load ptr, ptr %14, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.GraphNode, ptr %136, i32 0, i32 0
  %138 = load ptr, ptr %137, align 8, !tbaa !22
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = load i32, ptr %7, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = call i32 @memcmp(ptr noundef %138, ptr noundef %139, i64 noundef %141) #7
  %143 = icmp eq i32 %142, 0
  br i1 %143, label %144, label %146

144:                                              ; preds = %128
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %145, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %147

146:                                              ; preds = %128
  store i32 0, ptr %13, align 4
  br label %147

147:                                              ; preds = %146, %144
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %148 = load i32, ptr %13, align 4
  switch i32 %148, label %153 [
    i32 0, label %149
  ]

149:                                              ; preds = %147
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %12, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %12, align 4, !tbaa !9
  br label %121, !llvm.loop !24

153:                                              ; preds = %147, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  %154 = load i32, ptr %13, align 4
  switch i32 %154, label %215 [
    i32 4, label %155
  ]

155:                                              ; preds = %153
  br label %156

156:                                              ; preds = %155, %117
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.HandleGraphCreate, ptr %157, i32 0, i32 3
  %159 = load ptr, ptr %158, align 8, !tbaa !17
  %160 = load i32, ptr %7, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = add i64 48, %161
  %163 = trunc i64 %162 to i32
  %164 = call ptr @mMemoryWrite(ptr noundef %159, ptr noundef null, i32 noundef %163)
  store ptr %164, ptr %15, align 8, !tbaa !5
  %165 = load ptr, ptr %15, align 8, !tbaa !5
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.HandleGraphCreate, ptr %166, i32 0, i32 0
  %168 = load ptr, ptr %167, align 8, !tbaa !21
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.HandleGraphCreate, ptr %169, i32 0, i32 1
  %171 = load i32, ptr %170, align 8, !tbaa !20
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds ptr, ptr %168, i64 %172
  store ptr %165, ptr %173, align 8, !tbaa !5
  %174 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %174, i8 0, i64 48, i1 false)
  %175 = load ptr, ptr %15, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.GraphNode, ptr %175, i64 1
  %177 = load ptr, ptr %15, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.GraphNode, ptr %177, i32 0, i32 0
  store ptr %176, ptr %178, align 8, !tbaa !22
  %179 = load ptr, ptr %10, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.HandleGraphCreate, ptr %179, i32 0, i32 1
  %181 = load i32, ptr %180, align 8, !tbaa !20
  %182 = load ptr, ptr %15, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.GraphNode, ptr %182, i32 0, i32 5
  store i32 %181, ptr %183, align 8, !tbaa !26
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = load ptr, ptr %15, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.GraphNode, ptr %185, i32 0, i32 6
  store ptr %184, ptr %186, align 8, !tbaa !27
  %187 = load ptr, ptr %10, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.HandleGraphCreate, ptr %187, i32 0, i32 1
  %189 = load i32, ptr %188, align 8, !tbaa !20
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %188, align 8, !tbaa !20
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.MObject, ptr %191, i32 0, i32 1
  %193 = load ptr, ptr %192, align 8, !tbaa !28
  %194 = icmp eq ptr %193, null
  br i1 %194, label %195, label %199

195:                                              ; preds = %156
  %196 = load ptr, ptr %15, align 8, !tbaa !5
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.MObject, ptr %197, i32 0, i32 1
  store ptr %196, ptr %198, align 8, !tbaa !28
  br label %199

199:                                              ; preds = %195, %156
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = icmp ne ptr %200, null
  br i1 %201, label %202, label %209

202:                                              ; preds = %199
  %203 = load ptr, ptr %15, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.GraphNode, ptr %203, i32 0, i32 0
  %205 = load ptr, ptr %204, align 8, !tbaa !22
  %206 = load ptr, ptr %6, align 8, !tbaa !5
  %207 = load i32, ptr %7, align 4, !tbaa !9
  %208 = sext i32 %207 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %205, ptr align 1 %206, i64 %208, i1 false)
  br label %209

209:                                              ; preds = %202, %199
  %210 = load ptr, ptr %10, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.HandleGraphCreate, ptr %210, i32 0, i32 4
  %212 = load i32, ptr %211, align 8, !tbaa !29
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %211, align 8, !tbaa !29
  %214 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %214, ptr %4, align 8
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %215

215:                                              ; preds = %209, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %216 = load ptr, ptr %4, align 8
  ret ptr %216
}

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

declare ptr @mMemoryCreate(i32 noundef, i32 noundef, i32 noundef) #1

declare ptr @m_Malloc(i32 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) #3

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

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

declare ptr @mMemoryWrite(ptr noundef, ptr noundef, i32 noundef) #1

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

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 8}
!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 = !{!15, !10, i64 0}
!15 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!16 = !{!15, !6, i64 16}
!17 = !{!18, !6, i64 16}
!18 = !{!"HandleGraphCreate", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !6, i64 32, !6, i64 40}
!19 = !{!18, !10, i64 12}
!20 = !{!18, !10, i64 8}
!21 = !{!18, !6, i64 0}
!22 = !{!23, !6, i64 0}
!23 = !{!"GraphNode", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !6, i64 40}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!23, !10, i64 32}
!27 = !{!23, !6, i64 40}
!28 = !{!7, !7, i64 0}
!29 = !{!18, !10, i64 24}


; 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.2 = external hidden unnamed_addr constant [77 x i8], align 1
@__FUNCTION__.m_GraphNode = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [20 x i8], align 1

declare void @m_Free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @m_GraphNode(ptr noundef %0, ptr noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 -24
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  %8 = load volatile i32, ptr %7, align 8, !tbaa !13
  %.not79 = icmp eq i32 %8, -562223887
  br i1 %.not79, label %10, label %9

9:                                                ; preds = %3
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.2, i32 noundef 59, ptr noundef nonnull @__FUNCTION__.m_GraphNode, ptr noundef nonnull @.str.3) #6
  br label %10

10:                                               ; preds = %9, %3
  %11 = getelementptr inbounds i8, ptr %7, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !15
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %18

16:                                               ; preds = %10
  %17 = tail call ptr @mMemoryCreate(i32 noundef -1, i32 noundef -1, i32 noundef 0) #6
  store ptr %17, ptr %13, align 8, !tbaa !16
  br label %18

18:                                               ; preds = %16, %10
  %19 = getelementptr inbounds i8, ptr %12, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !18
  %21 = getelementptr inbounds i8, ptr %12, i64 8
  %22 = load i32, ptr %21, align 8, !tbaa !19
  %23 = icmp eq i32 %20, %22
  br i1 %23, label %24, label %39

24:                                               ; preds = %18
  %25 = icmp sgt i32 %20, 17
  %26 = sdiv i32 %20, 2
  %27 = select i1 %25, i32 %26, i32 8
  %28 = add nsw i32 %27, %20
  store i32 %28, ptr %19, align 4, !tbaa !18
  %29 = shl i32 %28, 3
  %30 = tail call ptr @m_Malloc(i32 noundef %29) #6
  %31 = load i32, ptr %21, align 8, !tbaa !19
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %33, label %38

33:                                               ; preds = %24
  %34 = load ptr, ptr %12, align 8, !tbaa !20
  %35 = zext nneg i32 %31 to i64
  %36 = shl nuw nsw i64 %35, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %34, i64 %36, i1 false)
  %37 = load ptr, ptr %12, align 8, !tbaa !20
  tail call void @m_Free(ptr noundef %37) #6
  br label %38

38:                                               ; preds = %33, %24
  store ptr %30, ptr %12, align 8, !tbaa !20
  br label %39

39:                                               ; preds = %38, %18
  %40 = icmp slt i32 %2, 1
  %.not = icmp eq ptr %1, null
  br i1 %40, label %41, label %45

41:                                               ; preds = %39
  br i1 %.not, label %.thread, label %.thread84

.thread84:                                        ; preds = %41
  %42 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #7
  %43 = trunc i64 %42 to i32
  %44 = add i32 %43, 1
  br label %.preheader

45:                                               ; preds = %39
  br i1 %.not, label %.thread, label %.preheader

.preheader:                                       ; preds = %.thread84, %45
  %.05987 = phi i32 [ %44, %.thread84 ], [ %2, %45 ]
  %46 = load i32, ptr %21, align 8, !tbaa !19
  %.not7280 = icmp sgt i32 %46, 0
  br i1 %.not7280, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %.preheader
  %47 = load ptr, ptr %12, align 8, !tbaa !20
  %48 = sext i32 %.05987 to i64
  %wide.trip.count = zext nneg i32 %46 to i64
  br label %50

49:                                               ; preds = %50
  %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 %.thread, label %50, !llvm.loop !21

50:                                               ; preds = %.lr.ph, %49
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %49 ]
  %51 = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv
  %52 = load ptr, ptr %51, align 8, !tbaa !12
  %53 = load ptr, ptr %52, align 8, !tbaa !23
  %bcmp = tail call i32 @bcmp(ptr %53, ptr nonnull %1, i64 %48)
  %.not71 = icmp eq i32 %bcmp, 0
  br i1 %.not71, label %.thread77, label %49

.thread:                                          ; preds = %49, %.preheader, %41, %45
  %.not7076 = phi i1 [ true, %45 ], [ true, %41 ], [ false, %.preheader ], [ false, %49 ]
  %.05975 = phi i32 [ %2, %45 ], [ 0, %41 ], [ %.05987, %.preheader ], [ %.05987, %49 ]
  %54 = load ptr, ptr %13, align 8, !tbaa !16
  %55 = sext i32 %.05975 to i64
  %56 = add i32 %.05975, 48
  %57 = tail call ptr @mMemoryWrite(ptr noundef %54, ptr noundef null, i32 noundef %56) #6
  %58 = load ptr, ptr %12, align 8, !tbaa !20
  %59 = load i32, ptr %21, align 8, !tbaa !19
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %58, i64 %60
  store ptr %57, ptr %61, align 8, !tbaa !12
  %62 = getelementptr inbounds i8, ptr %57, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %62, i8 0, i64 40, i1 false)
  %63 = getelementptr inbounds i8, ptr %57, i64 48
  store ptr %63, ptr %57, align 8, !tbaa !23
  %64 = load i32, ptr %21, align 8, !tbaa !19
  %65 = getelementptr inbounds i8, ptr %57, i64 32
  store i32 %64, ptr %65, align 8, !tbaa !25
  %66 = getelementptr inbounds i8, ptr %57, i64 40
  store ptr %0, ptr %66, align 8, !tbaa !26
  %67 = add nsw i32 %64, 1
  store i32 %67, ptr %21, align 8, !tbaa !19
  %68 = getelementptr inbounds i8, ptr %0, i64 8
  %69 = load ptr, ptr %68, align 8, !tbaa !27
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %72

71:                                               ; preds = %.thread
  store ptr %57, ptr %68, align 8, !tbaa !27
  br label %72

72:                                               ; preds = %71, %.thread
  br i1 %.not7076, label %75, label %73

73:                                               ; preds = %72
  %74 = load ptr, ptr %57, align 8, !tbaa !23
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %74, ptr nonnull align 1 %1, i64 %55, i1 false)
  br label %75

75:                                               ; preds = %73, %72
  %76 = getelementptr inbounds i8, ptr %12, i64 24
  %77 = load i32, ptr %76, align 8, !tbaa !28
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %76, align 8, !tbaa !28
  br label %.thread77

.thread77:                                        ; preds = %50, %75
  %.3 = phi ptr [ %57, %75 ], [ %52, %50 ]
  ret ptr %.3
}

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

declare ptr @mMemoryCreate(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare ptr @m_Malloc(i32 noundef) local_unnamed_addr #0

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

declare ptr @mMemoryWrite(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

attributes #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
attributes #7 = { 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, !11, i64 8}
!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 = !{!11, !11, i64 0}
!13 = !{!14, !8, i64 0}
!14 = !{!"MHandle", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16}
!15 = !{!14, !11, i64 16}
!16 = !{!17, !11, i64 16}
!17 = !{!"HandleGraphCreate", !11, i64 0, !8, i64 8, !8, i64 12, !11, i64 16, !8, i64 24, !11, i64 32, !11, i64 40}
!18 = !{!17, !8, i64 12}
!19 = !{!17, !8, i64 8}
!20 = !{!17, !11, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !11, i64 0}
!24 = !{!"GraphNode", !11, i64 0, !11, i64 8, !11, i64 16, !8, i64 24, !8, i64 28, !8, i64 32, !11, i64 40}
!25 = !{!24, !8, i64 32}
!26 = !{!24, !11, i64 40}
!27 = !{!9, !9, i64 0}
!28 = !{!17, !8, i64 24}


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