; LLVM IR from jpvt/Computer_Graphics :: Assignment #3/third_party/glm/test/gtx/gtx_common.ll (Z17test_closeBoundedv)

; 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.glm::vec.17" = type { %union.anon.18, %union.anon.19 }
%union.anon.18 = type { i8 }
%union.anon.19 = type { i8 }
%"struct.glm::vec.31" = type { %union.anon.32, %union.anon.33 }
%union.anon.32 = type { i32 }
%union.anon.33 = type { i32 }

; 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 zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z17test_closeBoundedv() #3 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.glm::vec.17", align 1
  %3 = alloca %"struct.glm::vec.31", align 4
  %4 = alloca %"struct.glm::vec.31", align 4
  %5 = alloca %"struct.glm::vec.31", align 4
  %6 = alloca %"struct.glm::vec.17", align 1
  %7 = alloca %"struct.glm::vec.31", align 4
  %8 = alloca %"struct.glm::vec.31", align 4
  %9 = alloca %"struct.glm::vec.31", align 4
  %10 = alloca %"struct.glm::vec.17", align 1
  %11 = alloca %"struct.glm::vec.31", align 4
  %12 = alloca %"struct.glm::vec.31", align 4
  %13 = alloca %"struct.glm::vec.31", align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %3, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %4, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %5, i32 noundef 3)
  %14 = call i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %4, ptr noundef nonnull align 4 dereferenceable(8) %5)
  store i16 %14, ptr %2, align 1
  %15 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %2)
  %16 = zext i1 %15 to i64
  %17 = select i1 %15, i32 0, i32 1
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = add nsw i32 %18, %17
  store i32 %19, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %7, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %8, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %9, i32 noundef 3)
  %20 = call i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
  store i16 %20, ptr %6, align 1
  %21 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %6)
  %22 = zext i1 %21 to i64
  %23 = select i1 %21, i32 0, i32 1
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = add nsw i32 %24, %23
  store i32 %25, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %11, i32 noundef 3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %12, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %13, i32 noundef 3)
  %26 = call i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %12, ptr noundef nonnull align 4 dereferenceable(8) %13)
  store i16 %26, ptr %10, align 1
  %27 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %10)
  %28 = zext i1 %27 to i64
  %29 = select i1 %27, i32 0, i32 1
  %30 = load i32, ptr %1, align 4, !tbaa !5
  %31 = add nsw i32 %30, %29
  store i32 %31, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #4
  %32 = load i32, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret i32 %32
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #1

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


; 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.glm::vec.17" = type { %union.anon.18, %union.anon.19 }
%union.anon.18 = type { i8 }
%union.anon.19 = type { i8 }
%"struct.glm::vec.31" = type { %union.anon.32, %union.anon.33 }
%union.anon.32 = type { i32 }
%union.anon.33 = type { i32 }

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

; Function Attrs: mustprogress 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 zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 4) i32 @_Z17test_closeBoundedv() local_unnamed_addr #3 {
  %1 = alloca %"struct.glm::vec.17", align 2
  %2 = alloca %"struct.glm::vec.31", align 4
  %3 = alloca %"struct.glm::vec.31", align 4
  %4 = alloca %"struct.glm::vec.31", align 4
  %5 = alloca %"struct.glm::vec.17", align 2
  %6 = alloca %"struct.glm::vec.31", align 4
  %7 = alloca %"struct.glm::vec.31", align 4
  %8 = alloca %"struct.glm::vec.31", align 4
  %9 = alloca %"struct.glm::vec.17", align 2
  %10 = alloca %"struct.glm::vec.31", align 4
  %11 = alloca %"struct.glm::vec.31", align 4
  %12 = alloca %"struct.glm::vec.31", align 4
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %2, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %3, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %4, i32 noundef 3)
  %13 = call i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8) %2, ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
  store i16 %13, ptr %1, align 2
  %14 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %1)
  %not. = xor i1 %14, true
  %15 = zext i1 %not. to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %6, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %7, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %8, i32 noundef 3)
  %16 = call i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8)
  store i16 %16, ptr %5, align 2
  %17 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %5)
  %not.4 = xor i1 %17, true
  %18 = zext i1 %not.4 to i32
  %19 = add nuw nsw i32 %18, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %10, i32 noundef 3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %11, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  call void @_ZN3glm3vecILi2EiLNS_9qualifierE0EEC2Ei(ptr noundef nonnull align 4 dereferenceable(8) %12, i32 noundef 3)
  %20 = call i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %12)
  store i16 %20, ptr %9, align 2
  %21 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %9)
  %not.5 = xor i1 %21, true
  %22 = zext i1 %not.5 to i32
  %23 = add nuw nsw i32 %19, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #4
  ret i32 %23
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i16 @_ZN3glm12closeBoundedILi2EiLNS_9qualifierE0EEENS_3vecIXT_EbXT1_EEERKNS2_IXT_ET0_XT1_EEES7_S7_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass