; LLVM IR from devlinzhou/deterministic_physics :: UnrealDemo/Source/UnrealDemo/gphysics/src/math/glacier_float.ll (ZN6GFloat3CosES_)

; 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"

%class.GFloat = type { i32 }
%class.GFixedType32 = type { i32 }
%class.GFixedType32.0 = 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 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6GFloat11getexponentEv(ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden i32 @_ZL10s_TriClampi6GFloat(i32 noundef, i32) #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden i32 @_ZL15s_NormalToRadus12GFixedType32ILi30EE(i32) #3

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK12GFixedType32ILi29EEngEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZNK12GFixedType32ILi29EE8ToGFloatEv(ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local i32 @_ZN6GFloat3CosES_(i32 %0) #4 align 2 {
  %2 = alloca %class.GFloat, align 4
  %3 = alloca %class.GFloat, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %class.GFixedType32, align 4
  %7 = alloca %class.GFloat, align 4
  %8 = alloca %class.GFixedType32, align 4
  %9 = alloca i8, align 1
  %10 = alloca %class.GFixedType32, align 4
  %11 = alloca %class.GFixedType32, align 4
  %12 = alloca %class.GFixedType32, align 4
  %13 = alloca %class.GFixedType32, align 4
  %14 = alloca %class.GFixedType32, align 4
  %15 = alloca %class.GFixedType32, align 4
  %16 = alloca %class.GFixedType32.0, align 4
  %17 = alloca %class.GFixedType32, align 4
  %18 = alloca %class.GFixedType32.0, align 4
  %19 = alloca %class.GFixedType32.0, align 4
  %20 = alloca %class.GFixedType32.0, align 4
  %21 = alloca %class.GFixedType32.0, align 4
  %22 = alloca %class.GFixedType32.0, align 4
  %23 = alloca %class.GFixedType32.0, align 4
  %24 = alloca %class.GFixedType32.0, align 4
  %25 = alloca %class.GFixedType32.0, align 4
  %26 = alloca %class.GFixedType32.0, align 4
  %27 = alloca %class.GFixedType32.0, align 4
  %28 = alloca %class.GFixedType32.0, align 4
  %29 = alloca %class.GFixedType32.0, align 4
  %30 = alloca %class.GFixedType32.0, align 4
  %31 = alloca %class.GFixedType32.0, align 4
  %32 = getelementptr inbounds %class.GFloat, ptr %3, i32 0, i32 0
  store i32 %0, ptr %32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %33 = call noundef i32 @_ZNK6GFloat11getexponentEv(ptr noundef nonnull align 4 dereferenceable(4) %3)
  %34 = sub nsw i32 %33, 127
  store i32 %34, ptr %4, align 4, !tbaa !5
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = icmp sge i32 -64, %35
  br i1 %36, label %40, label %37

37:                                               ; preds = %1
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = icmp sge i32 %38, 64
  br i1 %39, label %40, label %43

40:                                               ; preds = %37, %1
  %41 = call i32 @_ZN6GFloat3OneEv()
  %42 = getelementptr inbounds %class.GFloat, ptr %2, i32 0, i32 0
  store i32 %41, ptr %42, align 4
  store i32 1, ptr %5, align 4
  br label %111

43:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %44 = load i32, ptr %4, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %3, i64 4, i1 false), !tbaa.struct !9
  %45 = getelementptr inbounds %class.GFloat, ptr %7, i32 0, i32 0
  %46 = load i32, ptr %45, align 4
  %47 = call i32 @_ZL10s_TriClampi6GFloat(i32 noundef %44, i32 %46)
  %48 = getelementptr inbounds %class.GFixedType32, ptr %6, i32 0, i32 0
  store i32 %47, ptr %48, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @_ZN12GFixedType32ILi30EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  store i8 0, ptr %9, align 1, !tbaa !10
  %49 = getelementptr inbounds %class.GFixedType32, ptr %6, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 noundef 0, i64 noundef 3, i64 noundef 4)
  %51 = icmp sge i32 %50, 805306368
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br i1 %51, label %52, label %57

52:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef 1, i64 noundef 0, i64 noundef 4)
  %53 = getelementptr inbounds %class.GFixedType32, ptr %12, i32 0, i32 0
  %54 = load i32, ptr %53, align 4
  %55 = call i32 @_ZNK12GFixedType32ILi30EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 %54)
  %56 = getelementptr inbounds %class.GFixedType32, ptr %11, i32 0, i32 0
  store i32 %55, ptr %56, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %11, i64 4, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %68

57:                                               ; preds = %43
  %58 = getelementptr inbounds %class.GFixedType32, ptr %6, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 noundef 0, i64 noundef 1, i64 noundef 4)
  %60 = icmp sge i32 %59, 268435456
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br i1 %60, label %61, label %66

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef 0, i64 noundef 2, i64 noundef 4)
  %62 = getelementptr inbounds %class.GFixedType32, ptr %15, i32 0, i32 0
  %63 = load i32, ptr %62, align 4
  %64 = call i32 @_ZNK12GFixedType32ILi30EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 %63)
  %65 = getelementptr inbounds %class.GFixedType32, ptr %14, i32 0, i32 0
  store i32 %64, ptr %65, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %14, i64 4, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  store i8 1, ptr %9, align 1, !tbaa !10
  br label %67

66:                                               ; preds = %57
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %6, i64 4, i1 false), !tbaa.struct !9
  br label %67

67:                                               ; preds = %66, %61
  br label %68

68:                                               ; preds = %67, %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %8, i64 4, i1 false), !tbaa.struct !9
  %69 = getelementptr inbounds %class.GFixedType32, ptr %17, i32 0, i32 0
  %70 = load i32, ptr %69, align 4
  %71 = call i32 @_ZL15s_NormalToRadus12GFixedType32ILi30EE(i32 %70)
  %72 = getelementptr inbounds %class.GFixedType32.0, ptr %16, i32 0, i32 0
  store i32 %71, ptr %72, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %16, i64 4, i1 false), !tbaa.struct !9
  %73 = getelementptr inbounds %class.GFixedType32.0, ptr %19, i32 0, i32 0
  %74 = load i32, ptr %73, align 4
  %75 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %16, i32 %74)
  %76 = getelementptr inbounds %class.GFixedType32.0, ptr %18, i32 0, i32 0
  store i32 %75, ptr %76, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %21, i32 noundef 0, i64 noundef 999972, i64 noundef 1000000)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %25, i32 noundef 0, i64 noundef 499792, i64 noundef 1000000)
  %77 = call i32 @_ZNK12GFixedType32ILi29EEngEv(ptr noundef nonnull align 4 dereferenceable(4) %25)
  %78 = getelementptr inbounds %class.GFixedType32.0, ptr %24, i32 0, i32 0
  store i32 %77, ptr %78, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 noundef 0, i64 noundef 413742, i64 noundef 10000000)
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %30, i32 noundef 0, i64 noundef 124311, i64 noundef 100000000)
  %79 = getelementptr inbounds %class.GFixedType32.0, ptr %30, i32 0, i32 0
  %80 = load i32, ptr %79, align 4
  %81 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 %80)
  %82 = getelementptr inbounds %class.GFixedType32.0, ptr %29, i32 0, i32 0
  store i32 %81, ptr %82, align 4
  %83 = getelementptr inbounds %class.GFixedType32.0, ptr %29, i32 0, i32 0
  %84 = load i32, ptr %83, align 4
  %85 = call i32 @_ZNK12GFixedType32ILi29EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %28, i32 %84)
  %86 = getelementptr inbounds %class.GFixedType32.0, ptr %27, i32 0, i32 0
  store i32 %85, ptr %86, align 4
  %87 = getelementptr inbounds %class.GFixedType32.0, ptr %27, i32 0, i32 0
  %88 = load i32, ptr %87, align 4
  %89 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 %88)
  %90 = getelementptr inbounds %class.GFixedType32.0, ptr %26, i32 0, i32 0
  store i32 %89, ptr %90, align 4
  %91 = getelementptr inbounds %class.GFixedType32.0, ptr %26, i32 0, i32 0
  %92 = load i32, ptr %91, align 4
  %93 = call i32 @_ZNK12GFixedType32ILi29EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %24, i32 %92)
  %94 = getelementptr inbounds %class.GFixedType32.0, ptr %23, i32 0, i32 0
  store i32 %93, ptr %94, align 4
  %95 = getelementptr inbounds %class.GFixedType32.0, ptr %23, i32 0, i32 0
  %96 = load i32, ptr %95, align 4
  %97 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %18, i32 %96)
  %98 = getelementptr inbounds %class.GFixedType32.0, ptr %22, i32 0, i32 0
  store i32 %97, ptr %98, align 4
  %99 = getelementptr inbounds %class.GFixedType32.0, ptr %22, i32 0, i32 0
  %100 = load i32, ptr %99, align 4
  %101 = call i32 @_ZNK12GFixedType32ILi29EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %21, i32 %100)
  %102 = getelementptr inbounds %class.GFixedType32.0, ptr %20, i32 0, i32 0
  store i32 %101, ptr %102, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #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.end.p0(i64 4, ptr %21) #5
  %103 = load i8, ptr %9, align 1, !tbaa !10, !range !14, !noundef !15
  %104 = trunc i8 %103 to i1
  br i1 %104, label %105, label %108

105:                                              ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %106 = call i32 @_ZNK12GFixedType32ILi29EEngEv(ptr noundef nonnull align 4 dereferenceable(4) %20)
  %107 = getelementptr inbounds %class.GFixedType32.0, ptr %31, i32 0, i32 0
  store i32 %106, ptr %107, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %31, i64 4, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %108

108:                                              ; preds = %105, %68
  %109 = call i32 @_ZNK12GFixedType32ILi29EE8ToGFloatEv(ptr noundef nonnull align 4 dereferenceable(4) %20)
  %110 = getelementptr inbounds %class.GFloat, ptr %2, i32 0, i32 0
  store i32 %109, ptr %110, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %111

111:                                              ; preds = %108, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %112 = getelementptr inbounds %class.GFloat, ptr %2, i32 0, i32 0
  %113 = load i32, ptr %112, align 4
  ret i32 %113
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN6GFloat3OneEv() #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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"="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 #5 = { 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 = !{i64 0, i64 4, !5}
!10 = !{!11, !11, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS12GFixedType32ILi30EE", !6, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}


; 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"

%class.GFloat = type { i32 }
%class.GFixedType32 = type { i32 }
%class.GFixedType32.0 = 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK6GFloat11getexponentEv(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden i32 @_ZL10s_TriClampi6GFloat(i32 noundef, i32) local_unnamed_addr #2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden i32 @_ZL15s_NormalToRadus12GFixedType32ILi30EE(i32) local_unnamed_addr #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @_ZN6GFloat3CosES_(i32 %0) local_unnamed_addr #3 align 2 {
  %2 = alloca %class.GFloat, align 4
  %3 = alloca %class.GFixedType32, align 4
  %4 = alloca %class.GFixedType32, align 4
  %5 = alloca %class.GFixedType32, align 4
  %6 = alloca %class.GFixedType32, align 4
  %7 = alloca %class.GFixedType32, align 4
  %8 = alloca %class.GFixedType32, align 4
  %9 = alloca %class.GFixedType32.0, align 4
  %10 = alloca %class.GFixedType32.0, align 4
  %11 = alloca %class.GFixedType32.0, align 4
  %12 = alloca %class.GFixedType32.0, align 4
  %13 = alloca %class.GFixedType32.0, align 4
  %14 = alloca %class.GFixedType32.0, align 4
  %15 = alloca %class.GFixedType32.0, align 4
  %16 = alloca %class.GFixedType32.0, align 4
  store i32 %0, ptr %2, align 4
  %17 = call noundef i32 @_ZNK6GFloat11getexponentEv(ptr noundef nonnull align 4 dereferenceable(4) %2)
  %18 = add i32 %17, -191
  %or.cond = icmp ult i32 %18, -127
  br i1 %or.cond, label %19, label %21

19:                                               ; preds = %1
  %20 = call i32 @_ZN6GFloat3OneEv()
  br label %50

21:                                               ; preds = %1
  %22 = add nsw i32 %17, -127
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %.sroa.011.0.copyload = load i32, ptr %2, align 4, !tbaa !5
  %23 = call i32 @_ZL10s_TriClampi6GFloat(i32 noundef %22, i32 %.sroa.011.0.copyload)
  store i32 %23, ptr %3, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @_ZN12GFixedType32ILi30EEC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 0, i64 noundef 3, i64 noundef 4)
  %24 = icmp sgt i32 %23, 805306367
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br i1 %24, label %25, label %28

25:                                               ; preds = %21
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %6, i32 noundef 1, i64 noundef 0, i64 noundef 4)
  %26 = load i32, ptr %6, align 4
  %27 = call i32 @_ZNK12GFixedType32ILi30EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %26)
  store i32 %27, ptr %4, align 4, !tbaa !5
  br label %35

28:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef 0, i64 noundef 1, i64 noundef 4)
  %29 = icmp sgt i32 %23, 268435455
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br i1 %29, label %30, label %33

30:                                               ; preds = %28
  call void @_ZN12GFixedType32ILi30EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %8, i32 noundef 0, i64 noundef 2, i64 noundef 4)
  %31 = load i32, ptr %8, align 4
  %32 = call i32 @_ZNK12GFixedType32ILi30EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %3, i32 %31)
  store i32 %32, ptr %4, align 4, !tbaa !5
  br label %35

33:                                               ; preds = %28
  %34 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %34, ptr %4, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %30, %33, %25
  %.sroa.08.0.copyload = phi i32 [ %27, %25 ], [ %32, %30 ], [ %34, %33 ]
  %.0 = phi i1 [ false, %25 ], [ true, %30 ], [ false, %33 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #4
  %36 = call i32 @_ZL15s_NormalToRadus12GFixedType32ILi30EE(i32 %.sroa.08.0.copyload)
  store i32 %36, ptr %9, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #4
  %37 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %9, i32 %36)
  store i32 %37, ptr %10, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef 0, i64 noundef 999972, i64 noundef 1000000)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #4
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %14, i32 noundef 0, i64 noundef 499792, i64 noundef 1000000)
  %38 = call i32 @_ZNK12GFixedType32ILi29EEngEv(ptr noundef nonnull align 4 dereferenceable(4) %14)
  store i32 %38, ptr %13, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #4
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef 0, i64 noundef 413742, i64 noundef 10000000)
  call void @_ZN12GFixedType32ILi29EEC2Ejmm(ptr noundef nonnull align 4 dereferenceable(4) %16, i32 noundef 0, i64 noundef 124311, i64 noundef 100000000)
  %39 = load i32, ptr %16, align 4
  %40 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %39)
  %41 = call i32 @_ZNK12GFixedType32ILi29EEmiES0_(ptr noundef nonnull align 4 dereferenceable(4) %15, i32 %40)
  %42 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %41)
  %43 = call i32 @_ZNK12GFixedType32ILi29EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %13, i32 %42)
  %44 = call i32 @_ZNK12GFixedType32ILi29EEmlES0_(ptr noundef nonnull align 4 dereferenceable(4) %10, i32 %43)
  %45 = call i32 @_ZNK12GFixedType32ILi29EEplES0_(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 %44)
  store i32 %45, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  br i1 %.0, label %46, label %48

46:                                               ; preds = %35
  %47 = call i32 @_ZNK12GFixedType32ILi29EEngEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i32 %47, ptr %11, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %46, %35
  %49 = call i32 @_ZNK12GFixedType32ILi29EE8ToGFloatEv(ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %50

50:                                               ; preds = %48, %19
  %.sroa.015.0 = phi i32 [ %20, %19 ], [ %49, %48 ]
  ret i32 %.sroa.015.0
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i32 @_ZN6GFloat3OneEv() local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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"="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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass