; LLVM IR from AnzoDK/RPAudio :: includes/minimp3 (minimp3_test)

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

@mode = external hidden global i32, align 4
@position = external hidden global i32, align 4
@portion = external hidden global i32, align 4
@fail_io_num = external hidden global i32, align 4
@seek_to_byte = external hidden global i32, align 4
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@wave_out = external hidden global i32, align 4
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 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: nounwind
declare void @free(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  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 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %102, %2
  %18 = load i32, ptr %6, align 4, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %21, label %105

21:                                               ; preds = %17
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds ptr, ptr %22, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %26, i64 0
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = sext i8 %28 to i32
  %30 = icmp ne i32 %29, 45
  br i1 %30, label %31, label %32

31:                                               ; preds = %21
  br label %105

32:                                               ; preds = %21
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds ptr, ptr %33, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = getelementptr inbounds i8, ptr %37, i64 1
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = sext i8 %39 to i32
  switch i32 %40, label %99 [
    i32 109, label %41
    i32 115, label %55
    i32 112, label %69
    i32 101, label %83
    i32 98, label %97
    i32 116, label %98
  ]

41:                                               ; preds = %32
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %6, align 4, !tbaa !5
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %47, label %54

47:                                               ; preds = %41
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %48, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = call i32 @atoi(ptr noundef %52) #7
  store i32 %53, ptr @mode, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %47, %41
  br label %101

55:                                               ; preds = %32
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %6, align 4, !tbaa !5
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %61, label %68

61:                                               ; preds = %55
  %62 = load ptr, ptr %5, align 8, !tbaa !9
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = call i32 @atoi(ptr noundef %66) #7
  store i32 %67, ptr @position, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %61, %55
  br label %101

69:                                               ; preds = %32
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %75, label %82

75:                                               ; preds = %69
  %76 = load ptr, ptr %5, align 8, !tbaa !9
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %76, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !9
  %81 = call i32 @atoi(ptr noundef %80) #7
  store i32 %81, ptr @portion, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %75, %69
  br label %101

83:                                               ; preds = %32
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = icmp slt i32 %86, %87
  br i1 %88, label %89, label %96

89:                                               ; preds = %83
  %90 = load ptr, ptr %5, align 8, !tbaa !9
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds ptr, ptr %90, i64 %92
  %94 = load ptr, ptr %93, align 8, !tbaa !9
  %95 = call i32 @atoi(ptr noundef %94) #7
  store i32 %95, ptr @fail_io_num, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %89, %83
  br label %101

97:                                               ; preds = %32
  store i32 1, ptr @seek_to_byte, align 4, !tbaa !5
  br label %101

98:                                               ; preds = %32
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %101

99:                                               ; preds = %32
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %206

101:                                              ; preds = %98, %97, %96, %82, %68, %54
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %6, align 4, !tbaa !5
  br label %17, !llvm.loop !12

105:                                              ; preds = %31, %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %106 = load i32, ptr %4, align 4, !tbaa !5
  %107 = load i32, ptr %6, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  %109 = icmp sgt i32 %106, %108
  br i1 %109, label %110, label %117

110:                                              ; preds = %105
  %111 = load ptr, ptr %5, align 8, !tbaa !9
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds ptr, ptr %111, i64 %114
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  br label %118

117:                                              ; preds = %105
  br label %118

118:                                              ; preds = %117, %110
  %119 = phi ptr [ %116, %110 ], [ null, %117 ]
  store ptr %119, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %120 = load i32, ptr %4, align 4, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = add nsw i32 %121, 2
  %123 = icmp sgt i32 %120, %122
  br i1 %123, label %124, label %131

124:                                              ; preds = %118
  %125 = load ptr, ptr %5, align 8, !tbaa !9
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = add nsw i32 %126, 2
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds ptr, ptr %125, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !9
  br label %132

131:                                              ; preds = %118
  br label %132

132:                                              ; preds = %131, %124
  %133 = phi ptr [ %130, %124 ], [ null, %131 ]
  store ptr %133, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !9
  %134 = load ptr, ptr %11, align 8, !tbaa !9
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %150

136:                                              ; preds = %132
  %137 = load ptr, ptr %11, align 8, !tbaa !9
  %138 = call noalias ptr @fopen(ptr noundef %137, ptr noundef @.str.1)
  store ptr %138, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %139 = load ptr, ptr %11, align 8, !tbaa !9
  %140 = call ptr @strrchr(ptr noundef %139, i32 noundef 46) #7
  store ptr %140, ptr %13, align 8, !tbaa !9
  %141 = load ptr, ptr %13, align 8, !tbaa !9
  %142 = icmp ne ptr %141, null
  br i1 %142, label %143, label %149

143:                                              ; preds = %136
  %144 = load ptr, ptr %13, align 8, !tbaa !9
  %145 = getelementptr inbounds i8, ptr %144, i64 1
  %146 = call i32 @strcasecmp(ptr noundef %145, ptr noundef @.str.2) #7
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %149, label %148

148:                                              ; preds = %143
  store i32 1, ptr @wave_out, align 4, !tbaa !5
  br label %149

149:                                              ; preds = %148, %143, %136
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %150

150:                                              ; preds = %149, %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %151 = load ptr, ptr %10, align 8, !tbaa !9
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %156

153:                                              ; preds = %150
  %154 = load ptr, ptr %10, align 8, !tbaa !9
  %155 = call noalias ptr @fopen(ptr noundef %154, ptr noundef @.str.3)
  br label %157

156:                                              ; preds = %150
  br label %157

157:                                              ; preds = %156, %153
  %158 = phi ptr [ %155, %153 ], [ null, %156 ]
  store ptr %158, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %159 = load ptr, ptr %14, align 8, !tbaa !9
  %160 = call ptr @preload(ptr noundef %159, ptr noundef %7)
  store ptr %160, ptr %15, align 8, !tbaa !9
  %161 = load ptr, ptr %14, align 8, !tbaa !9
  %162 = icmp ne ptr %161, null
  br i1 %162, label %163, label %166

163:                                              ; preds = %157
  %164 = load ptr, ptr %14, align 8, !tbaa !9
  %165 = call i32 @fclose(ptr noundef %164)
  br label %166

166:                                              ; preds = %163, %157
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %167 = load i32, ptr %4, align 4, !tbaa !5
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = icmp sgt i32 %167, %168
  br i1 %169, label %170, label %176

170:                                              ; preds = %166
  %171 = load ptr, ptr %5, align 8, !tbaa !9
  %172 = load i32, ptr %6, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds ptr, ptr %171, i64 %173
  %175 = load ptr, ptr %174, align 8, !tbaa !9
  br label %177

176:                                              ; preds = %166
  br label %177

177:                                              ; preds = %176, %170
  %178 = phi ptr [ %175, %170 ], [ null, %176 ]
  store ptr %178, ptr %16, align 8, !tbaa !9
  %179 = load ptr, ptr %16, align 8, !tbaa !9
  %180 = icmp ne ptr %179, null
  br i1 %180, label %183, label %181

181:                                              ; preds = %177
  %182 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %205

183:                                              ; preds = %177
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = icmp ne i32 %184, 0
  br i1 %185, label %186, label %189

186:                                              ; preds = %183
  %187 = load ptr, ptr %16, align 8, !tbaa !9
  %188 = call i32 @self_test(ptr noundef %187)
  store i32 %188, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %205

189:                                              ; preds = %183
  %190 = load ptr, ptr %16, align 8, !tbaa !9
  %191 = load ptr, ptr %15, align 8, !tbaa !9
  %192 = load i32, ptr %7, align 4, !tbaa !5
  %193 = load ptr, ptr %12, align 8, !tbaa !9
  call void @decode_file(ptr noundef %190, ptr noundef %191, i32 noundef %192, ptr noundef %193)
  %194 = load ptr, ptr %15, align 8, !tbaa !9
  %195 = icmp ne ptr %194, null
  br i1 %195, label %196, label %198

196:                                              ; preds = %189
  %197 = load ptr, ptr %15, align 8, !tbaa !9
  call void @free(ptr noundef %197) #6
  br label %198

198:                                              ; preds = %196, %189
  %199 = load ptr, ptr %12, align 8, !tbaa !9
  %200 = icmp ne ptr %199, null
  br i1 %200, label %201, label %204

201:                                              ; preds = %198
  %202 = load ptr, ptr %12, align 8, !tbaa !9
  %203 = call i32 @fclose(ptr noundef %202)
  br label %204

204:                                              ; preds = %201, %198
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %205

205:                                              ; preds = %204, %186, %181
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %206

206:                                              ; preds = %205, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %207 = load i32, ptr %3, align 4
  ret i32 %207
}

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #3

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @preload(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @self_test(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { inlinehint nounwind willreturn memory(read) 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 #4 = { "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 willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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

@mode = external hidden local_unnamed_addr global i32, align 4
@position = external hidden local_unnamed_addr global i32, align 4
@portion = external hidden local_unnamed_addr global i32, align 4
@fail_io_num = external hidden local_unnamed_addr global i32, align 4
@seek_to_byte = external hidden local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@wave_out = external hidden local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [28 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %4 = icmp sgt i32 %0, 1
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %47
  %.05999 = phi i32 [ %48, %47 ], [ 1, %2 ]
  %.06198 = phi i32 [ %.162, %47 ], [ 0, %2 ]
  %5 = sext i32 %.05999 to i64
  %6 = getelementptr inbounds ptr, ptr %1, i64 %5
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load i8, ptr %7, align 1, !tbaa !9
  %.not = icmp ne i8 %8, 45
  br i1 %.not, label %._crit_edge.loopexit, label %9

9:                                                ; preds = %.lr.ph
  %10 = getelementptr inbounds i8, ptr %7, i64 1
  %11 = load i8, ptr %10, align 1, !tbaa !9
  switch i8 %11, label %45 [
    i8 109, label %12
    i8 115, label %20
    i8 112, label %28
    i8 101, label %36
    i8 98, label %44
    i8 116, label %47
  ]

12:                                               ; preds = %9
  %13 = add nsw i32 %.05999, 1
  %14 = icmp slt i32 %13, %0
  br i1 %14, label %15, label %47

15:                                               ; preds = %12
  %16 = sext i32 %13 to i64
  %17 = getelementptr inbounds ptr, ptr %1, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call i32 @atoi(ptr nocapture noundef %18) #8
  store i32 %19, ptr @mode, align 4, !tbaa !10
  br label %47

20:                                               ; preds = %9
  %21 = add nsw i32 %.05999, 1
  %22 = icmp slt i32 %21, %0
  br i1 %22, label %23, label %47

23:                                               ; preds = %20
  %24 = sext i32 %21 to i64
  %25 = getelementptr inbounds ptr, ptr %1, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  %27 = tail call i32 @atoi(ptr nocapture noundef %26) #8
  store i32 %27, ptr @position, align 4, !tbaa !10
  br label %47

28:                                               ; preds = %9
  %29 = add nsw i32 %.05999, 1
  %30 = icmp slt i32 %29, %0
  br i1 %30, label %31, label %47

31:                                               ; preds = %28
  %32 = sext i32 %29 to i64
  %33 = getelementptr inbounds ptr, ptr %1, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = tail call i32 @atoi(ptr nocapture noundef %34) #8
  store i32 %35, ptr @portion, align 4, !tbaa !10
  br label %47

36:                                               ; preds = %9
  %37 = add nsw i32 %.05999, 1
  %38 = icmp slt i32 %37, %0
  br i1 %38, label %39, label %47

39:                                               ; preds = %36
  %40 = sext i32 %37 to i64
  %41 = getelementptr inbounds ptr, ptr %1, i64 %40
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = tail call i32 @atoi(ptr nocapture noundef %42) #8
  store i32 %43, ptr @fail_io_num, align 4, !tbaa !10
  br label %47

44:                                               ; preds = %9
  store i32 1, ptr @seek_to_byte, align 4, !tbaa !10
  br label %47

45:                                               ; preds = %9
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  br label %94

47:                                               ; preds = %9, %44, %15, %12, %23, %20, %31, %28, %39, %36
  %.162 = phi i32 [ %.06198, %44 ], [ %.06198, %39 ], [ %.06198, %36 ], [ %.06198, %31 ], [ %.06198, %28 ], [ %.06198, %23 ], [ %.06198, %20 ], [ %.06198, %15 ], [ %.06198, %12 ], [ 1, %9 ]
  %.160 = phi i32 [ %.05999, %44 ], [ %37, %39 ], [ %37, %36 ], [ %29, %31 ], [ %29, %28 ], [ %21, %23 ], [ %21, %20 ], [ %13, %15 ], [ %13, %12 ], [ %.05999, %9 ]
  %48 = add nsw i32 %.160, 1
  %49 = icmp slt i32 %48, %0
  br i1 %49, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !12

._crit_edge.loopexit:                             ; preds = %.lr.ph, %47
  %.061.lcssa.ph = phi i32 [ %.162, %47 ], [ %.06198, %.lr.ph ]
  %.059.lcssa.ph = phi i32 [ %48, %47 ], [ %.05999, %.lr.ph ]
  %50 = icmp eq i32 %.061.lcssa.ph, 0
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %2
  %.061.lcssa = phi i1 [ true, %2 ], [ %50, %._crit_edge.loopexit ]
  %.059.lcssa = phi i32 [ 1, %2 ], [ %.059.lcssa.ph, %._crit_edge.loopexit ]
  %.lcssa = phi i1 [ false, %2 ], [ %.not, %._crit_edge.loopexit ]
  %51 = add nsw i32 %.059.lcssa, 1
  %52 = icmp slt i32 %51, %0
  br i1 %52, label %53, label %57

53:                                               ; preds = %._crit_edge
  %54 = sext i32 %51 to i64
  %55 = getelementptr inbounds ptr, ptr %1, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %._crit_edge, %53
  %58 = phi ptr [ %56, %53 ], [ null, %._crit_edge ]
  %59 = add nsw i32 %.059.lcssa, 2
  %60 = icmp slt i32 %59, %0
  br i1 %60, label %61, label %.thread

61:                                               ; preds = %57
  %62 = sext i32 %59 to i64
  %63 = getelementptr inbounds ptr, ptr %1, i64 %62
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  %.not81 = icmp eq ptr %64, null
  br i1 %.not81, label %.thread, label %65

65:                                               ; preds = %61
  %66 = tail call noalias ptr @fopen(ptr noundef nonnull %64, ptr noundef nonnull @.str.1)
  %67 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %64, i32 noundef 46) #8
  %.not82 = icmp eq ptr %67, null
  br i1 %.not82, label %.thread, label %68

68:                                               ; preds = %65
  %69 = getelementptr inbounds i8, ptr %67, i64 1
  %70 = tail call i32 @strcasecmp(ptr noundef nonnull %69, ptr noundef nonnull @.str.2) #8
  %.not83 = icmp eq i32 %70, 0
  br i1 %.not83, label %71, label %.thread

71:                                               ; preds = %68
  store i32 1, ptr @wave_out, align 4, !tbaa !10
  br label %.thread

.thread:                                          ; preds = %57, %65, %68, %71, %61
  %.063 = phi ptr [ null, %61 ], [ %66, %71 ], [ %66, %68 ], [ %66, %65 ], [ null, %57 ]
  %.not84 = icmp eq ptr %58, null
  br i1 %.not84, label %.thread91, label %73

.thread91:                                        ; preds = %.thread
  %72 = call ptr @preload(ptr noundef null, ptr noundef nonnull %3)
  br label %78

73:                                               ; preds = %.thread
  %74 = tail call noalias ptr @fopen(ptr noundef nonnull %58, ptr noundef nonnull @.str.3)
  %75 = call ptr @preload(ptr noundef %74, ptr noundef nonnull %3)
  %.not85 = icmp eq ptr %74, null
  br i1 %.not85, label %78, label %76

76:                                               ; preds = %73
  %77 = call i32 @fclose(ptr noundef nonnull %74)
  br label %78

78:                                               ; preds = %.thread91, %76, %73
  %79 = phi ptr [ %72, %.thread91 ], [ %75, %76 ], [ %75, %73 ]
  br i1 %.lcssa, label %80, label %.thread93

80:                                               ; preds = %78
  %81 = sext i32 %.059.lcssa to i64
  %82 = getelementptr inbounds ptr, ptr %1, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %.not86 = icmp eq ptr %83, null
  br i1 %.not86, label %.thread93, label %85

.thread93:                                        ; preds = %78, %80
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  br label %94

85:                                               ; preds = %80
  br i1 %.061.lcssa, label %88, label %86

86:                                               ; preds = %85
  %87 = call i32 @self_test(ptr noundef nonnull %83)
  br label %94

88:                                               ; preds = %85
  %89 = load i32, ptr %3, align 4, !tbaa !10
  call void @decode_file(ptr noundef nonnull %83, ptr noundef %79, i32 noundef %89, ptr noundef %.063)
  %.not88 = icmp eq ptr %79, null
  br i1 %.not88, label %91, label %90

90:                                               ; preds = %88
  call void @free(ptr noundef nonnull %79) #7
  br label %91

91:                                               ; preds = %90, %88
  %.not89 = icmp eq ptr %.063, null
  br i1 %.not89, label %94, label %92

92:                                               ; preds = %91
  %93 = call i32 @fclose(ptr noundef nonnull %.063)
  br label %94

94:                                               ; preds = %.thread93, %86, %92, %91, %45
  %.1 = phi i32 [ 1, %45 ], [ %87, %86 ], [ 1, %.thread93 ], [ 0, %92 ], [ 0, %91 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret i32 %.1
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden ptr @preload(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


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