; LLVM IR from VTIvanov20/eight-ball-pool :: src/game_manager.ll (ZN11GameManager9IsAudioOnEv)

; 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.GameManager::GameState" = type { i8, i8, i8, float, i32, i32 }

@_ZN11GameManager5stateE = external dso_local global %"struct.GameManager::GameState", align 4

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZN11GameManager9IsAudioOnEv() #0 {
  %1 = alloca i1, align 1
  %2 = load i8, ptr getelementptr inbounds (%"struct.GameManager::GameState", ptr @_ZN11GameManager5stateE, i32 0, i32 2), align 2, !tbaa !5, !range !13, !noundef !14
  %3 = trunc i8 %2 to i1
  br i1 %3, label %4, label %5

4:                                                ; preds = %0
  store i1 false, ptr %1, align 1
  br label %10

5:                                                ; preds = %0
  %6 = load float, ptr getelementptr inbounds (%"struct.GameManager::GameState", ptr @_ZN11GameManager5stateE, i32 0, i32 3), align 4, !tbaa !15
  %7 = fcmp ogt float %6, 0.000000e+00
  br i1 %7, label %8, label %9

8:                                                ; preds = %5
  store i1 true, ptr %1, align 1
  br label %10

9:                                                ; preds = %5
  store i1 false, ptr %1, align 1
  br label %10

10:                                               ; preds = %9, %8, %4
  %11 = load i1, ptr %1, align 1
  ret i1 %11
}

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

!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 2}
!6 = !{!"_ZTSN11GameManager9GameStateE", !7, i64 0, !7, i64 1, !7, i64 2, !10, i64 4, !11, i64 8, !12, i64 12}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"_ZTSN11GameManager5SceneE", !8, i64 0}
!12 = !{!"_ZTSN11GameManager4TurnE", !8, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !10, i64 4}


; 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.GameManager::GameState" = type { i8, i8, i8, float, i32, i32 }

@_ZN11GameManager5stateE = external dso_local local_unnamed_addr global %"struct.GameManager::GameState", align 4

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local noundef zeroext i1 @_ZN11GameManager9IsAudioOnEv() local_unnamed_addr #0 {
  %1 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN11GameManager5stateE, i64 2), align 2, !tbaa !5, !range !13, !noundef !14
  %2 = trunc nuw i8 %1 to i1
  %3 = load float, ptr getelementptr inbounds (i8, ptr @_ZN11GameManager5stateE, i64 4), align 4
  %4 = fcmp ogt float %3, 0.000000e+00
  %not. = xor i1 %2, true
  %.0 = select i1 %not., i1 %4, i1 false
  ret i1 %.0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) 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" }

!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 2}
!6 = !{!"_ZTSN11GameManager9GameStateE", !7, i64 0, !7, i64 1, !7, i64 2, !10, i64 4, !11, i64 8, !12, i64 12}
!7 = !{!"bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"_ZTSN11GameManager5SceneE", !8, i64 0}
!12 = !{!"_ZTSN11GameManager4TurnE", !8, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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