; LLVM IR from kacperks/Fractal_Engine :: Engine/Thirdparty/cmake/Engine/Thirdparty/cmake/openal-soft/alc (alconfig)

; 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.al::optional.12" = type { %"struct.al::optional_storage.13" }
%"struct.al::optional_storage.13" = type { %"struct.al::optstore_helper.14" }
%"struct.al::optstore_helper.14" = type { %"struct.al::optstore_base.15" }
%"struct.al::optstore_base.15" = type { i8, %union.anon.16 }
%union.anon.16 = type { float }
%"struct.al::nullopt_t" = type { i8 }

@.str.17 = external hidden unnamed_addr constant [1 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: mustprogress uwtable
declare dso_local noundef ptr @_Z14GetConfigValuePKcS0_S0_S0_(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z16ConfigValueFloatPKcS0_S0_(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca %"class.al::optional.12", align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.al::nullopt_t", align 1
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = call noundef ptr @_Z14GetConfigValuePKcS0_S0_S0_(ptr noundef %12, ptr noundef %13, ptr noundef %14, ptr noundef @.str.17)
  store ptr %15, ptr %8, align 8, !tbaa !5
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 0
  %18 = load i8, ptr %17, align 1, !tbaa !9
  %19 = icmp ne i8 %18, 0
  br i1 %19, label %21, label %20

20:                                               ; preds = %3
  call void @_ZN2al8optionalIfEC2ENS_9nullopt_tE(ptr noundef nonnull align 4 dereferenceable(8) %4) #5
  store i32 1, ptr %10, align 4
  br label %28

21:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = call float @strtof(ptr noundef %22, ptr noundef null) #5
  store float %23, ptr %11, align 4, !tbaa !10
  %24 = call i64 @_ZN2al13make_optionalIfEENS_8optionalINSt5decayIT_E4typeEEEOS3_(ptr noundef nonnull align 4 dereferenceable(4) %11)
  %25 = getelementptr inbounds %"class.al::optional.12", ptr %4, i32 0, i32 0
  %26 = getelementptr inbounds %"struct.al::optional_storage.13", ptr %25, i32 0, i32 0
  %27 = getelementptr inbounds %"struct.al::optstore_helper.14", ptr %26, i32 0, i32 0
  store i64 %24, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  store i32 1, ptr %10, align 4
  br label %28

28:                                               ; preds = %21, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %29 = getelementptr inbounds %"class.al::optional.12", ptr %4, i32 0, i32 0
  %30 = getelementptr inbounds %"struct.al::optional_storage.13", ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds %"struct.al::optstore_helper.14", ptr %30, i32 0, i32 0
  %32 = load i64, ptr %31, align 4
  ret i64 %32
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2al8optionalIfEC2ENS_9nullopt_tE(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

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

; Function Attrs: nounwind
declare float @strtof(ptr noundef, ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !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"

%"class.al::optional.12" = type { %"struct.al::optional_storage.13" }
%"struct.al::optional_storage.13" = type { %"struct.al::optstore_helper.14" }
%"struct.al::optstore_helper.14" = type { %"struct.al::optstore_base.15" }
%"struct.al::optstore_base.15" = type { i8, %union.anon.16 }
%union.anon.16 = type { float }

@.str.17 = external hidden unnamed_addr constant [1 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: mustprogress uwtable
declare dso_local noundef ptr @_Z14GetConfigValuePKcS0_S0_S0_(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local i64 @_Z16ConfigValueFloatPKcS0_S0_(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca %"class.al::optional.12", align 8
  %5 = alloca float, align 4
  %6 = tail call noundef ptr @_Z14GetConfigValuePKcS0_S0_S0_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef nonnull @.str.17)
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %.not = icmp eq i8 %7, 0
  br i1 %.not, label %8, label %9

8:                                                ; preds = %3
  call void @_ZN2al8optionalIfEC2ENS_9nullopt_tE(ptr noundef nonnull align 4 dereferenceable(8) %4) #5
  %.pre = load i64, ptr %4, align 8
  br label %12

9:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %10 = tail call float @strtof(ptr nocapture noundef nonnull %6, ptr noundef null) #5
  store float %10, ptr %5, align 4, !tbaa !8
  %11 = call i64 @_ZN2al13make_optionalIfEENS_8optionalINSt5decayIT_E4typeEEEOS3_(ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  br label %12

12:                                               ; preds = %9, %8
  %13 = phi i64 [ %11, %9 ], [ %.pre, %8 ]
  ret i64 %13
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN2al8optionalIfEC2ENS_9nullopt_tE(ptr noundef nonnull align 4 dereferenceable(8)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local i64 @_ZN2al13make_optionalIfEENS_8optionalINSt5decayIT_E4typeEEEOS3_(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn
declare float @strtof(ptr noundef readonly, ptr nocapture noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 nofree nounwind willreturn "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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !6, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,TailCallElimPass