; LLVM IR from sh1l0h/ZINC :: src (mat3)

; 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: inlinehint nounwind uwtable
define dso_local void @zinc_mat3_transpose(ptr noundef %0) #1 {
  %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) #2
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds [3 x float], ptr %12, i64 0
  %14 = getelementptr inbounds [3 x float], ptr %13, i64 0, i64 0
  %15 = load float, ptr %14, align 4, !tbaa !9
  store float %15, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds [3 x float], ptr %16, i64 0
  %18 = getelementptr inbounds [3 x float], ptr %17, i64 0, i64 1
  %19 = load float, ptr %18, align 4, !tbaa !9
  store float %19, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds [3 x float], ptr %20, i64 0
  %22 = getelementptr inbounds [3 x float], ptr %21, i64 0, i64 2
  %23 = load float, ptr %22, align 4, !tbaa !9
  store float %23, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds [3 x float], ptr %24, i64 1
  %26 = getelementptr inbounds [3 x float], ptr %25, i64 0, i64 0
  %27 = load float, ptr %26, align 4, !tbaa !9
  store float %27, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds [3 x float], ptr %28, i64 1
  %30 = getelementptr inbounds [3 x float], ptr %29, i64 0, i64 1
  %31 = load float, ptr %30, align 4, !tbaa !9
  store float %31, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds [3 x float], ptr %32, i64 1
  %34 = getelementptr inbounds [3 x float], ptr %33, i64 0, i64 2
  %35 = load float, ptr %34, align 4, !tbaa !9
  store float %35, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds [3 x float], ptr %36, i64 2
  %38 = getelementptr inbounds [3 x float], ptr %37, i64 0, i64 0
  %39 = load float, ptr %38, align 4, !tbaa !9
  store float %39, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds [3 x float], ptr %40, i64 2
  %42 = getelementptr inbounds [3 x float], ptr %41, i64 0, i64 1
  %43 = load float, ptr %42, align 4, !tbaa !9
  store float %43, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds [3 x float], ptr %44, i64 2
  %46 = getelementptr inbounds [3 x float], ptr %45, i64 0, i64 2
  %47 = load float, ptr %46, align 4, !tbaa !9
  store float %47, ptr %11, align 4, !tbaa !9
  %48 = load float, ptr %3, align 4, !tbaa !9
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds [3 x float], ptr %49, i64 0
  %51 = getelementptr inbounds [3 x float], ptr %50, i64 0, i64 0
  store float %48, ptr %51, align 4, !tbaa !9
  %52 = load float, ptr %6, align 4, !tbaa !9
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds [3 x float], ptr %53, i64 0
  %55 = getelementptr inbounds [3 x float], ptr %54, i64 0, i64 1
  store float %52, ptr %55, align 4, !tbaa !9
  %56 = load float, ptr %9, align 4, !tbaa !9
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds [3 x float], ptr %57, i64 0
  %59 = getelementptr inbounds [3 x float], ptr %58, i64 0, i64 2
  store float %56, ptr %59, align 4, !tbaa !9
  %60 = load float, ptr %4, align 4, !tbaa !9
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds [3 x float], ptr %61, i64 1
  %63 = getelementptr inbounds [3 x float], ptr %62, i64 0, i64 0
  store float %60, ptr %63, align 4, !tbaa !9
  %64 = load float, ptr %7, align 4, !tbaa !9
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds [3 x float], ptr %65, i64 1
  %67 = getelementptr inbounds [3 x float], ptr %66, i64 0, i64 1
  store float %64, ptr %67, align 4, !tbaa !9
  %68 = load float, ptr %10, align 4, !tbaa !9
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds [3 x float], ptr %69, i64 1
  %71 = getelementptr inbounds [3 x float], ptr %70, i64 0, i64 2
  store float %68, ptr %71, align 4, !tbaa !9
  %72 = load float, ptr %5, align 4, !tbaa !9
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds [3 x float], ptr %73, i64 2
  %75 = getelementptr inbounds [3 x float], ptr %74, i64 0, i64 0
  store float %72, ptr %75, align 4, !tbaa !9
  %76 = load float, ptr %8, align 4, !tbaa !9
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds [3 x float], ptr %77, i64 2
  %79 = getelementptr inbounds [3 x float], ptr %78, i64 0, i64 1
  store float %76, ptr %79, align 4, !tbaa !9
  %80 = load float, ptr %11, align 4, !tbaa !9
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds [3 x float], ptr %81, i64 2
  %83 = getelementptr inbounds [3 x float], ptr %82, i64 0, i64 2
  store float %80, ptr %83, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { 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/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: inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @zinc_mat3_transpose(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 4
  %3 = load float, ptr %2, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load float, ptr %4, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 20
  %9 = load float, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 28
  %13 = load float, ptr %12, align 4, !tbaa !5
  store float %7, ptr %2, align 4, !tbaa !5
  store float %11, ptr %4, align 4, !tbaa !5
  store float %3, ptr %6, align 4, !tbaa !5
  store float %13, ptr %8, align 4, !tbaa !5
  store float %5, ptr %10, align 4, !tbaa !5
  store float %9, ptr %12, align 4, !tbaa !5
  ret void
}

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

!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/C++ TBAA"}


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