; LLVM IR from jingweizhanghuai/Morn :: test/test_matrix3.ll (Z12test_inversei)

; 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.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { ptr, i64, i64 }
%"class.Eigen::Inverse" = type { ptr }
%struct.MMatrix = type { i32, i32, ptr }

@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@__FUNCTION__._Z12test_inversei = external hidden unnamed_addr constant [13 x i8], align 1

declare i32 @printf(ptr noundef, ...) #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2IiiEERKT_RKT0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 align 2

declare ptr @MatrixCreate(i32 noundef, i32 noundef, ptr noundef) #0

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEELi1EEclEll(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef, i64 noundef) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare void @_mTimerBegin(ptr noundef) #0

declare float @_mTimerEnd(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

declare void @mMatrixRelease(ptr noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12test_inversei(i32 noundef %0) #4 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.Eigen::Matrix", 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
  %10 = alloca float, align 4
  %11 = alloca %"class.Eigen::Matrix", align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.Eigen::Inverse", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %16, i32 noundef %17)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #5
  call void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2IiiEERKT_RKT0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add nsw i32 %19, 0
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = invoke ptr @MatrixCreate(i32 noundef %20, i32 noundef %21, ptr noundef null)
          to label %23 unwind label %29

23:                                               ; preds = %1
  store ptr %22, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %71, %23
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %33, label %28

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

29:                                               ; preds = %1
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %5, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %6, align 4
  br label %141

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

34:                                               ; preds = %63, %33
  %35 = load i32, ptr %9, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %70

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %40 = invoke i32 @m_Rand(i32 noundef -1000, i32 noundef 1000)
          to label %41 unwind label %66

41:                                               ; preds = %39
  %42 = sitofp i32 %40 to double
  %43 = fdiv double %42, 1.000000e+03
  %44 = fptrunc double %43 to float
  store float %44, ptr %10, align 4, !tbaa !11
  %45 = load float, ptr %10, align 4, !tbaa !11
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEELi1EEclEll(ptr noundef nonnull align 1 dereferenceable(1) %3, i64 noundef %47, i64 noundef %49)
          to label %51 unwind label %66

51:                                               ; preds = %41
  store float %45, ptr %50, align 4, !tbaa !11
  %52 = load float, ptr %10, align 4, !tbaa !11
  %53 = load ptr, ptr %4, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.MMatrix, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds ptr, ptr %55, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = load i32, ptr %9, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds float, ptr %59, i64 %61
  store float %52, ptr %62, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %63

63:                                               ; preds = %51
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %9, align 4, !tbaa !5
  br label %34, !llvm.loop !15

66:                                               ; preds = %41, %39
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %5, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %141

70:                                               ; preds = %38
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %7, align 4, !tbaa !5
  br label %24, !llvm.loop !17

74:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  invoke void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11)
          to label %75 unwind label %81

75:                                               ; preds = %74
  invoke void @_mTimerBegin(ptr noundef @.str.3)
          to label %76 unwind label %85

76:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %95, %76
  %78 = load i32, ptr %12, align 4, !tbaa !5
  %79 = icmp slt i32 %78, 10000
  br i1 %79, label %89, label %80

80:                                               ; preds = %77
  store i32 8, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %102

81:                                               ; preds = %74
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %5, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %6, align 4
  br label %140

85:                                               ; preds = %102, %75
  %86 = landingpad { ptr, i32 }
          cleanup
  %87 = extractvalue { ptr, i32 } %86, 0
  store ptr %87, ptr %5, align 8
  %88 = extractvalue { ptr, i32 } %86, 1
  store i32 %88, ptr %6, align 4
  br label %139

89:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %90 = invoke ptr @_ZNK5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7inverseEv(ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %91 unwind label %98

91:                                               ; preds = %89
  %92 = getelementptr inbounds %"class.Eigen::Inverse", ptr %13, i32 0, i32 0
  store ptr %90, ptr %92, align 8
  %93 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEaSINS_7InverseIS1_EEEERS1_RKNS_9DenseBaseIT_EE(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 1 dereferenceable(1) %13)
          to label %94 unwind label %98

94:                                               ; preds = %91
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %95

95:                                               ; preds = %94
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !5
  br label %77, !llvm.loop !18

98:                                               ; preds = %91, %89
  %99 = landingpad { ptr, i32 }
          cleanup
  %100 = extractvalue { ptr, i32 } %99, 0
  store ptr %100, ptr %5, align 8
  %101 = extractvalue { ptr, i32 } %99, 1
  store i32 %101, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %139

102:                                              ; preds = %80
  %103 = invoke float @_mTimerEnd(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 122, ptr noundef @__FUNCTION__._Z12test_inversei)
          to label %104 unwind label %85

104:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %105 = load i32, ptr %2, align 4, !tbaa !5
  %106 = add nsw i32 %105, 0
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = invoke ptr @MatrixCreate(i32 noundef %106, i32 noundef %107, ptr noundef null)
          to label %109 unwind label %115

109:                                              ; preds = %104
  store ptr %108, ptr %14, align 8, !tbaa !9
  invoke void @_mTimerBegin(ptr noundef @.str.5)
          to label %110 unwind label %115

110:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %124, %110
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = icmp slt i32 %112, 10000
  br i1 %113, label %119, label %114

114:                                              ; preds = %111
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %131

115:                                              ; preds = %135, %133, %131, %109, %104
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %5, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %6, align 4
  br label %138

119:                                              ; preds = %111
  %120 = load ptr, ptr %4, align 8, !tbaa !9
  %121 = load ptr, ptr %14, align 8, !tbaa !9
  %122 = invoke i32 @mMatrixInverse(ptr noundef %120, ptr noundef %121)
          to label %123 unwind label %127

123:                                              ; preds = %119
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %15, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %15, align 4, !tbaa !5
  br label %111, !llvm.loop !19

127:                                              ; preds = %119
  %128 = landingpad { ptr, i32 }
          cleanup
  %129 = extractvalue { ptr, i32 } %128, 0
  store ptr %129, ptr %5, align 8
  %130 = extractvalue { ptr, i32 } %128, 1
  store i32 %130, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %138

131:                                              ; preds = %114
  %132 = invoke float @_mTimerEnd(ptr noundef @.str.5, ptr noundef @.str.4, i32 noundef 129, ptr noundef @__FUNCTION__._Z12test_inversei)
          to label %133 unwind label %115

133:                                              ; preds = %131
  %134 = load ptr, ptr %14, align 8, !tbaa !9
  invoke void @mMatrixRelease(ptr noundef %134)
          to label %135 unwind label %115

135:                                              ; preds = %133
  %136 = load ptr, ptr %4, align 8, !tbaa !9
  invoke void @mMatrixRelease(ptr noundef %136)
          to label %137 unwind label %115

137:                                              ; preds = %135
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  ret void

138:                                              ; preds = %127, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %139

139:                                              ; preds = %138, %98, %85
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #5
  br label %140

140:                                              ; preds = %139, %81
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  br label %141

141:                                              ; preds = %140, %66, %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #5
  br label %142

142:                                              ; preds = %141
  %143 = load ptr, ptr %5, align 8
  %144 = load i32, ptr %6, align 4
  %145 = insertvalue { ptr, i32 } poison, ptr %143, 0
  %146 = insertvalue { ptr, i32 } %145, i32 %144, 1
  resume { ptr, i32 } %146
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZNK5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7inverseEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEaSINS_7InverseIS1_EEEERS1_RKNS_9DenseBaseIT_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

declare i32 @mMatrixInverse(ptr noundef, ptr noundef) #0

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #3 = { inlinehint mustprogress 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 = { 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 #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !10, i64 8}
!14 = !{!"_ZTS7MMatrix", !6, i64 0, !6, i64 4, !10, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


; 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.Eigen::Matrix" = type { %"class.Eigen::PlainObjectBase" }
%"class.Eigen::PlainObjectBase" = type { %"class.Eigen::DenseStorage" }
%"class.Eigen::DenseStorage" = type { ptr, i64, i64 }
%"class.Eigen::Inverse" = type { ptr }

@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@__FUNCTION__._Z12test_inversei = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2IiiEERKT_RKT0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #2 align 2

declare ptr @MatrixCreate(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEELi1EEclEll(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef, i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #2 align 2

declare void @_mTimerBegin(ptr noundef) local_unnamed_addr #3

declare float @_mTimerEnd(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @mMatrixRelease(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12test_inversei(i32 noundef %0) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %2 = alloca i32, align 4
  %3 = alloca %"class.Eigen::Matrix", align 8
  %4 = alloca %"class.Eigen::Matrix", align 8
  %5 = alloca %"class.Eigen::Inverse", align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %0, i32 noundef %0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2IiiEERKT_RKT0_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = invoke ptr @MatrixCreate(i32 noundef %7, i32 noundef %7, ptr noundef null)
          to label %.preheader36 unwind label %14

.preheader36:                                     ; preds = %1
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.preheader35.preheader, label %._crit_edge39

.preheader35.preheader:                           ; preds = %.preheader36
  %11 = getelementptr inbounds i8, ptr %8, i64 8
  br label %.preheader35

.preheader35:                                     ; preds = %.preheader35.preheader, %._crit_edge
  %12 = phi i32 [ %9, %.preheader35.preheader ], [ %16, %._crit_edge ]
  %indvars.iv44 = phi i64 [ 0, %.preheader35.preheader ], [ %indvars.iv.next45, %._crit_edge ]
  %13 = icmp sgt i32 %12, 0
  br i1 %13, label %.lr.ph, label %.preheader35.._crit_edge_crit_edge

.preheader35.._crit_edge_crit_edge:               ; preds = %.preheader35
  %.pre = sext i32 %12 to i64
  br label %._crit_edge

._crit_edge39:                                    ; preds = %._crit_edge, %.preheader36
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #6
  invoke void @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %34 unwind label %37

14:                                               ; preds = %1
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %66

._crit_edge:                                      ; preds = %21, %.preheader35.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader35.._crit_edge_crit_edge ], [ %30, %21 ]
  %16 = phi i32 [ %12, %.preheader35.._crit_edge_crit_edge ], [ %29, %21 ]
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %17 = icmp slt i64 %indvars.iv.next45, %.pre-phi
  br i1 %17, label %.preheader35, label %._crit_edge39, !llvm.loop !9

.lr.ph:                                           ; preds = %.preheader35, %21
  %indvars.iv = phi i64 [ %indvars.iv.next, %21 ], [ 0, %.preheader35 ]
  %18 = invoke i32 @m_Rand(i32 noundef -1000, i32 noundef 1000)
          to label %19 unwind label %32

19:                                               ; preds = %.lr.ph
  %20 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN5Eigen15DenseCoeffsBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEELi1EEclEll(ptr noundef nonnull align 1 dereferenceable(1) %3, i64 noundef %indvars.iv44, i64 noundef %indvars.iv)
          to label %21 unwind label %32

21:                                               ; preds = %19
  %22 = sitofp i32 %18 to double
  %23 = fdiv double %22, 1.000000e+03
  %24 = fptrunc double %23 to float
  store float %24, ptr %20, align 4, !tbaa !12
  %25 = load ptr, ptr %11, align 8, !tbaa !14
  %26 = getelementptr inbounds ptr, ptr %25, i64 %indvars.iv44
  %27 = load ptr, ptr %26, align 8, !tbaa !17
  %28 = getelementptr inbounds float, ptr %27, i64 %indvars.iv
  store float %24, ptr %28, align 4, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !18

32:                                               ; preds = %19, %.lr.ph
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %66

34:                                               ; preds = %._crit_edge39
  invoke void @_mTimerBegin(ptr noundef nonnull @.str.3)
          to label %.preheader34 unwind label %39

35:                                               ; preds = %44
  %36 = invoke float @_mTimerEnd(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 122, ptr noundef nonnull @__FUNCTION__._Z12test_inversei)
          to label %48 unwind label %39

37:                                               ; preds = %._crit_edge39
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %65

39:                                               ; preds = %35, %34
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %64

.preheader34:                                     ; preds = %34, %44
  %.02140 = phi i32 [ %45, %44 ], [ 0, %34 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %41 = invoke ptr @_ZNK5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7inverseEv(ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %42 unwind label %46

42:                                               ; preds = %.preheader34
  store ptr %41, ptr %5, align 8
  %43 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEaSINS_7InverseIS1_EEEERS1_RKNS_9DenseBaseIT_EE(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %44 unwind label %46

44:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %45 = add nuw nsw i32 %.02140, 1
  %exitcond.not = icmp eq i32 %45, 10000
  br i1 %exitcond.not, label %35, label %.preheader34, !llvm.loop !19

46:                                               ; preds = %42, %.preheader34
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %64

48:                                               ; preds = %35
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = invoke ptr @MatrixCreate(i32 noundef %49, i32 noundef %49, ptr noundef null)
          to label %51 unwind label %54

51:                                               ; preds = %48
  invoke void @_mTimerBegin(ptr noundef nonnull @.str.5)
          to label %.preheader unwind label %54

52:                                               ; preds = %57
  %53 = invoke float @_mTimerEnd(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4, i32 noundef 129, ptr noundef nonnull @__FUNCTION__._Z12test_inversei)
          to label %61 unwind label %54

54:                                               ; preds = %62, %61, %52, %51, %48
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %64

.preheader:                                       ; preds = %51, %57
  %.041 = phi i32 [ %58, %57 ], [ 0, %51 ]
  %56 = invoke i32 @mMatrixInverse(ptr noundef %8, ptr noundef %50)
          to label %57 unwind label %59

57:                                               ; preds = %.preheader
  %58 = add nuw nsw i32 %.041, 1
  %exitcond47.not = icmp eq i32 %58, 10000
  br i1 %exitcond47.not, label %52, label %.preheader, !llvm.loop !20

59:                                               ; preds = %.preheader
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %64

61:                                               ; preds = %52
  invoke void @mMatrixRelease(ptr noundef %50)
          to label %62 unwind label %54

62:                                               ; preds = %61
  invoke void @mMatrixRelease(ptr noundef %8)
          to label %63 unwind label %54

63:                                               ; preds = %62
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  ret void

64:                                               ; preds = %54, %59, %46, %39
  %.pn29 = phi { ptr, i32 } [ %47, %46 ], [ %40, %39 ], [ %60, %59 ], [ %55, %54 ]
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #6
  br label %65

65:                                               ; preds = %64, %37
  %.pn29.pn = phi { ptr, i32 } [ %.pn29, %64 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #6
  br label %66

66:                                               ; preds = %65, %32, %14
  %.pn32 = phi { ptr, i32 } [ %33, %32 ], [ %.pn29.pn, %65 ], [ %15, %14 ]
  call void @_ZN5Eigen15PlainObjectBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn32
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local ptr @_ZNK5Eigen10MatrixBaseINS_6MatrixIfLin1ELin1ELi0ELin1ELin1EEEE7inverseEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN5Eigen6MatrixIfLin1ELin1ELi0ELin1ELin1EEaSINS_7InverseIS1_EEEERS1_RKNS_9DenseBaseIT_EE(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

declare i32 @mMatrixInverse(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { nofree nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #3 = { "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 = { inlinehint mustprogress 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 #5 = { 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 #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = !{!13, !13, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!15, !16, i64 8}
!15 = !{!"_ZTS7MMatrix", !6, i64 0, !6, i64 4, !16, i64 8}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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