; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/flac-src/src/test_libFLAC (decoders)

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

@FLAC_API_SUPPORTS_OGG_FLAC = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @test_decoders() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %4

4:                                                ; preds = %40, %0
  br label %5

5:                                                ; preds = %4
  call void @init_metadata_blocks_()
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = call i32 @generate_file_(i32 noundef %6)
  %8 = icmp ne i32 %7, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %42

10:                                               ; preds = %5
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = call i32 @test_stream_decoder(i32 noundef 0, i32 noundef %11)
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %42

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = call i32 @test_stream_decoder(i32 noundef 1, i32 noundef %16)
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %42

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = call i32 @test_stream_decoder(i32 noundef 2, i32 noundef %21)
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %42

25:                                               ; preds = %20
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = call i32 @test_stream_decoder(i32 noundef 3, i32 noundef %26)
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %42

30:                                               ; preds = %25
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = call ptr @flacfilename(i32 noundef %31)
  %33 = call i32 @grabbag__file_remove_file(ptr noundef %32)
  call void @free_metadata_blocks_()
  %34 = load i32, ptr @FLAC_API_SUPPORTS_OGG_FLAC, align 4, !tbaa !5
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %30
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36, %30
  br label %41

40:                                               ; preds = %36
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %4

41:                                               ; preds = %39
  store i32 1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %42

42:                                               ; preds = %41, %29, %24, %19, %14, %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  %43 = load i32, ptr %1, align 4
  ret i32 %43
}

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @generate_file_(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden i32 @test_stream_decoder(i32 noundef, i32 noundef) #0

declare i32 @grabbag__file_remove_file(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @flacfilename(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @free_metadata_blocks_() #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 = { "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 }

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


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

@FLAC_API_SUPPORTS_OGG_FLAC = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @test_decoders() local_unnamed_addr #0 {
.peel.begin:
  tail call void @init_metadata_blocks_()
  %0 = tail call i32 @generate_file_(i32 noundef 0)
  %.not.peel = icmp eq i32 %0, 0
  br i1 %.not.peel, label %.loopexit, label %1

1:                                                ; preds = %.peel.begin
  %2 = tail call i32 @test_stream_decoder(i32 noundef 0, i32 noundef 0)
  %.not10.peel = icmp eq i32 %2, 0
  br i1 %.not10.peel, label %.loopexit, label %3

3:                                                ; preds = %1
  %4 = tail call i32 @test_stream_decoder(i32 noundef 1, i32 noundef 0)
  %.not11.peel = icmp eq i32 %4, 0
  br i1 %.not11.peel, label %.loopexit, label %5

5:                                                ; preds = %3
  %6 = tail call i32 @test_stream_decoder(i32 noundef 2, i32 noundef 0)
  %.not12.peel = icmp eq i32 %6, 0
  br i1 %.not12.peel, label %.loopexit, label %7

7:                                                ; preds = %5
  %8 = tail call i32 @test_stream_decoder(i32 noundef 3, i32 noundef 0)
  %.not13.peel = icmp eq i32 %8, 0
  br i1 %.not13.peel, label %.loopexit, label %9

9:                                                ; preds = %7
  %10 = tail call ptr @flacfilename(i32 noundef 0)
  %11 = tail call i32 @grabbag__file_remove_file(ptr noundef %10) #2
  tail call void @free_metadata_blocks_()
  %12 = load i32, ptr @FLAC_API_SUPPORTS_OGG_FLAC, align 4, !tbaa !5
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %.loopexit, label %.peel.next

.peel.next:                                       ; preds = %9
  tail call void @init_metadata_blocks_()
  %14 = tail call i32 @generate_file_(i32 noundef 1)
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %.loopexit, label %15

15:                                               ; preds = %.peel.next
  %16 = tail call i32 @test_stream_decoder(i32 noundef 0, i32 noundef 1)
  %.not10 = icmp eq i32 %16, 0
  br i1 %.not10, label %.loopexit, label %17

17:                                               ; preds = %15
  %18 = tail call i32 @test_stream_decoder(i32 noundef 1, i32 noundef 1)
  %.not11 = icmp eq i32 %18, 0
  br i1 %.not11, label %.loopexit, label %19

19:                                               ; preds = %17
  %20 = tail call i32 @test_stream_decoder(i32 noundef 2, i32 noundef 1)
  %.not12 = icmp eq i32 %20, 0
  br i1 %.not12, label %.loopexit, label %21

21:                                               ; preds = %19
  %22 = tail call i32 @test_stream_decoder(i32 noundef 3, i32 noundef 1)
  %.not13 = icmp eq i32 %22, 0
  br i1 %.not13, label %.loopexit, label %23

23:                                               ; preds = %21
  %24 = tail call ptr @flacfilename(i32 noundef 1)
  %25 = tail call i32 @grabbag__file_remove_file(ptr noundef %24) #2
  tail call void @free_metadata_blocks_()
  br label %.loopexit

.loopexit:                                        ; preds = %21, %19, %17, %15, %.peel.next, %23, %9, %7, %5, %3, %1, %.peel.begin
  %.09 = phi i32 [ 0, %.peel.begin ], [ 0, %1 ], [ 0, %3 ], [ 0, %5 ], [ 0, %7 ], [ 1, %9 ], [ 1, %23 ], [ 0, %21 ], [ 0, %19 ], [ 0, %17 ], [ 0, %15 ], [ 0, %.peel.next ]
  ret i32 %.09
}

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

; Function Attrs: nounwind uwtable
declare hidden i32 @generate_file_(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @test_stream_decoder(i32 noundef, i32 noundef) local_unnamed_addr #0

declare i32 @grabbag__file_remove_file(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @free_metadata_blocks_() 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 = { "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopFullUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass