; LLVM IR from jasonlmfong/Model-Modifier :: Model-Modifier/src/renderer/Camera.ll (ZN6Camera9changeFOVEf)

; 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.Camera = type { float, float, float, %"struct.glm::vec", %"struct.glm::vec", %"struct.glm::vec", %"struct.glm::vec", %"struct.glm::vec", %"struct.glm::mat", float }
%"struct.glm::vec" = type { %union.anon, %union.anon.0, %union.anon.1 }
%union.anon = type { float }
%union.anon.0 = type { float }
%union.anon.1 = type { float }
%"struct.glm::mat" = type { [4 x %"struct.glm::vec.2"] }
%"struct.glm::vec.2" = type { %union.anon.3, %union.anon.4, %union.anon.5, %union.anon.6 }
%union.anon.3 = type { float }
%union.anon.4 = type { float }
%union.anon.5 = type { float }
%union.anon.6 = type { float }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN6Camera9changeFOVEf(ptr noundef nonnull align 4 dereferenceable(140) %0, float noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %5 = load ptr, ptr %3, align 8
  %6 = load float, ptr %4, align 4, !tbaa !9
  %7 = getelementptr inbounds %class.Camera, ptr %5, i32 0, i32 9
  %8 = load float, ptr %7, align 4, !tbaa !11
  %9 = fneg float %6
  %10 = call float @llvm.fmuladd.f32(float %9, float 2.000000e+00, float %8)
  store float %10, ptr %7, align 4, !tbaa !11
  %11 = getelementptr inbounds %class.Camera, ptr %5, i32 0, i32 9
  %12 = load float, ptr %11, align 4, !tbaa !11
  %13 = fcmp olt float %12, 2.000000e+01
  br i1 %13, label %14, label %16

14:                                               ; preds = %2
  %15 = getelementptr inbounds %class.Camera, ptr %5, i32 0, i32 9
  store float 2.000000e+01, ptr %15, align 4, !tbaa !11
  br label %17

16:                                               ; preds = %2
  br label %17

17:                                               ; preds = %16, %14
  %18 = phi float [ 2.000000e+01, %14 ], [ 0.000000e+00, %16 ]
  %19 = getelementptr inbounds %class.Camera, ptr %5, i32 0, i32 9
  %20 = load float, ptr %19, align 4, !tbaa !11
  %21 = fcmp ogt float %20, 1.100000e+02
  br i1 %21, label %22, label %24

22:                                               ; preds = %17
  %23 = getelementptr inbounds %class.Camera, ptr %5, i32 0, i32 9
  store float 1.100000e+02, ptr %23, align 4, !tbaa !11
  br label %25

24:                                               ; preds = %17
  br label %25

25:                                               ; preds = %24, %22
  %26 = phi float [ 1.100000e+02, %22 ], [ 0.000000e+00, %24 ]
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 136}
!12 = !{!"_ZTS6Camera", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 12, !13, i64 24, !13, i64 36, !13, i64 48, !13, i64 60, !14, i64 72, !10, i64 136}
!13 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !7, i64 0, !7, i64 4, !7, i64 8}
!14 = !{!"_ZTSN3glm3matILi4ELi4EfLNS_9qualifierE0EEE", !7, i64 0}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN6Camera9changeFOVEf(ptr nocapture noundef nonnull align 4 dereferenceable(140) %0, float noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 136
  %4 = load float, ptr %3, align 4, !tbaa !5
  %5 = fneg float %1
  %6 = tail call float @llvm.fmuladd.f32(float %5, float 2.000000e+00, float %4)
  %7 = fcmp olt float %6, 2.000000e+01
  %storemerge = select i1 %7, float 2.000000e+01, float %6
  %8 = fcmp ogt float %storemerge, 1.100000e+02
  %storemerge2 = select i1 %8, float 1.100000e+02, float %storemerge
  store float %storemerge2, ptr %3, align 4, !tbaa !5
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #1

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

!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, !7, i64 136}
!6 = !{!"_ZTS6Camera", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12, !10, i64 24, !10, i64 36, !10, i64 48, !10, i64 60, !11, i64 72, !7, i64 136}
!7 = !{!"float", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN3glm3vecILi3EfLNS_9qualifierE0EEE", !8, i64 0, !8, i64 4, !8, i64 8}
!11 = !{!"_ZTSN3glm3matILi4ELi4EfLNS_9qualifierE0EEE", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass