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

; 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.TensorJitterPara = type { ptr, i32, float }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.MTensor = type { i32, i32, i32, i32, ptr, i32 }
%struct.HandleTensorJitter = type { i32, ptr }

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@morn_tensor_register = external global [256 x %struct.TensorRegister], align 16
@morn_network_flag = external global i32, align 4
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorJitterForward = external hidden unnamed_addr constant [21 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 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_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, 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 willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #2

declare i32 @m_Rand(i32 noundef, i32 noundef) #1

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

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

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

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

18:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %25, label %21

21:                                               ; preds = %18
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = ptrtoint ptr %22 to i64
  %24 = icmp eq i64 %23, -1
  br label %25

25:                                               ; preds = %21, %18
  %26 = phi i1 [ true, %18 ], [ %24, %21 ]
  %27 = zext i1 %26 to i32
  store i32 %27, ptr %3, align 4, !tbaa !9
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %32

30:                                               ; preds = %25
  %31 = load i32, ptr %3, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %31, i32 noundef -1, ptr noundef @.str.1, i32 noundef 169, ptr noundef @__FUNCTION__.mTensorJitterForward, ptr noundef @.str.6)
  br label %32

32:                                               ; preds = %30, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.MLayer, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %38
  %40 = getelementptr inbounds %struct.TensorRegister, ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds [32 x i8], ptr %40, i64 0, i64 0
  %42 = call i32 @strcmp(ptr noundef @.str.10, ptr noundef %41) #5
  store i32 %42, ptr %4, align 4, !tbaa !9
  %43 = load i32, ptr %4, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 0
  br i1 %44, label %45, label %47

45:                                               ; preds = %34
  %46 = load i32, ptr %4, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %46, i32 noundef -1, ptr noundef @.str.1, i32 noundef 170, ptr noundef @__FUNCTION__.mTensorJitterForward, ptr noundef @.str.8)
  br label %47

47:                                               ; preds = %45, %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %48

48:                                               ; preds = %47
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  call void @TensorJitterSet(ptr noundef %49)
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MLayer, ptr %50, i32 0, i32 5
  store i32 0, ptr %51, align 8, !tbaa !13
  %52 = load i32, ptr @morn_network_flag, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %48
  br label %188

55:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.MLayer, ptr %56, i32 0, i32 4
  %58 = load ptr, ptr %57, align 8, !tbaa !14
  store ptr %58, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.TensorJitterPara, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !15
  %62 = getelementptr inbounds %struct.MLayer, ptr %61, i32 0, i32 2
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  store ptr %63, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.MLayer, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !18
  store ptr %66, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = call ptr @GetHandle(ptr noundef %67, i32 noundef 16, i32 noundef 1952080228, ptr noundef @endTensorJitter)
  store ptr %68, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.MHandle, ptr %69, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !19
  store ptr %71, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.MTensor, ptr %72, i32 0, i32 1
  %74 = load i32, ptr %73, align 4, !tbaa !21
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.MTensor, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %76, align 8, !tbaa !23
  %78 = mul nsw i32 %74, %77
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.MTensor, ptr %79, i32 0, i32 3
  %81 = load i32, ptr %80, align 4, !tbaa !24
  %82 = mul nsw i32 %78, %81
  store i32 %82, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.HandleTensorJitter, ptr %83, i32 0, i32 0
  %85 = load i32, ptr %84, align 8, !tbaa !25
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.MTensor, ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !27
  %89 = sdiv i32 %85, %88
  store i32 %89, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %184, %55
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.MTensor, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 8, !tbaa !27
  %95 = icmp slt i32 %91, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %90
  store i32 6, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %187

97:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = load i32, ptr %11, align 4, !tbaa !9
  %100 = mul nsw i32 %98, %99
  store i32 %100, ptr %14, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %141, %97
  %102 = load i32, ptr %14, align 4, !tbaa !9
  %103 = load i32, ptr %12, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  %105 = load i32, ptr %11, align 4, !tbaa !9
  %106 = mul nsw i32 %104, %105
  %107 = icmp slt i32 %102, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %101
  store i32 9, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %144

109:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.HandleTensorJitter, ptr %110, i32 0, i32 0
  %112 = load i32, ptr %111, align 8, !tbaa !25
  %113 = call i32 @m_Rand(i32 noundef 0, i32 noundef %112)
  store i32 %113, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.HandleTensorJitter, ptr %114, i32 0, i32 1
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  %117 = load i32, ptr %14, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds float, ptr %116, i64 %118
  %120 = load float, ptr %119, align 4, !tbaa !29
  store float %120, ptr %16, align 4, !tbaa !29
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.HandleTensorJitter, ptr %121, i32 0, i32 1
  %123 = load ptr, ptr %122, align 8, !tbaa !28
  %124 = load i32, ptr %15, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds float, ptr %123, i64 %125
  %127 = load float, ptr %126, align 4, !tbaa !29
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.HandleTensorJitter, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !28
  %131 = load i32, ptr %14, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds float, ptr %130, i64 %132
  store float %127, ptr %133, align 4, !tbaa !29
  %134 = load float, ptr %16, align 4, !tbaa !29
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.HandleTensorJitter, ptr %135, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8, !tbaa !28
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds float, ptr %137, i64 %139
  store float %134, ptr %140, align 4, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %141

141:                                              ; preds = %109
  %142 = load i32, ptr %14, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %14, align 4, !tbaa !9
  br label %101, !llvm.loop !30

144:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %145

145:                                              ; preds = %180, %144
  %146 = load i32, ptr %17, align 4, !tbaa !9
  %147 = load i32, ptr %10, align 4, !tbaa !9
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %145
  store i32 12, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %183

150:                                              ; preds = %145
  %151 = load ptr, ptr %6, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.MTensor, ptr %151, i32 0, i32 4
  %153 = load ptr, ptr %152, align 8, !tbaa !32
  %154 = load i32, ptr %12, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds ptr, ptr %153, i64 %155
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = load i32, ptr %17, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds float, ptr %157, i64 %159
  %161 = load float, ptr %160, align 4, !tbaa !29
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.HandleTensorJitter, ptr %162, i32 0, i32 1
  %164 = load ptr, ptr %163, align 8, !tbaa !28
  %165 = load i32, ptr %17, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds float, ptr %164, i64 %166
  %168 = load float, ptr %167, align 4, !tbaa !29
  %169 = fmul float %161, %168
  %170 = load ptr, ptr %7, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.MTensor, ptr %170, i32 0, i32 4
  %172 = load ptr, ptr %171, align 8, !tbaa !32
  %173 = load i32, ptr %12, align 4, !tbaa !9
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds ptr, ptr %172, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  %177 = load i32, ptr %17, align 4, !tbaa !9
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds float, ptr %176, i64 %178
  store float %169, ptr %179, align 4, !tbaa !29
  br label %180

180:                                              ; preds = %150
  %181 = load i32, ptr %17, align 4, !tbaa !9
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %17, align 4, !tbaa !9
  br label %145, !llvm.loop !33

183:                                              ; preds = %149
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %12, align 4, !tbaa !9
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %12, align 4, !tbaa !9
  br label %90, !llvm.loop !34

187:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %188

188:                                              ; preds = %187, %54
  ret void
}

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 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { 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, !10, i64 32}
!12 = !{!"MLayer", !7, i64 0, !10, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64}
!13 = !{!12, !10, i64 64}
!14 = !{!12, !6, i64 56}
!15 = !{!16, !6, i64 0}
!16 = !{!"TensorJitterPara", !6, i64 0, !10, i64 8, !17, i64 12}
!17 = !{!"float", !7, i64 0}
!18 = !{!12, !6, i64 40}
!19 = !{!20, !6, i64 16}
!20 = !{!"MHandle", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!21 = !{!22, !10, i64 4}
!22 = !{!"MTensor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!23 = !{!22, !10, i64 8}
!24 = !{!22, !10, i64 12}
!25 = !{!26, !10, i64 0}
!26 = !{!"HandleTensorJitter", !10, i64 0, !6, i64 8}
!27 = !{!22, !10, i64 0}
!28 = !{!26, !6, i64 8}
!29 = !{!17, !17, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!22, !6, i64 16}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !31}


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

@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@morn_tensor_register = external global [256 x %struct.TensorRegister], align 16
@morn_network_flag = external local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorJitterForward = external hidden unnamed_addr constant [21 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1

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

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

declare i32 @m_Rand(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @endTensorJitter(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mTensorJitterForward(ptr noundef %0) local_unnamed_addr #2 {
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %7 [
    i64 -1, label %2
    i64 0, label %2
  ]

2:                                                ; preds = %1, %1
  %3 = icmp eq ptr %0, null
  %4 = icmp eq ptr %0, inttoptr (i64 -1 to ptr)
  %5 = or i1 %3, %4
  %6 = zext i1 %5 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %6, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 169, ptr noundef nonnull @__FUNCTION__.mTensorJitterForward, ptr noundef nonnull @.str.6) #3
  br label %7

7:                                                ; preds = %1, %2
  %8 = getelementptr inbounds i8, ptr %0, i64 32
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [256 x %struct.TensorRegister], ptr @morn_tensor_register, i64 0, i64 %10
  %12 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @.str.10, ptr noundef nonnull dereferenceable(1) %11) #4
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %14, label %13

13:                                               ; preds = %7
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %12, i32 noundef -1, ptr noundef nonnull @.str.1, i32 noundef 170, ptr noundef nonnull @__FUNCTION__.mTensorJitterForward, ptr noundef nonnull @.str.8) #3
  br label %14

14:                                               ; preds = %13, %7
  tail call void @TensorJitterSet(ptr noundef nonnull %0)
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  store i32 0, ptr %15, align 8, !tbaa !11
  %16 = load i32, ptr @morn_network_flag, align 4, !tbaa !12
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %.loopexit51, label %18

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 56
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %21, i64 40
  %23 = load ptr, ptr %22, align 8, !tbaa !17
  %24 = getelementptr inbounds i8, ptr %0, i64 40
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  %26 = tail call ptr @GetHandle(ptr noundef %25, i32 noundef 16, i32 noundef 1952080228, ptr noundef nonnull @endTensorJitter) #3
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !18
  %29 = getelementptr inbounds i8, ptr %23, i64 4
  %30 = load i32, ptr %29, align 4, !tbaa !20
  %31 = getelementptr inbounds i8, ptr %23, i64 8
  %32 = load i32, ptr %31, align 8, !tbaa !22
  %33 = mul nsw i32 %32, %30
  %34 = getelementptr inbounds i8, ptr %23, i64 12
  %35 = load i32, ptr %34, align 4, !tbaa !23
  %36 = mul nsw i32 %33, %35
  %.fr57 = freeze i32 %36
  %37 = load i32, ptr %28, align 8, !tbaa !24
  %38 = load i32, ptr %23, align 8, !tbaa !26
  %39 = sdiv i32 %37, %38
  %40 = icmp sgt i32 %38, 0
  br i1 %40, label %.lr.ph56, label %.loopexit51

.lr.ph56:                                         ; preds = %18
  %41 = getelementptr inbounds i8, ptr %28, i64 8
  %42 = icmp sgt i32 %.fr57, 0
  %43 = getelementptr inbounds i8, ptr %23, i64 16
  %44 = getelementptr inbounds i8, ptr %25, i64 16
  %45 = sext i32 %39 to i64
  br i1 %42, label %.lr.ph56.split.us.preheader, label %.lr.ph56.split

.lr.ph56.split.us.preheader:                      ; preds = %.lr.ph56
  %wide.trip.count = zext nneg i32 %.fr57 to i64
  %min.iters.check = icmp ult i32 %.fr57, 8
  %n.vec = and i64 %wide.trip.count, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph56.split.us

.lr.ph56.split.us:                                ; preds = %.lr.ph56.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv77 = phi i64 [ 0, %.lr.ph56.split.us.preheader ], [ %indvars.iv.next78, %..loopexit_crit_edge.us ]
  %indvars.iv69 = phi i32 [ %39, %.lr.ph56.split.us.preheader ], [ %indvars.iv.next70, %..loopexit_crit_edge.us ]
  %indvars.iv64 = phi i64 [ 0, %.lr.ph56.split.us.preheader ], [ %indvars.iv.next65, %..loopexit_crit_edge.us ]
  %46 = mul nsw i64 %indvars.iv77, %45
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %47 = mul nsw i64 %indvars.iv.next78, %45
  %48 = icmp slt i64 %46, %47
  br i1 %48, label %.lr.ph.us, label %.lr.ph56.split.us..preheader.us_crit_edge

.lr.ph56.split.us..preheader.us_crit_edge:        ; preds = %.lr.ph56.split.us
  %.pre80 = load ptr, ptr %41, align 8, !tbaa !27
  br label %.preheader.us

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv73 = phi i64 [ %indvars.iv.next74.3, %scalar.ph ], [ %indvars.iv73.unr, %scalar.ph.prol.loopexit ]
  %49 = getelementptr inbounds float, ptr %84, i64 %indvars.iv73
  %50 = load float, ptr %49, align 4, !tbaa !28
  %51 = getelementptr inbounds float, ptr %81, i64 %indvars.iv73
  %52 = load float, ptr %51, align 4, !tbaa !28
  %53 = fmul float %50, %52
  %54 = getelementptr inbounds float, ptr %87, i64 %indvars.iv73
  store float %53, ptr %54, align 4, !tbaa !28
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %55 = getelementptr inbounds float, ptr %84, i64 %indvars.iv.next74
  %56 = load float, ptr %55, align 4, !tbaa !28
  %57 = getelementptr inbounds float, ptr %81, i64 %indvars.iv.next74
  %58 = load float, ptr %57, align 4, !tbaa !28
  %59 = fmul float %56, %58
  %60 = getelementptr inbounds float, ptr %87, i64 %indvars.iv.next74
  store float %59, ptr %60, align 4, !tbaa !28
  %indvars.iv.next74.1 = add nuw nsw i64 %indvars.iv73, 2
  %61 = getelementptr inbounds float, ptr %84, i64 %indvars.iv.next74.1
  %62 = load float, ptr %61, align 4, !tbaa !28
  %63 = getelementptr inbounds float, ptr %81, i64 %indvars.iv.next74.1
  %64 = load float, ptr %63, align 4, !tbaa !28
  %65 = fmul float %62, %64
  %66 = getelementptr inbounds float, ptr %87, i64 %indvars.iv.next74.1
  store float %65, ptr %66, align 4, !tbaa !28
  %indvars.iv.next74.2 = add nuw nsw i64 %indvars.iv73, 3
  %67 = getelementptr inbounds float, ptr %84, i64 %indvars.iv.next74.2
  %68 = load float, ptr %67, align 4, !tbaa !28
  %69 = getelementptr inbounds float, ptr %81, i64 %indvars.iv.next74.2
  %70 = load float, ptr %69, align 4, !tbaa !28
  %71 = fmul float %68, %70
  %72 = getelementptr inbounds float, ptr %87, i64 %indvars.iv.next74.2
  store float %71, ptr %72, align 4, !tbaa !28
  %indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
  %exitcond76.not.3 = icmp eq i64 %indvars.iv.next74.3, %wide.trip.count
  br i1 %exitcond76.not.3, label %..loopexit_crit_edge.us, label %scalar.ph, !llvm.loop !29

.lr.ph.us:                                        ; preds = %.lr.ph56.split.us, %.lr.ph.us
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.lr.ph.us ], [ %indvars.iv64, %.lr.ph56.split.us ]
  %73 = load i32, ptr %28, align 8, !tbaa !24
  %74 = tail call i32 @m_Rand(i32 noundef 0, i32 noundef %73) #3
  %75 = load ptr, ptr %41, align 8, !tbaa !27
  %76 = getelementptr inbounds float, ptr %75, i64 %indvars.iv66
  %77 = load float, ptr %76, align 4, !tbaa !28
  %78 = sext i32 %74 to i64
  %79 = getelementptr inbounds float, ptr %75, i64 %78
  %80 = load float, ptr %79, align 4, !tbaa !28
  store float %80, ptr %76, align 4, !tbaa !28
  store float %77, ptr %79, align 4, !tbaa !28
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, 1
  %lftr.wideiv71 = trunc i64 %indvars.iv.next67 to i32
  %exitcond72.not = icmp eq i32 %indvars.iv69, %lftr.wideiv71
  br i1 %exitcond72.not, label %.preheader.us, label %.lr.ph.us, !llvm.loop !32

.preheader.us:                                    ; preds = %.lr.ph.us, %.lr.ph56.split.us..preheader.us_crit_edge
  %81 = phi ptr [ %.pre80, %.lr.ph56.split.us..preheader.us_crit_edge ], [ %75, %.lr.ph.us ]
  %82 = load ptr, ptr %43, align 8, !tbaa !33
  %83 = getelementptr inbounds ptr, ptr %82, i64 %indvars.iv77
  %84 = load ptr, ptr %83, align 8, !tbaa !34
  %85 = load ptr, ptr %44, align 8, !tbaa !33
  %86 = getelementptr inbounds ptr, ptr %85, i64 %indvars.iv77
  %87 = load ptr, ptr %86, align 8, !tbaa !34
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader.us
  %indvars.iv73.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.preheader.us ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader, %scalar.ph.prol
  %indvars.iv73.prol = phi i64 [ %indvars.iv.next74.prol, %scalar.ph.prol ], [ %indvars.iv73.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %88 = getelementptr inbounds float, ptr %84, i64 %indvars.iv73.prol
  %89 = load float, ptr %88, align 4, !tbaa !28
  %90 = getelementptr inbounds float, ptr %81, i64 %indvars.iv73.prol
  %91 = load float, ptr %90, align 4, !tbaa !28
  %92 = fmul float %89, %91
  %93 = getelementptr inbounds float, ptr %87, i64 %indvars.iv73.prol
  store float %92, ptr %93, align 4, !tbaa !28
  %indvars.iv.next74.prol = add nuw nsw i64 %indvars.iv73.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol, !llvm.loop !35

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv73.unr = phi i64 [ %indvars.iv73.ph, %scalar.ph.preheader ], [ %indvars.iv.next74.prol, %scalar.ph.prol ]
  %94 = sub nsw i64 %indvars.iv73.ph, %wide.trip.count
  %95 = icmp ugt i64 %94, -4
  br i1 %95, label %..loopexit_crit_edge.us, label %scalar.ph

vector.memcheck:                                  ; preds = %.preheader.us
  %96 = ptrtoint ptr %87 to i64
  %97 = ptrtoint ptr %84 to i64
  %98 = ptrtoint ptr %81 to i64
  %99 = sub i64 %96, %97
  %diff.check = icmp ult i64 %99, 32
  %100 = sub i64 %96, %98
  %diff.check83 = icmp ult i64 %100, 32
  %conflict.rdx = or i1 %diff.check, %diff.check83
  br i1 %conflict.rdx, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %vector.memcheck, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
  %101 = getelementptr inbounds float, ptr %84, i64 %index
  %102 = getelementptr inbounds i8, ptr %101, i64 16
  %wide.load = load <4 x float>, ptr %101, align 4, !tbaa !28
  %wide.load84 = load <4 x float>, ptr %102, align 4, !tbaa !28
  %103 = getelementptr inbounds float, ptr %81, i64 %index
  %104 = getelementptr inbounds i8, ptr %103, i64 16
  %wide.load85 = load <4 x float>, ptr %103, align 4, !tbaa !28
  %wide.load86 = load <4 x float>, ptr %104, align 4, !tbaa !28
  %105 = fmul <4 x float> %wide.load, %wide.load85
  %106 = fmul <4 x float> %wide.load84, %wide.load86
  %107 = getelementptr inbounds float, ptr %87, i64 %index
  %108 = getelementptr inbounds i8, ptr %107, i64 16
  store <4 x float> %105, ptr %107, align 4, !tbaa !28
  store <4 x float> %106, ptr %108, align 4, !tbaa !28
  %index.next = add nuw i64 %index, 8
  %109 = icmp eq i64 %index.next, %n.vec
  br i1 %109, label %middle.block, label %vector.body, !llvm.loop !37

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %..loopexit_crit_edge.us, label %scalar.ph.preheader

..loopexit_crit_edge.us:                          ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %110 = load i32, ptr %23, align 8, !tbaa !26
  %111 = sext i32 %110 to i64
  %112 = icmp slt i64 %indvars.iv.next78, %111
  %indvars.iv.next65 = add i64 %indvars.iv64, %45
  %indvars.iv.next70 = add i32 %indvars.iv69, %39
  br i1 %112, label %.lr.ph56.split.us, label %.loopexit51, !llvm.loop !39

.lr.ph56.split:                                   ; preds = %.lr.ph56, %.preheader
  %113 = phi i32 [ %118, %.preheader ], [ %38, %.lr.ph56 ]
  %indvars.iv62 = phi i32 [ %indvars.iv.next63, %.preheader ], [ %39, %.lr.ph56 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader ], [ 0, %.lr.ph56 ]
  %.04855 = phi i32 [ %115, %.preheader ], [ 0, %.lr.ph56 ]
  %114 = mul nsw i32 %.04855, %39
  %115 = add nuw nsw i32 %.04855, 1
  %116 = mul nsw i32 %115, %39
  %117 = icmp slt i32 %114, %116
  br i1 %117, label %.lr.ph, label %.preheader

.preheader.loopexit:                              ; preds = %.lr.ph
  %.pre = load i32, ptr %23, align 8, !tbaa !26
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.lr.ph56.split
  %118 = phi i32 [ %.pre, %.preheader.loopexit ], [ %113, %.lr.ph56.split ]
  %119 = icmp slt i32 %115, %118
  %indvars.iv.next = add i64 %indvars.iv, %45
  %indvars.iv.next63 = add i32 %indvars.iv62, %39
  br i1 %119, label %.lr.ph56.split, label %.loopexit51, !llvm.loop !39

.lr.ph:                                           ; preds = %.lr.ph56.split, %.lr.ph
  %indvars.iv59 = phi i64 [ %indvars.iv.next60, %.lr.ph ], [ %indvars.iv, %.lr.ph56.split ]
  %120 = load i32, ptr %28, align 8, !tbaa !24
  %121 = tail call i32 @m_Rand(i32 noundef 0, i32 noundef %120) #3
  %122 = load ptr, ptr %41, align 8, !tbaa !27
  %123 = getelementptr inbounds float, ptr %122, i64 %indvars.iv59
  %124 = load float, ptr %123, align 4, !tbaa !28
  %125 = sext i32 %121 to i64
  %126 = getelementptr inbounds float, ptr %122, i64 %125
  %127 = load float, ptr %126, align 4, !tbaa !28
  store float %127, ptr %123, align 4, !tbaa !28
  store float %124, ptr %126, align 4, !tbaa !28
  %indvars.iv.next60 = add nsw i64 %indvars.iv59, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next60 to i32
  %exitcond.not = icmp eq i32 %indvars.iv62, %lftr.wideiv
  br i1 %exitcond.not, label %.preheader.loopexit, label %.lr.ph, !llvm.loop !32

.loopexit51:                                      ; preds = %.preheader, %..loopexit_crit_edge.us, %18, %14
  ret void
}

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 = { 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 = { 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 = { nounwind }
attributes #4 = { 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, !9, i64 32}
!6 = !{!"MLayer", !7, i64 0, !9, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !9, i64 64}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!6, !9, i64 64}
!12 = !{!9, !9, i64 0}
!13 = !{!6, !10, i64 56}
!14 = !{!15, !10, i64 0}
!15 = !{!"TensorJitterPara", !10, i64 0, !9, i64 8, !16, i64 12}
!16 = !{!"float", !7, i64 0}
!17 = !{!6, !10, i64 40}
!18 = !{!19, !10, i64 16}
!19 = !{!"MHandle", !9, i64 0, !9, i64 4, !10, i64 8, !10, i64 16}
!20 = !{!21, !9, i64 4}
!21 = !{!"MTensor", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !10, i64 16, !9, i64 24}
!22 = !{!21, !9, i64 8}
!23 = !{!21, !9, i64 12}
!24 = !{!25, !9, i64 0}
!25 = !{!"HandleTensorJitter", !9, i64 0, !10, i64 8}
!26 = !{!21, !9, i64 0}
!27 = !{!25, !10, i64 8}
!28 = !{!16, !16, i64 0}
!29 = distinct !{!29, !30, !31}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!"llvm.loop.isvectorized", i32 1}
!32 = distinct !{!32, !30}
!33 = !{!21, !10, i64 16}
!34 = !{!10, !10, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.unroll.disable"}
!37 = distinct !{!37, !30, !31, !38}
!38 = !{!"llvm.loop.unroll.runtime.disable"}
!39 = distinct !{!39, !30}


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