; LLVM IR from moarseniy/CudaFEMproject :: deprecated/Linal2/src/Linal2.ll (ZN6Matrix10transpose2Ev)

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

%class.Matrix = type { i32, i32, i8, i8, ptr }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6MatrixaSERKS_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Matrix10transpose2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %class.Matrix, align 8
  %4 = alloca %class.Matrix, 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
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %13 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #2
  %14 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  %17 = load i32, ptr %16, align 4, !tbaa !13
  call void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %15, i32 noundef %17)
  invoke void @_ZN6MatrixaSERKS_(ptr dead_on_unwind writable sret(%class.Matrix) align 8 %4, ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %13)
          to label %18 unwind label %38

18:                                               ; preds = %1
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  %19 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  %20 = load i32, ptr %19, align 8, !tbaa !9
  store i32 %20, ptr %7, align 4, !tbaa !14
  %21 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !13
  %23 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  store i32 %22, ptr %23, align 8, !tbaa !9
  %24 = load i32, ptr %7, align 4, !tbaa !14
  %25 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  store i32 %24, ptr %25, align 4, !tbaa !13
  %26 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !13
  %28 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  %29 = load i32, ptr %28, align 8, !tbaa !9
  %30 = icmp eq i32 %27, %29
  br i1 %30, label %31, label %79

31:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  store i32 0, ptr %8, align 4, !tbaa !14
  br label %32

32:                                               ; preds = %75, %31
  %33 = load i32, ptr %8, align 4, !tbaa !14
  %34 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !9
  %36 = icmp slt i32 %33, %35
  br i1 %36, label %42, label %37

37:                                               ; preds = %32
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  br label %78

38:                                               ; preds = %1
  %39 = landingpad { ptr, i32 }
          cleanup
  %40 = extractvalue { ptr, i32 } %39, 0
  store ptr %40, ptr %5, align 8
  %41 = extractvalue { ptr, i32 } %39, 1
  store i32 %41, ptr %6, align 4
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #2
  br label %124

42:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  store i32 0, ptr %10, align 4, !tbaa !14
  br label %43

43:                                               ; preds = %71, %42
  %44 = load i32, ptr %10, align 4, !tbaa !14
  %45 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !13
  %47 = icmp slt i32 %44, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %43
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  br label %74

49:                                               ; preds = %43
  %50 = getelementptr inbounds %class.Matrix, ptr %3, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !15
  %52 = load i32, ptr %8, align 4, !tbaa !14
  %53 = load i32, ptr %10, align 4, !tbaa !14
  %54 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  %55 = load i32, ptr %54, align 8, !tbaa !9
  %56 = mul nsw i32 %53, %55
  %57 = add nsw i32 %52, %56
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds float, ptr %51, i64 %58
  %60 = load float, ptr %59, align 4, !tbaa !16
  %61 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !15
  %63 = load i32, ptr %10, align 4, !tbaa !14
  %64 = load i32, ptr %8, align 4, !tbaa !14
  %65 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  %66 = load i32, ptr %65, align 4, !tbaa !13
  %67 = mul nsw i32 %64, %66
  %68 = add nsw i32 %63, %67
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds float, ptr %62, i64 %69
  store float %60, ptr %70, align 4, !tbaa !16
  br label %71

71:                                               ; preds = %49
  %72 = load i32, ptr %10, align 4, !tbaa !14
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %10, align 4, !tbaa !14
  br label %43, !llvm.loop !18

74:                                               ; preds = %48
  br label %75

75:                                               ; preds = %74
  %76 = load i32, ptr %8, align 4, !tbaa !14
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !14
  br label %32, !llvm.loop !20

78:                                               ; preds = %37
  br label %123

79:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  store i32 0, ptr %11, align 4, !tbaa !14
  br label %80

80:                                               ; preds = %119, %79
  %81 = load i32, ptr %11, align 4, !tbaa !14
  %82 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  %83 = load i32, ptr %82, align 8, !tbaa !9
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %80
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  br label %122

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  store i32 0, ptr %12, align 4, !tbaa !14
  br label %87

87:                                               ; preds = %115, %86
  %88 = load i32, ptr %12, align 4, !tbaa !14
  %89 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  %90 = load i32, ptr %89, align 4, !tbaa !13
  %91 = icmp slt i32 %88, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %87
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  br label %118

93:                                               ; preds = %87
  %94 = getelementptr inbounds %class.Matrix, ptr %3, i32 0, i32 4
  %95 = load ptr, ptr %94, align 8, !tbaa !15
  %96 = load i32, ptr %11, align 4, !tbaa !14
  %97 = load i32, ptr %12, align 4, !tbaa !14
  %98 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 0
  %99 = load i32, ptr %98, align 8, !tbaa !9
  %100 = mul nsw i32 %97, %99
  %101 = add nsw i32 %96, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds float, ptr %95, i64 %102
  %104 = load float, ptr %103, align 4, !tbaa !16
  %105 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 4
  %106 = load ptr, ptr %105, align 8, !tbaa !15
  %107 = load i32, ptr %12, align 4, !tbaa !14
  %108 = load i32, ptr %11, align 4, !tbaa !14
  %109 = getelementptr inbounds %class.Matrix, ptr %13, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !13
  %111 = mul nsw i32 %108, %110
  %112 = add nsw i32 %107, %111
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds float, ptr %106, i64 %113
  store float %104, ptr %114, align 4, !tbaa !16
  br label %115

115:                                              ; preds = %93
  %116 = load i32, ptr %12, align 4, !tbaa !14
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %12, align 4, !tbaa !14
  br label %87, !llvm.loop !21

118:                                              ; preds = %92
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %11, align 4, !tbaa !14
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %11, align 4, !tbaa !14
  br label %80, !llvm.loop !22

122:                                              ; preds = %85
  br label %123

123:                                              ; preds = %122, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #2
  ret void

124:                                              ; preds = %38
  %125 = load ptr, ptr %5, align 8
  %126 = load i32, ptr %6, align 4
  %127 = insertvalue { ptr, i32 } poison, ptr %125, 0
  %128 = insertvalue { ptr, i32 } %127, i32 %126, 1
  resume { ptr, i32 } %128
}

declare void @_ZN6MatrixC1Eii(ptr, i32, i32)

declare void @_ZN6MatrixD1Ev(ptr)

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 }

!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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS6Matrix", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 9, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 16}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}


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

%class.Matrix = type { i32, i32, i8, i8, ptr }

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6MatrixaSERKS_(ptr dead_on_unwind noalias writable sret(%class.Matrix) align 8, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Matrix10transpose2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.Matrix, align 8
  %3 = alloca %class.Matrix, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #2
  %4 = load i32, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !12
  call void @_ZN6MatrixC1Eii(ptr noundef nonnull align 8 dereferenceable(24) %2, i32 noundef %4, i32 noundef %6)
  invoke void @_ZN6MatrixaSERKS_(ptr dead_on_unwind nonnull writable sret(%class.Matrix) align 8 %3, ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) %0)
          to label %7 unwind label %60

7:                                                ; preds = %1
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #2
  %8 = load i32, ptr %0, align 8, !tbaa !5
  %9 = load i32, ptr %5, align 4, !tbaa !12
  store i32 %9, ptr %0, align 8, !tbaa !5
  store i32 %8, ptr %5, align 4, !tbaa !12
  %10 = icmp eq i32 %8, %9
  br i1 %10, label %.preheader24, label %.preheader26

.preheader26:                                     ; preds = %7
  %11 = icmp sgt i32 %9, 0
  br i1 %11, label %.preheader25.lr.ph, label %.loopexit

.preheader25.lr.ph:                               ; preds = %.preheader26
  %12 = icmp sgt i32 %8, 0
  %13 = getelementptr inbounds i8, ptr %2, i64 16
  %14 = load ptr, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load ptr, ptr %15, align 8
  br i1 %12, label %.preheader25.us.preheader, label %.loopexit

.preheader25.us.preheader:                        ; preds = %.preheader25.lr.ph
  %17 = zext nneg i32 %9 to i64
  %18 = zext nneg i32 %8 to i64
  %19 = mul nuw nsw i64 %17, %18
  %20 = shl nuw i64 %19, 2
  %scevgep = getelementptr i8, ptr %16, i64 %20
  %21 = add nuw nsw i64 %17, %18
  %22 = shl nuw nsw i64 %21, 2
  %23 = getelementptr i8, ptr %14, i64 %22
  %scevgep60 = getelementptr i8, ptr %23, i64 -4
  %min.iters.check = icmp ugt i32 %8, 7
  %ident.check.not = icmp eq i32 %9, 1
  %or.cond = and i1 %min.iters.check, %ident.check.not
  %bound0 = icmp ult ptr %16, %scevgep60
  %bound1 = icmp ult ptr %14, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %n.vec = and i64 %18, 2147483640
  %cmp.n = icmp eq i64 %n.vec, %18
  %xtraiter = and i64 %18, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader25.us

.preheader25.us:                                  ; preds = %.preheader25.us.preheader, %._crit_edge.us
  %indvars.iv37 = phi i64 [ 0, %.preheader25.us.preheader ], [ %indvars.iv.next38, %._crit_edge.us ]
  %24 = mul nuw nsw i64 %indvars.iv37, %18
  %invariant.gep = getelementptr inbounds float, ptr %14, i64 %indvars.iv37
  %invariant.gep53 = getelementptr inbounds float, ptr %16, i64 %24
  %or.cond.not = xor i1 %or.cond, true
  %brmerge = select i1 %or.cond.not, i1 true, i1 %found.conflict
  br i1 %brmerge, label %scalar.ph.preheader, label %vector.body

vector.body:                                      ; preds = %.preheader25.us, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %.preheader25.us ]
  %25 = getelementptr inbounds float, ptr %invariant.gep, i64 %index
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  %wide.load = load <4 x float>, ptr %25, align 4, !tbaa !13, !alias.scope !15
  %wide.load61 = load <4 x float>, ptr %26, align 4, !tbaa !13, !alias.scope !15
  %27 = getelementptr inbounds float, ptr %invariant.gep53, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  store <4 x float> %wide.load, ptr %27, align 4, !tbaa !13, !alias.scope !18, !noalias !15
  store <4 x float> %wide.load61, ptr %28, align 4, !tbaa !13, !alias.scope !18, !noalias !15
  %index.next = add nuw i64 %index, 8
  %29 = icmp eq i64 %index.next, %n.vec
  br i1 %29, label %middle.block, label %vector.body, !llvm.loop !20

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

scalar.ph.preheader:                              ; preds = %.preheader25.us, %middle.block
  %indvars.iv.ph = phi i64 [ 0, %.preheader25.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.iv.prol = phi i64 [ %indvars.iv.next.prol, %scalar.ph.prol ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph.prol ], [ 0, %scalar.ph.preheader ]
  %30 = mul nuw nsw i64 %indvars.iv.prol, %17
  %gep.prol = getelementptr inbounds float, ptr %invariant.gep, i64 %30
  %31 = load float, ptr %gep.prol, align 4, !tbaa !13
  %gep54.prol = getelementptr inbounds float, ptr %invariant.gep53, i64 %indvars.iv.prol
  store float %31, ptr %gep54.prol, align 4, !tbaa !13
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.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 !24

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 ]
  %32 = sub nsw i64 %indvars.iv.ph, %18
  %33 = icmp ugt i64 %32, -4
  br i1 %33, label %._crit_edge.us, label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %scalar.ph ], [ %indvars.iv.unr, %scalar.ph.prol.loopexit ]
  %34 = mul nuw nsw i64 %indvars.iv, %17
  %gep = getelementptr inbounds float, ptr %invariant.gep, i64 %34
  %35 = load float, ptr %gep, align 4, !tbaa !13
  %gep54 = getelementptr inbounds float, ptr %invariant.gep53, i64 %indvars.iv
  store float %35, ptr %gep54, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = mul nuw nsw i64 %indvars.iv.next, %17
  %gep.1 = getelementptr inbounds float, ptr %invariant.gep, i64 %36
  %37 = load float, ptr %gep.1, align 4, !tbaa !13
  %gep54.1 = getelementptr inbounds float, ptr %invariant.gep53, i64 %indvars.iv.next
  store float %37, ptr %gep54.1, align 4, !tbaa !13
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %38 = mul nuw nsw i64 %indvars.iv.next.1, %17
  %gep.2 = getelementptr inbounds float, ptr %invariant.gep, i64 %38
  %39 = load float, ptr %gep.2, align 4, !tbaa !13
  %gep54.2 = getelementptr inbounds float, ptr %invariant.gep53, i64 %indvars.iv.next.1
  store float %39, ptr %gep54.2, align 4, !tbaa !13
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %40 = mul nuw nsw i64 %indvars.iv.next.2, %17
  %gep.3 = getelementptr inbounds float, ptr %invariant.gep, i64 %40
  %41 = load float, ptr %gep.3, align 4, !tbaa !13
  %gep54.3 = getelementptr inbounds float, ptr %invariant.gep53, i64 %indvars.iv.next.2
  store float %41, ptr %gep54.3, align 4, !tbaa !13
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %18
  br i1 %exitcond.not.3, label %._crit_edge.us, label %scalar.ph, !llvm.loop !26

._crit_edge.us:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %exitcond41.not = icmp eq i64 %indvars.iv.next38, %17
  br i1 %exitcond41.not, label %.loopexit, label %.preheader25.us, !llvm.loop !27

.preheader24:                                     ; preds = %7
  %42 = icmp sgt i32 %8, 0
  br i1 %42, label %.preheader.us.preheader, label %.loopexit

.preheader.us.preheader:                          ; preds = %.preheader24
  %43 = getelementptr inbounds i8, ptr %2, i64 16
  %44 = load ptr, ptr %43, align 8
  %45 = getelementptr inbounds i8, ptr %0, i64 16
  %46 = load ptr, ptr %45, align 8
  %47 = zext nneg i32 %8 to i64
  %xtraiter63 = and i64 %47, 3
  %48 = icmp ult i32 %8, 4
  %unroll_iter = and i64 %47, 2147483644
  %lcmp.mod64.not = icmp eq i64 %xtraiter63, 0
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us32
  %indvars.iv47 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next48, %._crit_edge.us32 ]
  %49 = mul nuw nsw i64 %indvars.iv47, %47
  %invariant.gep55 = getelementptr inbounds float, ptr %44, i64 %indvars.iv47
  %invariant.gep57 = getelementptr inbounds float, ptr %46, i64 %49
  br i1 %48, label %._crit_edge.us32.unr-lcssa, label %.preheader.us.new

.preheader.us.new:                                ; preds = %.preheader.us, %.preheader.us.new
  %indvars.iv42 = phi i64 [ %indvars.iv.next43.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %niter = phi i64 [ %niter.next.3, %.preheader.us.new ], [ 0, %.preheader.us ]
  %50 = mul nuw nsw i64 %indvars.iv42, %47
  %gep56 = getelementptr inbounds float, ptr %invariant.gep55, i64 %50
  %51 = load float, ptr %gep56, align 4, !tbaa !13
  %gep58 = getelementptr inbounds float, ptr %invariant.gep57, i64 %indvars.iv42
  store float %51, ptr %gep58, align 4, !tbaa !13
  %indvars.iv.next43 = or disjoint i64 %indvars.iv42, 1
  %52 = mul nuw nsw i64 %indvars.iv.next43, %47
  %gep56.1 = getelementptr inbounds float, ptr %invariant.gep55, i64 %52
  %53 = load float, ptr %gep56.1, align 4, !tbaa !13
  %gep58.1 = getelementptr inbounds float, ptr %invariant.gep57, i64 %indvars.iv.next43
  store float %53, ptr %gep58.1, align 4, !tbaa !13
  %indvars.iv.next43.1 = or disjoint i64 %indvars.iv42, 2
  %54 = mul nuw nsw i64 %indvars.iv.next43.1, %47
  %gep56.2 = getelementptr inbounds float, ptr %invariant.gep55, i64 %54
  %55 = load float, ptr %gep56.2, align 4, !tbaa !13
  %gep58.2 = getelementptr inbounds float, ptr %invariant.gep57, i64 %indvars.iv.next43.1
  store float %55, ptr %gep58.2, align 4, !tbaa !13
  %indvars.iv.next43.2 = or disjoint i64 %indvars.iv42, 3
  %56 = mul nuw nsw i64 %indvars.iv.next43.2, %47
  %gep56.3 = getelementptr inbounds float, ptr %invariant.gep55, i64 %56
  %57 = load float, ptr %gep56.3, align 4, !tbaa !13
  %gep58.3 = getelementptr inbounds float, ptr %invariant.gep57, i64 %indvars.iv.next43.2
  store float %57, ptr %gep58.3, align 4, !tbaa !13
  %indvars.iv.next43.3 = add nuw nsw i64 %indvars.iv42, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.us32.unr-lcssa, label %.preheader.us.new, !llvm.loop !28

._crit_edge.us32.unr-lcssa:                       ; preds = %.preheader.us.new, %.preheader.us
  %indvars.iv42.unr = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next43.3, %.preheader.us.new ]
  br i1 %lcmp.mod64.not, label %._crit_edge.us32, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.us32.unr-lcssa, %.epil.preheader
  %indvars.iv42.epil = phi i64 [ %indvars.iv.next43.epil, %.epil.preheader ], [ %indvars.iv42.unr, %._crit_edge.us32.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.us32.unr-lcssa ]
  %58 = mul nuw nsw i64 %indvars.iv42.epil, %47
  %gep56.epil = getelementptr inbounds float, ptr %invariant.gep55, i64 %58
  %59 = load float, ptr %gep56.epil, align 4, !tbaa !13
  %gep58.epil = getelementptr inbounds float, ptr %invariant.gep57, i64 %indvars.iv42.epil
  store float %59, ptr %gep58.epil, align 4, !tbaa !13
  %indvars.iv.next43.epil = add nuw nsw i64 %indvars.iv42.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter63
  br i1 %epil.iter.cmp.not, label %._crit_edge.us32, label %.epil.preheader, !llvm.loop !29

._crit_edge.us32:                                 ; preds = %.epil.preheader, %._crit_edge.us32.unr-lcssa
  %indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
  %exitcond51.not = icmp eq i64 %indvars.iv.next48, %47
  br i1 %exitcond51.not, label %.loopexit, label %.preheader.us, !llvm.loop !30

60:                                               ; preds = %1
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #2
  resume { ptr, i32 } %61

.loopexit:                                        ; preds = %._crit_edge.us, %._crit_edge.us32, %.preheader25.lr.ph, %.preheader26, %.preheader24
  call void @_ZN6MatrixD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #2
  ret void
}

declare void @_ZN6MatrixC1Eii(ptr, i32, i32) local_unnamed_addr

declare void @_ZN6MatrixD1Ev(ptr) local_unnamed_addr

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 }

!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, !7, i64 0}
!6 = !{!"_ZTS6Matrix", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 9, !11, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.unroll.disable"}
!26 = distinct !{!26, !21, !22}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !21}
!29 = distinct !{!29, !25}
!30 = distinct !{!30, !21}


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