; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/MINC/src/libminc/nifti (nifti1_io)

; 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.mat33 = type { [3 x [3 x float]] }

; 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 double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: nounwind uwtable
define dso_local float @nifti_mat33_determ(ptr noundef byval(%struct.mat33) align 8 %0) #2 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %11 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %12 = getelementptr inbounds [3 x [3 x float]], ptr %11, i64 0, i64 0
  %13 = getelementptr inbounds [3 x float], ptr %12, i64 0, i64 0
  %14 = load float, ptr %13, align 8, !tbaa !5
  %15 = fpext float %14 to double
  store double %15, ptr %2, align 8, !tbaa !9
  %16 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %17 = getelementptr inbounds [3 x [3 x float]], ptr %16, i64 0, i64 0
  %18 = getelementptr inbounds [3 x float], ptr %17, i64 0, i64 1
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = fpext float %19 to double
  store double %20, ptr %3, align 8, !tbaa !9
  %21 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %22 = getelementptr inbounds [3 x [3 x float]], ptr %21, i64 0, i64 0
  %23 = getelementptr inbounds [3 x float], ptr %22, i64 0, i64 2
  %24 = load float, ptr %23, align 8, !tbaa !5
  %25 = fpext float %24 to double
  store double %25, ptr %4, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %27 = getelementptr inbounds [3 x [3 x float]], ptr %26, i64 0, i64 1
  %28 = getelementptr inbounds [3 x float], ptr %27, i64 0, i64 0
  %29 = load float, ptr %28, align 4, !tbaa !5
  %30 = fpext float %29 to double
  store double %30, ptr %5, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %32 = getelementptr inbounds [3 x [3 x float]], ptr %31, i64 0, i64 1
  %33 = getelementptr inbounds [3 x float], ptr %32, i64 0, i64 1
  %34 = load float, ptr %33, align 4, !tbaa !5
  %35 = fpext float %34 to double
  store double %35, ptr %6, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %37 = getelementptr inbounds [3 x [3 x float]], ptr %36, i64 0, i64 1
  %38 = getelementptr inbounds [3 x float], ptr %37, i64 0, i64 2
  %39 = load float, ptr %38, align 4, !tbaa !5
  %40 = fpext float %39 to double
  store double %40, ptr %7, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %42 = getelementptr inbounds [3 x [3 x float]], ptr %41, i64 0, i64 2
  %43 = getelementptr inbounds [3 x float], ptr %42, i64 0, i64 0
  %44 = load float, ptr %43, align 8, !tbaa !5
  %45 = fpext float %44 to double
  store double %45, ptr %8, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %47 = getelementptr inbounds [3 x [3 x float]], ptr %46, i64 0, i64 2
  %48 = getelementptr inbounds [3 x float], ptr %47, i64 0, i64 1
  %49 = load float, ptr %48, align 4, !tbaa !5
  %50 = fpext float %49 to double
  store double %50, ptr %9, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %52 = getelementptr inbounds [3 x [3 x float]], ptr %51, i64 0, i64 2
  %53 = getelementptr inbounds [3 x float], ptr %52, i64 0, i64 2
  %54 = load float, ptr %53, align 8, !tbaa !5
  %55 = fpext float %54 to double
  store double %55, ptr %10, align 8, !tbaa !9
  %56 = load double, ptr %2, align 8, !tbaa !9
  %57 = load double, ptr %6, align 8, !tbaa !9
  %58 = fmul double %56, %57
  %59 = load double, ptr %10, align 8, !tbaa !9
  %60 = load double, ptr %2, align 8, !tbaa !9
  %61 = load double, ptr %9, align 8, !tbaa !9
  %62 = fmul double %60, %61
  %63 = load double, ptr %7, align 8, !tbaa !9
  %64 = fmul double %62, %63
  %65 = fneg double %64
  %66 = call double @llvm.fmuladd.f64(double %58, double %59, double %65)
  %67 = load double, ptr %5, align 8, !tbaa !9
  %68 = load double, ptr %3, align 8, !tbaa !9
  %69 = fmul double %67, %68
  %70 = load double, ptr %10, align 8, !tbaa !9
  %71 = fneg double %69
  %72 = call double @llvm.fmuladd.f64(double %71, double %70, double %66)
  %73 = load double, ptr %5, align 8, !tbaa !9
  %74 = load double, ptr %9, align 8, !tbaa !9
  %75 = fmul double %73, %74
  %76 = load double, ptr %4, align 8, !tbaa !9
  %77 = call double @llvm.fmuladd.f64(double %75, double %76, double %72)
  %78 = load double, ptr %8, align 8, !tbaa !9
  %79 = load double, ptr %3, align 8, !tbaa !9
  %80 = fmul double %78, %79
  %81 = load double, ptr %7, align 8, !tbaa !9
  %82 = call double @llvm.fmuladd.f64(double %80, double %81, double %77)
  %83 = load double, ptr %8, align 8, !tbaa !9
  %84 = load double, ptr %6, align 8, !tbaa !9
  %85 = fmul double %83, %84
  %86 = load double, ptr %4, align 8, !tbaa !9
  %87 = fneg double %85
  %88 = call double @llvm.fmuladd.f64(double %87, double %86, double %82)
  %89 = fptrunc double %88 to float
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #3
  ret float %89
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !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"

%struct.mat33 = type { [3 x [3 x float]] }

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local float @nifti_mat33_determ(ptr nocapture noundef readonly byval(%struct.mat33) align 8 %0) local_unnamed_addr #1 {
  %2 = load float, ptr %0, align 8, !tbaa !5
  %3 = fpext float %2 to double
  %4 = getelementptr inbounds i8, ptr %0, i64 4
  %5 = load float, ptr %4, align 4, !tbaa !5
  %6 = fpext float %5 to double
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load float, ptr %7, align 8, !tbaa !5
  %9 = fpext float %8 to double
  %10 = getelementptr inbounds i8, ptr %0, i64 12
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = fpext float %11 to double
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load float, ptr %13, align 8, !tbaa !5
  %15 = fpext float %14 to double
  %16 = getelementptr inbounds i8, ptr %0, i64 20
  %17 = load float, ptr %16, align 4, !tbaa !5
  %18 = fpext float %17 to double
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load float, ptr %19, align 8, !tbaa !5
  %21 = fpext float %20 to double
  %22 = getelementptr inbounds i8, ptr %0, i64 28
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = fpext float %23 to double
  %25 = getelementptr inbounds i8, ptr %0, i64 32
  %26 = load float, ptr %25, align 8, !tbaa !5
  %27 = fpext float %26 to double
  %28 = fmul double %3, %15
  %29 = fneg double %3
  %30 = fmul double %29, %24
  %31 = fmul double %30, %18
  %32 = tail call double @llvm.fmuladd.f64(double %28, double %27, double %31)
  %33 = fneg double %12
  %34 = fmul double %6, %33
  %35 = tail call double @llvm.fmuladd.f64(double %34, double %27, double %32)
  %36 = fmul double %12, %24
  %37 = tail call double @llvm.fmuladd.f64(double %36, double %9, double %35)
  %38 = fmul double %6, %21
  %39 = tail call double @llvm.fmuladd.f64(double %38, double %18, double %37)
  %40 = fneg double %21
  %41 = fmul double %15, %40
  %42 = tail call double @llvm.fmuladd.f64(double %41, double %9, double %39)
  %43 = fptrunc double %42 to float
  ret float %43
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) 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,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass