; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/vorbis-src/test (write_read)

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

%struct.ogg_stream_state = type { ptr, i64, i64, i64, ptr, ptr, i64, i64, i64, i64, [282 x i8], i32, i32, i32, i64, i64, i64, i64 }
%struct.ogg_page = type { ptr, i64, ptr, i64 }
%struct.ogg_packet = type { ptr, i64, i64, i64, i64, i64 }
%struct.vorbis_info = type { i32, i32, i64, i64, i64, i64, i64, ptr }
%struct.vorbis_comment = type { ptr, ptr, i32, ptr }
%struct.vorbis_dsp_state = type { i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr }
%struct.vorbis_block = type { ptr, %struct.oggpack_buffer, i64, i64, i64, i32, i32, i32, i64, i64, ptr, ptr, i64, i64, i64, ptr, i64, i64, i64, i64, ptr }
%struct.oggpack_buffer = type { i64, i32, ptr, ptr, i64 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @write_vorbis_data_or_die(ptr noundef %0, i32 noundef %1, float noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) #0 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %struct.ogg_stream_state, align 8
  %15 = alloca %struct.ogg_page, align 8
  %16 = alloca %struct.ogg_packet, align 8
  %17 = alloca %struct.vorbis_info, align 8
  %18 = alloca %struct.vorbis_comment, align 8
  %19 = alloca %struct.vorbis_dsp_state, align 8
  %20 = alloca %struct.vorbis_block, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %struct.ogg_packet, align 8
  %24 = alloca %struct.ogg_packet, align 8
  %25 = alloca %struct.ogg_packet, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i32, align 4
  %30 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store float %2, ptr %9, align 4, !tbaa !11
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 408, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 144, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 192, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call noalias ptr @fopen(ptr noundef %31, ptr noundef @.str)
  store ptr %32, ptr %13, align 8, !tbaa !5
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %39

34:                                               ; preds = %6
  %35 = call ptr @__errno_location() #8
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = call ptr @strerror(i32 noundef %36) #7
  %38 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %37)
  call void @exit(i32 noundef 1) #9
  unreachable

39:                                               ; preds = %6
  call void @vorbis_info_init(ptr noundef %17)
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = load i32, ptr %8, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = load float, ptr %9, align 4, !tbaa !11
  %45 = call i32 @vorbis_encode_init_vbr(ptr noundef %17, i64 noundef %41, i64 noundef %43, float noundef %44)
  store i32 %45, ptr %22, align 4, !tbaa !9
  %46 = load i32, ptr %22, align 4, !tbaa !9
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %39
  %49 = load i32, ptr %22, align 4, !tbaa !9
  %50 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %49)
  call void @exit(i32 noundef 1) #9
  unreachable

51:                                               ; preds = %39
  call void @vorbis_comment_init(ptr noundef %18)
  call void @vorbis_comment_add_tag(ptr noundef %18, ptr noundef @.str.3, ptr noundef @.str.4)
  %52 = call i32 @vorbis_analysis_init(ptr noundef %19, ptr noundef %17)
  %53 = call i32 @vorbis_block_init(ptr noundef %19, ptr noundef %20)
  %54 = call i32 @ogg_stream_init(ptr noundef %14, i32 noundef 12345678)
  call void @llvm.lifetime.start.p0(i64 48, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr %25) #7
  %55 = call i32 @vorbis_analysis_headerout(ptr noundef %19, ptr noundef %18, ptr noundef %23, ptr noundef %24, ptr noundef %25)
  %56 = call i32 @ogg_stream_packetin(ptr noundef %14, ptr noundef %23)
  %57 = call i32 @ogg_stream_packetin(ptr noundef %14, ptr noundef %24)
  %58 = call i32 @ogg_stream_packetin(ptr noundef %14, ptr noundef %25)
  br label %59

59:                                               ; preds = %83, %51
  %60 = load i32, ptr %21, align 4, !tbaa !9
  %61 = icmp ne i32 %60, 0
  %62 = xor i1 %61, true
  br i1 %62, label %63, label %84

63:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  %64 = call i32 @ogg_stream_flush(ptr noundef %14, ptr noundef %15)
  store i32 %64, ptr %26, align 4, !tbaa !9
  %65 = load i32, ptr %26, align 4, !tbaa !9
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %63
  store i32 3, ptr %27, align 4
  br label %81

68:                                               ; preds = %63
  %69 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 1
  %72 = load i64, ptr %71, align 8, !tbaa !16
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = call i64 @fwrite(ptr noundef %70, i64 noundef 1, i64 noundef %72, ptr noundef %73)
  %75 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !17
  %77 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 3
  %78 = load i64, ptr %77, align 8, !tbaa !18
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = call i64 @fwrite(ptr noundef %76, i64 noundef 1, i64 noundef %78, ptr noundef %79)
  store i32 0, ptr %27, align 4
  br label %81

81:                                               ; preds = %68, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  %82 = load i32, ptr %27, align 4
  switch i32 %82, label %155 [
    i32 0, label %83
    i32 3, label %84
  ]

83:                                               ; preds = %81
  br label %59, !llvm.loop !19

84:                                               ; preds = %81, %59
  call void @llvm.lifetime.end.p0(i64 48, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = call ptr @vorbis_analysis_buffer(ptr noundef %19, i32 noundef %85)
  store ptr %86, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %101, %84
  %88 = load i32, ptr %29, align 4, !tbaa !9
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %91, label %104

91:                                               ; preds = %87
  %92 = load ptr, ptr %28, align 8, !tbaa !5
  %93 = load i32, ptr %29, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds ptr, ptr %92, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = mul i64 %99, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %96, ptr align 4 %97, i64 %100, i1 false)
  br label %101

101:                                              ; preds = %91
  %102 = load i32, ptr %29, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %29, align 4, !tbaa !9
  br label %87, !llvm.loop !21

104:                                              ; preds = %87
  %105 = load i32, ptr %11, align 4, !tbaa !9
  %106 = call i32 @vorbis_analysis_wrote(ptr noundef %19, i32 noundef %105)
  %107 = call i32 @vorbis_analysis_wrote(ptr noundef %19, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %108

108:                                              ; preds = %149, %104
  %109 = call i32 @vorbis_analysis_blockout(ptr noundef %19, ptr noundef %20)
  %110 = icmp eq i32 %109, 1
  br i1 %110, label %111, label %150

111:                                              ; preds = %108
  %112 = call i32 @vorbis_analysis(ptr noundef %20, ptr noundef null)
  %113 = call i32 @vorbis_bitrate_addblock(ptr noundef %20)
  br label %114

114:                                              ; preds = %148, %111
  %115 = call i32 @vorbis_bitrate_flushpacket(ptr noundef %19, ptr noundef %16)
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %149

117:                                              ; preds = %114
  %118 = call i32 @ogg_stream_packetin(ptr noundef %14, ptr noundef %16)
  br label %119

119:                                              ; preds = %147, %117
  %120 = load i32, ptr %21, align 4, !tbaa !9
  %121 = icmp ne i32 %120, 0
  %122 = xor i1 %121, true
  br i1 %122, label %123, label %148

123:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %124 = call i32 @ogg_stream_pageout(ptr noundef %14, ptr noundef %15)
  store i32 %124, ptr %30, align 4, !tbaa !9
  %125 = load i32, ptr %30, align 4, !tbaa !9
  %126 = icmp eq i32 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %123
  store i32 12, ptr %27, align 4
  br label %145

128:                                              ; preds = %123
  %129 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !13
  %131 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 1
  %132 = load i64, ptr %131, align 8, !tbaa !16
  %133 = load ptr, ptr %13, align 8, !tbaa !5
  %134 = call i64 @fwrite(ptr noundef %130, i64 noundef 1, i64 noundef %132, ptr noundef %133)
  %135 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 2
  %136 = load ptr, ptr %135, align 8, !tbaa !17
  %137 = getelementptr inbounds %struct.ogg_page, ptr %15, i32 0, i32 3
  %138 = load i64, ptr %137, align 8, !tbaa !18
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = call i64 @fwrite(ptr noundef %136, i64 noundef 1, i64 noundef %138, ptr noundef %139)
  %141 = call i32 @ogg_page_eos(ptr noundef %15)
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %144

143:                                              ; preds = %128
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %144

144:                                              ; preds = %143, %128
  store i32 0, ptr %27, align 4
  br label %145

145:                                              ; preds = %144, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  %146 = load i32, ptr %27, align 4
  switch i32 %146, label %155 [
    i32 0, label %147
    i32 12, label %148
  ]

147:                                              ; preds = %145
  br label %119, !llvm.loop !22

148:                                              ; preds = %145, %119
  br label %114, !llvm.loop !23

149:                                              ; preds = %114
  br label %108, !llvm.loop !24

150:                                              ; preds = %108
  %151 = call i32 @ogg_stream_clear(ptr noundef %14)
  %152 = call i32 @vorbis_block_clear(ptr noundef %20)
  call void @vorbis_dsp_clear(ptr noundef %19)
  call void @vorbis_comment_clear(ptr noundef %18)
  call void @vorbis_info_clear(ptr noundef %17)
  %153 = load ptr, ptr %13, align 8, !tbaa !5
  %154 = call i32 @fclose(ptr noundef %153)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 192, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 144, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 408, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  ret void

155:                                              ; preds = %145, %81
  unreachable
}

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #5

declare void @vorbis_info_init(ptr noundef) #2

declare i32 @vorbis_encode_init_vbr(ptr noundef, i64 noundef, i64 noundef, float noundef) #2

declare void @vorbis_comment_init(ptr noundef) #2

declare void @vorbis_comment_add_tag(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @vorbis_analysis_init(ptr noundef, ptr noundef) #2

declare i32 @vorbis_block_init(ptr noundef, ptr noundef) #2

declare i32 @ogg_stream_init(ptr noundef, i32 noundef) #2

declare i32 @vorbis_analysis_headerout(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @ogg_stream_packetin(ptr noundef, ptr noundef) #2

declare i32 @ogg_stream_flush(ptr noundef, ptr noundef) #2

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

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

declare ptr @vorbis_analysis_buffer(ptr noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

declare i32 @vorbis_analysis_wrote(ptr noundef, i32 noundef) #2

declare i32 @vorbis_analysis_blockout(ptr noundef, ptr noundef) #2

declare i32 @vorbis_analysis(ptr noundef, ptr noundef) #2

declare i32 @vorbis_bitrate_addblock(ptr noundef) #2

declare i32 @vorbis_bitrate_flushpacket(ptr noundef, ptr noundef) #2

declare i32 @ogg_stream_pageout(ptr noundef, ptr noundef) #2

declare i32 @ogg_page_eos(ptr noundef) #2

declare i32 @ogg_stream_clear(ptr noundef) #2

declare i32 @vorbis_block_clear(ptr noundef) #2

declare void @vorbis_dsp_clear(ptr noundef) #2

declare void @vorbis_comment_clear(ptr noundef) #2

declare void @vorbis_info_clear(ptr noundef) #2

declare i32 @fclose(ptr noundef) #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 = { 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 "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 = { noreturn 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
attributes #9 = { noreturn 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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"", !6, i64 0, !15, i64 8, !6, i64 16, !15, i64 24}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !15, i64 8}
!17 = !{!14, !6, i64 16}
!18 = !{!14, !15, i64 24}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}


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

%struct.ogg_stream_state = type { ptr, i64, i64, i64, ptr, ptr, i64, i64, i64, i64, [282 x i8], i32, i32, i32, i64, i64, i64, i64 }
%struct.ogg_page = type { ptr, i64, ptr, i64 }
%struct.ogg_packet = type { ptr, i64, i64, i64, i64, i64 }
%struct.vorbis_info = type { i32, i32, i64, i64, i64, i64, i64, ptr }
%struct.vorbis_comment = type { ptr, ptr, i32, ptr }
%struct.vorbis_dsp_state = type { i32, ptr, ptr, ptr, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, ptr }
%struct.vorbis_block = type { ptr, %struct.oggpack_buffer, i64, i64, i64, i32, i32, i32, i64, i64, ptr, ptr, i64, i64, i64, ptr, i64, i64, i64, i64, ptr }
%struct.oggpack_buffer = type { i64, i32, ptr, ptr, i64 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @write_vorbis_data_or_die(ptr nocapture noundef readonly %0, i32 noundef %1, float noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #0 {
  %7 = alloca %struct.ogg_stream_state, align 8
  %8 = alloca %struct.ogg_page, align 8
  %9 = alloca %struct.ogg_packet, align 8
  %10 = alloca %struct.vorbis_info, align 8
  %11 = alloca %struct.vorbis_comment, align 8
  %12 = alloca %struct.vorbis_dsp_state, align 8
  %13 = alloca %struct.vorbis_block, align 8
  %14 = alloca %struct.ogg_packet, align 8
  %15 = alloca %struct.ogg_packet, align 8
  %16 = alloca %struct.ogg_packet, align 8
  call void @llvm.lifetime.start.p0(i64 408, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 144, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %13) #8
  %17 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %24

19:                                               ; preds = %6
  %20 = tail call ptr @__errno_location() #9
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = tail call ptr @strerror(i32 noundef %21) #8
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %22)
  tail call void @exit(i32 noundef 1) #10
  unreachable

24:                                               ; preds = %6
  call void @vorbis_info_init(ptr noundef nonnull %10) #8
  %25 = sext i32 %5 to i64
  %26 = sext i32 %1 to i64
  %27 = call i32 @vorbis_encode_init_vbr(ptr noundef nonnull %10, i64 noundef %25, i64 noundef %26, float noundef %2) #8
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %30, label %28

28:                                               ; preds = %24
  %29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
  call void @exit(i32 noundef 1) #10
  unreachable

30:                                               ; preds = %24
  call void @vorbis_comment_init(ptr noundef nonnull %11) #8
  call void @vorbis_comment_add_tag(ptr noundef nonnull %11, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4) #8
  %31 = call i32 @vorbis_analysis_init(ptr noundef nonnull %12, ptr noundef nonnull %10) #8
  %32 = call i32 @vorbis_block_init(ptr noundef nonnull %12, ptr noundef nonnull %13) #8
  %33 = call i32 @ogg_stream_init(ptr noundef nonnull %7, i32 noundef 12345678) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %16) #8
  %34 = call i32 @vorbis_analysis_headerout(ptr noundef nonnull %12, ptr noundef nonnull %11, ptr noundef nonnull %14, ptr noundef nonnull %15, ptr noundef nonnull %16) #8
  %35 = call i32 @ogg_stream_packetin(ptr noundef nonnull %7, ptr noundef nonnull %14) #8
  %36 = call i32 @ogg_stream_packetin(ptr noundef nonnull %7, ptr noundef nonnull %15) #8
  %37 = call i32 @ogg_stream_packetin(ptr noundef nonnull %7, ptr noundef nonnull %16) #8
  %38 = call i32 @ogg_stream_flush(ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %30
  %40 = getelementptr inbounds i8, ptr %8, i64 8
  %41 = getelementptr inbounds i8, ptr %8, i64 16
  %42 = getelementptr inbounds i8, ptr %8, i64 24
  br label %43

43:                                               ; preds = %.lr.ph, %43
  %44 = load ptr, ptr %8, align 8, !tbaa !9
  %45 = load i64, ptr %40, align 8, !tbaa !13
  %46 = call i64 @fwrite(ptr noundef %44, i64 noundef 1, i64 noundef %45, ptr noundef nonnull %17)
  %47 = load ptr, ptr %41, align 8, !tbaa !14
  %48 = load i64, ptr %42, align 8, !tbaa !15
  %49 = call i64 @fwrite(ptr noundef %47, i64 noundef 1, i64 noundef %48, ptr noundef nonnull %17)
  %50 = call i32 @ogg_stream_flush(ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %._crit_edge, label %43

._crit_edge:                                      ; preds = %43, %30
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %16) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %15) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %14) #8
  %52 = call ptr @vorbis_analysis_buffer(ptr noundef nonnull %12, i32 noundef %4) #8
  %53 = icmp sgt i32 %5, 0
  br i1 %53, label %.lr.ph43, label %._crit_edge44

.lr.ph43:                                         ; preds = %._crit_edge
  %54 = sext i32 %4 to i64
  %55 = shl nsw i64 %54, 2
  %wide.trip.count = zext nneg i32 %5 to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %56 = icmp ult i32 %5, 4
  br i1 %56, label %._crit_edge44.loopexit.unr-lcssa, label %.lr.ph43.new

.lr.ph43.new:                                     ; preds = %.lr.ph43
  %unroll_iter = and i64 %wide.trip.count, 2147483644
  br label %57

57:                                               ; preds = %57, %.lr.ph43.new
  %indvars.iv = phi i64 [ 0, %.lr.ph43.new ], [ %indvars.iv.next.3, %57 ]
  %niter = phi i64 [ 0, %.lr.ph43.new ], [ %niter.next.3, %57 ]
  %58 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %59, ptr align 4 %3, i64 %55, i1 false)
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %60 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv.next
  %61 = load ptr, ptr %60, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %61, ptr align 4 %3, i64 %55, i1 false)
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %62 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv.next.1
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %63, ptr align 4 %3, i64 %55, i1 false)
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %64 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv.next.2
  %65 = load ptr, ptr %64, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %65, ptr align 4 %3, i64 %55, i1 false)
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge44.loopexit.unr-lcssa, label %57, !llvm.loop !17

._crit_edge44.loopexit.unr-lcssa:                 ; preds = %57, %.lr.ph43
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph43 ], [ %indvars.iv.next.3, %57 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge44, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge44.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge44.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge44.loopexit.unr-lcssa ]
  %66 = getelementptr inbounds ptr, ptr %52, i64 %indvars.iv.epil
  %67 = load ptr, ptr %66, align 8, !tbaa !16
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %67, ptr align 4 %3, i64 %55, i1 false)
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge44, label %.epil.preheader, !llvm.loop !19

._crit_edge44:                                    ; preds = %._crit_edge44.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge
  %68 = call i32 @vorbis_analysis_wrote(ptr noundef nonnull %12, i32 noundef %4) #8
  %69 = call i32 @vorbis_analysis_wrote(ptr noundef nonnull %12, i32 noundef 0) #8
  %70 = call i32 @vorbis_analysis_blockout(ptr noundef nonnull %12, ptr noundef nonnull %13) #8
  %71 = icmp eq i32 %70, 1
  br i1 %71, label %.lr.ph57, label %._crit_edge58

.lr.ph57:                                         ; preds = %._crit_edge44
  %72 = getelementptr inbounds i8, ptr %8, i64 8
  %73 = getelementptr inbounds i8, ptr %8, i64 16
  %74 = getelementptr inbounds i8, ptr %8, i64 24
  br label %77

.loopexit:                                        ; preds = %.thread37, %77
  %.1.lcssa = phi i32 [ %.055, %77 ], [ %.2.lcssa, %.thread37 ]
  %75 = call i32 @vorbis_analysis_blockout(ptr noundef nonnull %12, ptr noundef nonnull %13) #8
  %76 = icmp eq i32 %75, 1
  br i1 %76, label %77, label %._crit_edge58, !llvm.loop !21

77:                                               ; preds = %.lr.ph57, %.loopexit
  %.055 = phi i32 [ 0, %.lr.ph57 ], [ %.1.lcssa, %.loopexit ]
  %78 = call i32 @vorbis_analysis(ptr noundef nonnull %13, ptr noundef null) #8
  %79 = call i32 @vorbis_bitrate_addblock(ptr noundef nonnull %13) #8
  %80 = call i32 @vorbis_bitrate_flushpacket(ptr noundef nonnull %12, ptr noundef nonnull %9) #8
  %.not3050 = icmp eq i32 %80, 0
  br i1 %.not3050, label %.loopexit, label %.lr.ph53

.lr.ph53:                                         ; preds = %77, %.thread37
  %.151 = phi i32 [ %.2.lcssa, %.thread37 ], [ %.055, %77 ]
  %81 = call i32 @ogg_stream_packetin(ptr noundef nonnull %7, ptr noundef nonnull %9) #8
  %.not3145 = icmp eq i32 %.151, 0
  br i1 %.not3145, label %.lr.ph48, label %.thread37

.lr.ph48:                                         ; preds = %.lr.ph53, %select.unfold
  %82 = call i32 @ogg_stream_pageout(ptr noundef nonnull %7, ptr noundef nonnull %8) #8
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %.thread37, label %select.unfold

select.unfold:                                    ; preds = %.lr.ph48
  %84 = load ptr, ptr %8, align 8, !tbaa !9
  %85 = load i64, ptr %72, align 8, !tbaa !13
  %86 = call i64 @fwrite(ptr noundef %84, i64 noundef 1, i64 noundef %85, ptr noundef nonnull %17)
  %87 = load ptr, ptr %73, align 8, !tbaa !14
  %88 = load i64, ptr %74, align 8, !tbaa !15
  %89 = call i64 @fwrite(ptr noundef %87, i64 noundef 1, i64 noundef %88, ptr noundef nonnull %17)
  %90 = call i32 @ogg_page_eos(ptr noundef nonnull %8) #8
  %.not32.not = icmp eq i32 %90, 0
  br i1 %.not32.not, label %.lr.ph48, label %.thread37

.thread37:                                        ; preds = %select.unfold, %.lr.ph48, %.lr.ph53
  %.2.lcssa = phi i32 [ %.151, %.lr.ph53 ], [ 0, %.lr.ph48 ], [ 1, %select.unfold ]
  %91 = call i32 @vorbis_bitrate_flushpacket(ptr noundef nonnull %12, ptr noundef nonnull %9) #8
  %.not30 = icmp eq i32 %91, 0
  br i1 %.not30, label %.loopexit, label %.lr.ph53, !llvm.loop !22

._crit_edge58:                                    ; preds = %.loopexit, %._crit_edge44
  %92 = call i32 @ogg_stream_clear(ptr noundef nonnull %7) #8
  %93 = call i32 @vorbis_block_clear(ptr noundef nonnull %13) #8
  call void @vorbis_dsp_clear(ptr noundef nonnull %12) #8
  call void @vorbis_comment_clear(ptr noundef nonnull %11) #8
  call void @vorbis_info_clear(ptr noundef nonnull %10) #8
  %94 = call i32 @fclose(ptr noundef nonnull %17)
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %13) #8
  call void @llvm.lifetime.end.p0(i64 144, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 408, ptr nonnull %7) #8
  ret void
}

; 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 noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #5

declare void @vorbis_info_init(ptr noundef) local_unnamed_addr #6

declare i32 @vorbis_encode_init_vbr(ptr noundef, i64 noundef, i64 noundef, float noundef) local_unnamed_addr #6

declare void @vorbis_comment_init(ptr noundef) local_unnamed_addr #6

declare void @vorbis_comment_add_tag(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @vorbis_analysis_init(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @vorbis_block_init(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @ogg_stream_init(ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @vorbis_analysis_headerout(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @ogg_stream_packetin(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @ogg_stream_flush(ptr noundef, ptr noundef) local_unnamed_addr #6

; 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 ptr @vorbis_analysis_buffer(ptr noundef, i32 noundef) local_unnamed_addr #6

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

declare i32 @vorbis_analysis_wrote(ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @vorbis_analysis_blockout(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @vorbis_analysis(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @vorbis_bitrate_addblock(ptr noundef) local_unnamed_addr #6

declare i32 @vorbis_bitrate_flushpacket(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @ogg_stream_pageout(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @ogg_page_eos(ptr noundef) local_unnamed_addr #6

declare i32 @ogg_stream_clear(ptr noundef) local_unnamed_addr #6

declare i32 @vorbis_block_clear(ptr noundef) local_unnamed_addr #6

declare void @vorbis_dsp_clear(ptr noundef) local_unnamed_addr #6

declare void @vorbis_comment_clear(ptr noundef) local_unnamed_addr #6

declare void @vorbis_info_clear(ptr noundef) local_unnamed_addr #6

; 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { noreturn 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 #6 = { "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: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(none) }
attributes #10 = { noreturn 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"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !12, i64 8, !11, i64 16, !12, i64 24}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!10, !12, i64 8}
!14 = !{!10, !11, i64 16}
!15 = !{!10, !12, i64 24}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


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