; LLVM IR from Try/Tempest :: Engine/thirdparty/openal-soft/utils (openal-info)

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

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 1
  br i1 %10, label %11, label %28

11:                                               ; preds = %2
  %12 = load ptr, ptr %5, align 8, !tbaa !9
  %13 = getelementptr inbounds ptr, ptr %12, i64 1
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = call i32 @strcmp(ptr noundef %14, ptr noundef @.str) #5
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %23, label %17

17:                                               ; preds = %11
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %18, i64 1
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = call i32 @strcmp(ptr noundef %20, ptr noundef @.str.1) #5
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %28

23:                                               ; preds = %17, %11
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %26)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %103

28:                                               ; preds = %17, %2
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  %30 = call signext i8 @alcIsExtensionPresent(ptr noundef null, ptr noundef @.str.4)
  %31 = sext i8 %30 to i32
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %35

33:                                               ; preds = %28
  %34 = call ptr @alcGetString(ptr noundef null, i32 noundef 4115)
  call void @printDeviceList(ptr noundef %34)
  br label %37

35:                                               ; preds = %28
  %36 = call ptr @alcGetString(ptr noundef null, i32 noundef 4101)
  call void @printDeviceList(ptr noundef %36)
  br label %37

37:                                               ; preds = %35, %33
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %39 = call ptr @alcGetString(ptr noundef null, i32 noundef 784)
  call void @printDeviceList(ptr noundef %39)
  %40 = call signext i8 @alcIsExtensionPresent(ptr noundef null, ptr noundef @.str.4)
  %41 = sext i8 %40 to i32
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %37
  %44 = call ptr @alcGetString(ptr noundef null, i32 noundef 4114)
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %44)
  br label %49

46:                                               ; preds = %37
  %47 = call ptr @alcGetString(ptr noundef null, i32 noundef 4100)
  %48 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %47)
  br label %49

49:                                               ; preds = %46, %43
  %50 = call ptr @alcGetString(ptr noundef null, i32 noundef 785)
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %50)
  call void @printALCInfo(ptr noundef null)
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = icmp sgt i32 %52, 1
  br i1 %53, label %54, label %58

54:                                               ; preds = %49
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = getelementptr inbounds ptr, ptr %55, i64 1
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  br label %59

58:                                               ; preds = %49
  br label %59

59:                                               ; preds = %58, %54
  %60 = phi ptr [ %57, %54 ], [ null, %58 ]
  %61 = call ptr @alcOpenDevice(ptr noundef %60)
  store ptr %61, ptr %6, align 8, !tbaa !9
  %62 = load ptr, ptr %6, align 8, !tbaa !9
  %63 = icmp ne ptr %62, null
  br i1 %63, label %75, label %64

64:                                               ; preds = %59
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = icmp sgt i32 %65, 1
  br i1 %66, label %67, label %71

67:                                               ; preds = %64
  %68 = load ptr, ptr %5, align 8, !tbaa !9
  %69 = getelementptr inbounds ptr, ptr %68, i64 1
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  br label %72

71:                                               ; preds = %64
  br label %72

72:                                               ; preds = %71, %67
  %73 = phi ptr [ %70, %67 ], [ @.str.9, %71 ]
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %73)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %103

75:                                               ; preds = %59
  %76 = load ptr, ptr %6, align 8, !tbaa !9
  call void @printALCInfo(ptr noundef %76)
  %77 = load ptr, ptr %6, align 8, !tbaa !9
  call void @printHRTFInfo(ptr noundef %77)
  call void @printALC_SOFT_system_event()
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  %79 = call ptr @alcCreateContext(ptr noundef %78, ptr noundef null)
  store ptr %79, ptr %7, align 8, !tbaa !9
  %80 = load ptr, ptr %7, align 8, !tbaa !9
  %81 = icmp ne ptr %80, null
  br i1 %81, label %82, label %87

82:                                               ; preds = %75
  %83 = load ptr, ptr %7, align 8, !tbaa !9
  %84 = call signext i8 @alcMakeContextCurrent(ptr noundef %83)
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 0
  br i1 %86, label %87, label %96

87:                                               ; preds = %82, %75
  %88 = load ptr, ptr %7, align 8, !tbaa !9
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %92

90:                                               ; preds = %87
  %91 = load ptr, ptr %7, align 8, !tbaa !9
  call void @alcDestroyContext(ptr noundef %91)
  br label %92

92:                                               ; preds = %90, %87
  %93 = load ptr, ptr %6, align 8, !tbaa !9
  %94 = call signext i8 @alcCloseDevice(ptr noundef %93)
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %103

96:                                               ; preds = %82
  %97 = load ptr, ptr %6, align 8, !tbaa !9
  call void @printModeInfo(ptr noundef %97)
  call void @printALInfo()
  call void @printResamplerInfo()
  %98 = load ptr, ptr %6, align 8, !tbaa !9
  call void @printEFXInfo(ptr noundef %98)
  %99 = call signext i8 @alcMakeContextCurrent(ptr noundef null)
  %100 = load ptr, ptr %7, align 8, !tbaa !9
  call void @alcDestroyContext(ptr noundef %100)
  %101 = load ptr, ptr %6, align 8, !tbaa !9
  %102 = call signext i8 @alcCloseDevice(ptr noundef %101)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %103

103:                                              ; preds = %96, %92, %72, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %104 = load i32, ptr %3, align 4
  ret i32 %104
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #3

declare signext i8 @alcIsExtensionPresent(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @printDeviceList(ptr noundef) #0

declare ptr @alcGetString(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @printALCInfo(ptr noundef) #0

declare ptr @alcOpenDevice(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @printHRTFInfo(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @printALC_SOFT_system_event() #0

declare ptr @alcCreateContext(ptr noundef, ptr noundef) #3

declare signext i8 @alcMakeContextCurrent(ptr noundef) #3

declare void @alcDestroyContext(ptr noundef) #3

declare signext i8 @alcCloseDevice(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @printModeInfo(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @printALInfo() #0

; Function Attrs: nounwind uwtable
declare hidden void @printResamplerInfo() #0

; Function Attrs: nounwind uwtable
declare hidden void @printEFXInfo(ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { 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 willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind willreturn memory(read) "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 = { "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 }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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"

@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = icmp sgt i32 %0, 1
  br i1 %3, label %4, label %15

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str) #4
  %8 = icmp eq i32 %7, 0
  br i1 %8, label %12, label %9

9:                                                ; preds = %4
  %10 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %6, ptr noundef nonnull dereferenceable(1) @.str.1) #4
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %15

12:                                               ; preds = %9, %4
  %13 = load ptr, ptr %1, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %13)
  br label %47

15:                                               ; preds = %9, %2
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %17 = tail call signext i8 @alcIsExtensionPresent(ptr noundef null, ptr noundef nonnull @.str.4) #5
  %.not = icmp eq i8 %17, 0
  %. = select i1 %.not, i32 4101, i32 4115
  %18 = tail call ptr @alcGetString(ptr noundef null, i32 noundef %.) #5
  tail call void @printDeviceList(ptr noundef %18)
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %20 = tail call ptr @alcGetString(ptr noundef null, i32 noundef 784) #5
  tail call void @printDeviceList(ptr noundef %20)
  %21 = tail call signext i8 @alcIsExtensionPresent(ptr noundef null, ptr noundef nonnull @.str.4) #5
  %.not23 = icmp eq i8 %21, 0
  %.sink29 = select i1 %.not23, i32 4100, i32 4114
  %22 = tail call ptr @alcGetString(ptr noundef null, i32 noundef %.sink29) #5
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %22)
  %24 = tail call ptr @alcGetString(ptr noundef null, i32 noundef 785) #5
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %24)
  tail call void @printALCInfo(ptr noundef null)
  br i1 %3, label %26, label %.thread

26:                                               ; preds = %15
  %27 = getelementptr inbounds i8, ptr %1, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = tail call ptr @alcOpenDevice(ptr noundef %28) #5
  %.not24 = icmp eq ptr %29, null
  br i1 %.not24, label %31, label %35

.thread:                                          ; preds = %15
  %30 = tail call ptr @alcOpenDevice(ptr noundef null) #5
  %.not2426 = icmp eq ptr %30, null
  br i1 %.not2426, label %.thread27, label %35

31:                                               ; preds = %26
  %32 = load ptr, ptr %27, align 8, !tbaa !5
  br label %.thread27

.thread27:                                        ; preds = %.thread, %31
  %33 = phi ptr [ %32, %31 ], [ @.str.9, %.thread ]
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %33)
  br label %47

35:                                               ; preds = %.thread, %26
  %36 = phi ptr [ %30, %.thread ], [ %29, %26 ]
  tail call void @printALCInfo(ptr noundef nonnull %36)
  tail call void @printHRTFInfo(ptr noundef nonnull %36)
  tail call void @printALC_SOFT_system_event()
  %37 = tail call ptr @alcCreateContext(ptr noundef nonnull %36, ptr noundef null) #5
  %.not25 = icmp eq ptr %37, null
  br i1 %.not25, label %.critedge, label %38

38:                                               ; preds = %35
  %39 = tail call signext i8 @alcMakeContextCurrent(ptr noundef nonnull %37) #5
  %40 = icmp eq i8 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %38
  tail call void @alcDestroyContext(ptr noundef nonnull %37) #5
  br label %.critedge

.critedge:                                        ; preds = %35, %41
  %42 = tail call signext i8 @alcCloseDevice(ptr noundef nonnull %36) #5
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  br label %47

44:                                               ; preds = %38
  tail call void @printModeInfo(ptr noundef nonnull %36)
  tail call void @printALInfo()
  tail call void @printResamplerInfo()
  tail call void @printEFXInfo(ptr noundef nonnull %36)
  %45 = tail call signext i8 @alcMakeContextCurrent(ptr noundef null) #5
  tail call void @alcDestroyContext(ptr noundef nonnull %37) #5
  %46 = tail call signext i8 @alcCloseDevice(ptr noundef nonnull %36) #5
  br label %47

47:                                               ; preds = %44, %.critedge, %.thread27, %12
  %.0 = phi i32 [ 0, %12 ], [ 1, %.critedge ], [ 0, %44 ], [ 1, %.thread27 ]
  ret i32 %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

declare signext i8 @alcIsExtensionPresent(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @printDeviceList(ptr noundef) local_unnamed_addr #0

declare ptr @alcGetString(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @printALCInfo(ptr noundef) local_unnamed_addr #0

declare ptr @alcOpenDevice(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @printHRTFInfo(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @printALC_SOFT_system_event() local_unnamed_addr #0

declare ptr @alcCreateContext(ptr noundef, ptr noundef) local_unnamed_addr #3

declare signext i8 @alcMakeContextCurrent(ptr noundef) local_unnamed_addr #3

declare void @alcDestroyContext(ptr noundef) local_unnamed_addr #3

declare signext i8 @alcCloseDevice(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @printModeInfo(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @printALInfo() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @printResamplerInfo() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @printEFXInfo(ptr noundef) local_unnamed_addr #0

attributes #0 = { 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nofree 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 #3 = { "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 willreturn memory(read) }
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/C++ TBAA"}


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