; LLVM IR from Dovyski/opengl-demos :: libs/glm-0.9.9.3/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.52" = type { %union.anon.53 }
%union.anon.53 = type { %"struct.glm::detail::storage<3, float, true>::type" }
%"struct.glm::detail::storage<3, float, true>::type" = type { [4 x float] }
%"struct.glm::vec.57" = type { %union.anon.58 }
%union.anon.58 = type { %"struct.glm::detail::storage<3, double, true>::type" }
%"struct.glm::detail::storage<3, double, true>::type" = type { [4 x double] }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 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 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) #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)) #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)) #2

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

28:                                               ; preds = %76, %0
  %29 = load i64, ptr %9, align 8, !tbaa !9
  %30 = load i64, ptr %2, align 8, !tbaa !9
  %31 = icmp ult i64 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %79

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %34 = call { <2 x float>, <2 x float> } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(float noundef 1.000000e+00)
  %35 = getelementptr inbounds %"struct.glm::vec.52", ptr %10, i32 0, i32 0
  %36 = getelementptr inbounds %union.anon.53, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %"struct.glm::detail::storage<3, float, true>::type", ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %37, i32 0, i32 0
  %39 = extractvalue { <2 x float>, <2 x float> } %34, 0
  store <2 x float> %39, ptr %38, align 16
  %40 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %37, i32 0, i32 1
  %41 = extractvalue { <2 x float>, <2 x float> } %34, 1
  store <2 x float> %41, ptr %40, align 8
  %42 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16) %10)
  %43 = load float, ptr %3, align 4, !tbaa !11
  %44 = fadd float %43, %42
  store float %44, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(ptr dead_on_unwind writable sret(%"struct.glm::vec.57") align 32 %11, double noundef 1.000000e+00)
  %45 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 32 dereferenceable(32) %11)
  %46 = load double, ptr %6, align 8, !tbaa !13
  %47 = fadd double %46, %45
  store double %47, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %48 = call { <2 x float>, <2 x float> } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(float noundef 2.000000e+00)
  %49 = getelementptr inbounds %"struct.glm::vec.52", ptr %12, i32 0, i32 0
  %50 = getelementptr inbounds %union.anon.53, ptr %49, i32 0, i32 0
  %51 = getelementptr inbounds %"struct.glm::detail::storage<3, float, true>::type", ptr %50, i32 0, i32 0
  %52 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %51, i32 0, i32 0
  %53 = extractvalue { <2 x float>, <2 x float> } %48, 0
  store <2 x float> %53, ptr %52, align 16
  %54 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %51, i32 0, i32 1
  %55 = extractvalue { <2 x float>, <2 x float> } %48, 1
  store <2 x float> %55, ptr %54, align 8
  %56 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16) %12)
  %57 = load float, ptr %4, align 4, !tbaa !11
  %58 = fadd float %57, %56
  store float %58, ptr %4, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(ptr dead_on_unwind writable sret(%"struct.glm::vec.57") align 32 %13, double noundef 2.000000e+00)
  %59 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 32 dereferenceable(32) %13)
  %60 = load double, ptr %7, align 8, !tbaa !13
  %61 = fadd double %60, %59
  store double %61, ptr %7, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %62 = call { <2 x float>, <2 x float> } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(float noundef 3.000000e+00)
  %63 = getelementptr inbounds %"struct.glm::vec.52", ptr %14, i32 0, i32 0
  %64 = getelementptr inbounds %union.anon.53, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds %"struct.glm::detail::storage<3, float, true>::type", ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %65, i32 0, i32 0
  %67 = extractvalue { <2 x float>, <2 x float> } %62, 0
  store <2 x float> %67, ptr %66, align 16
  %68 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %65, i32 0, i32 1
  %69 = extractvalue { <2 x float>, <2 x float> } %62, 1
  store <2 x float> %69, ptr %68, align 8
  %70 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16) %14)
  %71 = load float, ptr %5, align 4, !tbaa !11
  %72 = fadd float %71, %70
  store float %72, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(ptr dead_on_unwind writable sret(%"struct.glm::vec.57") align 32 %15, double noundef 3.000000e+00)
  %73 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 32 dereferenceable(32) %15)
  %74 = load double, ptr %8, align 8, !tbaa !13
  %75 = fadd double %74, %73
  store double %75, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #5
  br label %76

76:                                               ; preds = %33
  %77 = load i64, ptr %9, align 8, !tbaa !9
  %78 = add i64 %77, 1
  store i64 %78, ptr %9, align 8, !tbaa !9
  br label %28, !llvm.loop !15

79:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %80 = load i64, ptr %2, align 8, !tbaa !9
  %81 = uitofp i64 %80 to float
  store float %81, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store float 0x3F847AE140000000, ptr %17, align 4, !tbaa !11
  %82 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %83 = zext i1 %82 to i64
  %84 = select i1 %82, i32 0, i32 1
  %85 = load i32, ptr %1, align 4, !tbaa !5
  %86 = add nsw i32 %85, %84
  store i32 %86, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %87 = load i64, ptr %2, align 8, !tbaa !9
  %88 = uitofp i64 %87 to double
  store double %88, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store double 1.000000e-04, ptr %19, align 8, !tbaa !13
  %89 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %90 = zext i1 %89 to i64
  %91 = select i1 %89, i32 0, i32 1
  %92 = load i32, ptr %1, align 4, !tbaa !5
  %93 = add nsw i32 %92, %91
  store i32 %93, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %94 = load i64, ptr %2, align 8, !tbaa !9
  %95 = mul i64 %94, 2
  %96 = uitofp i64 %95 to float
  store float %96, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store float 0x3F847AE140000000, ptr %21, align 4, !tbaa !11
  %97 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %98 = zext i1 %97 to i64
  %99 = select i1 %97, i32 0, i32 1
  %100 = load i32, ptr %1, align 4, !tbaa !5
  %101 = add nsw i32 %100, %99
  store i32 %101, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %102 = load i64, ptr %2, align 8, !tbaa !9
  %103 = mul i64 %102, 2
  %104 = uitofp i64 %103 to double
  store double %104, ptr %22, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  store double 1.000000e-04, ptr %23, align 8, !tbaa !13
  %105 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull align 8 dereferenceable(8) %23)
  %106 = zext i1 %105 to i64
  %107 = select i1 %105, i32 0, i32 1
  %108 = load i32, ptr %1, align 4, !tbaa !5
  %109 = add nsw i32 %108, %107
  store i32 %109, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %110 = load i64, ptr %2, align 8, !tbaa !9
  %111 = mul i64 %110, 3
  %112 = uitofp i64 %111 to float
  store float %112, ptr %24, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store float 0x3F847AE140000000, ptr %25, align 4, !tbaa !11
  %113 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIfEEbRKT_S3_S3_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %24, ptr noundef nonnull align 4 dereferenceable(4) %25)
  %114 = zext i1 %113 to i64
  %115 = select i1 %113, i32 0, i32 1
  %116 = load i32, ptr %1, align 4, !tbaa !5
  %117 = add nsw i32 %116, %115
  store i32 %117, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %118 = load i64, ptr %2, align 8, !tbaa !9
  %119 = mul i64 %118, 3
  %120 = uitofp i64 %119 to double
  store double %120, ptr %26, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  store double 1.000000e-02, ptr %27, align 8, !tbaa !13
  %121 = call noundef zeroext i1 @_ZN3glm12epsilonEqualIdEEbRKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull align 8 dereferenceable(8) %27)
  %122 = zext i1 %121 to i64
  %123 = select i1 %121, i32 0, i32 1
  %124 = load i32, ptr %1, align 4, !tbaa !5
  %125 = add nsw i32 %124, %123
  store i32 %125, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  %126 = load i32, ptr %1, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  %128 = xor i1 %127, true
  br i1 %128, label %129, label %130

129:                                              ; preds = %79
  br label %132

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

131:                                              ; No predecessors!
  br label %132

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 32 dereferenceable(32)) #2

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

attributes #0 = { 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 = !{!"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.52" = type { %union.anon.53 }
%union.anon.53 = type { %"struct.glm::detail::storage<3, float, true>::type" }
%"struct.glm::detail::storage<3, float, true>::type" = type { [4 x float] }
%"struct.glm::vec.57" = type { %union.anon.58 }
%union.anon.58 = type { %"struct.glm::detail::storage<3, double, true>::type" }
%"struct.glm::detail::storage<3, double, true>::type" = type { [4 x double] }

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [95 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.52", align 16
  %8 = alloca %"struct.glm::vec.57", align 32
  %9 = alloca %"struct.glm::vec.52", align 16
  %10 = alloca %"struct.glm::vec.57", align 32
  %11 = alloca %"struct.glm::vec.52", align 16
  %12 = alloca %"struct.glm::vec.57", align 32
  %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
  %25 = getelementptr inbounds i8, ptr %7, i64 8
  %26 = getelementptr inbounds i8, ptr %9, i64 8
  %27 = getelementptr inbounds i8, ptr %11, i64 8
  br label %46

28:                                               ; preds = %46
  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
  %29 = 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 %29, true
  %30 = 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
  %31 = 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.17 = xor i1 %31, true
  %32 = zext i1 %not.17 to i32
  %33 = add nuw nsw i32 %32, %30
  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
  %34 = 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.18 = xor i1 %34, true
  %35 = zext i1 %not.18 to i32
  %36 = add nuw nsw i32 %33, %35
  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
  %37 = 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.19 = xor i1 %37, true
  %38 = zext i1 %not.19 to i32
  %39 = add nuw nsw i32 %36, %38
  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
  %40 = 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.20 = xor i1 %40, true
  %41 = zext i1 %not.20 to i32
  %42 = add nuw nsw i32 %39, %41
  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
  %43 = 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.21 = xor i1 %43, true
  %44 = zext i1 %not.21 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
  %45 = or i32 %42, %44
  %.not = icmp eq i32 %45, 0
  br i1 %.not, label %76, label %75

46:                                               ; preds = %0, %46
  %47 = phi double [ 0.000000e+00, %0 ], [ %73, %46 ]
  %48 = phi float [ 0.000000e+00, %0 ], [ %71, %46 ]
  %49 = phi double [ 0.000000e+00, %0 ], [ %66, %46 ]
  %50 = phi float [ 0.000000e+00, %0 ], [ %64, %46 ]
  %51 = phi double [ 0.000000e+00, %0 ], [ %59, %46 ]
  %52 = phi float [ 0.000000e+00, %0 ], [ %57, %46 ]
  %.022 = phi i64 [ 0, %0 ], [ %74, %46 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  %53 = call { <2 x float>, <2 x float> } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(float noundef 1.000000e+00)
  %54 = extractvalue { <2 x float>, <2 x float> } %53, 0
  store <2 x float> %54, ptr %7, align 16
  %55 = extractvalue { <2 x float>, <2 x float> } %53, 1
  store <2 x float> %55, ptr %25, align 8
  %56 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16) %7)
  %57 = fadd float %56, %52
  store float %57, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::vec.57") align 32 %8, double noundef 1.000000e+00)
  %58 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 32 dereferenceable(32) %8)
  %59 = fadd double %58, %51
  store double %59, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  %60 = call { <2 x float>, <2 x float> } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(float noundef 2.000000e+00)
  %61 = extractvalue { <2 x float>, <2 x float> } %60, 0
  store <2 x float> %61, ptr %9, align 16
  %62 = extractvalue { <2 x float>, <2 x float> } %60, 1
  store <2 x float> %62, ptr %26, align 8
  %63 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16) %9)
  %64 = fadd float %63, %50
  store float %64, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::vec.57") align 32 %10, double noundef 2.000000e+00)
  %65 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 32 dereferenceable(32) %10)
  %66 = fadd double %65, %49
  store double %66, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  %67 = call { <2 x float>, <2 x float> } @_ZN3glm13sphericalRandIfEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(float noundef 3.000000e+00)
  %68 = extractvalue { <2 x float>, <2 x float> } %67, 0
  store <2 x float> %68, ptr %11, align 16
  %69 = extractvalue { <2 x float>, <2 x float> } %67, 1
  store <2 x float> %69, ptr %27, align 8
  %70 = call noundef float @_ZN3glm6lengthILi3EfLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16) %11)
  %71 = fadd float %70, %48
  store float %71, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #5
  call void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::vec.57") align 32 %12, double noundef 3.000000e+00)
  %72 = call noundef double @_ZN3glm6lengthILi3EdLNS_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 32 dereferenceable(32) %12)
  %73 = fadd double %72, %47
  store double %73, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #5
  %74 = add nuw nsw i64 %.022, 1
  %exitcond.not = icmp eq i64 %74, 10000
  br i1 %exitcond.not, label %28, label %46, !llvm.loop !11

75:                                               ; preds = %28
  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

76:                                               ; preds = %28
  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_9qualifierE3EEET0_RKNS_3vecIXT_ES2_XT1_EEE(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm13sphericalRandIdEENS_3vecILi3ET_LNS_9qualifierE3EEES2_(ptr dead_on_unwind noalias writable sret(%"struct.glm::vec.57") align 32, 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,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass