; LLVM IR from Dovyski/opengl-demos :: libs/glm-0.9.9.3/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.16" = type { %union.anon.17 }
%union.anon.17 = type { %struct.anon.18 }
%struct.anon.18 = type { i8, i8 }
%"struct.glm::vec.36" = type { %union.anon.37 }
%union.anon.37 = type { %struct.anon.38 }
%struct.anon.38 = type { i32, 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.16", align 1
  %3 = alloca %"struct.glm::vec.36", align 4
  %4 = alloca %"struct.glm::vec.36", align 4
  %5 = alloca %"struct.glm::vec.36", align 4
  %6 = alloca %"struct.glm::vec.16", align 1
  %7 = alloca %"struct.glm::vec.36", align 4
  %8 = alloca %"struct.glm::vec.36", align 4
  %9 = alloca %"struct.glm::vec.36", align 4
  %10 = alloca %"struct.glm::vec.16", align 1
  %11 = alloca %"struct.glm::vec.36", align 4
  %12 = alloca %"struct.glm::vec.36", align 4
  %13 = alloca %"struct.glm::vec.36", 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)
  %15 = getelementptr inbounds %"struct.glm::vec.16", ptr %2, i32 0, i32 0
  %16 = getelementptr inbounds %union.anon.17, ptr %15, i32 0, i32 0
  store i16 %14, ptr %16, align 1
  %17 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %2)
  %18 = zext i1 %17 to i64
  %19 = select i1 %17, i32 0, i32 1
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = add nsw i32 %20, %19
  store i32 %21, 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)
  %22 = 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)
  %23 = getelementptr inbounds %"struct.glm::vec.16", ptr %6, i32 0, i32 0
  %24 = getelementptr inbounds %union.anon.17, ptr %23, i32 0, i32 0
  store i16 %22, ptr %24, align 1
  %25 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %6)
  %26 = zext i1 %25 to i64
  %27 = select i1 %25, i32 0, i32 1
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = add nsw i32 %28, %27
  store i32 %29, 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)
  %30 = 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)
  %31 = getelementptr inbounds %"struct.glm::vec.16", ptr %10, i32 0, i32 0
  %32 = getelementptr inbounds %union.anon.17, ptr %31, i32 0, i32 0
  store i16 %30, ptr %32, align 1
  %33 = call noundef zeroext i1 @_ZN3glm3allILi2ELNS_9qualifierE0EEEbRKNS_3vecIXT_EbXT0_EEE(ptr noundef nonnull align 1 dereferenceable(2) %10)
  %34 = zext i1 %33 to i64
  %35 = select i1 %33, i32 0, i32 1
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = add nsw i32 %36, %35
  store i32 %37, 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
  %38 = load i32, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret i32 %38
}

; 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.16" = type { %union.anon.17 }
%union.anon.17 = type { %struct.anon.18 }
%struct.anon.18 = type { i8, i8 }
%"struct.glm::vec.36" = type { %union.anon.37 }
%union.anon.37 = type { %struct.anon.38 }
%struct.anon.38 = type { i32, 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.16", align 2
  %2 = alloca %"struct.glm::vec.36", align 4
  %3 = alloca %"struct.glm::vec.36", align 4
  %4 = alloca %"struct.glm::vec.36", align 4
  %5 = alloca %"struct.glm::vec.16", align 2
  %6 = alloca %"struct.glm::vec.36", align 4
  %7 = alloca %"struct.glm::vec.36", align 4
  %8 = alloca %"struct.glm::vec.36", align 4
  %9 = alloca %"struct.glm::vec.16", align 2
  %10 = alloca %"struct.glm::vec.36", align 4
  %11 = alloca %"struct.glm::vec.36", align 4
  %12 = alloca %"struct.glm::vec.36", 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