; LLVM IR from Aakriti05/DSP-implementation_LMS_RNN :: rnn (dot)

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local ptr @dot(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %10 = call noalias ptr @malloc(i64 noundef 256) #4
  store ptr %10, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %21, %2
  %12 = load i32, ptr %6, align 4, !tbaa !9
  %13 = icmp slt i32 %12, 32
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %24

15:                                               ; preds = %11
  %16 = call noalias ptr @malloc(i64 noundef 128) #4
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds ptr, ptr %17, i64 %19
  store ptr %16, ptr %20, align 8, !tbaa !5
  br label %21

21:                                               ; preds = %15
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %6, align 4, !tbaa !9
  br label %11, !llvm.loop !11

24:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %59, %24
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 32
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %62

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %55, %29
  %31 = load i32, ptr %9, align 4, !tbaa !9
  %32 = icmp slt i32 %31, 16
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %58

34:                                               ; preds = %30
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %35, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = sitofp i32 %39 to double
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds double, ptr %41, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !13
  %46 = fmul double %40, %45
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds ptr, ptr %47, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = load i32, ptr %9, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds double, ptr %51, i64 %53
  store double %46, ptr %54, align 8, !tbaa !13
  br label %55

55:                                               ; preds = %34
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %9, align 4, !tbaa !9
  br label %30, !llvm.loop !15

58:                                               ; preds = %33
  br label %59

59:                                               ; preds = %58
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %7, align 4, !tbaa !9
  br label %25, !llvm.loop !16

62:                                               ; preds = %28
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret ptr %63
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 allocsize(0) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind uwtable
define dso_local noalias noundef ptr @dot(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
.preheader.preheader:
  %2 = tail call noalias dereferenceable_or_null(256) ptr @malloc(i64 noundef 256) #2
  %3 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  store ptr %3, ptr %2, align 8, !tbaa !5
  %4 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %5 = getelementptr inbounds i8, ptr %2, i64 8
  store ptr %4, ptr %5, align 8, !tbaa !5
  %6 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  store ptr %6, ptr %7, align 8, !tbaa !5
  %8 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %9 = getelementptr inbounds i8, ptr %2, i64 24
  store ptr %8, ptr %9, align 8, !tbaa !5
  %10 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %11 = getelementptr inbounds i8, ptr %2, i64 32
  store ptr %10, ptr %11, align 8, !tbaa !5
  %12 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %13 = getelementptr inbounds i8, ptr %2, i64 40
  store ptr %12, ptr %13, align 8, !tbaa !5
  %14 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %15 = getelementptr inbounds i8, ptr %2, i64 48
  store ptr %14, ptr %15, align 8, !tbaa !5
  %16 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %17 = getelementptr inbounds i8, ptr %2, i64 56
  store ptr %16, ptr %17, align 8, !tbaa !5
  %18 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %19 = getelementptr inbounds i8, ptr %2, i64 64
  store ptr %18, ptr %19, align 8, !tbaa !5
  %20 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %21 = getelementptr inbounds i8, ptr %2, i64 72
  store ptr %20, ptr %21, align 8, !tbaa !5
  %22 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %23 = getelementptr inbounds i8, ptr %2, i64 80
  store ptr %22, ptr %23, align 8, !tbaa !5
  %24 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %25 = getelementptr inbounds i8, ptr %2, i64 88
  store ptr %24, ptr %25, align 8, !tbaa !5
  %26 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %27 = getelementptr inbounds i8, ptr %2, i64 96
  store ptr %26, ptr %27, align 8, !tbaa !5
  %28 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %29 = getelementptr inbounds i8, ptr %2, i64 104
  store ptr %28, ptr %29, align 8, !tbaa !5
  %30 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %31 = getelementptr inbounds i8, ptr %2, i64 112
  store ptr %30, ptr %31, align 8, !tbaa !5
  %32 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %33 = getelementptr inbounds i8, ptr %2, i64 120
  store ptr %32, ptr %33, align 8, !tbaa !5
  %34 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %35 = getelementptr inbounds i8, ptr %2, i64 128
  store ptr %34, ptr %35, align 8, !tbaa !5
  %36 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %37 = getelementptr inbounds i8, ptr %2, i64 136
  store ptr %36, ptr %37, align 8, !tbaa !5
  %38 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %39 = getelementptr inbounds i8, ptr %2, i64 144
  store ptr %38, ptr %39, align 8, !tbaa !5
  %40 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %41 = getelementptr inbounds i8, ptr %2, i64 152
  store ptr %40, ptr %41, align 8, !tbaa !5
  %42 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %43 = getelementptr inbounds i8, ptr %2, i64 160
  store ptr %42, ptr %43, align 8, !tbaa !5
  %44 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %45 = getelementptr inbounds i8, ptr %2, i64 168
  store ptr %44, ptr %45, align 8, !tbaa !5
  %46 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %47 = getelementptr inbounds i8, ptr %2, i64 176
  store ptr %46, ptr %47, align 8, !tbaa !5
  %48 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %49 = getelementptr inbounds i8, ptr %2, i64 184
  store ptr %48, ptr %49, align 8, !tbaa !5
  %50 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %51 = getelementptr inbounds i8, ptr %2, i64 192
  store ptr %50, ptr %51, align 8, !tbaa !5
  %52 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %53 = getelementptr inbounds i8, ptr %2, i64 200
  store ptr %52, ptr %53, align 8, !tbaa !5
  %54 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %55 = getelementptr inbounds i8, ptr %2, i64 208
  store ptr %54, ptr %55, align 8, !tbaa !5
  %56 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %57 = getelementptr inbounds i8, ptr %2, i64 216
  store ptr %56, ptr %57, align 8, !tbaa !5
  %58 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %59 = getelementptr inbounds i8, ptr %2, i64 224
  store ptr %58, ptr %59, align 8, !tbaa !5
  %60 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %61 = getelementptr inbounds i8, ptr %2, i64 232
  store ptr %60, ptr %61, align 8, !tbaa !5
  %62 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %63 = getelementptr inbounds i8, ptr %2, i64 240
  store ptr %62, ptr %63, align 8, !tbaa !5
  %64 = tail call noalias dereferenceable_or_null(128) ptr @malloc(i64 noundef 128) #2
  %65 = getelementptr inbounds i8, ptr %2, i64 248
  store ptr %64, ptr %65, align 8, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %1, i64 8
  %67 = getelementptr inbounds i8, ptr %1, i64 16
  %68 = getelementptr inbounds i8, ptr %1, i64 24
  %69 = getelementptr inbounds i8, ptr %1, i64 32
  %70 = getelementptr inbounds i8, ptr %1, i64 40
  %71 = getelementptr inbounds i8, ptr %1, i64 48
  %72 = getelementptr inbounds i8, ptr %1, i64 56
  %73 = getelementptr inbounds i8, ptr %1, i64 64
  %74 = getelementptr inbounds i8, ptr %1, i64 72
  %75 = getelementptr inbounds i8, ptr %1, i64 80
  %76 = getelementptr inbounds i8, ptr %1, i64 88
  %77 = getelementptr inbounds i8, ptr %1, i64 96
  %78 = getelementptr inbounds i8, ptr %1, i64 104
  %79 = getelementptr inbounds i8, ptr %1, i64 112
  %80 = getelementptr inbounds i8, ptr %1, i64 120
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next, %.preheader ]
  %81 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = sitofp i32 %82 to double
  %84 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  %86 = load double, ptr %1, align 8, !tbaa !11
  %87 = fmul double %86, %83
  store double %87, ptr %85, align 8, !tbaa !11
  %88 = load double, ptr %66, align 8, !tbaa !11
  %89 = fmul double %88, %83
  %90 = getelementptr inbounds i8, ptr %85, i64 8
  store double %89, ptr %90, align 8, !tbaa !11
  %91 = load double, ptr %67, align 8, !tbaa !11
  %92 = fmul double %91, %83
  %93 = getelementptr inbounds i8, ptr %85, i64 16
  store double %92, ptr %93, align 8, !tbaa !11
  %94 = load double, ptr %68, align 8, !tbaa !11
  %95 = fmul double %94, %83
  %96 = getelementptr inbounds i8, ptr %85, i64 24
  store double %95, ptr %96, align 8, !tbaa !11
  %97 = load double, ptr %69, align 8, !tbaa !11
  %98 = fmul double %97, %83
  %99 = getelementptr inbounds i8, ptr %85, i64 32
  store double %98, ptr %99, align 8, !tbaa !11
  %100 = load double, ptr %70, align 8, !tbaa !11
  %101 = fmul double %100, %83
  %102 = getelementptr inbounds i8, ptr %85, i64 40
  store double %101, ptr %102, align 8, !tbaa !11
  %103 = load double, ptr %71, align 8, !tbaa !11
  %104 = fmul double %103, %83
  %105 = getelementptr inbounds i8, ptr %85, i64 48
  store double %104, ptr %105, align 8, !tbaa !11
  %106 = load double, ptr %72, align 8, !tbaa !11
  %107 = fmul double %106, %83
  %108 = getelementptr inbounds i8, ptr %85, i64 56
  store double %107, ptr %108, align 8, !tbaa !11
  %109 = load double, ptr %73, align 8, !tbaa !11
  %110 = fmul double %109, %83
  %111 = getelementptr inbounds i8, ptr %85, i64 64
  store double %110, ptr %111, align 8, !tbaa !11
  %112 = load double, ptr %74, align 8, !tbaa !11
  %113 = fmul double %112, %83
  %114 = getelementptr inbounds i8, ptr %85, i64 72
  store double %113, ptr %114, align 8, !tbaa !11
  %115 = load double, ptr %75, align 8, !tbaa !11
  %116 = fmul double %115, %83
  %117 = getelementptr inbounds i8, ptr %85, i64 80
  store double %116, ptr %117, align 8, !tbaa !11
  %118 = load double, ptr %76, align 8, !tbaa !11
  %119 = fmul double %118, %83
  %120 = getelementptr inbounds i8, ptr %85, i64 88
  store double %119, ptr %120, align 8, !tbaa !11
  %121 = load double, ptr %77, align 8, !tbaa !11
  %122 = fmul double %121, %83
  %123 = getelementptr inbounds i8, ptr %85, i64 96
  store double %122, ptr %123, align 8, !tbaa !11
  %124 = load double, ptr %78, align 8, !tbaa !11
  %125 = fmul double %124, %83
  %126 = getelementptr inbounds i8, ptr %85, i64 104
  store double %125, ptr %126, align 8, !tbaa !11
  %127 = load double, ptr %79, align 8, !tbaa !11
  %128 = fmul double %127, %83
  %129 = getelementptr inbounds i8, ptr %85, i64 112
  store double %128, ptr %129, align 8, !tbaa !11
  %130 = load double, ptr %80, align 8, !tbaa !11
  %131 = fmul double %130, %83
  %132 = getelementptr inbounds i8, ptr %85, i64 120
  store double %131, ptr %132, align 8, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 32
  br i1 %exitcond.not, label %133, label %.preheader, !llvm.loop !13

133:                                              ; preds = %.preheader
  ret ptr %2
}

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind allocsize(0) }

!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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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