; LLVM IR from jingweizhanghuai/Morn :: src/deep_learning (morn_learning_net)

; 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.TensorRegister = type { [32 x i8], ptr, ptr, ptr }
%struct.MLayer = type { [32 x i8], i32, ptr, ptr, ptr, i32 }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleNetworkGenerate = type { ptr }
%struct.MSheet = type { i32, ptr, ptr, ptr }
%struct.MList = type { i32, ptr }

@morn_tensor_register = external dso_local global [256 x %struct.TensorRegister], align 16
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 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: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, 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
declare ptr @strcpy(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @mTensorRegisterAll() #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @NetworkPara(ptr noundef) #3

declare ptr @m_INIRead(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
declare dso_local void @endNetworkGenerate(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @mNetworkGenerate(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.MLayer, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = call ptr @GetHandle(ptr noundef %12, i32 noundef 8, i32 noundef 1486489908, ptr noundef @endNetworkGenerate)
  store ptr %13, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.MHandle, ptr %14, i32 0, i32 3
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.MHandle, ptr %17, i32 0, i32 1
  %19 = load volatile i32, ptr %18, align 4, !tbaa !12
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %25

21:                                               ; preds = %1
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  store ptr %24, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %138

25:                                               ; preds = %1
  call void (...) @mActivationRegisterAll()
  call void @mTensorRegisterAll()
  call void (...) @mLossRegisterAll()
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %26, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %34

30:                                               ; preds = %25
  %31 = call ptr @ListCreate(i32 noundef -1, ptr noundef null)
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %32, i32 0, i32 0
  store ptr %31, ptr %33, align 8, !tbaa !13
  br label %34

34:                                               ; preds = %30, %25
  call void @llvm.lifetime.start.p0(i64 72, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr %7, ptr %8, align 8, !tbaa !5
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  call void @mListClear(ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !15
  br label %38

38:                                               ; preds = %91, %34
  %39 = load i32, ptr %9, align 4, !tbaa !15
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.MSheet, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !16
  %43 = icmp slt i32 %39, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %38
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %94

45:                                               ; preds = %38
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.MSheet, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = load i32, ptr %9, align 4, !tbaa !15
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = call i32 @strcmp(ptr noundef %52, ptr noundef @.str.15) #6
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %45
  br label %91

56:                                               ; preds = %45
  %57 = load ptr, ptr %8, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.MLayer, ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds [32 x i8], ptr %58, i64 0, i64 0
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.MSheet, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  %63 = load i32, ptr %9, align 4, !tbaa !15
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = call ptr @strcpy(ptr noundef %59, ptr noundef %66) #5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.MLayer, ptr %68, i32 0, i32 5
  store i32 -1, ptr %69, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.MLayer, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds [32 x i8], ptr %72, i64 0, i64 0
  %74 = ptrtoint ptr %73 to i64
  %75 = call ptr (ptr, i64, i64, ptr, ...) @m_INIRead(ptr noundef %70, i64 noundef %74, i64 noundef ptrtoint (ptr @.str.24 to i64), ptr noundef inttoptr (i64 -1 to ptr), i32 noundef -1)
  store ptr %75, ptr %10, align 8, !tbaa !5
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = call i32 @mTensorRegisterIndex(ptr noundef %76)
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.MLayer, ptr %78, i32 0, i32 1
  store i32 %77, ptr %79, align 8, !tbaa !21
  %80 = call ptr @TensorCreate(i32 noundef -1, i32 noundef -1, i32 noundef -1, i32 noundef -1, ptr noundef null, i32 noundef -1)
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.MLayer, ptr %81, i32 0, i32 2
  store ptr %80, ptr %82, align 8, !tbaa !22
  %83 = call ptr @TensorCreate(i32 noundef -1, i32 noundef -1, i32 noundef -1, i32 noundef -1, ptr noundef null, i32 noundef -1)
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.MLayer, ptr %84, i32 0, i32 3
  store ptr %83, ptr %85, align 8, !tbaa !23
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %86, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !13
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = call ptr @mListWrite(ptr noundef %88, i32 noundef -1, ptr noundef %89, i32 noundef 72)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %91

91:                                               ; preds = %56, %55
  %92 = load i32, ptr %9, align 4, !tbaa !15
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %9, align 4, !tbaa !15
  br label %38, !llvm.loop !24

94:                                               ; preds = %44
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.MHandle, ptr %95, i32 0, i32 1
  store volatile i32 1, ptr %96, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !15
  br label %97

97:                                               ; preds = %130, %94
  %98 = load i32, ptr %11, align 4, !tbaa !15
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !13
  %102 = getelementptr inbounds %struct.MList, ptr %101, i32 0, i32 0
  %103 = load i32, ptr %102, align 8, !tbaa !26
  %104 = icmp slt i32 %98, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %97
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %133

106:                                              ; preds = %97
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !13
  %110 = getelementptr inbounds %struct.MList, ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !28
  %112 = load i32, ptr %11, align 4, !tbaa !15
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds ptr, ptr %111, i64 %113
  %115 = load ptr, ptr %114, align 8, !tbaa !5
  store ptr %115, ptr %8, align 8, !tbaa !5
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.MLayer, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 8, !tbaa !21
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %119
  %121 = getelementptr inbounds %struct.TensorRegister, ptr %120, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !29
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = load ptr, ptr %8, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.MLayer, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds [32 x i8], ptr %125, i64 0, i64 0
  %127 = call ptr %122(ptr noundef %123, ptr noundef %126)
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.MLayer, ptr %128, i32 0, i32 4
  store ptr %127, ptr %129, align 8, !tbaa !31
  br label %130

130:                                              ; preds = %106
  %131 = load i32, ptr %11, align 4, !tbaa !15
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %11, align 4, !tbaa !15
  br label %97, !llvm.loop !32

133:                                              ; preds = %105
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  call void @NetworkPara(ptr noundef %134)
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.HandleNetworkGenerate, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !13
  store ptr %137, ptr %2, align 8
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 72, ptr %7) #5
  br label %138

138:                                              ; preds = %133, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %139 = load ptr, ptr %2, align 8
  ret ptr %139
}

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #4

declare void @mActivationRegisterAll(...) #4

declare void @mLossRegisterAll(...) #4

declare ptr @ListCreate(i32 noundef, ptr noundef) #4

declare void @mListClear(ptr noundef) #4

declare ptr @TensorCreate(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #4

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { "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 = !{!10, !6, i64 16}
!10 = !{!"MHandle", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!14, !6, i64 0}
!14 = !{!"HandleNetworkGenerate", !6, i64 0}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !11, i64 0}
!17 = !{!"MSheet", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!17, !6, i64 8}
!19 = !{!20, !11, i64 64}
!20 = !{!"MLayer", !7, i64 0, !11, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64}
!21 = !{!20, !11, i64 32}
!22 = !{!20, !6, i64 40}
!23 = !{!20, !6, i64 48}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !11, i64 0}
!27 = !{!"MList", !11, i64 0, !6, i64 8}
!28 = !{!27, !6, i64 8}
!29 = !{!30, !6, i64 32}
!30 = !{!"TensorRegister", !7, i64 0, !6, i64 32, !6, i64 40, !6, i64 48}
!31 = !{!20, !6, i64 56}
!32 = distinct !{!32, !25}


; 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"

%struct.TensorRegister = type { [32 x i8], ptr, ptr, ptr }
%struct.MLayer = type { [32 x i8], i32, ptr, ptr, ptr, i32 }

@morn_tensor_register = external dso_local local_unnamed_addr global [256 x %struct.TensorRegister], align 16
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 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 nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @mTensorRegisterAll() local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @NetworkPara(ptr noundef) local_unnamed_addr #3

declare ptr @m_INIRead(ptr noundef, i64 noundef, i64 noundef, ptr noundef, ...) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @endNetworkGenerate(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @mNetworkGenerate(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca %struct.MLayer, align 8
  %3 = tail call ptr @GetHandle(ptr noundef %0, i32 noundef 8, i32 noundef 1486489908, ptr noundef nonnull @endNetworkGenerate) #5
  %4 = getelementptr inbounds i8, ptr %3, i64 16
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %3, i64 4
  %7 = load volatile i32, ptr %6, align 4, !tbaa !11
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %9, label %11

9:                                                ; preds = %1
  %10 = load ptr, ptr %5, align 8, !tbaa !12
  br label %65

11:                                               ; preds = %1
  tail call void (...) @mActivationRegisterAll() #5
  tail call void @mTensorRegisterAll()
  tail call void (...) @mLossRegisterAll() #5
  %12 = load ptr, ptr %5, align 8, !tbaa !12
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %16

14:                                               ; preds = %11
  %15 = tail call ptr @ListCreate(i32 noundef -1, ptr noundef null) #5
  store ptr %15, ptr %5, align 8, !tbaa !12
  br label %16

16:                                               ; preds = %14, %11
  %17 = phi ptr [ %15, %14 ], [ %12, %11 ]
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %2) #5
  tail call void @mListClear(ptr noundef %17) #5
  %18 = load i32, ptr %0, align 8, !tbaa !14
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %21 = getelementptr inbounds i8, ptr %2, i64 64
  %22 = ptrtoint ptr %2 to i64
  %23 = getelementptr inbounds i8, ptr %2, i64 32
  %24 = getelementptr inbounds i8, ptr %2, i64 40
  %25 = getelementptr inbounds i8, ptr %2, i64 48
  br label %29

._crit_edge:                                      ; preds = %44, %16
  store volatile i32 1, ptr %6, align 4, !tbaa !11
  %26 = load ptr, ptr %5, align 8, !tbaa !12
  %27 = load i32, ptr %26, align 8, !tbaa !16
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph41, label %._crit_edge42

29:                                               ; preds = %.lr.ph, %44
  %30 = phi i32 [ %18, %.lr.ph ], [ %45, %44 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %44 ]
  %31 = load ptr, ptr %20, align 8, !tbaa !18
  %32 = getelementptr inbounds ptr, ptr %31, i64 %indvars.iv
  %33 = load ptr, ptr %32, align 8, !tbaa !19
  %34 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %33, ptr noundef nonnull dereferenceable(1) @.str.15) #6
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %44, label %36

36:                                               ; preds = %29
  %37 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %33) #5
  store i32 -1, ptr %21, align 8, !tbaa !20
  %38 = call ptr (ptr, i64, i64, ptr, ...) @m_INIRead(ptr noundef nonnull %0, i64 noundef %22, i64 noundef ptrtoint (ptr @.str.24 to i64), ptr noundef nonnull inttoptr (i64 -1 to ptr), i32 noundef -1) #5
  %39 = call i32 @mTensorRegisterIndex(ptr noundef %38)
  store i32 %39, ptr %23, align 8, !tbaa !22
  %40 = call ptr @TensorCreate(i32 noundef -1, i32 noundef -1, i32 noundef -1, i32 noundef -1, ptr noundef null, i32 noundef -1) #5
  store ptr %40, ptr %24, align 8, !tbaa !23
  %41 = call ptr @TensorCreate(i32 noundef -1, i32 noundef -1, i32 noundef -1, i32 noundef -1, ptr noundef null, i32 noundef -1) #5
  store ptr %41, ptr %25, align 8, !tbaa !24
  %42 = load ptr, ptr %5, align 8, !tbaa !12
  %43 = call ptr @mListWrite(ptr noundef %42, i32 noundef -1, ptr noundef nonnull %2, i32 noundef 72) #5
  %.pre = load i32, ptr %0, align 8, !tbaa !14
  br label %44

44:                                               ; preds = %29, %36
  %45 = phi i32 [ %30, %29 ], [ %.pre, %36 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next, %46
  br i1 %47, label %29, label %._crit_edge, !llvm.loop !25

._crit_edge42:                                    ; preds = %.lr.ph41, %._crit_edge
  call void @NetworkPara(ptr noundef nonnull %0)
  %48 = load ptr, ptr %5, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %2) #5
  br label %65

.lr.ph41:                                         ; preds = %._crit_edge, %.lr.ph41
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.lr.ph41 ], [ 0, %._crit_edge ]
  %49 = phi ptr [ %61, %.lr.ph41 ], [ %26, %._crit_edge ]
  %50 = getelementptr inbounds i8, ptr %49, i64 8
  %51 = load ptr, ptr %50, align 8, !tbaa !27
  %52 = getelementptr inbounds ptr, ptr %51, i64 %indvars.iv44
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = getelementptr inbounds i8, ptr %53, i64 32
  %55 = load i32, ptr %54, align 8, !tbaa !22
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %56, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !28
  %59 = call ptr %58(ptr noundef nonnull %0, ptr noundef %53) #5
  %60 = getelementptr inbounds i8, ptr %53, i64 56
  store ptr %59, ptr %60, align 8, !tbaa !30
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %61 = load ptr, ptr %5, align 8, !tbaa !12
  %62 = load i32, ptr %61, align 8, !tbaa !16
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next45, %63
  br i1 %64, label %.lr.ph41, label %._crit_edge42, !llvm.loop !31

65:                                               ; preds = %._crit_edge42, %9
  %.036 = phi ptr [ %10, %9 ], [ %48, %._crit_edge42 ]
  ret ptr %.036
}

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @mActivationRegisterAll(...) local_unnamed_addr #4

declare void @mLossRegisterAll(...) local_unnamed_addr #4

declare ptr @ListCreate(i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @mListClear(ptr noundef) local_unnamed_addr #4

declare ptr @TensorCreate(i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @mListWrite(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { 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 = { "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, !10, i64 16}
!6 = !{!"MHandle", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!13, !10, i64 0}
!13 = !{!"HandleNetworkGenerate", !10, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"MSheet", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!16 = !{!17, !7, i64 0}
!17 = !{!"MList", !7, i64 0, !10, i64 8}
!18 = !{!15, !10, i64 8}
!19 = !{!10, !10, i64 0}
!20 = !{!21, !7, i64 64}
!21 = !{!"MLayer", !8, i64 0, !7, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64}
!22 = !{!21, !7, i64 32}
!23 = !{!21, !10, i64 40}
!24 = !{!21, !10, i64 48}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!17, !10, i64 8}
!28 = !{!29, !10, i64 32}
!29 = !{!"TensorRegister", !8, i64 0, !10, i64 32, !10, i64 40, !10, i64 48}
!30 = !{!21, !10, i64 56}
!31 = distinct !{!31, !26}


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