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

@.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__.mTensorDropoutBackward = external hidden unnamed_addr constant [23 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
define dso_local void @mTensorDropoutBackward(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 i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca float, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  br label %19

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

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

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

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

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

34:                                               ; preds = %33
  br label %35

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

46:                                               ; preds = %35
  %47 = load i32, ptr %4, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %47, i32 noundef -1, ptr noundef @.str.1, i32 noundef 79, ptr noundef @__FUNCTION__.mTensorDropoutBackward, ptr noundef @.str.8)
  br label %48

48:                                               ; preds = %46, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %49

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.MLayer, ptr %50, i32 0, i32 4
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  store ptr %52, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.TensorDropoutPara, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !14
  %56 = getelementptr inbounds %struct.MLayer, ptr %55, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  store ptr %57, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.MLayer, ptr %58, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  store ptr %60, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.MTensor, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !18
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.MTensor, ptr %64, i32 0, i32 2
  %66 = load i32, ptr %65, align 8, !tbaa !20
  %67 = mul nsw i32 %63, %66
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.MTensor, ptr %68, i32 0, i32 3
  %70 = load i32, ptr %69, align 4, !tbaa !21
  %71 = mul nsw i32 %67, %70
  store i32 %71, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.MTensor, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !22
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = mul nsw i32 %74, %75
  %77 = sitofp i32 %76 to float
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.TensorDropoutPara, ptr %78, i32 0, i32 2
  %80 = load float, ptr %79, align 4, !tbaa !23
  %81 = fmul float %77, %80
  %82 = fpext float %81 to double
  %83 = fadd double %82, 5.000000e-01
  %84 = fptosi double %83 to i32
  store i32 %84, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.TensorDropoutPara, ptr %85, i32 0, i32 2
  %87 = load float, ptr %86, align 4, !tbaa !23
  %88 = fdiv float 1.000000e+00, %87
  store float %88, ptr %10, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %154, %49
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.MTensor, ptr %91, i32 0, i32 0
  %93 = load i32, ptr %92, align 8, !tbaa !22
  %94 = icmp slt i32 %90, %93
  br i1 %94, label %96, label %95

95:                                               ; preds = %89
  store i32 6, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %157

96:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %150, %96
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = load i32, ptr %8, align 4, !tbaa !9
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

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

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.MTensor, ptr %103, i32 0, i32 4
  %105 = load ptr, ptr %104, align 8, !tbaa !25
  %106 = load i32, ptr %11, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds ptr, ptr %105, i64 %107
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds float, ptr %109, i64 %111
  %113 = load float, ptr %112, align 4, !tbaa !24
  %114 = load float, ptr %10, align 4, !tbaa !24
  %115 = fmul float %113, %114
  store float %115, ptr %14, align 4, !tbaa !24
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.TensorDropoutPara, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !14
  %119 = getelementptr inbounds %struct.MLayer, ptr %118, i32 0, i32 5
  %120 = load i32, ptr %119, align 8, !tbaa !26
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %124

122:                                              ; preds = %102
  %123 = load float, ptr %14, align 4, !tbaa !24
  br label %138

124:                                              ; preds = %102
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.MTensor, ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !25
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds ptr, ptr %127, i64 %129
  %131 = load ptr, ptr %130, align 8, !tbaa !5
  %132 = load i32, ptr %13, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds float, ptr %131, i64 %133
  %135 = load float, ptr %134, align 4, !tbaa !24
  %136 = load float, ptr %14, align 4, !tbaa !24
  %137 = fadd float %135, %136
  br label %138

138:                                              ; preds = %124, %122
  %139 = phi float [ %123, %122 ], [ %137, %124 ]
  %140 = load ptr, ptr %6, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.MTensor, ptr %140, i32 0, i32 4
  %142 = load ptr, ptr %141, align 8, !tbaa !25
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds ptr, ptr %142, i64 %144
  %146 = load ptr, ptr %145, align 8, !tbaa !5
  %147 = load i32, ptr %13, align 4, !tbaa !9
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds float, ptr %146, i64 %148
  store float %139, ptr %149, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %150

150:                                              ; preds = %138
  %151 = load i32, ptr %13, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %13, align 4, !tbaa !9
  br label %97, !llvm.loop !27

153:                                              ; preds = %101
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %11, align 4, !tbaa !9
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %11, align 4, !tbaa !9
  br label %89, !llvm.loop !29

157:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %158

158:                                              ; preds = %207, %157
  %159 = load i32, ptr %15, align 4, !tbaa !9
  %160 = load i32, ptr %9, align 4, !tbaa !9
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %158
  store i32 12, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %210

163:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %164 = load i32, ptr %8, align 4, !tbaa !9
  %165 = load ptr, ptr %7, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.MTensor, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 8, !tbaa !22
  %168 = mul nsw i32 %164, %167
  %169 = call i32 @m_Rand(i32 noundef 0, i32 noundef %168)
  store i32 %169, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %170 = load i32, ptr %16, align 4, !tbaa !9
  %171 = load i32, ptr %8, align 4, !tbaa !9
  %172 = sdiv i32 %170, %171
  store i32 %172, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %173 = load i32, ptr %16, align 4, !tbaa !9
  %174 = load i32, ptr %8, align 4, !tbaa !9
  %175 = srem i32 %173, %174
  store i32 %175, ptr %18, align 4, !tbaa !9
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.TensorDropoutPara, ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !14
  %179 = getelementptr inbounds %struct.MLayer, ptr %178, i32 0, i32 5
  %180 = load i32, ptr %179, align 8, !tbaa !26
  %181 = icmp eq i32 %180, 0
  br i1 %181, label %182, label %183

182:                                              ; preds = %163
  br label %195

183:                                              ; preds = %163
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.MTensor, ptr %184, i32 0, i32 4
  %186 = load ptr, ptr %185, align 8, !tbaa !25
  %187 = load i32, ptr %17, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds ptr, ptr %186, i64 %188
  %190 = load ptr, ptr %189, align 8, !tbaa !5
  %191 = load i32, ptr %18, align 4, !tbaa !9
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds float, ptr %190, i64 %192
  %194 = load float, ptr %193, align 4, !tbaa !24
  br label %195

195:                                              ; preds = %183, %182
  %196 = phi float [ 0.000000e+00, %182 ], [ %194, %183 ]
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.MTensor, ptr %197, i32 0, i32 4
  %199 = load ptr, ptr %198, align 8, !tbaa !25
  %200 = load i32, ptr %17, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds ptr, ptr %199, i64 %201
  %203 = load ptr, ptr %202, align 8, !tbaa !5
  %204 = load i32, ptr %18, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds float, ptr %203, i64 %205
  store float %196, ptr %206, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %207

207:                                              ; preds = %195
  %208 = load i32, ptr %15, align 4, !tbaa !9
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %15, align 4, !tbaa !9
  br label %158, !llvm.loop !30

210:                                              ; preds = %162
  %211 = load ptr, ptr %5, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.TensorDropoutPara, ptr %211, i32 0, i32 0
  %213 = load ptr, ptr %212, align 8, !tbaa !14
  %214 = getelementptr inbounds %struct.MLayer, ptr %213, i32 0, i32 5
  store i32 1, ptr %214, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, 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 = !{!"TensorDropoutPara", !6, i64 0, !10, i64 8, !16, i64 12}
!16 = !{!"float", !7, i64 0}
!17 = !{!12, !6, i64 48}
!18 = !{!19, !10, i64 4}
!19 = !{!"MTensor", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24}
!20 = !{!19, !10, i64 8}
!21 = !{!19, !10, i64 12}
!22 = !{!19, !10, i64 0}
!23 = !{!15, !16, i64 12}
!24 = !{!16, !16, i64 0}
!25 = !{!19, !6, i64 16}
!26 = !{!12, !10, i64 64}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = distinct !{!30, !28}


; 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__.mTensorDropoutBackward = external hidden unnamed_addr constant [23 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
define dso_local void @mTensorDropoutBackward(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 78, ptr noundef nonnull @__FUNCTION__.mTensorDropoutBackward, 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 79, ptr noundef nonnull @__FUNCTION__.mTensorDropoutBackward, 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 %21, i64 4
  %23 = load i32, ptr %22, align 4, !tbaa !16
  %24 = getelementptr inbounds i8, ptr %21, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !18
  %26 = mul i32 %25, %23
  %27 = getelementptr inbounds i8, ptr %21, i64 12
  %28 = load i32, ptr %27, align 4, !tbaa !19
  %29 = mul i32 %26, %28
  %30 = load i32, ptr %21, align 8, !tbaa !20
  %31 = mul nsw i32 %30, %29
  %32 = sitofp i32 %31 to float
  %33 = getelementptr inbounds i8, ptr %16, i64 12
  %34 = load float, ptr %33, align 4, !tbaa !21
  %35 = fmul float %34, %32
  %36 = fpext float %35 to double
  %37 = fadd double %36, 5.000000e-01
  %38 = fptosi double %37 to i32
  %39 = fdiv float 1.000000e+00, %34
  %40 = icmp sgt i32 %30, 0
  %41 = icmp sgt i32 %29, 0
  %or.cond = select i1 %40, i1 %41, i1 false
  br i1 %or.cond, label %.preheader55.lr.ph.split.us, label %.preheader

.preheader55.lr.ph.split.us:                      ; preds = %14
  %42 = getelementptr inbounds i8, ptr %19, i64 16
  %43 = getelementptr inbounds i8, ptr %17, i64 64
  %44 = getelementptr inbounds i8, ptr %21, i64 16
  %45 = load ptr, ptr %44, align 8, !tbaa !22
  %46 = load i32, ptr %43, align 8, !tbaa !23
  %47 = icmp eq i32 %46, 0
  %48 = load ptr, ptr %42, align 8, !tbaa !22
  %wide.trip.count78 = zext nneg i32 %30 to i64
  %wide.trip.count73 = zext nneg i32 %29 to i64
  br i1 %47, label %.preheader55.us.us.preheader, label %.preheader55.us.preheader

.preheader55.us.us.preheader:                     ; preds = %.preheader55.lr.ph.split.us
  %min.iters.check95 = icmp ult i32 %29, 8
  %n.vec98 = and i64 %wide.trip.count73, 2147483640
  %broadcast.splatinsert104 = insertelement <4 x float> poison, float %39, i64 0
  %broadcast.splat105 = shufflevector <4 x float> %broadcast.splatinsert104, <4 x float> poison, <4 x i32> zeroinitializer
  %cmp.n107 = icmp eq i64 %n.vec98, %wide.trip.count73
  %xtraiter112 = and i64 %wide.trip.count73, 3
  %lcmp.mod113.not = icmp eq i64 %xtraiter112, 0
  br label %.preheader55.us.us

.preheader55.us.preheader:                        ; preds = %.preheader55.lr.ph.split.us
  %49 = shl nuw nsw i64 %wide.trip.count73, 2
  %min.iters.check = icmp ult i32 %29, 8
  %n.vec = and i64 %wide.trip.count73, 2147483640
  %broadcast.splatinsert = insertelement <4 x float> poison, float %39, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count73
  %xtraiter = and i64 %wide.trip.count73, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %50 = add nsw i64 %wide.trip.count73, -1
  br label %.preheader55.us

.preheader55.us.us:                               ; preds = %.preheader55.us.us.preheader, %._crit_edge.split.us.us.us
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %._crit_edge.split.us.us.us ], [ 0, %.preheader55.us.us.preheader ]
  %51 = getelementptr inbounds ptr, ptr %45, i64 %indvars.iv75
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  %53 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv75
  %54 = load ptr, ptr %53, align 8, !tbaa !24
  %55 = ptrtoint ptr %54 to i64
  %56 = ptrtoint ptr %52 to i64
  %57 = sub i64 %55, %56
  %diff.check = icmp ult i64 %57, 32
  %or.cond110 = select i1 %min.iters.check95, i1 true, i1 %diff.check
  br i1 %or.cond110, label %scalar.ph94.preheader, label %vector.body100

vector.body100:                                   ; preds = %.preheader55.us.us, %vector.body100
  %index101 = phi i64 [ %index.next106, %vector.body100 ], [ 0, %.preheader55.us.us ]
  %58 = getelementptr inbounds float, ptr %52, i64 %index101
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %wide.load102 = load <4 x float>, ptr %58, align 4, !tbaa !25
  %wide.load103 = load <4 x float>, ptr %59, align 4, !tbaa !25
  %60 = fmul <4 x float> %broadcast.splat105, %wide.load102
  %61 = fmul <4 x float> %broadcast.splat105, %wide.load103
  %62 = getelementptr inbounds float, ptr %54, i64 %index101
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  store <4 x float> %60, ptr %62, align 4, !tbaa !25
  store <4 x float> %61, ptr %63, align 4, !tbaa !25
  %index.next106 = add nuw i64 %index101, 8
  %64 = icmp eq i64 %index.next106, %n.vec98
  br i1 %64, label %middle.block93, label %vector.body100, !llvm.loop !26

middle.block93:                                   ; preds = %vector.body100
  br i1 %cmp.n107, label %._crit_edge.split.us.us.us, label %scalar.ph94.preheader

scalar.ph94.preheader:                            ; preds = %middle.block93, %.preheader55.us.us
  %indvars.iv70.ph = phi i64 [ 0, %.preheader55.us.us ], [ %n.vec98, %middle.block93 ]
  br i1 %lcmp.mod113.not, label %scalar.ph94.prol.loopexit, label %scalar.ph94.prol

scalar.ph94.prol:                                 ; preds = %scalar.ph94.preheader, %scalar.ph94.prol
  %indvars.iv70.prol = phi i64 [ %indvars.iv.next71.prol, %scalar.ph94.prol ], [ %indvars.iv70.ph, %scalar.ph94.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph94.prol ], [ 0, %scalar.ph94.preheader ]
  %65 = getelementptr inbounds float, ptr %52, i64 %indvars.iv70.prol
  %66 = load float, ptr %65, align 4, !tbaa !25
  %67 = fmul float %39, %66
  %68 = getelementptr inbounds float, ptr %54, i64 %indvars.iv70.prol
  store float %67, ptr %68, align 4, !tbaa !25
  %indvars.iv.next71.prol = add nuw nsw i64 %indvars.iv70.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter112
  br i1 %prol.iter.cmp.not, label %scalar.ph94.prol.loopexit, label %scalar.ph94.prol, !llvm.loop !30

scalar.ph94.prol.loopexit:                        ; preds = %scalar.ph94.prol, %scalar.ph94.preheader
  %indvars.iv70.unr = phi i64 [ %indvars.iv70.ph, %scalar.ph94.preheader ], [ %indvars.iv.next71.prol, %scalar.ph94.prol ]
  %69 = sub nsw i64 %indvars.iv70.ph, %wide.trip.count73
  %70 = icmp ugt i64 %69, -4
  br i1 %70, label %._crit_edge.split.us.us.us, label %scalar.ph94

scalar.ph94:                                      ; preds = %scalar.ph94.prol.loopexit, %scalar.ph94
  %indvars.iv70 = phi i64 [ %indvars.iv.next71.3, %scalar.ph94 ], [ %indvars.iv70.unr, %scalar.ph94.prol.loopexit ]
  %71 = getelementptr inbounds float, ptr %52, i64 %indvars.iv70
  %72 = load float, ptr %71, align 4, !tbaa !25
  %73 = fmul float %39, %72
  %74 = getelementptr inbounds float, ptr %54, i64 %indvars.iv70
  store float %73, ptr %74, align 4, !tbaa !25
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %75 = getelementptr inbounds float, ptr %52, i64 %indvars.iv.next71
  %76 = load float, ptr %75, align 4, !tbaa !25
  %77 = fmul float %39, %76
  %78 = getelementptr inbounds float, ptr %54, i64 %indvars.iv.next71
  store float %77, ptr %78, align 4, !tbaa !25
  %indvars.iv.next71.1 = add nuw nsw i64 %indvars.iv70, 2
  %79 = getelementptr inbounds float, ptr %52, i64 %indvars.iv.next71.1
  %80 = load float, ptr %79, align 4, !tbaa !25
  %81 = fmul float %39, %80
  %82 = getelementptr inbounds float, ptr %54, i64 %indvars.iv.next71.1
  store float %81, ptr %82, align 4, !tbaa !25
  %indvars.iv.next71.2 = add nuw nsw i64 %indvars.iv70, 3
  %83 = getelementptr inbounds float, ptr %52, i64 %indvars.iv.next71.2
  %84 = load float, ptr %83, align 4, !tbaa !25
  %85 = fmul float %39, %84
  %86 = getelementptr inbounds float, ptr %54, i64 %indvars.iv.next71.2
  store float %85, ptr %86, align 4, !tbaa !25
  %indvars.iv.next71.3 = add nuw nsw i64 %indvars.iv70, 4
  %exitcond74.not.3 = icmp eq i64 %indvars.iv.next71.3, %wide.trip.count73
  br i1 %exitcond74.not.3, label %._crit_edge.split.us.us.us, label %scalar.ph94, !llvm.loop !32

._crit_edge.split.us.us.us:                       ; preds = %scalar.ph94.prol.loopexit, %scalar.ph94, %middle.block93
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
  br i1 %exitcond79.not, label %.preheader, label %.preheader55.us.us, !llvm.loop !33

.preheader55.us:                                  ; preds = %.preheader55.us.preheader, %._crit_edge.split.us59
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %._crit_edge.split.us59 ], [ 0, %.preheader55.us.preheader ]
  %87 = getelementptr inbounds ptr, ptr %45, i64 %indvars.iv65
  %88 = load ptr, ptr %87, align 8, !tbaa !24
  %89 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv65
  %90 = load ptr, ptr %89, align 8, !tbaa !24
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %.preheader55.us
  %scevgep = getelementptr i8, ptr %90, i64 %49
  %scevgep88 = getelementptr i8, ptr %88, i64 %49
  %bound0 = icmp ult ptr %90, %scevgep88
  %bound1 = icmp ult ptr %88, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %vector.memcheck, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.memcheck ]
  %91 = getelementptr inbounds float, ptr %88, i64 %index
  %92 = getelementptr inbounds i8, ptr %91, i64 16
  %wide.load = load <4 x float>, ptr %91, align 4, !tbaa !25, !alias.scope !34
  %wide.load89 = load <4 x float>, ptr %92, align 4, !tbaa !25, !alias.scope !34
  %93 = fmul <4 x float> %broadcast.splat, %wide.load
  %94 = fmul <4 x float> %broadcast.splat, %wide.load89
  %95 = getelementptr inbounds float, ptr %90, i64 %index
  %96 = getelementptr inbounds i8, ptr %95, i64 16
  %wide.load90 = load <4 x float>, ptr %95, align 4, !tbaa !25, !alias.scope !37, !noalias !34
  %wide.load91 = load <4 x float>, ptr %96, align 4, !tbaa !25, !alias.scope !37, !noalias !34
  %97 = fadd <4 x float> %93, %wide.load90
  %98 = fadd <4 x float> %94, %wide.load91
  store <4 x float> %97, ptr %95, align 4, !tbaa !25, !alias.scope !37, !noalias !34
  store <4 x float> %98, ptr %96, align 4, !tbaa !25, !alias.scope !37, !noalias !34
  %index.next = add nuw i64 %index, 8
  %99 = icmp eq i64 %index.next, %n.vec
  br i1 %99, label %middle.block, label %vector.body, !llvm.loop !39

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge.split.us59, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.preheader55.us
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.preheader55.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
  %100 = getelementptr inbounds float, ptr %88, i64 %indvars.iv.ph
  %101 = load float, ptr %100, align 4, !tbaa !25
  %102 = fmul float %39, %101
  %103 = getelementptr inbounds float, ptr %90, i64 %indvars.iv.ph
  %104 = load float, ptr %103, align 4, !tbaa !25
  %105 = fadd float %102, %104
  store float %105, ptr %103, align 4, !tbaa !25
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %scalar.ph.preheader ], [ %indvars.iv.next.prol, %scalar.ph.prol ]
  %106 = icmp eq i64 %indvars.iv.ph, %50
  br i1 %106, label %._crit_edge.split.us59, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %107 = getelementptr inbounds float, ptr %88, i64 %indvars.iv
  %108 = load float, ptr %107, align 4, !tbaa !25
  %109 = fmul float %39, %108
  %110 = getelementptr inbounds float, ptr %90, i64 %indvars.iv
  %111 = load float, ptr %110, align 4, !tbaa !25
  %112 = fadd float %109, %111
  store float %112, ptr %110, align 4, !tbaa !25
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %113 = getelementptr inbounds float, ptr %88, i64 %indvars.iv.next
  %114 = load float, ptr %113, align 4, !tbaa !25
  %115 = fmul float %39, %114
  %116 = getelementptr inbounds float, ptr %90, i64 %indvars.iv.next
  %117 = load float, ptr %116, align 4, !tbaa !25
  %118 = fadd float %115, %117
  store float %118, ptr %116, align 4, !tbaa !25
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count73
  br i1 %exitcond.not.1, label %._crit_edge.split.us59, label %scalar.ph, !llvm.loop !40

._crit_edge.split.us59:                           ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count78
  br i1 %exitcond69.not, label %.preheader, label %.preheader55.us, !llvm.loop !33

.preheader:                                       ; preds = %._crit_edge.split.us59, %._crit_edge.split.us.us.us, %14
  %119 = icmp sgt i32 %38, 0
  br i1 %119, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %120 = getelementptr inbounds i8, ptr %19, i64 16
  br label %123

._crit_edge:                                      ; preds = %._crit_edge81, %.preheader
  %121 = phi ptr [ %17, %.preheader ], [ %129, %._crit_edge81 ]
  %122 = getelementptr inbounds i8, ptr %121, i64 64
  store i32 1, ptr %122, align 8, !tbaa !23
  ret void

123:                                              ; preds = %.lr.ph, %._crit_edge81
  %.05361 = phi i32 [ 0, %.lr.ph ], [ %138, %._crit_edge81 ]
  %124 = load i32, ptr %21, align 8, !tbaa !20
  %125 = mul nsw i32 %124, %29
  %126 = tail call i32 @m_Rand(i32 noundef 0, i32 noundef %125) #3
  %127 = sdiv i32 %126, %29
  %128 = srem i32 %126, %29
  %129 = load ptr, ptr %16, align 8, !tbaa !12
  %130 = getelementptr inbounds i8, ptr %129, i64 64
  %131 = load i32, ptr %130, align 8, !tbaa !23
  %132 = icmp eq i32 %131, 0
  %.pre = load ptr, ptr %120, align 8, !tbaa !22
  %.phi.trans.insert = sext i32 %127 to i64
  %.phi.trans.insert82 = getelementptr inbounds ptr, ptr %.pre, i64 %.phi.trans.insert
  %.pre83 = load ptr, ptr %.phi.trans.insert82, align 8, !tbaa !24
  %.pre84 = sext i32 %128 to i64
  br i1 %132, label %._crit_edge81, label %133

133:                                              ; preds = %123
  %134 = getelementptr inbounds float, ptr %.pre83, i64 %.pre84
  %135 = load float, ptr %134, align 4, !tbaa !25
  br label %._crit_edge81

._crit_edge81:                                    ; preds = %123, %133
  %136 = phi float [ %135, %133 ], [ 0.000000e+00, %123 ]
  %137 = getelementptr inbounds float, ptr %.pre83, i64 %.pre84
  store float %136, ptr %137, align 4, !tbaa !25
  %138 = add nuw nsw i32 %.05361, 1
  %exitcond80.not = icmp eq i32 %138, %38
  br i1 %exitcond80.not, label %._crit_edge, label %123, !llvm.loop !41
}

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


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