; LLVM IR from vertver/Fresponze-old :: modules/opus/tests (test_opus_projection)

; 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 [97 x i8], align 1
@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 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: inlinehint nounwind uwtable
declare hidden ptr @opus_alloc(i64 noundef) #1

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @_test_failed(ptr noundef, i32 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @opus_free(ptr noundef) #1

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

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

declare void @opus_projection_encoder_destroy(ptr noundef) #3

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

declare void @opus_projection_decoder_destroy(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
declare dso_local void @generate_music(ptr noundef, i32 noundef, i32 noundef) #5

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local void @test_encode_decode(i32 noundef %0, i32 noundef %1, i32 noundef %2) #5 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca [32768 x i8], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 48000, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 2049, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 32768, ptr %16) #8
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 32768, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  store ptr null, ptr %20, align 8, !tbaa !9
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = mul i64 1920, %22
  %24 = call noalias ptr @malloc(i64 noundef %23) #9
  store ptr %24, ptr %14, align 8, !tbaa !9
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = mul i64 1920, %26
  %28 = call noalias ptr @malloc(i64 noundef %27) #9
  store ptr %28, ptr %15, align 8, !tbaa !9
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = call ptr @opus_projection_ambisonics_encoder_create(i32 noundef 48000, i32 noundef %29, i32 noundef %30, ptr noundef %11, ptr noundef %12, i32 noundef 2049, ptr noundef %13)
  store ptr %31, ptr %9, align 8, !tbaa !9
  %32 = load i32, ptr %13, align 4, !tbaa !5
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %41

34:                                               ; preds = %3
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.4, i32 noundef %36, i32 noundef %37) #8
  %39 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %39) #8
  %40 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %40) #8
  call void @_test_failed(ptr noundef @.str, i32 noundef 315) #10
  unreachable

41:                                               ; preds = %3
  %42 = load ptr, ptr %9, align 8, !tbaa !9
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = mul nsw i32 %43, 1000
  %45 = load i32, ptr %11, align 4, !tbaa !5
  %46 = load i32, ptr %12, align 4, !tbaa !5
  %47 = add nsw i32 %45, %46
  %48 = mul nsw i32 %44, %47
  %49 = icmp eq i32 %48, 0
  %50 = zext i1 %49 to i32
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = mul nsw i32 %51, 1000
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = load i32, ptr %12, align 4, !tbaa !5
  %55 = add nsw i32 %53, %54
  %56 = mul nsw i32 %52, %55
  %57 = call i32 (ptr, i32, ...) @opus_projection_encoder_ctl(ptr noundef %42, i32 noundef 4002, i32 noundef %56)
  store i32 %57, ptr %13, align 4, !tbaa !5
  %58 = load i32, ptr %13, align 4, !tbaa !5
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %61

60:                                               ; preds = %41
  br label %126

61:                                               ; preds = %41
  %62 = load ptr, ptr %9, align 8, !tbaa !9
  %63 = call i32 (ptr, i32, ...) @opus_projection_encoder_ctl(ptr noundef %62, i32 noundef 6003, ptr noundef %19)
  store i32 %63, ptr %13, align 4, !tbaa !5
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %69, label %66

66:                                               ; preds = %61
  %67 = load i32, ptr %19, align 4, !tbaa !5
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %66, %61
  br label %126

70:                                               ; preds = %66
  %71 = load i32, ptr %19, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = call ptr @opus_alloc(i64 noundef %72)
  store ptr %73, ptr %20, align 8, !tbaa !9
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = load ptr, ptr %20, align 8, !tbaa !9
  %76 = load i32, ptr %19, align 4, !tbaa !5
  %77 = call i32 (ptr, i32, ...) @opus_projection_encoder_ctl(ptr noundef %74, i32 noundef 6005, ptr noundef %75, i32 noundef %76)
  store i32 %77, ptr %13, align 4, !tbaa !5
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = load i32, ptr %11, align 4, !tbaa !5
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = load ptr, ptr %20, align 8, !tbaa !9
  %82 = load i32, ptr %19, align 4, !tbaa !5
  %83 = call ptr @opus_projection_decoder_create(i32 noundef 48000, i32 noundef %78, i32 noundef %79, i32 noundef %80, ptr noundef %81, i32 noundef %82, ptr noundef %13)
  store ptr %83, ptr %10, align 8, !tbaa !9
  %84 = load ptr, ptr %20, align 8, !tbaa !9
  call void @opus_free(ptr noundef %84)
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %93

87:                                               ; preds = %70
  %88 = load ptr, ptr @stderr, align 8, !tbaa !9
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef @.str.5, i32 noundef %89, i32 noundef %90, i32 noundef %91) #8
  br label %126

93:                                               ; preds = %70
  %94 = load ptr, ptr %14, align 8, !tbaa !9
  %95 = load i32, ptr %5, align 4, !tbaa !5
  call void @generate_music(ptr noundef %94, i32 noundef 960, i32 noundef %95)
  %96 = load ptr, ptr %9, align 8, !tbaa !9
  %97 = load ptr, ptr %14, align 8, !tbaa !9
  %98 = getelementptr inbounds [32768 x i8], ptr %16, i64 0, i64 0
  %99 = call i32 @opus_projection_encode(ptr noundef %96, ptr noundef %97, i32 noundef 960, ptr noundef %98, i32 noundef 32768)
  store i32 %99, ptr %17, align 4, !tbaa !5
  %100 = load i32, ptr %17, align 4, !tbaa !5
  %101 = icmp slt i32 %100, 0
  br i1 %101, label %105, label %102

102:                                              ; preds = %93
  %103 = load i32, ptr %17, align 4, !tbaa !5
  %104 = icmp sgt i32 %103, 32768
  br i1 %104, label %105, label %109

105:                                              ; preds = %102, %93
  %106 = load ptr, ptr @stderr, align 8, !tbaa !9
  %107 = load i32, ptr %17, align 4, !tbaa !5
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.6, i32 noundef %107) #8
  br label %126

109:                                              ; preds = %102
  %110 = load ptr, ptr %10, align 8, !tbaa !9
  %111 = getelementptr inbounds [32768 x i8], ptr %16, i64 0, i64 0
  %112 = load i32, ptr %17, align 4, !tbaa !5
  %113 = load ptr, ptr %15, align 8, !tbaa !9
  %114 = call i32 @opus_projection_decode(ptr noundef %110, ptr noundef %111, i32 noundef %112, ptr noundef %113, i32 noundef 5760, i32 noundef 0)
  store i32 %114, ptr %18, align 4, !tbaa !5
  %115 = load i32, ptr %18, align 4, !tbaa !5
  %116 = icmp ne i32 %115, 960
  br i1 %116, label %117, label %121

117:                                              ; preds = %109
  %118 = load ptr, ptr @stderr, align 8, !tbaa !9
  %119 = load i32, ptr %18, align 4, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.7, i32 noundef %119) #8
  br label %126

121:                                              ; preds = %109
  %122 = load ptr, ptr %10, align 8, !tbaa !9
  call void @opus_projection_decoder_destroy(ptr noundef %122)
  %123 = load ptr, ptr %9, align 8, !tbaa !9
  call void @opus_projection_encoder_destroy(ptr noundef %123)
  %124 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %124) #8
  %125 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %125) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 32768, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  ret void

126:                                              ; preds = %117, %105, %87, %69, %60
  %127 = load ptr, ptr %14, align 8, !tbaa !9
  call void @free(ptr noundef %127) #8
  %128 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %128) #8
  call void @_test_failed(ptr noundef @.str, i32 noundef 371) #10
  unreachable
}

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { inlinehint noreturn 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 = { "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 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 #6 = { nounwind allocsize(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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { noreturn }

!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 [97 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [27 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: inlinehint nounwind uwtable
declare hidden ptr @opus_alloc(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @_test_failed(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @opus_free(ptr noundef) local_unnamed_addr #1

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

declare i32 @opus_projection_encoder_ctl(ptr noundef, i32 noundef, ...) local_unnamed_addr #3

declare void @opus_projection_encoder_destroy(ptr noundef) local_unnamed_addr #3

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

declare void @opus_projection_decoder_destroy(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @generate_music(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
define dso_local void @test_encode_decode(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #5 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [32768 x i8], align 16
  %8 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.start.p0(i64 32768, ptr nonnull %7) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32768) %7, i8 0, i64 32768, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #9
  store i32 0, ptr %8, align 4, !tbaa !5
  %9 = sext i32 %1 to i64
  %10 = mul nsw i64 %9, 1920
  %11 = tail call noalias ptr @malloc(i64 noundef %10) #10
  %12 = tail call noalias ptr @malloc(i64 noundef %10) #10
  %13 = call ptr @opus_projection_ambisonics_encoder_create(i32 noundef 48000, i32 noundef %1, i32 noundef %2, ptr noundef nonnull %4, ptr noundef nonnull %5, i32 noundef 2049, ptr noundef nonnull %6) #9
  %14 = load i32, ptr %6, align 4, !tbaa !5
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %18, label %15

15:                                               ; preds = %3
  %16 = load ptr, ptr @stderr, align 8, !tbaa !9
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.4, i32 noundef %1, i32 noundef %2) #11
  call void @free(ptr noundef %11) #9
  call void @free(ptr noundef %12) #9
  call void @_test_failed(ptr noundef nonnull @.str, i32 noundef 315) #12
  unreachable

18:                                               ; preds = %3
  %19 = mul nsw i32 %0, 1000
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = add nsw i32 %21, %20
  %23 = mul nsw i32 %19, %22
  %24 = call i32 (ptr, i32, ...) @opus_projection_encoder_ctl(ptr noundef %13, i32 noundef 4002, i32 noundef %23) #9
  store i32 %24, ptr %6, align 4, !tbaa !5
  %.not40 = icmp eq i32 %24, 0
  br i1 %.not40, label %25, label %56

25:                                               ; preds = %18
  %26 = call i32 (ptr, i32, ...) @opus_projection_encoder_ctl(ptr noundef %13, i32 noundef 6003, ptr noundef nonnull %8) #9
  store i32 %26, ptr %6, align 4, !tbaa !5
  %27 = icmp eq i32 %26, 0
  %28 = load i32, ptr %8, align 4
  %29 = icmp ne i32 %28, 0
  %or.cond = select i1 %27, i1 %29, i1 false
  br i1 %or.cond, label %30, label %56

30:                                               ; preds = %25
  %31 = sext i32 %28 to i64
  %32 = call ptr @opus_alloc(i64 noundef %31)
  %33 = load i32, ptr %8, align 4, !tbaa !5
  %34 = call i32 (ptr, i32, ...) @opus_projection_encoder_ctl(ptr noundef %13, i32 noundef 6005, ptr noundef %32, i32 noundef %33) #9
  store i32 %34, ptr %6, align 4, !tbaa !5
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = load i32, ptr %8, align 4, !tbaa !5
  %38 = call ptr @opus_projection_decoder_create(i32 noundef 48000, i32 noundef %1, i32 noundef %35, i32 noundef %36, ptr noundef %32, i32 noundef %37, ptr noundef nonnull %6) #9
  call void @opus_free(ptr noundef %32)
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %.not41 = icmp eq i32 %39, 0
  br i1 %.not41, label %45, label %40

40:                                               ; preds = %30
  %41 = load ptr, ptr @stderr, align 8, !tbaa !9
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str.5, i32 noundef %1, i32 noundef %42, i32 noundef %43) #11
  br label %56

45:                                               ; preds = %30
  call void @generate_music(ptr noundef %11, i32 noundef 960, i32 noundef %1)
  %46 = call i32 @opus_projection_encode(ptr noundef %13, ptr noundef %11, i32 noundef 960, ptr noundef nonnull %7, i32 noundef 32768) #9
  %or.cond3 = icmp ugt i32 %46, 32768
  br i1 %or.cond3, label %47, label %50

47:                                               ; preds = %45
  %48 = load ptr, ptr @stderr, align 8, !tbaa !9
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.6, i32 noundef %46) #11
  br label %56

50:                                               ; preds = %45
  %51 = call i32 @opus_projection_decode(ptr noundef %38, ptr noundef nonnull %7, i32 noundef %46, ptr noundef %12, i32 noundef 5760, i32 noundef 0) #9
  %.not42 = icmp eq i32 %51, 960
  br i1 %.not42, label %55, label %52

52:                                               ; preds = %50
  %53 = load ptr, ptr @stderr, align 8, !tbaa !9
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.7, i32 noundef %51) #11
  br label %56

55:                                               ; preds = %50
  call void @opus_projection_decoder_destroy(ptr noundef %38) #9
  call void @opus_projection_encoder_destroy(ptr noundef %13) #9
  call void @free(ptr noundef %11) #9
  call void @free(ptr noundef %12) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 32768, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  ret void

56:                                               ; preds = %25, %18, %52, %47, %40
  call void @free(ptr noundef %11) #9
  call void @free(ptr noundef %12) #9
  call void @_test_failed(ptr noundef nonnull @.str, i32 noundef 371) #12
  unreachable
}

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { inlinehint noreturn 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 = { "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 = { 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 #5 = { 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 #6 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { cold nounwind }
attributes #12 = { noreturn }

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


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