; LLVM IR from drohmer/cgp :: library/cgp/06_mat/mat4/mat4.ll (ZN3cgppLERNS_12matrix_stackIfLi4ELi4EEERKS1_)

; 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE5beginEv(ptr noundef nonnull align 4 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZNK3cgp12matrix_stackIfLi4ELi4EE6cbeginEv(ptr noundef nonnull align 4 dereferenceable(64)) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 4 dereferenceable(64) ptr @_ZN3cgppLERNS_12matrix_stackIfLi4ELi4EEERKS1_(ptr noundef nonnull align 4 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(64) %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = call noundef ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE5beginEv(ptr noundef nonnull align 4 dereferenceable(64) %8)
  store ptr %9, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call noundef ptr @_ZNK3cgp12matrix_stackIfLi4ELi4EE6cbeginEv(ptr noundef nonnull align 4 dereferenceable(64) %10)
  store ptr %11, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %12

12:                                               ; preds = %26, %2
  %13 = load i32, ptr %7, align 4, !tbaa !9
  %14 = icmp slt i32 %13, 16
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  br label %29

16:                                               ; preds = %12
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = load float, ptr %17, align 4, !tbaa !11
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = load float, ptr %19, align 4, !tbaa !11
  %21 = fadd float %20, %18
  store float %21, ptr %19, align 4, !tbaa !11
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds float, ptr %22, i32 1
  store ptr %23, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds float, ptr %24, i32 1
  store ptr %25, ptr %6, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %16
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %7, align 4, !tbaa !9
  br label %12, !llvm.loop !13

29:                                               ; preds = %15
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  ret ptr %30
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 4 dereferenceable(64) ptr @_ZN3cgppLERNS_12matrix_stackIfLi4ELi4EEERKS1_(ptr noundef nonnull returned align 4 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(64) %1) local_unnamed_addr #0 {
  %3 = tail call noundef ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE5beginEv(ptr noundef nonnull align 4 dereferenceable(64) %0)
  %4 = tail call noundef ptr @_ZNK3cgp12matrix_stackIfLi4ELi4EE6cbeginEv(ptr noundef nonnull align 4 dereferenceable(64) %1)
  %5 = load float, ptr %4, align 4, !tbaa !5
  %6 = load float, ptr %3, align 4, !tbaa !5
  %7 = fadd float %5, %6
  store float %7, ptr %3, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  %9 = getelementptr inbounds i8, ptr %4, i64 4
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = load float, ptr %8, align 4, !tbaa !5
  %12 = fadd float %10, %11
  store float %12, ptr %8, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %3, i64 8
  %14 = getelementptr inbounds i8, ptr %4, i64 8
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = load float, ptr %13, align 4, !tbaa !5
  %17 = fadd float %15, %16
  store float %17, ptr %13, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %3, i64 12
  %19 = getelementptr inbounds i8, ptr %4, i64 12
  %20 = load float, ptr %19, align 4, !tbaa !5
  %21 = load float, ptr %18, align 4, !tbaa !5
  %22 = fadd float %20, %21
  store float %22, ptr %18, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %3, i64 16
  %24 = getelementptr inbounds i8, ptr %4, i64 16
  %25 = load float, ptr %24, align 4, !tbaa !5
  %26 = load float, ptr %23, align 4, !tbaa !5
  %27 = fadd float %25, %26
  store float %27, ptr %23, align 4, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %3, i64 20
  %29 = getelementptr inbounds i8, ptr %4, i64 20
  %30 = load float, ptr %29, align 4, !tbaa !5
  %31 = load float, ptr %28, align 4, !tbaa !5
  %32 = fadd float %30, %31
  store float %32, ptr %28, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %3, i64 24
  %34 = getelementptr inbounds i8, ptr %4, i64 24
  %35 = load float, ptr %34, align 4, !tbaa !5
  %36 = load float, ptr %33, align 4, !tbaa !5
  %37 = fadd float %35, %36
  store float %37, ptr %33, align 4, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %3, i64 28
  %39 = getelementptr inbounds i8, ptr %4, i64 28
  %40 = load float, ptr %39, align 4, !tbaa !5
  %41 = load float, ptr %38, align 4, !tbaa !5
  %42 = fadd float %40, %41
  store float %42, ptr %38, align 4, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %3, i64 32
  %44 = getelementptr inbounds i8, ptr %4, i64 32
  %45 = load float, ptr %44, align 4, !tbaa !5
  %46 = load float, ptr %43, align 4, !tbaa !5
  %47 = fadd float %45, %46
  store float %47, ptr %43, align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %3, i64 36
  %49 = getelementptr inbounds i8, ptr %4, i64 36
  %50 = load float, ptr %49, align 4, !tbaa !5
  %51 = load float, ptr %48, align 4, !tbaa !5
  %52 = fadd float %50, %51
  store float %52, ptr %48, align 4, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %3, i64 40
  %54 = getelementptr inbounds i8, ptr %4, i64 40
  %55 = load float, ptr %54, align 4, !tbaa !5
  %56 = load float, ptr %53, align 4, !tbaa !5
  %57 = fadd float %55, %56
  store float %57, ptr %53, align 4, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %3, i64 44
  %59 = getelementptr inbounds i8, ptr %4, i64 44
  %60 = load float, ptr %59, align 4, !tbaa !5
  %61 = load float, ptr %58, align 4, !tbaa !5
  %62 = fadd float %60, %61
  store float %62, ptr %58, align 4, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %3, i64 48
  %64 = getelementptr inbounds i8, ptr %4, i64 48
  %65 = load float, ptr %64, align 4, !tbaa !5
  %66 = load float, ptr %63, align 4, !tbaa !5
  %67 = fadd float %65, %66
  store float %67, ptr %63, align 4, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %3, i64 52
  %69 = getelementptr inbounds i8, ptr %4, i64 52
  %70 = load float, ptr %69, align 4, !tbaa !5
  %71 = load float, ptr %68, align 4, !tbaa !5
  %72 = fadd float %70, %71
  store float %72, ptr %68, align 4, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %3, i64 56
  %74 = getelementptr inbounds i8, ptr %4, i64 56
  %75 = load float, ptr %74, align 4, !tbaa !5
  %76 = load float, ptr %73, align 4, !tbaa !5
  %77 = fadd float %75, %76
  store float %77, ptr %73, align 4, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %3, i64 60
  %79 = getelementptr inbounds i8, ptr %4, i64 60
  %80 = load float, ptr %79, align 4, !tbaa !5
  %81 = load float, ptr %78, align 4, !tbaa !5
  %82 = fadd float %80, %81
  store float %82, ptr %78, align 4, !tbaa !5
  ret ptr %0
}

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

!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: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass