; LLVM IR from achilles288/robot-monitor-graphics :: src/base/math/mat3.ll (ZNK3rmg4Mat37inverseEv)

; 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.rmg::Mat3" = type { %union.anon }
%union.anon = type { [3 x [3 x float]] }
%"struct.rmg::Mat3Row" = type { [3 x float] }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

; 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 noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36), i8 noundef zeroext) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) #2 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3rmg4Mat37inverseEv(ptr dead_on_unwind noalias writable sret(%"struct.rmg::Mat3") align 4 %0, ptr noundef nonnull align 4 dereferenceable(36) %1) #4 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca %"struct.rmg::Mat3", align 4
  %5 = alloca %"struct.rmg::Mat3", align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.rmg::Mat3Row", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  store ptr %1, ptr %3, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 36, ptr %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %15, i64 36, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 36, ptr %5) #5
  call void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !11
  br label %16

16:                                               ; preds = %184, %2
  %17 = load i32, ptr %6, align 4, !tbaa !11
  %18 = icmp slt i32 %17, 3
  br i1 %18, label %20, label %19

19:                                               ; preds = %16
  store i32 2, ptr %7, align 4
  br label %187

20:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %21 = load i32, ptr %6, align 4, !tbaa !11
  %22 = trunc i32 %21 to i8
  %23 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %22)
  %24 = load i32, ptr %6, align 4, !tbaa !11
  %25 = trunc i32 %24 to i8
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %23, i8 noundef zeroext %25)
  %27 = load float, ptr %26, align 4, !tbaa !13
  store float %27, ptr %8, align 4, !tbaa !13
  %28 = load float, ptr %8, align 4, !tbaa !13
  %29 = fpext float %28 to double
  %30 = call double @llvm.fabs.f64(double %29)
  %31 = fcmp olt double %30, 0x3F1A36E2E0000000
  br i1 %31, label %32, label %89

32:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %33 = load i32, ptr %6, align 4, !tbaa !11
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %9, align 4, !tbaa !11
  br label %35

35:                                               ; preds = %83, %32
  %36 = load i32, ptr %9, align 4, !tbaa !11
  %37 = icmp sge i32 %36, 3
  br i1 %37, label %38, label %39

38:                                               ; preds = %35
  call void @_ZN3rmg4Mat3C1Ef(ptr noundef nonnull align 4 dereferenceable(36) %0, float noundef 0x7FF8000000000000)
  store i32 1, ptr %7, align 4
  br label %86

39:                                               ; preds = %35
  %40 = load i32, ptr %9, align 4, !tbaa !11
  %41 = trunc i32 %40 to i8
  %42 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %41)
  %43 = load i32, ptr %6, align 4, !tbaa !11
  %44 = trunc i32 %43 to i8
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %42, i8 noundef zeroext %44)
  %46 = load float, ptr %45, align 4, !tbaa !13
  %47 = fpext float %46 to double
  %48 = call double @llvm.fabs.f64(double %47)
  %49 = fcmp olt double %48, 0x3F50624DE0000000
  br i1 %49, label %50, label %51

50:                                               ; preds = %39
  br label %83

51:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #5
  %52 = load i32, ptr %6, align 4, !tbaa !11
  %53 = trunc i32 %52 to i8
  %54 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %53)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %54, i64 12, i1 false), !tbaa.struct !15
  %55 = load i32, ptr %9, align 4, !tbaa !11
  %56 = trunc i32 %55 to i8
  %57 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %56)
  %58 = load i32, ptr %6, align 4, !tbaa !11
  %59 = trunc i32 %58 to i8
  %60 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %59)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %60, ptr align 4 %57, i64 12, i1 false), !tbaa.struct !15
  %61 = load i32, ptr %9, align 4, !tbaa !11
  %62 = trunc i32 %61 to i8
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %62)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %63, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !15
  %64 = load i32, ptr %6, align 4, !tbaa !11
  %65 = trunc i32 %64 to i8
  %66 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext %65)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %66, i64 12, i1 false), !tbaa.struct !15
  %67 = load i32, ptr %9, align 4, !tbaa !11
  %68 = trunc i32 %67 to i8
  %69 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext %68)
  %70 = load i32, ptr %6, align 4, !tbaa !11
  %71 = trunc i32 %70 to i8
  %72 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext %71)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %72, ptr align 4 %69, i64 12, i1 false), !tbaa.struct !15
  %73 = load i32, ptr %9, align 4, !tbaa !11
  %74 = trunc i32 %73 to i8
  %75 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext %74)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %75, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !15
  %76 = load i32, ptr %6, align 4, !tbaa !11
  %77 = trunc i32 %76 to i8
  %78 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %77)
  %79 = load i32, ptr %6, align 4, !tbaa !11
  %80 = trunc i32 %79 to i8
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %78, i8 noundef zeroext %80)
  %82 = load float, ptr %81, align 4, !tbaa !13
  store float %82, ptr %8, align 4, !tbaa !13
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #5
  br label %86

83:                                               ; preds = %50
  %84 = load i32, ptr %9, align 4, !tbaa !11
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %9, align 4, !tbaa !11
  br label %35, !llvm.loop !16

86:                                               ; preds = %51, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %87 = load i32, ptr %7, align 4
  switch i32 %87, label %181 [
    i32 5, label %88
  ]

88:                                               ; preds = %86
  br label %89

89:                                               ; preds = %88, %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %90

90:                                               ; preds = %113, %89
  %91 = load i32, ptr %11, align 4, !tbaa !11
  %92 = icmp slt i32 %91, 3
  br i1 %92, label %94, label %93

93:                                               ; preds = %90
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %116

94:                                               ; preds = %90
  %95 = load float, ptr %8, align 4, !tbaa !13
  %96 = load i32, ptr %6, align 4, !tbaa !11
  %97 = trunc i32 %96 to i8
  %98 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %97)
  %99 = load i32, ptr %11, align 4, !tbaa !11
  %100 = trunc i32 %99 to i8
  %101 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %98, i8 noundef zeroext %100)
  %102 = load float, ptr %101, align 4, !tbaa !13
  %103 = fdiv float %102, %95
  store float %103, ptr %101, align 4, !tbaa !13
  %104 = load float, ptr %8, align 4, !tbaa !13
  %105 = load i32, ptr %6, align 4, !tbaa !11
  %106 = trunc i32 %105 to i8
  %107 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext %106)
  %108 = load i32, ptr %11, align 4, !tbaa !11
  %109 = trunc i32 %108 to i8
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %107, i8 noundef zeroext %109)
  %111 = load float, ptr %110, align 4, !tbaa !13
  %112 = fdiv float %111, %104
  store float %112, ptr %110, align 4, !tbaa !13
  br label %113

113:                                              ; preds = %94
  %114 = load i32, ptr %11, align 4, !tbaa !11
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %11, align 4, !tbaa !11
  br label %90, !llvm.loop !18

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

117:                                              ; preds = %177, %116
  %118 = load i32, ptr %12, align 4, !tbaa !11
  %119 = icmp slt i32 %118, 3
  br i1 %119, label %121, label %120

120:                                              ; preds = %117
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %180

121:                                              ; preds = %117
  %122 = load i32, ptr %12, align 4, !tbaa !11
  %123 = load i32, ptr %6, align 4, !tbaa !11
  %124 = icmp eq i32 %122, %123
  br i1 %124, label %125, label %126

125:                                              ; preds = %121
  br label %177

126:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %127 = load i32, ptr %12, align 4, !tbaa !11
  %128 = trunc i32 %127 to i8
  %129 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %128)
  %130 = load i32, ptr %6, align 4, !tbaa !11
  %131 = trunc i32 %130 to i8
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %129, i8 noundef zeroext %131)
  %133 = load float, ptr %132, align 4, !tbaa !13
  store float %133, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %134

134:                                              ; preds = %173, %126
  %135 = load i32, ptr %14, align 4, !tbaa !11
  %136 = icmp slt i32 %135, 3
  br i1 %136, label %138, label %137

137:                                              ; preds = %134
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %176

138:                                              ; preds = %134
  %139 = load float, ptr %13, align 4, !tbaa !13
  %140 = load i32, ptr %6, align 4, !tbaa !11
  %141 = trunc i32 %140 to i8
  %142 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %141)
  %143 = load i32, ptr %14, align 4, !tbaa !11
  %144 = trunc i32 %143 to i8
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %142, i8 noundef zeroext %144)
  %146 = load float, ptr %145, align 4, !tbaa !13
  %147 = load i32, ptr %12, align 4, !tbaa !11
  %148 = trunc i32 %147 to i8
  %149 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %148)
  %150 = load i32, ptr %14, align 4, !tbaa !11
  %151 = trunc i32 %150 to i8
  %152 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %149, i8 noundef zeroext %151)
  %153 = load float, ptr %152, align 4, !tbaa !13
  %154 = fneg float %139
  %155 = call float @llvm.fmuladd.f32(float %154, float %146, float %153)
  store float %155, ptr %152, align 4, !tbaa !13
  %156 = load float, ptr %13, align 4, !tbaa !13
  %157 = load i32, ptr %6, align 4, !tbaa !11
  %158 = trunc i32 %157 to i8
  %159 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext %158)
  %160 = load i32, ptr %14, align 4, !tbaa !11
  %161 = trunc i32 %160 to i8
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %159, i8 noundef zeroext %161)
  %163 = load float, ptr %162, align 4, !tbaa !13
  %164 = load i32, ptr %12, align 4, !tbaa !11
  %165 = trunc i32 %164 to i8
  %166 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %5, i8 noundef zeroext %165)
  %167 = load i32, ptr %14, align 4, !tbaa !11
  %168 = trunc i32 %167 to i8
  %169 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %166, i8 noundef zeroext %168)
  %170 = load float, ptr %169, align 4, !tbaa !13
  %171 = fneg float %156
  %172 = call float @llvm.fmuladd.f32(float %171, float %163, float %170)
  store float %172, ptr %169, align 4, !tbaa !13
  br label %173

173:                                              ; preds = %138
  %174 = load i32, ptr %14, align 4, !tbaa !11
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %14, align 4, !tbaa !11
  br label %134, !llvm.loop !19

176:                                              ; preds = %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %177

177:                                              ; preds = %176, %125
  %178 = load i32, ptr %12, align 4, !tbaa !11
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %12, align 4, !tbaa !11
  br label %117, !llvm.loop !20

180:                                              ; preds = %120
  store i32 0, ptr %7, align 4
  br label %181

181:                                              ; preds = %180, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %182 = load i32, ptr %7, align 4
  switch i32 %182, label %187 [
    i32 0, label %183
  ]

183:                                              ; preds = %181
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %6, align 4, !tbaa !11
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %6, align 4, !tbaa !11
  br label %16, !llvm.loop !21

187:                                              ; preds = %181, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %188 = load i32, ptr %7, align 4
  switch i32 %188, label %190 [
    i32 2, label %189
  ]

189:                                              ; preds = %187
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 %5, i64 36, i1 false), !tbaa.struct !9
  store i32 1, ptr %7, align 4
  br label %190

190:                                              ; preds = %189, %187
  call void @llvm.lifetime.end.p0(i64 36, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %4) #5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

declare void @_ZN3rmg4Mat3C1Ev(ptr)

declare void @_ZN3rmg4Mat3C1Ef(ptr, float)

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


; 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.rmg::Mat3" = type { %union.anon }
%union.anon = type { [3 x [3 x float]] }

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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: 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 noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36), i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12), i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3rmg4Mat37inverseEv(ptr dead_on_unwind noalias writable sret(%"struct.rmg::Mat3") align 4 %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(36) %1) local_unnamed_addr #4 align 2 {
  %3 = alloca %"struct.rmg::Mat3", align 4
  %4 = alloca %"struct.rmg::Mat3", align 4
  %.sroa.0 = alloca [3 x float], align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %3, ptr noundef nonnull align 4 dereferenceable(36) %1, i64 36, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %4) #6
  call void @_ZN3rmg4Mat3C1Ev(ptr noundef nonnull align 4 dereferenceable(36) %4)
  br label %5

5:                                                ; preds = %2, %103
  %.05164 = phi i32 [ 0, %2 ], [ %104, %103 ]
  %6 = trunc nuw i32 %.05164 to i8
  %7 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %8 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %7, i8 noundef zeroext %6)
  %9 = load float, ptr %8, align 4, !tbaa !9
  %10 = call float @llvm.fabs.f32(float %9)
  %11 = fcmp olt float %10, 0x3F1A36E2E0000000
  br i1 %11, label %.preheader60, label %.preheader.preheader

.preheader60:                                     ; preds = %5, %12
  %.054.in = phi i32 [ %.054, %12 ], [ %.05164, %5 ]
  %exitcond.not = icmp eq i32 %.054.in, 2
  br i1 %exitcond.not, label %.critedge, label %12

12:                                               ; preds = %.preheader60
  %.054 = add nuw nsw i32 %.054.in, 1
  %13 = trunc nuw i32 %.054 to i8
  %14 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %13)
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %14, i8 noundef zeroext %6)
  %16 = load float, ptr %15, align 4, !tbaa !9
  %17 = call float @llvm.fabs.f32(float %16)
  %18 = fcmp olt float %17, 0x3F50624DE0000000
  br i1 %18, label %.preheader60, label %.thread, !llvm.loop !11

.thread:                                          ; preds = %12
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %.sroa.0)
  %19 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %.sroa.0, ptr noundef nonnull align 4 dereferenceable(12) %19, i64 12, i1 false), !tbaa.struct !13
  %20 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %13)
  %21 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %21, ptr noundef nonnull align 4 dereferenceable(12) %20, i64 12, i1 false), !tbaa.struct !13
  %22 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %13)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %22, ptr noundef nonnull align 4 dereferenceable(12) %.sroa.0, i64 12, i1 false), !tbaa.struct !13
  %23 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %.sroa.0, ptr noundef nonnull align 4 dereferenceable(12) %23, i64 12, i1 false), !tbaa.struct !13
  %24 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %13)
  %25 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %25, ptr noundef nonnull align 4 dereferenceable(12) %24, i64 12, i1 false), !tbaa.struct !13
  %26 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %13)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %26, ptr noundef nonnull align 4 dereferenceable(12) %.sroa.0, i64 12, i1 false), !tbaa.struct !13
  %27 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %27, i8 noundef zeroext %6)
  %29 = load float, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %.sroa.0)
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %.thread, %5
  %.1 = phi float [ %9, %5 ], [ %29, %.thread ]
  %30 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %30, i8 noundef zeroext 0)
  %32 = load float, ptr %31, align 4, !tbaa !9
  %33 = fdiv float %32, %.1
  store float %33, ptr %31, align 4, !tbaa !9
  %34 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %34, i8 noundef zeroext 0)
  %36 = load float, ptr %35, align 4, !tbaa !9
  %37 = fdiv float %36, %.1
  store float %37, ptr %35, align 4, !tbaa !9
  %38 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %38, i8 noundef zeroext 1)
  %40 = load float, ptr %39, align 4, !tbaa !9
  %41 = fdiv float %40, %.1
  store float %41, ptr %39, align 4, !tbaa !9
  %42 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %42, i8 noundef zeroext 1)
  %44 = load float, ptr %43, align 4, !tbaa !9
  %45 = fdiv float %44, %.1
  store float %45, ptr %43, align 4, !tbaa !9
  %46 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %46, i8 noundef zeroext 2)
  %48 = load float, ptr %47, align 4, !tbaa !9
  %49 = fdiv float %48, %.1
  store float %49, ptr %47, align 4, !tbaa !9
  %50 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %50, i8 noundef zeroext 2)
  %52 = load float, ptr %51, align 4, !tbaa !9
  %53 = fdiv float %52, %.1
  store float %53, ptr %51, align 4, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %.05263 = phi i32 [ %102, %.loopexit ], [ 0, %.preheader.preheader ]
  %54 = icmp eq i32 %.05263, %.05164
  br i1 %54, label %.loopexit, label %.loopexit.loopexit

.loopexit.loopexit:                               ; preds = %.preheader
  %55 = trunc nuw i32 %.05263 to i8
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %55)
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %56, i8 noundef zeroext %6)
  %58 = load float, ptr %57, align 4, !tbaa !9
  %59 = fneg float %58
  %60 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %60, i8 noundef zeroext 0)
  %62 = load float, ptr %61, align 4, !tbaa !9
  %63 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %55)
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %63, i8 noundef zeroext 0)
  %65 = load float, ptr %64, align 4, !tbaa !9
  %66 = call float @llvm.fmuladd.f32(float %59, float %62, float %65)
  store float %66, ptr %64, align 4, !tbaa !9
  %67 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %67, i8 noundef zeroext 0)
  %69 = load float, ptr %68, align 4, !tbaa !9
  %70 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %55)
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %70, i8 noundef zeroext 0)
  %72 = load float, ptr %71, align 4, !tbaa !9
  %73 = call float @llvm.fmuladd.f32(float %59, float %69, float %72)
  store float %73, ptr %71, align 4, !tbaa !9
  %74 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %74, i8 noundef zeroext 1)
  %76 = load float, ptr %75, align 4, !tbaa !9
  %77 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %55)
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %77, i8 noundef zeroext 1)
  %79 = load float, ptr %78, align 4, !tbaa !9
  %80 = call float @llvm.fmuladd.f32(float %59, float %76, float %79)
  store float %80, ptr %78, align 4, !tbaa !9
  %81 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %81, i8 noundef zeroext 1)
  %83 = load float, ptr %82, align 4, !tbaa !9
  %84 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %55)
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %84, i8 noundef zeroext 1)
  %86 = load float, ptr %85, align 4, !tbaa !9
  %87 = call float @llvm.fmuladd.f32(float %59, float %83, float %86)
  store float %87, ptr %85, align 4, !tbaa !9
  %88 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %6)
  %89 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %88, i8 noundef zeroext 2)
  %90 = load float, ptr %89, align 4, !tbaa !9
  %91 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %3, i8 noundef zeroext %55)
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %91, i8 noundef zeroext 2)
  %93 = load float, ptr %92, align 4, !tbaa !9
  %94 = call float @llvm.fmuladd.f32(float %59, float %90, float %93)
  store float %94, ptr %92, align 4, !tbaa !9
  %95 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %6)
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %95, i8 noundef zeroext 2)
  %97 = load float, ptr %96, align 4, !tbaa !9
  %98 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN3rmg4Mat3ixEh(ptr noundef nonnull align 4 dereferenceable(36) %4, i8 noundef zeroext %55)
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3rmg7Mat3RowixEh(ptr noundef nonnull align 4 dereferenceable(12) %98, i8 noundef zeroext 2)
  %100 = load float, ptr %99, align 4, !tbaa !9
  %101 = call float @llvm.fmuladd.f32(float %59, float %97, float %100)
  store float %101, ptr %99, align 4, !tbaa !9
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader
  %102 = add nuw nsw i32 %.05263, 1
  %exitcond67.not = icmp eq i32 %102, 3
  br i1 %exitcond67.not, label %103, label %.preheader, !llvm.loop !14

103:                                              ; preds = %.loopexit
  %104 = add nuw nsw i32 %.05164, 1
  %exitcond68 = icmp eq i32 %104, 3
  br i1 %exitcond68, label %.critedge58, label %5, !llvm.loop !15

.critedge:                                        ; preds = %.preheader60
  call void @_ZN3rmg4Mat3C1Ef(ptr noundef nonnull align 4 dereferenceable(36) %0, float noundef 0x7FF8000000000000)
  br label %105

.critedge58:                                      ; preds = %103
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(36) %0, ptr noundef nonnull align 4 dereferenceable(36) %4, i64 36, i1 false), !tbaa.struct !5
  br label %105

105:                                              ; preds = %.critedge, %.critedge58
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %3) #6
  ret void
}

declare void @_ZN3rmg4Mat3C1Ev(ptr) local_unnamed_addr

declare void @_ZN3rmg4Mat3C1Ef(ptr, float) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #5

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{i64 0, i64 36, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i64 0, i64 12, !6}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass