; LLVM IR from aap/librw :: src/base.ll (ZN2rw6Matrix13identityErrorEv)

; 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.rw::V3d" = type { float, float, float }
%"struct.rw::Matrix" = type { %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32, %"struct.rw::V3d", i32 }

; 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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN2rw6Matrix13identityErrorEv(ptr noundef nonnull align 4 dereferenceable(64) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.rw::V3d", align 4
  %4 = alloca %"struct.rw::V3d", align 4
  %5 = alloca %"struct.rw::V3d", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %6 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %3) #3
  %7 = getelementptr inbounds %"struct.rw::V3d", ptr %3, i32 0, i32 0
  %8 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 0
  %9 = getelementptr inbounds %"struct.rw::V3d", ptr %8, i32 0, i32 0
  %10 = load float, ptr %9, align 4, !tbaa !9
  %11 = fsub float %10, 1.000000e+00
  store float %11, ptr %7, align 4, !tbaa !14
  %12 = getelementptr inbounds %"struct.rw::V3d", ptr %3, i32 0, i32 1
  %13 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 0
  %14 = getelementptr inbounds %"struct.rw::V3d", ptr %13, i32 0, i32 1
  %15 = load float, ptr %14, align 4, !tbaa !15
  store float %15, ptr %12, align 4, !tbaa !16
  %16 = getelementptr inbounds %"struct.rw::V3d", ptr %3, i32 0, i32 2
  %17 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 0
  %18 = getelementptr inbounds %"struct.rw::V3d", ptr %17, i32 0, i32 2
  %19 = load float, ptr %18, align 4, !tbaa !17
  store float %19, ptr %16, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #3
  %20 = getelementptr inbounds %"struct.rw::V3d", ptr %4, i32 0, i32 0
  %21 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 2
  %22 = getelementptr inbounds %"struct.rw::V3d", ptr %21, i32 0, i32 0
  %23 = load float, ptr %22, align 4, !tbaa !19
  store float %23, ptr %20, align 4, !tbaa !14
  %24 = getelementptr inbounds %"struct.rw::V3d", ptr %4, i32 0, i32 1
  %25 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 2
  %26 = getelementptr inbounds %"struct.rw::V3d", ptr %25, i32 0, i32 1
  %27 = load float, ptr %26, align 4, !tbaa !20
  %28 = fsub float %27, 1.000000e+00
  store float %28, ptr %24, align 4, !tbaa !16
  %29 = getelementptr inbounds %"struct.rw::V3d", ptr %4, i32 0, i32 2
  %30 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 2
  %31 = getelementptr inbounds %"struct.rw::V3d", ptr %30, i32 0, i32 2
  %32 = load float, ptr %31, align 4, !tbaa !21
  store float %32, ptr %29, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #3
  %33 = getelementptr inbounds %"struct.rw::V3d", ptr %5, i32 0, i32 0
  %34 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 4
  %35 = getelementptr inbounds %"struct.rw::V3d", ptr %34, i32 0, i32 0
  %36 = load float, ptr %35, align 4, !tbaa !22
  store float %36, ptr %33, align 4, !tbaa !14
  %37 = getelementptr inbounds %"struct.rw::V3d", ptr %5, i32 0, i32 1
  %38 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 4
  %39 = getelementptr inbounds %"struct.rw::V3d", ptr %38, i32 0, i32 1
  %40 = load float, ptr %39, align 4, !tbaa !23
  store float %40, ptr %37, align 4, !tbaa !16
  %41 = getelementptr inbounds %"struct.rw::V3d", ptr %5, i32 0, i32 2
  %42 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 4
  %43 = getelementptr inbounds %"struct.rw::V3d", ptr %42, i32 0, i32 2
  %44 = load float, ptr %43, align 4, !tbaa !24
  %45 = fsub float %44, 1.000000e+00
  store float %45, ptr %41, align 4, !tbaa !18
  %46 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %47 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %48 = fadd float %46, %47
  %49 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %50 = fadd float %48, %49
  %51 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 6
  %52 = getelementptr inbounds %"struct.rw::Matrix", ptr %6, i32 0, i32 6
  %53 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %51, ptr noundef nonnull align 4 dereferenceable(12) %52)
  %54 = fadd float %50, %53
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr %3) #3
  ret float %54
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #2

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 = { 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 #3 = { 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, !12, i64 0}
!10 = !{!"_ZTSN2rw6MatrixE", !11, i64 0, !13, i64 12, !11, i64 16, !13, i64 28, !11, i64 32, !13, i64 44, !11, i64 48, !13, i64 60}
!11 = !{!"_ZTSN2rw3V3dE", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"float", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!11, !12, i64 0}
!15 = !{!10, !12, i64 4}
!16 = !{!11, !12, i64 4}
!17 = !{!10, !12, i64 8}
!18 = !{!11, !12, i64 8}
!19 = !{!10, !12, i64 16}
!20 = !{!10, !12, i64 20}
!21 = !{!10, !12, i64 24}
!22 = !{!10, !12, i64 32}
!23 = !{!10, !12, i64 36}
!24 = !{!10, !12, i64 40}


; 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.rw::V3d" = type { float, float, float }

; 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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef float @_ZN2rw6Matrix13identityErrorEv(ptr noundef nonnull align 4 dereferenceable(64) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.rw::V3d", align 4
  %3 = alloca %"struct.rw::V3d", align 4
  %4 = alloca %"struct.rw::V3d", align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #3
  %5 = load float, ptr %0, align 4, !tbaa !5
  %6 = fadd float %5, -1.000000e+00
  store float %6, ptr %2, align 4, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %2, i64 4
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load <2 x float>, ptr %8, align 4, !tbaa !13
  store <2 x float> %9, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = load float, ptr %10, align 4, !tbaa !14
  store float %11, ptr %3, align 4, !tbaa !12
  %12 = getelementptr inbounds i8, ptr %3, i64 4
  %13 = getelementptr inbounds i8, ptr %0, i64 20
  %14 = load float, ptr %13, align 4, !tbaa !15
  %15 = fadd float %14, -1.000000e+00
  store float %15, ptr %12, align 4, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %3, i64 8
  %17 = getelementptr inbounds i8, ptr %0, i64 24
  %18 = load float, ptr %17, align 4, !tbaa !17
  store float %18, ptr %16, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #3
  %19 = getelementptr inbounds i8, ptr %0, i64 32
  %20 = load <2 x float>, ptr %19, align 4, !tbaa !13
  store <2 x float> %20, ptr %4, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %4, i64 8
  %22 = getelementptr inbounds i8, ptr %0, i64 40
  %23 = load float, ptr %22, align 4, !tbaa !19
  %24 = fadd float %23, -1.000000e+00
  store float %24, ptr %21, align 8, !tbaa !18
  %25 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %2)
  %26 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %27 = fadd float %25, %26
  %28 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %29 = fadd float %27, %28
  %30 = getelementptr inbounds i8, ptr %0, i64 48
  %31 = call noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %30, ptr noundef nonnull align 4 dereferenceable(12) %30)
  %32 = fadd float %29, %31
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #3
  ret float %32
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZN2rw3dotERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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, !8, i64 0}
!6 = !{!"_ZTSN2rw6MatrixE", !7, i64 0, !11, i64 12, !7, i64 16, !11, i64 28, !7, i64 32, !11, i64 44, !7, i64 48, !11, i64 60}
!7 = !{!"_ZTSN2rw3V3dE", !8, i64 0, !8, i64 4, !8, i64 8}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!7, !8, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!6, !8, i64 16}
!15 = !{!6, !8, i64 20}
!16 = !{!7, !8, i64 4}
!17 = !{!6, !8, i64 24}
!18 = !{!7, !8, i64 8}
!19 = !{!6, !8, i64 40}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass