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

; 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_mat4_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
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds [4 x float], ptr %19, i64 0
  %21 = getelementptr inbounds [4 x float], ptr %20, i64 0, i64 0
  %22 = load float, ptr %21, align 4, !tbaa !9
  store float %22, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds [4 x float], ptr %23, i64 0
  %25 = getelementptr inbounds [4 x float], ptr %24, i64 0, i64 1
  %26 = load float, ptr %25, align 4, !tbaa !9
  store float %26, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds [4 x float], ptr %27, i64 0
  %29 = getelementptr inbounds [4 x float], ptr %28, i64 0, i64 2
  %30 = load float, ptr %29, align 4, !tbaa !9
  store float %30, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #2
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds [4 x float], ptr %31, i64 0
  %33 = getelementptr inbounds [4 x float], ptr %32, i64 0, i64 3
  %34 = load float, ptr %33, align 4, !tbaa !9
  store float %34, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds [4 x float], ptr %35, i64 1
  %37 = getelementptr inbounds [4 x float], ptr %36, i64 0, i64 0
  %38 = load float, ptr %37, align 4, !tbaa !9
  store float %38, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds [4 x float], ptr %39, i64 1
  %41 = getelementptr inbounds [4 x float], ptr %40, i64 0, i64 1
  %42 = load float, ptr %41, align 4, !tbaa !9
  store float %42, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds [4 x float], ptr %43, i64 1
  %45 = getelementptr inbounds [4 x float], ptr %44, i64 0, i64 2
  %46 = load float, ptr %45, align 4, !tbaa !9
  store float %46, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds [4 x float], ptr %47, i64 1
  %49 = getelementptr inbounds [4 x float], ptr %48, i64 0, i64 3
  %50 = load float, ptr %49, align 4, !tbaa !9
  store float %50, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds [4 x float], ptr %51, i64 2
  %53 = getelementptr inbounds [4 x float], ptr %52, i64 0, i64 0
  %54 = load float, ptr %53, align 4, !tbaa !9
  store float %54, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds [4 x float], ptr %55, i64 2
  %57 = getelementptr inbounds [4 x float], ptr %56, i64 0, i64 1
  %58 = load float, ptr %57, align 4, !tbaa !9
  store float %58, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds [4 x float], ptr %59, i64 2
  %61 = getelementptr inbounds [4 x float], ptr %60, i64 0, i64 2
  %62 = load float, ptr %61, align 4, !tbaa !9
  store float %62, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds [4 x float], ptr %63, i64 2
  %65 = getelementptr inbounds [4 x float], ptr %64, i64 0, i64 3
  %66 = load float, ptr %65, align 4, !tbaa !9
  store float %66, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds [4 x float], ptr %67, i64 3
  %69 = getelementptr inbounds [4 x float], ptr %68, i64 0, i64 0
  %70 = load float, ptr %69, align 4, !tbaa !9
  store float %70, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #2
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds [4 x float], ptr %71, i64 3
  %73 = getelementptr inbounds [4 x float], ptr %72, i64 0, i64 1
  %74 = load float, ptr %73, align 4, !tbaa !9
  store float %74, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds [4 x float], ptr %75, i64 3
  %77 = getelementptr inbounds [4 x float], ptr %76, i64 0, i64 2
  %78 = load float, ptr %77, align 4, !tbaa !9
  store float %78, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds [4 x float], ptr %79, i64 3
  %81 = getelementptr inbounds [4 x float], ptr %80, i64 0, i64 3
  %82 = load float, ptr %81, align 4, !tbaa !9
  store float %82, ptr %18, align 4, !tbaa !9
  %83 = load float, ptr %3, align 4, !tbaa !9
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds [4 x float], ptr %84, i64 0
  %86 = getelementptr inbounds [4 x float], ptr %85, i64 0, i64 0
  store float %83, ptr %86, align 4, !tbaa !9
  %87 = load float, ptr %7, align 4, !tbaa !9
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds [4 x float], ptr %88, i64 0
  %90 = getelementptr inbounds [4 x float], ptr %89, i64 0, i64 1
  store float %87, ptr %90, align 4, !tbaa !9
  %91 = load float, ptr %11, align 4, !tbaa !9
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds [4 x float], ptr %92, i64 0
  %94 = getelementptr inbounds [4 x float], ptr %93, i64 0, i64 2
  store float %91, ptr %94, align 4, !tbaa !9
  %95 = load float, ptr %15, align 4, !tbaa !9
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  %97 = getelementptr inbounds [4 x float], ptr %96, i64 0
  %98 = getelementptr inbounds [4 x float], ptr %97, i64 0, i64 3
  store float %95, ptr %98, align 4, !tbaa !9
  %99 = load float, ptr %4, align 4, !tbaa !9
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds [4 x float], ptr %100, i64 1
  %102 = getelementptr inbounds [4 x float], ptr %101, i64 0, i64 0
  store float %99, ptr %102, align 4, !tbaa !9
  %103 = load float, ptr %8, align 4, !tbaa !9
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds [4 x float], ptr %104, i64 1
  %106 = getelementptr inbounds [4 x float], ptr %105, i64 0, i64 1
  store float %103, ptr %106, align 4, !tbaa !9
  %107 = load float, ptr %12, align 4, !tbaa !9
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = getelementptr inbounds [4 x float], ptr %108, i64 1
  %110 = getelementptr inbounds [4 x float], ptr %109, i64 0, i64 2
  store float %107, ptr %110, align 4, !tbaa !9
  %111 = load float, ptr %16, align 4, !tbaa !9
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds [4 x float], ptr %112, i64 1
  %114 = getelementptr inbounds [4 x float], ptr %113, i64 0, i64 3
  store float %111, ptr %114, align 4, !tbaa !9
  %115 = load float, ptr %5, align 4, !tbaa !9
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds [4 x float], ptr %116, i64 2
  %118 = getelementptr inbounds [4 x float], ptr %117, i64 0, i64 0
  store float %115, ptr %118, align 4, !tbaa !9
  %119 = load float, ptr %9, align 4, !tbaa !9
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = getelementptr inbounds [4 x float], ptr %120, i64 2
  %122 = getelementptr inbounds [4 x float], ptr %121, i64 0, i64 1
  store float %119, ptr %122, align 4, !tbaa !9
  %123 = load float, ptr %13, align 4, !tbaa !9
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds [4 x float], ptr %124, i64 2
  %126 = getelementptr inbounds [4 x float], ptr %125, i64 0, i64 2
  store float %123, ptr %126, align 4, !tbaa !9
  %127 = load float, ptr %17, align 4, !tbaa !9
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds [4 x float], ptr %128, i64 2
  %130 = getelementptr inbounds [4 x float], ptr %129, i64 0, i64 3
  store float %127, ptr %130, align 4, !tbaa !9
  %131 = load float, ptr %6, align 4, !tbaa !9
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  %133 = getelementptr inbounds [4 x float], ptr %132, i64 3
  %134 = getelementptr inbounds [4 x float], ptr %133, i64 0, i64 0
  store float %131, ptr %134, align 4, !tbaa !9
  %135 = load float, ptr %10, align 4, !tbaa !9
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds [4 x float], ptr %136, i64 3
  %138 = getelementptr inbounds [4 x float], ptr %137, i64 0, i64 1
  store float %135, ptr %138, align 4, !tbaa !9
  %139 = load float, ptr %14, align 4, !tbaa !9
  %140 = load ptr, ptr %2, align 8, !tbaa !5
  %141 = getelementptr inbounds [4 x float], ptr %140, i64 3
  %142 = getelementptr inbounds [4 x float], ptr %141, i64 0, i64 2
  store float %139, ptr %142, align 4, !tbaa !9
  %143 = load float, ptr %18, align 4, !tbaa !9
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = getelementptr inbounds [4 x float], ptr %144, i64 3
  %146 = getelementptr inbounds [4 x float], ptr %145, i64 0, i64 3
  store float %143, ptr %146, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  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_mat4_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 16
  %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
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 36
  %17 = load float, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 44
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 48
  %21 = load float, ptr %20, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 52
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %0, i64 56
  %25 = load float, ptr %24, align 4, !tbaa !5
  store float %9, ptr %2, align 4, !tbaa !5
  store float %15, ptr %4, align 4, !tbaa !5
  store float %21, ptr %6, align 4, !tbaa !5
  store float %3, ptr %8, align 4, !tbaa !5
  store float %17, ptr %10, align 4, !tbaa !5
  store float %23, ptr %12, align 4, !tbaa !5
  store float %5, ptr %14, align 4, !tbaa !5
  store float %11, ptr %16, align 4, !tbaa !5
  store float %25, ptr %18, align 4, !tbaa !5
  store float %7, ptr %20, align 4, !tbaa !5
  store float %13, ptr %22, align 4, !tbaa !5
  store float %19, ptr %24, 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