; LLVM IR from vertver/Fresponze-old :: modules/opus/doc (trivial_example)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [45 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 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 ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca [1920 x i16], align 16
  %11 = alloca [11520 x i16], align 16
  %12 = alloca [3828 x i8], align 16
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca [23040 x i8], align 16
  %20 = 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) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 3840, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 23040, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 3828, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 3
  br i1 %22, label %23, label %28

23:                                               ; preds = %2
  %24 = load ptr, ptr @stderr, align 8, !tbaa !9
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str) #5
  %26 = load ptr, ptr @stderr, align 8, !tbaa !9
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.1) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %197

28:                                               ; preds = %2
  %29 = call ptr @opus_encoder_create(i32 noundef 48000, i32 noundef 2, i32 noundef 2049, ptr noundef %16)
  store ptr %29, ptr %14, align 8, !tbaa !9
  %30 = load i32, ptr %16, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 0
  br i1 %31, label %32, label %37

32:                                               ; preds = %28
  %33 = load ptr, ptr @stderr, align 8, !tbaa !9
  %34 = load i32, ptr %16, align 4, !tbaa !5
  %35 = call ptr @opus_strerror(i32 noundef %34)
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.2, ptr noundef %35) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %197

37:                                               ; preds = %28
  %38 = load ptr, ptr %14, align 8, !tbaa !9
  %39 = call i32 (ptr, i32, ...) @opus_encoder_ctl(ptr noundef %38, i32 noundef 4002, i32 noundef 64000)
  store i32 %39, ptr %16, align 4, !tbaa !5
  %40 = load i32, ptr %16, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 0
  br i1 %41, label %42, label %47

42:                                               ; preds = %37
  %43 = load ptr, ptr @stderr, align 8, !tbaa !9
  %44 = load i32, ptr %16, align 4, !tbaa !5
  %45 = call ptr @opus_strerror(i32 noundef %44)
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.3, ptr noundef %45) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %197

47:                                               ; preds = %37
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = getelementptr inbounds ptr, ptr %48, i64 1
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  store ptr %50, ptr %6, align 8, !tbaa !9
  %51 = load ptr, ptr %6, align 8, !tbaa !9
  %52 = call noalias ptr @fopen(ptr noundef %51, ptr noundef @.str.4)
  store ptr %52, ptr %7, align 8, !tbaa !9
  %53 = load ptr, ptr %7, align 8, !tbaa !9
  %54 = icmp eq ptr %53, null
  br i1 %54, label %55, label %61

55:                                               ; preds = %47
  %56 = load ptr, ptr @stderr, align 8, !tbaa !9
  %57 = call ptr @__errno_location() #6
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = call ptr @strerror(i32 noundef %58) #5
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.5, ptr noundef %59) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %197

61:                                               ; preds = %47
  %62 = call ptr @opus_decoder_create(i32 noundef 48000, i32 noundef 2, ptr noundef %16)
  store ptr %62, ptr %15, align 8, !tbaa !9
  %63 = load i32, ptr %16, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 0
  br i1 %64, label %65, label %70

65:                                               ; preds = %61
  %66 = load ptr, ptr @stderr, align 8, !tbaa !9
  %67 = load i32, ptr %16, align 4, !tbaa !5
  %68 = call ptr @opus_strerror(i32 noundef %67)
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef @.str.6, ptr noundef %68) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %197

70:                                               ; preds = %61
  %71 = load ptr, ptr %5, align 8, !tbaa !9
  %72 = getelementptr inbounds ptr, ptr %71, i64 2
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  store ptr %73, ptr %8, align 8, !tbaa !9
  %74 = load ptr, ptr %8, align 8, !tbaa !9
  %75 = call noalias ptr @fopen(ptr noundef %74, ptr noundef @.str.7)
  store ptr %75, ptr %9, align 8, !tbaa !9
  %76 = load ptr, ptr %9, align 8, !tbaa !9
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %84

78:                                               ; preds = %70
  %79 = load ptr, ptr @stderr, align 8, !tbaa !9
  %80 = call ptr @__errno_location() #6
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = call ptr @strerror(i32 noundef %81) #5
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.8, ptr noundef %82) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %197

84:                                               ; preds = %70
  br label %85

85:                                               ; preds = %189, %84
  br label %86

86:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 23040, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %87 = getelementptr inbounds [23040 x i8], ptr %19, i64 0, i64 0
  %88 = load ptr, ptr %7, align 8, !tbaa !9
  %89 = call i64 @fread(ptr noundef %87, i64 noundef 4, i64 noundef 960, ptr noundef %88)
  %90 = load ptr, ptr %7, align 8, !tbaa !9
  %91 = call i32 @feof(ptr noundef %90) #5
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %94

93:                                               ; preds = %86
  store i32 3, ptr %17, align 4
  br label %187

94:                                               ; preds = %86
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %118, %94
  %96 = load i32, ptr %18, align 4, !tbaa !5
  %97 = icmp slt i32 %96, 1920
  br i1 %97, label %98, label %121

98:                                               ; preds = %95
  %99 = load i32, ptr %18, align 4, !tbaa !5
  %100 = mul nsw i32 2, %99
  %101 = add nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [23040 x i8], ptr %19, i64 0, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !11
  %105 = zext i8 %104 to i32
  %106 = shl i32 %105, 8
  %107 = load i32, ptr %18, align 4, !tbaa !5
  %108 = mul nsw i32 2, %107
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [23040 x i8], ptr %19, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !11
  %112 = zext i8 %111 to i32
  %113 = or i32 %106, %112
  %114 = trunc i32 %113 to i16
  %115 = load i32, ptr %18, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [1920 x i16], ptr %10, i64 0, i64 %116
  store i16 %114, ptr %117, align 2, !tbaa !12
  br label %118

118:                                              ; preds = %98
  %119 = load i32, ptr %18, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %18, align 4, !tbaa !5
  br label %95, !llvm.loop !14

121:                                              ; preds = %95
  %122 = load ptr, ptr %14, align 8, !tbaa !9
  %123 = getelementptr inbounds [1920 x i16], ptr %10, i64 0, i64 0
  %124 = getelementptr inbounds [3828 x i8], ptr %12, i64 0, i64 0
  %125 = call i32 @opus_encode(ptr noundef %122, ptr noundef %123, i32 noundef 960, ptr noundef %124, i32 noundef 3828)
  store i32 %125, ptr %13, align 4, !tbaa !5
  %126 = load i32, ptr %13, align 4, !tbaa !5
  %127 = icmp slt i32 %126, 0
  br i1 %127, label %128, label %133

128:                                              ; preds = %121
  %129 = load ptr, ptr @stderr, align 8, !tbaa !9
  %130 = load i32, ptr %13, align 4, !tbaa !5
  %131 = call ptr @opus_strerror(i32 noundef %130)
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.9, ptr noundef %131) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %187

133:                                              ; preds = %121
  %134 = load ptr, ptr %15, align 8, !tbaa !9
  %135 = getelementptr inbounds [3828 x i8], ptr %12, i64 0, i64 0
  %136 = load i32, ptr %13, align 4, !tbaa !5
  %137 = getelementptr inbounds [11520 x i16], ptr %11, i64 0, i64 0
  %138 = call i32 @opus_decode(ptr noundef %134, ptr noundef %135, i32 noundef %136, ptr noundef %137, i32 noundef 5760, i32 noundef 0)
  store i32 %138, ptr %20, align 4, !tbaa !5
  %139 = load i32, ptr %20, align 4, !tbaa !5
  %140 = icmp slt i32 %139, 0
  br i1 %140, label %141, label %146

141:                                              ; preds = %133
  %142 = load ptr, ptr @stderr, align 8, !tbaa !9
  %143 = load i32, ptr %20, align 4, !tbaa !5
  %144 = call ptr @opus_strerror(i32 noundef %143)
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef @.str.10, ptr noundef %144) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %187

146:                                              ; preds = %133
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %177, %146
  %148 = load i32, ptr %18, align 4, !tbaa !5
  %149 = load i32, ptr %20, align 4, !tbaa !5
  %150 = mul nsw i32 2, %149
  %151 = icmp slt i32 %148, %150
  br i1 %151, label %152, label %180

152:                                              ; preds = %147
  %153 = load i32, ptr %18, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [11520 x i16], ptr %11, i64 0, i64 %154
  %156 = load i16, ptr %155, align 2, !tbaa !12
  %157 = sext i16 %156 to i32
  %158 = and i32 %157, 255
  %159 = trunc i32 %158 to i8
  %160 = load i32, ptr %18, align 4, !tbaa !5
  %161 = mul nsw i32 2, %160
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [23040 x i8], ptr %19, i64 0, i64 %162
  store i8 %159, ptr %163, align 1, !tbaa !11
  %164 = load i32, ptr %18, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [11520 x i16], ptr %11, i64 0, i64 %165
  %167 = load i16, ptr %166, align 2, !tbaa !12
  %168 = sext i16 %167 to i32
  %169 = ashr i32 %168, 8
  %170 = and i32 %169, 255
  %171 = trunc i32 %170 to i8
  %172 = load i32, ptr %18, align 4, !tbaa !5
  %173 = mul nsw i32 2, %172
  %174 = add nsw i32 %173, 1
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [23040 x i8], ptr %19, i64 0, i64 %175
  store i8 %171, ptr %176, align 1, !tbaa !11
  br label %177

177:                                              ; preds = %152
  %178 = load i32, ptr %18, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %18, align 4, !tbaa !5
  br label %147, !llvm.loop !16

180:                                              ; preds = %147
  %181 = getelementptr inbounds [23040 x i8], ptr %19, i64 0, i64 0
  %182 = load i32, ptr %20, align 4, !tbaa !5
  %183 = mul nsw i32 %182, 2
  %184 = sext i32 %183 to i64
  %185 = load ptr, ptr %9, align 8, !tbaa !9
  %186 = call i64 @fwrite(ptr noundef %181, i64 noundef 2, i64 noundef %184, ptr noundef %185)
  store i32 0, ptr %17, align 4
  br label %187

187:                                              ; preds = %180, %141, %128, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 23040, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  %188 = load i32, ptr %17, align 4
  switch i32 %188, label %197 [
    i32 0, label %189
    i32 3, label %190
  ]

189:                                              ; preds = %187
  br label %85

190:                                              ; preds = %187
  %191 = load ptr, ptr %14, align 8, !tbaa !9
  call void @opus_encoder_destroy(ptr noundef %191)
  %192 = load ptr, ptr %15, align 8, !tbaa !9
  call void @opus_decoder_destroy(ptr noundef %192)
  %193 = load ptr, ptr %7, align 8, !tbaa !9
  %194 = call i32 @fclose(ptr noundef %193)
  %195 = load ptr, ptr %9, align 8, !tbaa !9
  %196 = call i32 @fclose(ptr noundef %195)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %17, align 4
  br label %197

197:                                              ; preds = %190, %187, %78, %65, %55, %42, %32, %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 3828, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 23040, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 3840, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %198 = load i32, ptr %3, align 4
  ret i32 %198
}

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

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

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

declare ptr @opus_strerror(i32 noundef) #3

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #4

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #2

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

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

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

declare void @opus_encoder_destroy(ptr noundef) #3

declare void @opus_decoder_destroy(ptr noundef) #3

declare i32 @fclose(ptr noundef) #3

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 "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(none) "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(none) }

!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}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [45 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [20 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 = alloca [1920 x i16], align 16
  %4 = alloca [11520 x i16], align 16
  %5 = alloca [3828 x i8], align 16
  %6 = alloca i32, align 4
  %7 = alloca [23040 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 3840, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 23040, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 3828, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  %.not = icmp eq i32 %0, 3
  br i1 %.not, label %13, label %8

8:                                                ; preds = %2
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str) #7
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.1) #7
  br label %102

13:                                               ; preds = %2
  %14 = call ptr @opus_encoder_create(i32 noundef 48000, i32 noundef 2, i32 noundef 2049, ptr noundef nonnull %6) #6
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = icmp slt i32 %15, 0
  br i1 %16, label %17, label %21

17:                                               ; preds = %13
  %18 = load ptr, ptr @stderr, align 8, !tbaa !5
  %19 = call ptr @opus_strerror(i32 noundef %15) #6
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.2, ptr noundef %19) #7
  br label %102

21:                                               ; preds = %13
  %22 = call i32 (ptr, i32, ...) @opus_encoder_ctl(ptr noundef %14, i32 noundef 4002, i32 noundef 64000) #6
  store i32 %22, ptr %6, align 4, !tbaa !9
  %23 = icmp slt i32 %22, 0
  br i1 %23, label %24, label %28

24:                                               ; preds = %21
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = call ptr @opus_strerror(i32 noundef %22) #6
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.3, ptr noundef %26) #7
  br label %102

28:                                               ; preds = %21
  %29 = getelementptr inbounds i8, ptr %1, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = call noalias ptr @fopen(ptr noundef %30, ptr noundef nonnull @.str.4)
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %39

33:                                               ; preds = %28
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = tail call ptr @__errno_location() #8
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = call ptr @strerror(i32 noundef %36) #6
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.5, ptr noundef %37) #7
  br label %102

39:                                               ; preds = %28
  %40 = call ptr @opus_decoder_create(i32 noundef 48000, i32 noundef 2, ptr noundef nonnull %6) #6
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %43, label %47

43:                                               ; preds = %39
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = call ptr @opus_strerror(i32 noundef %41) #6
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.6, ptr noundef %45) #7
  br label %102

47:                                               ; preds = %39
  %48 = getelementptr inbounds i8, ptr %1, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = call noalias ptr @fopen(ptr noundef %49, ptr noundef nonnull @.str.7)
  %51 = icmp eq ptr %50, null
  br i1 %51, label %54, label %.preheader55

.preheader55:                                     ; preds = %47
  call void @llvm.lifetime.start.p0(i64 23040, ptr nonnull %7) #6
  %52 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 960, ptr noundef nonnull %31)
  %53 = call i32 @feof(ptr noundef nonnull %31) #6
  %.not4861 = icmp eq i32 %53, 0
  br i1 %.not4861, label %vector.body84.preheader, label %._crit_edge62

vector.body84.preheader:                          ; preds = %.preheader55
  %invariant.gep91 = getelementptr i8, ptr %7, i64 -1
  %invariant.gep = getelementptr i8, ptr %7, i64 -1
  %invariant.gep89 = getelementptr i8, ptr %7, i64 -1
  br label %vector.body84

54:                                               ; preds = %47
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = tail call ptr @__errno_location() #8
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = call ptr @strerror(i32 noundef %57) #6
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.8, ptr noundef %58) #7
  br label %102

vector.body84:                                    ; preds = %vector.body84.backedge, %vector.body84.preheader
  %index85 = phi i64 [ 0, %vector.body84.preheader ], [ %index85.be, %vector.body84.backedge ]
  %60 = shl nuw nsw i64 %index85, 1
  %61 = or disjoint i64 %60, 1
  %gep92 = getelementptr [23040 x i8], ptr %invariant.gep91, i64 0, i64 %61
  %wide.vec = load <16 x i8>, ptr %gep92, align 16, !tbaa !11
  %strided.vec = shufflevector <16 x i8> %wide.vec, <16 x i8> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
  %strided.vec86 = shufflevector <16 x i8> %wide.vec, <16 x i8> poison, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
  %62 = zext <8 x i8> %strided.vec86 to <8 x i16>
  %63 = shl nuw <8 x i16> %62, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
  %64 = zext <8 x i8> %strided.vec to <8 x i16>
  %65 = or disjoint <8 x i16> %63, %64
  %66 = getelementptr inbounds [1920 x i16], ptr %3, i64 0, i64 %index85
  store <8 x i16> %65, ptr %66, align 16, !tbaa !12
  %index.next87 = add nuw i64 %index85, 8
  %67 = icmp eq i64 %index.next87, 1920
  br i1 %67, label %middle.block80, label %vector.body84.backedge

vector.body84.backedge:                           ; preds = %vector.body84, %._crit_edge
  %index85.be = phi i64 [ %index.next87, %vector.body84 ], [ 0, %._crit_edge ]
  br label %vector.body84, !llvm.loop !14

middle.block80:                                   ; preds = %vector.body84
  %68 = call i32 @opus_encode(ptr noundef %14, ptr noundef nonnull %3, i32 noundef 960, ptr noundef nonnull %5, i32 noundef 3828) #6
  %69 = icmp slt i32 %68, 0
  br i1 %69, label %.thread, label %70

70:                                               ; preds = %middle.block80
  %71 = call i32 @opus_decode(ptr noundef %40, ptr noundef nonnull %5, i32 noundef %68, ptr noundef nonnull %4, i32 noundef 5760, i32 noundef 0) #6
  %72 = icmp slt i32 %71, 0
  br i1 %72, label %.thread, label %.preheader

.preheader:                                       ; preds = %70
  %.not63 = icmp eq i32 %71, 0
  br i1 %.not63, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %73 = shl nuw i32 %71, 1
  %wide.trip.count = zext i32 %73 to i64
  %min.iters.check = icmp ult i32 %71, 8
  br i1 %min.iters.check, label %.lr.ph.preheader88, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 4294967280
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %74 = getelementptr inbounds [11520 x i16], ptr %4, i64 0, i64 %index
  %75 = getelementptr inbounds i8, ptr %74, i64 16
  %wide.load = load <8 x i16>, ptr %74, align 16, !tbaa !12
  %wide.load78 = load <8 x i16>, ptr %75, align 16, !tbaa !12
  %76 = shl nuw nsw i64 %index, 1
  %77 = shl i64 %index, 1
  %78 = lshr <8 x i16> %wide.load, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
  %79 = lshr <8 x i16> %wide.load78, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
  %80 = or disjoint i64 %76, 1
  %81 = or disjoint i64 %77, 17
  %gep = getelementptr [23040 x i8], ptr %invariant.gep, i64 0, i64 %80
  %gep90 = getelementptr [23040 x i8], ptr %invariant.gep89, i64 0, i64 %81
  %82 = shufflevector <8 x i16> %wide.load, <8 x i16> %78, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  %interleaved.vec = trunc <16 x i16> %82 to <16 x i8>
  store <16 x i8> %interleaved.vec, ptr %gep, align 16, !tbaa !11
  %83 = shufflevector <8 x i16> %wide.load78, <8 x i16> %79, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  %interleaved.vec79 = trunc <16 x i16> %83 to <16 x i8>
  store <16 x i8> %interleaved.vec79, ptr %gep90, align 16, !tbaa !11
  %index.next = add nuw i64 %index, 16
  %84 = icmp eq i64 %index.next, %n.vec
  br i1 %84, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader88

.lr.ph.preheader88:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv69.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader88, %.lr.ph
  %indvars.iv69 = phi i64 [ %indvars.iv.next70, %.lr.ph ], [ %indvars.iv69.ph, %.lr.ph.preheader88 ]
  %85 = getelementptr inbounds [11520 x i16], ptr %4, i64 0, i64 %indvars.iv69
  %86 = load i16, ptr %85, align 2, !tbaa !12
  %87 = trunc i16 %86 to i8
  %88 = shl nuw nsw i64 %indvars.iv69, 1
  %89 = getelementptr inbounds [23040 x i8], ptr %7, i64 0, i64 %88
  store i8 %87, ptr %89, align 2, !tbaa !11
  %90 = lshr i16 %86, 8
  %91 = trunc nuw i16 %90 to i8
  %92 = or disjoint i64 %88, 1
  %93 = getelementptr inbounds [23040 x i8], ptr %7, i64 0, i64 %92
  store i8 %91, ptr %93, align 1, !tbaa !11
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond72.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
  br i1 %exitcond72.not, label %._crit_edge, label %.lr.ph, !llvm.loop !19

.thread:                                          ; preds = %70, %middle.block80
  %.lcssa.sink = phi i32 [ %68, %middle.block80 ], [ %71, %70 ]
  %.str.9.sink = phi ptr [ @.str.9, %middle.block80 ], [ @.str.10, %70 ]
  %94 = load ptr, ptr @stderr, align 8, !tbaa !5
  %95 = call ptr @opus_strerror(i32 noundef %.lcssa.sink) #6
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef nonnull %.str.9.sink, ptr noundef %95) #7
  call void @llvm.lifetime.end.p0(i64 23040, ptr nonnull %7) #6
  br label %102

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %.preheader
  %.pre-phi = phi i64 [ 0, %.preheader ], [ %wide.trip.count, %middle.block ], [ %wide.trip.count, %.lr.ph ]
  %97 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 2, i64 noundef %.pre-phi, ptr noundef nonnull %50)
  call void @llvm.lifetime.end.p0(i64 23040, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 23040, ptr nonnull %7) #6
  %98 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 960, ptr noundef nonnull %31)
  %99 = call i32 @feof(ptr noundef nonnull %31) #6
  %.not48 = icmp eq i32 %99, 0
  br i1 %.not48, label %vector.body84.backedge, label %._crit_edge62

._crit_edge62:                                    ; preds = %._crit_edge, %.preheader55
  call void @llvm.lifetime.end.p0(i64 23040, ptr nonnull %7) #6
  call void @opus_encoder_destroy(ptr noundef %14) #6
  call void @opus_decoder_destroy(ptr noundef %40) #6
  %100 = call i32 @fclose(ptr noundef nonnull %31)
  %101 = call i32 @fclose(ptr noundef nonnull %50)
  br label %102

102:                                              ; preds = %.thread, %._crit_edge62, %54, %43, %33, %24, %17, %8
  %.2 = phi i32 [ 1, %8 ], [ 1, %17 ], [ 1, %24 ], [ 1, %33 ], [ 1, %43 ], [ 1, %54 ], [ 0, %._crit_edge62 ], [ 1, %.thread ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 3828, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 23040, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 3840, ptr nonnull %3) #6
  ret i32 %.2
}

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

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

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

declare ptr @opus_strerror(i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @feof(ptr nocapture noundef) local_unnamed_addr #2

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

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

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

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

declare void @opus_encoder_destroy(ptr noundef) local_unnamed_addr #3

declare void @opus_decoder_destroy(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 }
attributes #7 = { cold nounwind }
attributes #8 = { nounwind willreturn memory(none) }

!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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = distinct !{!14, !15, !16, !17}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !15, !16, !17}
!19 = distinct !{!19, !15, !17, !16}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass