; LLVM IR from Dovyski/opengl-demos :: libs/glm-0.9.9.3/test/core (core_func_matrix)

; 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"

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z19test_matrixCompMultv() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_outerProductv() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z14test_transposev() #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z16test_determinantv() #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12test_inversev() #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_inverse_simdv() #3

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  %5 = call noundef i32 @_Z19test_matrixCompMultv()
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = add nsw i32 %6, %5
  store i32 %7, ptr %2, align 4, !tbaa !5
  %8 = call noundef i32 @_Z17test_outerProductv()
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = add nsw i32 %9, %8
  store i32 %10, ptr %2, align 4, !tbaa !5
  %11 = call noundef i32 @_Z14test_transposev()
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = add nsw i32 %12, %11
  store i32 %13, ptr %2, align 4, !tbaa !5
  %14 = call noundef i32 @_Z16test_determinantv()
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = add nsw i32 %15, %14
  store i32 %16, ptr %2, align 4, !tbaa !5
  %17 = call noundef i32 @_Z12test_inversev()
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = add nsw i32 %18, %17
  store i32 %19, ptr %2, align 4, !tbaa !5
  %20 = call noundef i32 @_Z17test_inverse_simdv()
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = add nsw i32 %21, %20
  store i32 %22, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 1, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 0, ptr %4, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %36, %0
  %24 = load i64, ptr %4, align 8, !tbaa !9
  %25 = icmp ult i64 %24, 1
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %39

27:                                               ; preds = %23
  %28 = load i64, ptr %4, align 8, !tbaa !9
  %29 = call noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EfLNS0_9qualifierE0EEENS0_3matILi4ELi4EfLS2_0EEEEimmPKc(i64 noundef 1, i64 noundef %28, ptr noundef @.str)
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = add nsw i32 %30, %29
  store i32 %31, ptr %2, align 4, !tbaa !5
  %32 = load i64, ptr %4, align 8, !tbaa !9
  %33 = call noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EdLNS0_9qualifierE0EEENS0_3matILi4ELi4EdLS2_0EEEEimmPKc(i64 noundef 1, i64 noundef %32, ptr noundef @.str.1)
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, %33
  store i32 %35, ptr %2, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %27
  %37 = load i64, ptr %4, align 8, !tbaa !9
  %38 = add i64 %37, 1
  store i64 %38, ptr %4, align 8, !tbaa !9
  br label %23, !llvm.loop !11

39:                                               ; preds = %26
  %40 = load i32, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  ret i32 %40
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EfLNS0_9qualifierE0EEENS0_3matILi4ELi4EfLS2_0EEEEimmPKc(i64 noundef, i64 noundef, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EdLNS0_9qualifierE0EEENS0_3matILi4ELi4EdLS2_0EEEEimmPKc(i64 noundef, i64 noundef, ptr noundef) #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { 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 #4 = { mustprogress norecurse 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 #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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"

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z19test_matrixCompMultv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_outerProductv() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z14test_transposev() local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z16test_determinantv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z12test_inversev() local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_inverse_simdv() local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = tail call noundef i32 @_Z19test_matrixCompMultv()
  %2 = tail call noundef i32 @_Z17test_outerProductv()
  %3 = add nsw i32 %2, %1
  %4 = tail call noundef i32 @_Z14test_transposev()
  %5 = add nsw i32 %3, %4
  %6 = tail call noundef i32 @_Z16test_determinantv()
  %7 = add nsw i32 %5, %6
  %8 = tail call noundef i32 @_Z12test_inversev()
  %9 = add nsw i32 %7, %8
  %10 = tail call noundef i32 @_Z17test_inverse_simdv()
  %11 = add nsw i32 %9, %10
  %12 = tail call noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EfLNS0_9qualifierE0EEENS0_3matILi4ELi4EfLS2_0EEEEimmPKc(i64 noundef 1, i64 noundef 0, ptr noundef nonnull @.str)
  %13 = add nsw i32 %12, %11
  %14 = tail call noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EdLNS0_9qualifierE0EEENS0_3matILi4ELi4EdLS2_0EEEEimmPKc(i64 noundef 1, i64 noundef 0, ptr noundef nonnull @.str.1)
  %15 = add nsw i32 %13, %14
  ret i32 %15
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EfLNS0_9qualifierE0EEENS0_3matILi4ELi4EfLS2_0EEEEimmPKc(i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z17test_inverse_perfIN3glm3vecILi3EdLNS0_9qualifierE0EEENS0_3matILi4ELi4EdLS2_0EEEEimmPKc(i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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 = { 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 = { mustprogress norecurse 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass