; LLVM IR from drohmer/cgp :: library/cgp/06_mat/mat4 (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 mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64), i32 noundef, i32 noundef) #1 align 2

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

9:                                                ; preds = %31, %2
  %10 = load i32, ptr %5, align 4, !tbaa !9
  %11 = icmp slt i32 %10, 3
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %34

13:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %27, %13
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = icmp slt i32 %15, 3
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %30

18:                                               ; preds = %14
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = load i32, ptr %7, align 4, !tbaa !9
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %19, i32 noundef %20, i32 noundef %21)
  %23 = load float, ptr %22, align 4, !tbaa !11
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %8, i32 noundef %24, i32 noundef %25)
  store float %23, ptr %26, align 4, !tbaa !11
  br label %27

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

30:                                               ; preds = %17
  br label %31

31:                                               ; preds = %30
  %32 = load i32, ptr %5, align 4, !tbaa !9
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %5, align 4, !tbaa !9
  br label %9, !llvm.loop !15

34:                                               ; preds = %12
  ret ptr %8
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36), i32 noundef, i32 noundef) #1 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 = { 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 = { 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"}
!15 = distinct !{!15, !14}


; 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 uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 4 dereferenceable(64) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE16set_block_linearERKNS0_IfLi3ELi3EEE(ptr noundef nonnull returned align 4 dereferenceable(64) %0, ptr noundef nonnull align 4 dereferenceable(36) %1) local_unnamed_addr #1 align 2 {
.preheader:
  %2 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 0, i32 noundef 0)
  %3 = load float, ptr %2, align 4, !tbaa !5
  %4 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 0, i32 noundef 0)
  store float %3, ptr %4, align 4, !tbaa !5
  %5 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 0, i32 noundef 1)
  %6 = load float, ptr %5, align 4, !tbaa !5
  %7 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 0, i32 noundef 1)
  store float %6, ptr %7, align 4, !tbaa !5
  %8 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 0, i32 noundef 2)
  %9 = load float, ptr %8, align 4, !tbaa !5
  %10 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 0, i32 noundef 2)
  store float %9, ptr %10, align 4, !tbaa !5
  %11 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 1, i32 noundef 0)
  %12 = load float, ptr %11, align 4, !tbaa !5
  %13 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 1, i32 noundef 0)
  store float %12, ptr %13, align 4, !tbaa !5
  %14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 1, i32 noundef 1)
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 1, i32 noundef 1)
  store float %15, ptr %16, align 4, !tbaa !5
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 1, i32 noundef 2)
  %18 = load float, ptr %17, align 4, !tbaa !5
  %19 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 1, i32 noundef 2)
  store float %18, ptr %19, align 4, !tbaa !5
  %20 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 2, i32 noundef 0)
  %21 = load float, ptr %20, align 4, !tbaa !5
  %22 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 2, i32 noundef 0)
  store float %21, ptr %22, align 4, !tbaa !5
  %23 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 2, i32 noundef 1)
  %24 = load float, ptr %23, align 4, !tbaa !5
  %25 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 2, i32 noundef 1)
  store float %24, ptr %25, align 4, !tbaa !5
  %26 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36) %1, i32 noundef 2, i32 noundef 2)
  %27 = load float, ptr %26, align 4, !tbaa !5
  %28 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3cgp12matrix_stackIfLi4ELi4EE2atEii(ptr noundef nonnull align 4 dereferenceable(64) %0, i32 noundef 2, i32 noundef 2)
  store float %27, ptr %28, align 4, !tbaa !5
  ret ptr %0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK3cgp12matrix_stackIfLi3ELi3EE2atEii(ptr noundef nonnull align 4 dereferenceable(36), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

attributes #0 = { inlinehint 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 #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" }

!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,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass