; LLVM IR from Try/Tempest :: Engine/thirdparty/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.std::basic_string_view" = type { i64, ptr }

@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 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 hidden noundef ptr @_ZN12_GLOBAL__N_114GetConfigValueESt17basic_string_viewIcSt11char_traitsIcEES3_S3_(i64, ptr, i64, ptr, i64, ptr) #1

; 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) #2

; Function Attrs: nounwind
declare noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z18GetConfigValueBoolSt17basic_string_viewIcSt11char_traitsIcEES2_S2_b(i64 %0, ptr %1, i64 %2, ptr %3, i64 %4, ptr %5, i1 noundef zeroext %6) #1 {
  %8 = alloca i1, align 1
  %9 = alloca %"class.std::basic_string_view", align 8
  %10 = alloca %"class.std::basic_string_view", align 8
  %11 = alloca %"class.std::basic_string_view", align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca %"class.std::basic_string_view", align 8
  %15 = alloca %"class.std::basic_string_view", align 8
  %16 = alloca %"class.std::basic_string_view", align 8
  %17 = alloca i32, align 4
  %18 = getelementptr inbounds { i64, ptr }, ptr %9, i32 0, i32 0
  store i64 %0, ptr %18, align 8
  %19 = getelementptr inbounds { i64, ptr }, ptr %9, i32 0, i32 1
  store ptr %1, ptr %19, align 8
  %20 = getelementptr inbounds { i64, ptr }, ptr %10, i32 0, i32 0
  store i64 %2, ptr %20, align 8
  %21 = getelementptr inbounds { i64, ptr }, ptr %10, i32 0, i32 1
  store ptr %3, ptr %21, align 8
  %22 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 0
  store i64 %4, ptr %22, align 8
  %23 = getelementptr inbounds { i64, ptr }, ptr %11, i32 0, i32 1
  store ptr %5, ptr %23, align 8
  %24 = zext i1 %6 to i8
  store i8 %24, ptr %12, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !9
  %25 = getelementptr inbounds { i64, ptr }, ptr %14, i32 0, i32 0
  %26 = load i64, ptr %25, align 8
  %27 = getelementptr inbounds { i64, ptr }, ptr %14, i32 0, i32 1
  %28 = load ptr, ptr %27, align 8
  %29 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 0
  %30 = load i64, ptr %29, align 8
  %31 = getelementptr inbounds { i64, ptr }, ptr %15, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8
  %33 = getelementptr inbounds { i64, ptr }, ptr %16, i32 0, i32 0
  %34 = load i64, ptr %33, align 8
  %35 = getelementptr inbounds { i64, ptr }, ptr %16, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8
  %37 = call noundef ptr @_ZN12_GLOBAL__N_114GetConfigValueESt17basic_string_viewIcSt11char_traitsIcEES3_S3_(i64 %26, ptr %28, i64 %30, ptr %32, i64 %34, ptr %36)
  store ptr %37, ptr %13, align 8, !tbaa !12
  %38 = load ptr, ptr %13, align 8, !tbaa !12
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %58

40:                                               ; preds = %7
  %41 = load ptr, ptr %13, align 8, !tbaa !12
  %42 = call noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef %41, ptr noundef @.str.11) #5
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %56, label %44

44:                                               ; preds = %40
  %45 = load ptr, ptr %13, align 8, !tbaa !12
  %46 = call noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef %45, ptr noundef @.str.12) #5
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %56, label %48

48:                                               ; preds = %44
  %49 = load ptr, ptr %13, align 8, !tbaa !12
  %50 = call noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef %49, ptr noundef @.str.13) #5
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %56, label %52

52:                                               ; preds = %48
  %53 = load ptr, ptr %13, align 8, !tbaa !12
  %54 = call i32 @atoi(ptr noundef %53) #6
  %55 = icmp ne i32 %54, 0
  br label %56

56:                                               ; preds = %52, %48, %44, %40
  %57 = phi i1 [ true, %48 ], [ true, %44 ], [ true, %40 ], [ %55, %52 ]
  store i1 %57, ptr %8, align 1
  store i32 1, ptr %17, align 4
  br label %59

58:                                               ; preds = %7
  store i32 0, ptr %17, align 4
  br label %59

59:                                               ; preds = %58, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %60 = load i32, ptr %17, align 4
  switch i32 %60, label %66 [
    i32 0, label %61
    i32 1, label %64
  ]

61:                                               ; preds = %59
  %62 = load i8, ptr %12, align 1, !tbaa !5, !range !14, !noundef !15
  %63 = trunc i8 %62 to i1
  store i1 %63, ptr %8, align 1
  br label %64

64:                                               ; preds = %61, %59
  %65 = load i1, ptr %8, align 1
  ret i1 %65

66:                                               ; preds = %59
  unreachable
}

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint mustprogress nounwind willreturn memory(read) 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 }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 8, !10, i64 8, i64 8, !12}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, 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"

@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN12_GLOBAL__N_114GetConfigValueESt17basic_string_viewIcSt11char_traitsIcEES3_S3_(i64, ptr, i64, ptr, i64, ptr) local_unnamed_addr #0

; Function Attrs: nounwind
declare noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z18GetConfigValueBoolSt17basic_string_viewIcSt11char_traitsIcEES2_S2_b(i64 %0, ptr %1, i64 %2, ptr %3, i64 %4, ptr %5, i1 noundef zeroext %6) local_unnamed_addr #0 {
  %8 = tail call noundef ptr @_ZN12_GLOBAL__N_114GetConfigValueESt17basic_string_viewIcSt11char_traitsIcEES3_S3_(i64 %0, ptr %1, i64 %2, ptr %3, i64 %4, ptr %5)
  %.not.not = icmp eq ptr %8, null
  br i1 %.not.not, label %21, label %9

9:                                                ; preds = %7
  %10 = tail call noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef nonnull %8, ptr noundef nonnull @.str.11) #3
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %21, label %12

12:                                               ; preds = %9
  %13 = tail call noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef nonnull %8, ptr noundef nonnull @.str.12) #3
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %21, label %15

15:                                               ; preds = %12
  %16 = tail call noundef i32 @_ZN2al10strcasecmpEPKcS1_(ptr noundef nonnull %8, ptr noundef nonnull @.str.13) #3
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %21, label %18

18:                                               ; preds = %15
  %19 = tail call i32 @atoi(ptr nocapture noundef %8) #4
  %20 = icmp ne i32 %19, 0
  br label %21

21:                                               ; preds = %7, %9, %12, %15, %18
  %spec.select = phi i1 [ true, %15 ], [ true, %12 ], [ true, %9 ], [ %20, %18 ], [ %6, %7 ]
  ret i1 %spec.select
}

attributes #0 = { 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 #1 = { 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 nofree nounwind willreturn memory(read) 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 = { nounwind }
attributes #4 = { nounwind willreturn memory(read) }

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


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