; LLVM IR from drohmer/cgp :: library/cgp/06_mat/functions (mat_functions)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN3cgp3detERKNS_12matrix_stackIfLi3ELi3EEE(ptr noundef nonnull align 4 dereferenceable(36) %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %12)
  %14 = load float, ptr %13, align 4, !tbaa !9
  store float %14, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %15)
  %17 = load float, ptr %16, align 4, !tbaa !9
  store float %17, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %18)
  %20 = load float, ptr %19, align 4, !tbaa !9
  store float %20, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %21)
  %23 = load float, ptr %22, align 4, !tbaa !9
  store float %23, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %24)
  %26 = load float, ptr %25, align 4, !tbaa !9
  store float %26, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %27)
  %29 = load float, ptr %28, align 4, !tbaa !9
  store float %29, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %30)
  %32 = load float, ptr %31, align 4, !tbaa !9
  store float %32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %33)
  %35 = load float, ptr %34, align 4, !tbaa !9
  store float %35, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %36)
  %38 = load float, ptr %37, align 4, !tbaa !9
  store float %38, ptr %11, align 4, !tbaa !9
  %39 = load float, ptr %3, align 4, !tbaa !9
  %40 = load float, ptr %7, align 4, !tbaa !9
  %41 = fmul float %39, %40
  %42 = load float, ptr %11, align 4, !tbaa !9
  %43 = load float, ptr %4, align 4, !tbaa !9
  %44 = load float, ptr %8, align 4, !tbaa !9
  %45 = fmul float %43, %44
  %46 = load float, ptr %9, align 4, !tbaa !9
  %47 = fmul float %45, %46
  %48 = call float @llvm.fmuladd.f32(float %41, float %42, float %47)
  %49 = load float, ptr %6, align 4, !tbaa !9
  %50 = load float, ptr %10, align 4, !tbaa !9
  %51 = fmul float %49, %50
  %52 = load float, ptr %5, align 4, !tbaa !9
  %53 = call float @llvm.fmuladd.f32(float %51, float %52, float %48)
  %54 = load float, ptr %9, align 4, !tbaa !9
  %55 = load float, ptr %7, align 4, !tbaa !9
  %56 = fmul float %54, %55
  %57 = load float, ptr %5, align 4, !tbaa !9
  %58 = load float, ptr %10, align 4, !tbaa !9
  %59 = load float, ptr %8, align 4, !tbaa !9
  %60 = fmul float %58, %59
  %61 = load float, ptr %3, align 4, !tbaa !9
  %62 = fmul float %60, %61
  %63 = call float @llvm.fmuladd.f32(float %56, float %57, float %62)
  %64 = load float, ptr %6, align 4, !tbaa !9
  %65 = load float, ptr %4, align 4, !tbaa !9
  %66 = fmul float %64, %65
  %67 = load float, ptr %11, align 4, !tbaa !9
  %68 = call float @llvm.fmuladd.f32(float %66, float %67, float %63)
  %69 = fsub float %53, %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  ret float %69
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = { 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, !10, i64 0}
!10 = !{!"float", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN3cgp3detERKNS_12matrix_stackIfLi3ELi3EEE(ptr noundef nonnull align 4 dereferenceable(36) %0) local_unnamed_addr #0 {
  %2 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %3 = load float, ptr %2, align 4, !tbaa !5
  %4 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %5 = load float, ptr %4, align 4, !tbaa !5
  %6 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %9 = load float, ptr %8, align 4, !tbaa !5
  %10 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %13 = load float, ptr %12, align 4, !tbaa !5
  %14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %17 = load float, ptr %16, align 4, !tbaa !5
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36) %0)
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = insertelement <2 x float> poison, float %11, i64 0
  %21 = shufflevector <2 x float> %20, <2 x float> poison, <2 x i32> zeroinitializer
  %22 = insertelement <2 x float> poison, float %15, i64 0
  %23 = insertelement <2 x float> %22, float %3, i64 1
  %24 = fmul <2 x float> %21, %23
  %25 = insertelement <2 x float> poison, float %13, i64 0
  %26 = shufflevector <2 x float> %25, <2 x float> poison, <2 x i32> zeroinitializer
  %27 = insertelement <2 x float> poison, float %17, i64 0
  %28 = insertelement <2 x float> %27, float %5, i64 1
  %29 = fmul <2 x float> %26, %28
  %30 = insertelement <2 x float> poison, float %3, i64 0
  %31 = insertelement <2 x float> %30, float %15, i64 1
  %32 = fmul <2 x float> %29, %31
  %33 = insertelement <2 x float> poison, float %7, i64 0
  %34 = insertelement <2 x float> %33, float %19, i64 1
  %35 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %24, <2 x float> %34, <2 x float> %32)
  %36 = shufflevector <2 x float> %35, <2 x float> poison, <2 x i32> <i32 1, i32 0>
  %37 = insertelement <2 x float> poison, float %9, i64 0
  %38 = shufflevector <2 x float> %37, <2 x float> poison, <2 x i32> zeroinitializer
  %39 = fmul <2 x float> %28, %38
  %40 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %39, <2 x float> %34, <2 x float> %36)
  %shift = shufflevector <2 x float> %40, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %41 = fsub <2 x float> %40, %shift
  %42 = extractelement <2 x float> %41, i64 0
  ret float %42
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi0ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi1ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi0EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi1EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp3getILi2ELi2EfLi3ELi3EEERKT1_RKNS_12matrix_stackIS1_XT2_EXT3_EEE(ptr noundef nonnull align 4 dereferenceable(36)) local_unnamed_addr #0

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #1

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass,VectorCombinePass