; LLVM IR from jpvt/Computer_Graphics :: Assignment #3/third_party/glm/test/gtc/gtc_random.ll (Z18test_sphericalRandv)

; 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.31" = type { %union.anon.32, %union.anon.33, %union.anon.34 }
%union.anon.32 = type { float }
%union.anon.33 = type { float }
%union.anon.34 = type { float }
%"struct.glm::vec.35" = type { %union.anon.36, %union.anon.37, %union.anon.38 }
%union.anon.36 = type { double }
%union.anon.37 = type { double }
%union.anon.38 = type { double }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [110 x i8], align 1
@__PRETTY_FUNCTION__._Z18test_sphericalRandv = external hidden unnamed_addr constant [25 x i8], align 1

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z18test_sphericalRandv() #4 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.glm::vec.31", align 4
  %11 = alloca { <2 x float>, float }, align 8
  %12 = alloca %"struct.glm::vec.35", align 8
  %13 = alloca %"struct.glm::vec.31", align 4
  %14 = alloca { <2 x float>, float }, align 8
  %15 = alloca %"struct.glm::vec.35", align 8
  %16 = alloca %"struct.glm::vec.31", align 4
  %17 = alloca { <2 x float>, float }, align 8
  %18 = alloca %"struct.glm::vec.35", align 8
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 10000, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store float 0.000000e+00, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store float 0.000000e+00, ptr %4, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store float 0.000000e+00, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store double 0.000000e+00, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store double 0.000000e+00, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store double 0.000000e+00, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 0, ptr %9, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %58, %0
  %32 = load i64, ptr %9, align 8, !tbaa !9
  %33 = load i64, ptr %2, align 8, !tbaa !9
  %34 = icmp ult i64 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %61

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #6
  %37 = call { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef 1.000000e+00)
  store { <2 x float>, float } %37, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %11, i64 12, i1 false)
  %38 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %39 = load float, ptr %3, align 4, !tbaa !11
  %40 = fadd float %39, %38
  store float %40, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind writable sret(%"struct.glm::vec.35") align 8 %12, double noundef 1.000000e+00)
  %41 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %42 = load double, ptr %6, align 8, !tbaa !13
  %43 = fadd double %42, %41
  store double %43, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #6
  %44 = call { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef 2.000000e+00)
  store { <2 x float>, float } %44, ptr %14, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %14, i64 12, i1 false)
  %45 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12) %13)
  %46 = load float, ptr %4, align 4, !tbaa !11
  %47 = fadd float %46, %45
  store float %47, ptr %4, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #6
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind writable sret(%"struct.glm::vec.35") align 8 %15, double noundef 2.000000e+00)
  %48 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24) %15)
  %49 = load double, ptr %7, align 8, !tbaa !13
  %50 = fadd double %49, %48
  store double %50, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #6
  %51 = call { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef 3.000000e+00)
  store { <2 x float>, float } %51, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %17, i64 12, i1 false)
  %52 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12) %16)
  %53 = load float, ptr %5, align 4, !tbaa !11
  %54 = fadd float %53, %52
  store float %54, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind writable sret(%"struct.glm::vec.35") align 8 %18, double noundef 3.000000e+00)
  %55 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24) %18)
  %56 = load double, ptr %8, align 8, !tbaa !13
  %57 = fadd double %56, %55
  store double %57, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  br label %58

58:                                               ; preds = %36
  %59 = load i64, ptr %9, align 8, !tbaa !9
  %60 = add i64 %59, 1
  store i64 %60, ptr %9, align 8, !tbaa !9
  br label %31, !llvm.loop !15

61:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %62 = load i64, ptr %2, align 8, !tbaa !9
  %63 = uitofp i64 %62 to float
  store float %63, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store float 0x3F847AE140000000, ptr %20, align 4, !tbaa !11
  %64 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %65 = zext i1 %64 to i64
  %66 = select i1 %64, i32 0, i32 1
  %67 = load i32, ptr %1, align 4, !tbaa !5
  %68 = add nsw i32 %67, %66
  store i32 %68, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %69 = load i64, ptr %2, align 8, !tbaa !9
  %70 = uitofp i64 %69 to double
  store double %70, ptr %21, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  store double 1.000000e-04, ptr %22, align 8, !tbaa !13
  %71 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %72 = zext i1 %71 to i64
  %73 = select i1 %71, i32 0, i32 1
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %75 = add nsw i32 %74, %73
  store i32 %75, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %76 = load i64, ptr %2, align 8, !tbaa !9
  %77 = mul i64 %76, 2
  %78 = uitofp i64 %77 to float
  store float %78, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store float 0x3F847AE140000000, ptr %24, align 4, !tbaa !11
  %79 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %80 = zext i1 %79 to i64
  %81 = select i1 %79, i32 0, i32 1
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %83 = add nsw i32 %82, %81
  store i32 %83, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  %84 = load i64, ptr %2, align 8, !tbaa !9
  %85 = mul i64 %84, 2
  %86 = uitofp i64 %85 to double
  store double %86, ptr %25, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  store double 1.000000e-04, ptr %26, align 8, !tbaa !13
  %87 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %88 = zext i1 %87 to i64
  %89 = select i1 %87, i32 0, i32 1
  %90 = load i32, ptr %1, align 4, !tbaa !5
  %91 = add nsw i32 %90, %89
  store i32 %91, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %92 = load i64, ptr %2, align 8, !tbaa !9
  %93 = mul i64 %92, 3
  %94 = uitofp i64 %93 to float
  store float %94, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #6
  store float 0x3F847AE140000000, ptr %28, align 4, !tbaa !11
  %95 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %27, ptr noundef nonnull align 4 dereferenceable(4) %28)
  %96 = zext i1 %95 to i64
  %97 = select i1 %95, i32 0, i32 1
  %98 = load i32, ptr %1, align 4, !tbaa !5
  %99 = add nsw i32 %98, %97
  store i32 %99, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %100 = load i64, ptr %2, align 8, !tbaa !9
  %101 = mul i64 %100, 3
  %102 = uitofp i64 %101 to double
  store double %102, ptr %29, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  store double 1.000000e-02, ptr %30, align 8, !tbaa !13
  %103 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %104 = zext i1 %103 to i64
  %105 = select i1 %103, i32 0, i32 1
  %106 = load i32, ptr %1, align 4, !tbaa !5
  %107 = add nsw i32 %106, %105
  store i32 %107, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  %108 = load i32, ptr %1, align 4, !tbaa !5
  %109 = icmp ne i32 %108, 0
  %110 = xor i1 %109, true
  br i1 %110, label %111, label %112

111:                                              ; preds = %61
  br label %114

112:                                              ; preds = %61
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 276, ptr noundef @__PRETTY_FUNCTION__._Z18test_sphericalRandv) #7
  unreachable

113:                                              ; No predecessors!
  br label %114

114:                                              ; preds = %113, %111
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %115 = load i32, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret i32 %115
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24)) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind noalias writable sret(%"struct.glm::vec.35") align 8, double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn nounwind "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 = { 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 #4 = { 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 #5 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { noreturn 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 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"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"

%"struct.glm::vec.31" = type { %union.anon.32, %union.anon.33, %union.anon.34 }
%union.anon.32 = type { float }
%union.anon.33 = type { float }
%union.anon.34 = type { float }
%"struct.glm::vec.35" = type { %union.anon.36, %union.anon.37, %union.anon.38 }
%union.anon.36 = type { double }
%union.anon.37 = type { double }
%union.anon.38 = type { double }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [110 x i8], align 1
@__PRETTY_FUNCTION__._Z18test_sphericalRandv = external hidden unnamed_addr constant [25 x i8], align 1

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 7) i32 @_Z18test_sphericalRandv() local_unnamed_addr #3 {
  %1 = alloca float, align 4
  %2 = alloca float, align 4
  %3 = alloca float, align 4
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca %"struct.glm::vec.31", align 8
  %8 = alloca %"struct.glm::vec.35", align 8
  %9 = alloca %"struct.glm::vec.31", align 8
  %10 = alloca %"struct.glm::vec.35", align 8
  %11 = alloca %"struct.glm::vec.31", align 8
  %12 = alloca %"struct.glm::vec.35", align 8
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.24.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  br label %43

25:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  store float 1.000000e+04, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  store float 0x3F847AE140000000, ptr %14, align 4, !tbaa !5
  %26 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %not. = xor i1 %26, true
  %27 = zext i1 %not. to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #5
  store double 1.000000e+04, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #5
  store double 1.000000e-04, ptr %16, align 8, !tbaa !9
  %28 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %not.25 = xor i1 %28, true
  %29 = zext i1 %not.25 to i32
  %30 = add nuw nsw i32 %29, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %17) #5
  store float 2.000000e+04, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %18) #5
  store float 0x3F847AE140000000, ptr %18, align 4, !tbaa !5
  %31 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %not.26 = xor i1 %31, true
  %32 = zext i1 %not.26 to i32
  %33 = add nuw nsw i32 %30, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %19) #5
  store double 2.000000e+04, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %20) #5
  store double 1.000000e-04, ptr %20, align 8, !tbaa !9
  %34 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %not.27 = xor i1 %34, true
  %35 = zext i1 %not.27 to i32
  %36 = add nuw nsw i32 %33, %35
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %21) #5
  store float 3.000000e+04, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %22) #5
  store float 0x3F847AE140000000, ptr %22, align 4, !tbaa !5
  %37 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %not.28 = xor i1 %37, true
  %38 = zext i1 %not.28 to i32
  %39 = add nuw nsw i32 %36, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %21) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #5
  store double 3.000000e+04, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %24) #5
  store double 1.000000e-02, ptr %24, align 8, !tbaa !9
  %40 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %not.29 = xor i1 %40, true
  %41 = zext i1 %not.29 to i32
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #5
  %42 = or i32 %39, %41
  %.not = icmp eq i32 %42, 0
  br i1 %.not, label %67, label %66

43:                                               ; preds = %0, %43
  %44 = phi double [ 0.000000e+00, %0 ], [ %64, %43 ]
  %45 = phi float [ 0.000000e+00, %0 ], [ %62, %43 ]
  %46 = phi double [ 0.000000e+00, %0 ], [ %59, %43 ]
  %47 = phi float [ 0.000000e+00, %0 ], [ %57, %43 ]
  %48 = phi double [ 0.000000e+00, %0 ], [ %54, %43 ]
  %49 = phi float [ 0.000000e+00, %0 ], [ %52, %43 ]
  %.030 = phi i64 [ 0, %0 ], [ %65, %43 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #5
  %50 = call { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef 1.000000e+00)
  %.fca.0.extract5 = extractvalue { <2 x float>, float } %50, 0
  %.fca.1.extract6 = extractvalue { <2 x float>, float } %50, 1
  store <2 x float> %.fca.0.extract5, ptr %7, align 8
  store float %.fca.1.extract6, ptr %.sroa.28.0..sroa_idx, align 8
  %51 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12) %7)
  %52 = fadd float %51, %49
  store float %52, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::vec.35") align 8 %8, double noundef 1.000000e+00)
  %53 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %54 = fadd double %53, %48
  store double %54, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #5
  %55 = call { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef 2.000000e+00)
  %.fca.0.extract1 = extractvalue { <2 x float>, float } %55, 0
  %.fca.1.extract2 = extractvalue { <2 x float>, float } %55, 1
  store <2 x float> %.fca.0.extract1, ptr %9, align 8
  store float %.fca.1.extract2, ptr %.sroa.24.0..sroa_idx, align 8
  %56 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %57 = fadd float %56, %47
  store float %57, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::vec.35") align 8 %10, double noundef 2.000000e+00)
  %58 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24) %10)
  %59 = fadd double %58, %46
  store double %59, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #5
  %60 = call { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef 3.000000e+00)
  %.fca.0.extract = extractvalue { <2 x float>, float } %60, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %60, 1
  store <2 x float> %.fca.0.extract, ptr %11, align 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %61 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12) %11)
  %62 = fadd float %61, %45
  store float %62, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %12) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::vec.35") align 8 %12, double noundef 3.000000e+00)
  %63 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24) %12)
  %64 = fadd double %63, %44
  store double %64, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %12) #5
  %65 = add nuw nsw i64 %.030, 1
  %exitcond.not = icmp eq i64 %65, 10000
  br i1 %exitcond.not, label %25, label %43, !llvm.loop !11

66:                                               ; preds = %25
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 276, ptr noundef nonnull @__PRETTY_FUNCTION__._Z18test_sphericalRandv) #6
  unreachable

67:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(float noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE0EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE0EEES2_(ptr dead_on_unwind noalias writable sret(%"struct.glm::vec.35") align 8, double noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 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"="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 #4 = { inlinehint 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 #5 = { nounwind }
attributes #6 = { noreturn 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass