; 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
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorJitterBackward = external hidden unnamed_addr constant [22 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

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

; Function Attrs: nounwind uwtable
define dso_local void @mTensorJitterBackward(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 201, ptr noundef @__FUNCTION__.mTensorJitterBackward, 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.7, 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 202, ptr noundef @__FUNCTION__.mTensorJitterBackward, 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
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MLayer, ptr %49, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !13
  store ptr %51, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.TensorJitterPara, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = getelementptr inbounds %struct.MLayer, ptr %54, i32 0, i32 3
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  store ptr %56, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.MLayer, ptr %57, i32 0, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  store ptr %59, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.MLayer, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !18
  %63 = call ptr @GetHandle(ptr noundef %62, i32 noundef 16, i32 noundef 1952080228, ptr noundef @endTensorJitter)
  store ptr %63, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.MHandle, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  store ptr %66, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.MTensor, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !21
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.MTensor, ptr %70, i32 0, i32 2
  %72 = load i32, ptr %71, align 8, !tbaa !23
  %73 = mul nsw i32 %69, %72
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.MTensor, ptr %74, i32 0, i32 3
  %76 = load i32, ptr %75, align 4, !tbaa !24
  %77 = mul nsw i32 %73, %76
  store i32 %77, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.HandleTensorJitter, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !25
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.MTensor, ptr %81, i32 0, i32 0
  %83 = load i32, ptr %82, align 8, !tbaa !27
  %84 = sdiv i32 %80, %83
  store i32 %84, 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 %85

85:                                               ; preds = %179, %48
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.MTensor, ptr %87, i32 0, i32 0
  %89 = load i32, ptr %88, align 8, !tbaa !27
  %90 = icmp slt i32 %86, %89
  br i1 %90, label %92, label %91

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

92:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = mul nsw i32 %93, %94
  store i32 %95, ptr %14, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %136, %92
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  %100 = load i32, ptr %11, align 4, !tbaa !9
  %101 = mul nsw i32 %99, %100
  %102 = icmp slt i32 %97, %101
  br i1 %102, label %104, label %103

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

104:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.HandleTensorJitter, ptr %105, i32 0, i32 0
  %107 = load i32, ptr %106, align 8, !tbaa !25
  %108 = call i32 @m_Rand(i32 noundef 0, i32 noundef %107)
  store i32 %108, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.HandleTensorJitter, ptr %109, i32 0, i32 1
  %111 = load ptr, ptr %110, align 8, !tbaa !28
  %112 = load i32, ptr %14, align 4, !tbaa !9
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds float, ptr %111, i64 %113
  %115 = load float, ptr %114, align 4, !tbaa !29
  store float %115, ptr %16, align 4, !tbaa !29
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.HandleTensorJitter, ptr %116, i32 0, i32 1
  %118 = load ptr, ptr %117, align 8, !tbaa !28
  %119 = load i32, ptr %15, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds float, ptr %118, i64 %120
  %122 = load float, ptr %121, align 4, !tbaa !29
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.HandleTensorJitter, ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !28
  %126 = load i32, ptr %14, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds float, ptr %125, i64 %127
  store float %122, ptr %128, align 4, !tbaa !29
  %129 = load float, ptr %16, align 4, !tbaa !29
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.HandleTensorJitter, ptr %130, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !28
  %133 = load i32, ptr %15, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds float, ptr %132, i64 %134
  store float %129, ptr %135, 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 %136

136:                                              ; preds = %104
  %137 = load i32, ptr %14, align 4, !tbaa !9
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %14, align 4, !tbaa !9
  br label %96, !llvm.loop !30

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

140:                                              ; preds = %175, %139
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = load i32, ptr %10, align 4, !tbaa !9
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %145, label %144

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

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

175:                                              ; preds = %145
  %176 = load i32, ptr %17, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %17, align 4, !tbaa !9
  br label %140, !llvm.loop !33

178:                                              ; preds = %144
  br label %179

179:                                              ; preds = %178
  %180 = load i32, ptr %12, align 4, !tbaa !9
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %12, align 4, !tbaa !9
  br label %85, !llvm.loop !34

182:                                              ; preds = %91
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.TensorJitterPara, ptr %183, i32 0, i32 0
  %185 = load ptr, ptr %184, align 8, !tbaa !14
  %186 = getelementptr inbounds %struct.MLayer, ptr %185, i32 0, i32 5
  store i32 1, ptr %186, align 8, !tbaa !35
  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
  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, !6, i64 56}
!14 = !{!15, !6, i64 0}
!15 = !{!"TensorJitterPara", !6, i64 0, !10, i64 8, !16, i64 12}
!16 = !{!"float", !7, i64 0}
!17 = !{!12, !6, i64 48}
!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 = !{!16, !16, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!22, !6, i64 16}
!33 = distinct !{!33, !31}
!34 = distinct !{!34, !31}
!35 = !{!12, !10, i64 64}


; 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
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@__FUNCTION__.mTensorJitterBackward = external hidden unnamed_addr constant [22 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

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

; Function Attrs: nounwind uwtable
define dso_local void @mTensorJitterBackward(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 201, ptr noundef nonnull @__FUNCTION__.mTensorJitterBackward, 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.7, 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 202, ptr noundef nonnull @__FUNCTION__.mTensorJitterBackward, ptr noundef nonnull @.str.8) #3
  br label %14

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

.lr.ph54:                                         ; preds = %14
  %39 = getelementptr inbounds i8, ptr %26, i64 8
  %40 = icmp sgt i32 %.fr55, 0
  %41 = getelementptr inbounds i8, ptr %21, i64 16
  %42 = getelementptr inbounds i8, ptr %19, i64 16
  %43 = sext i32 %37 to i64
  br i1 %40, label %.lr.ph54.split.us.preheader, label %.lr.ph54.split

.lr.ph54.split.us.preheader:                      ; preds = %.lr.ph54
  %wide.trip.count = zext nneg i32 %.fr55 to i64
  %min.iters.check = icmp ult i32 %.fr55, 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.ph54.split.us

.lr.ph54.split.us:                                ; preds = %.lr.ph54.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv75 = phi i64 [ 0, %.lr.ph54.split.us.preheader ], [ %indvars.iv.next76, %..loopexit_crit_edge.us ]
  %indvars.iv67 = phi i32 [ %37, %.lr.ph54.split.us.preheader ], [ %indvars.iv.next68, %..loopexit_crit_edge.us ]
  %indvars.iv62 = phi i64 [ 0, %.lr.ph54.split.us.preheader ], [ %indvars.iv.next63, %..loopexit_crit_edge.us ]
  %44 = mul nsw i64 %indvars.iv75, %43
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %45 = mul nsw i64 %indvars.iv.next76, %43
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %.lr.ph.us, label %.lr.ph54.split.us..preheader.us_crit_edge

.lr.ph54.split.us..preheader.us_crit_edge:        ; preds = %.lr.ph54.split.us
  %.pre78 = load ptr, ptr %39, align 8, !tbaa !26
  br label %.preheader.us

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv71 = phi i64 [ %indvars.iv.next72.3, %scalar.ph ], [ %indvars.iv71.unr, %scalar.ph.prol.loopexit ]
  %47 = getelementptr inbounds float, ptr %82, i64 %indvars.iv71
  %48 = load float, ptr %47, align 4, !tbaa !27
  %49 = getelementptr inbounds float, ptr %79, i64 %indvars.iv71
  %50 = load float, ptr %49, align 4, !tbaa !27
  %51 = fmul float %48, %50
  %52 = getelementptr inbounds float, ptr %85, i64 %indvars.iv71
  store float %51, ptr %52, align 4, !tbaa !27
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %53 = getelementptr inbounds float, ptr %82, i64 %indvars.iv.next72
  %54 = load float, ptr %53, align 4, !tbaa !27
  %55 = getelementptr inbounds float, ptr %79, i64 %indvars.iv.next72
  %56 = load float, ptr %55, align 4, !tbaa !27
  %57 = fmul float %54, %56
  %58 = getelementptr inbounds float, ptr %85, i64 %indvars.iv.next72
  store float %57, ptr %58, align 4, !tbaa !27
  %indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 2
  %59 = getelementptr inbounds float, ptr %82, i64 %indvars.iv.next72.1
  %60 = load float, ptr %59, align 4, !tbaa !27
  %61 = getelementptr inbounds float, ptr %79, i64 %indvars.iv.next72.1
  %62 = load float, ptr %61, align 4, !tbaa !27
  %63 = fmul float %60, %62
  %64 = getelementptr inbounds float, ptr %85, i64 %indvars.iv.next72.1
  store float %63, ptr %64, align 4, !tbaa !27
  %indvars.iv.next72.2 = add nuw nsw i64 %indvars.iv71, 3
  %65 = getelementptr inbounds float, ptr %82, i64 %indvars.iv.next72.2
  %66 = load float, ptr %65, align 4, !tbaa !27
  %67 = getelementptr inbounds float, ptr %79, i64 %indvars.iv.next72.2
  %68 = load float, ptr %67, align 4, !tbaa !27
  %69 = fmul float %66, %68
  %70 = getelementptr inbounds float, ptr %85, i64 %indvars.iv.next72.2
  store float %69, ptr %70, align 4, !tbaa !27
  %indvars.iv.next72.3 = add nuw nsw i64 %indvars.iv71, 4
  %exitcond74.not.3 = icmp eq i64 %indvars.iv.next72.3, %wide.trip.count
  br i1 %exitcond74.not.3, label %..loopexit_crit_edge.us, label %scalar.ph, !llvm.loop !28

.lr.ph.us:                                        ; preds = %.lr.ph54.split.us, %.lr.ph.us
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph.us ], [ %indvars.iv62, %.lr.ph54.split.us ]
  %71 = load i32, ptr %26, align 8, !tbaa !23
  %72 = tail call i32 @m_Rand(i32 noundef 0, i32 noundef %71) #3
  %73 = load ptr, ptr %39, align 8, !tbaa !26
  %74 = getelementptr inbounds float, ptr %73, i64 %indvars.iv64
  %75 = load float, ptr %74, align 4, !tbaa !27
  %76 = sext i32 %72 to i64
  %77 = getelementptr inbounds float, ptr %73, i64 %76
  %78 = load float, ptr %77, align 4, !tbaa !27
  store float %78, ptr %74, align 4, !tbaa !27
  store float %75, ptr %77, align 4, !tbaa !27
  %indvars.iv.next65 = add nsw i64 %indvars.iv64, 1
  %lftr.wideiv69 = trunc i64 %indvars.iv.next65 to i32
  %exitcond70.not = icmp eq i32 %indvars.iv67, %lftr.wideiv69
  br i1 %exitcond70.not, label %.preheader.us, label %.lr.ph.us, !llvm.loop !31

.preheader.us:                                    ; preds = %.lr.ph.us, %.lr.ph54.split.us..preheader.us_crit_edge
  %79 = phi ptr [ %.pre78, %.lr.ph54.split.us..preheader.us_crit_edge ], [ %73, %.lr.ph.us ]
  %80 = load ptr, ptr %41, align 8, !tbaa !32
  %81 = getelementptr inbounds ptr, ptr %80, i64 %indvars.iv75
  %82 = load ptr, ptr %81, align 8, !tbaa !33
  %83 = load ptr, ptr %42, align 8, !tbaa !32
  %84 = getelementptr inbounds ptr, ptr %83, i64 %indvars.iv75
  %85 = load ptr, ptr %84, align 8, !tbaa !33
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader.us
  %indvars.iv71.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.iv71.prol = phi i64 [ %indvars.iv.next72.prol, %scalar.ph.prol ], [ %indvars.iv71.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %86 = getelementptr inbounds float, ptr %82, i64 %indvars.iv71.prol
  %87 = load float, ptr %86, align 4, !tbaa !27
  %88 = getelementptr inbounds float, ptr %79, i64 %indvars.iv71.prol
  %89 = load float, ptr %88, align 4, !tbaa !27
  %90 = fmul float %87, %89
  %91 = getelementptr inbounds float, ptr %85, i64 %indvars.iv71.prol
  store float %90, ptr %91, align 4, !tbaa !27
  %indvars.iv.next72.prol = add nuw nsw i64 %indvars.iv71.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 !34

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

vector.memcheck:                                  ; preds = %.preheader.us
  %94 = ptrtoint ptr %85 to i64
  %95 = ptrtoint ptr %82 to i64
  %96 = ptrtoint ptr %79 to i64
  %97 = sub i64 %94, %95
  %diff.check = icmp ult i64 %97, 32
  %98 = sub i64 %94, %96
  %diff.check81 = icmp ult i64 %98, 32
  %conflict.rdx = or i1 %diff.check, %diff.check81
  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 ]
  %99 = getelementptr inbounds float, ptr %82, i64 %index
  %100 = getelementptr inbounds i8, ptr %99, i64 16
  %wide.load = load <4 x float>, ptr %99, align 4, !tbaa !27
  %wide.load82 = load <4 x float>, ptr %100, align 4, !tbaa !27
  %101 = getelementptr inbounds float, ptr %79, i64 %index
  %102 = getelementptr inbounds i8, ptr %101, i64 16
  %wide.load83 = load <4 x float>, ptr %101, align 4, !tbaa !27
  %wide.load84 = load <4 x float>, ptr %102, align 4, !tbaa !27
  %103 = fmul <4 x float> %wide.load, %wide.load83
  %104 = fmul <4 x float> %wide.load82, %wide.load84
  %105 = getelementptr inbounds float, ptr %85, i64 %index
  %106 = getelementptr inbounds i8, ptr %105, i64 16
  store <4 x float> %103, ptr %105, align 4, !tbaa !27
  store <4 x float> %104, ptr %106, align 4, !tbaa !27
  %index.next = add nuw i64 %index, 8
  %107 = icmp eq i64 %index.next, %n.vec
  br i1 %107, label %middle.block, label %vector.body, !llvm.loop !36

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
  %108 = load i32, ptr %21, align 8, !tbaa !25
  %109 = sext i32 %108 to i64
  %110 = icmp slt i64 %indvars.iv.next76, %109
  %indvars.iv.next63 = add i64 %indvars.iv62, %43
  %indvars.iv.next68 = add i32 %indvars.iv67, %37
  br i1 %110, label %.lr.ph54.split.us, label %._crit_edge, !llvm.loop !38

._crit_edge:                                      ; preds = %.preheader, %..loopexit_crit_edge.us, %14
  %111 = load ptr, ptr %16, align 8, !tbaa !12
  %112 = getelementptr inbounds i8, ptr %111, i64 64
  store i32 1, ptr %112, align 8, !tbaa !39
  ret void

.lr.ph54.split:                                   ; preds = %.lr.ph54, %.preheader
  %113 = phi i32 [ %118, %.preheader ], [ %36, %.lr.ph54 ]
  %indvars.iv60 = phi i32 [ %indvars.iv.next61, %.preheader ], [ %37, %.lr.ph54 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader ], [ 0, %.lr.ph54 ]
  %.04753 = phi i32 [ %115, %.preheader ], [ 0, %.lr.ph54 ]
  %114 = mul nsw i32 %.04753, %37
  %115 = add nuw nsw i32 %.04753, 1
  %116 = mul nsw i32 %115, %37
  %117 = icmp slt i32 %114, %116
  br i1 %117, label %.lr.ph, label %.preheader

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

.preheader:                                       ; preds = %.preheader.loopexit, %.lr.ph54.split
  %118 = phi i32 [ %.pre, %.preheader.loopexit ], [ %113, %.lr.ph54.split ]
  %119 = icmp slt i32 %115, %118
  %indvars.iv.next = add i64 %indvars.iv, %43
  %indvars.iv.next61 = add i32 %indvars.iv60, %37
  br i1 %119, label %.lr.ph54.split, label %._crit_edge, !llvm.loop !38

.lr.ph:                                           ; preds = %.lr.ph54.split, %.lr.ph
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %.lr.ph ], [ %indvars.iv, %.lr.ph54.split ]
  %120 = load i32, ptr %26, align 8, !tbaa !23
  %121 = tail call i32 @m_Rand(i32 noundef 0, i32 noundef %120) #3
  %122 = load ptr, ptr %39, align 8, !tbaa !26
  %123 = getelementptr inbounds float, ptr %122, i64 %indvars.iv57
  %124 = load float, ptr %123, align 4, !tbaa !27
  %125 = sext i32 %121 to i64
  %126 = getelementptr inbounds float, ptr %122, i64 %125
  %127 = load float, ptr %126, align 4, !tbaa !27
  store float %127, ptr %123, align 4, !tbaa !27
  store float %124, ptr %126, align 4, !tbaa !27
  %indvars.iv.next58 = add nsw i64 %indvars.iv57, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next58 to i32
  %exitcond.not = icmp eq i32 %indvars.iv60, %lftr.wideiv
  br i1 %exitcond.not, label %.preheader.loopexit, label %.lr.ph, !llvm.loop !31
}

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


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