; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/NIFTI/src/nifti/niftilib (nifti1_tool)

; 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.nt_opts = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [8 x i32], [8 x i32], i32, i32, i32, i32, ptr, %struct.str_list, %struct.int_list, %struct.str_list, %struct.str_list, %struct.str_list, [2048 x i8] }
%struct.int_list = type { i32, ptr }
%struct.str_list = type { i32, ptr }

@stderr = external global ptr, align 8
@.str.45 = external hidden unnamed_addr constant [9 x i8], align 1
@g_debug = external hidden global i32, align 4
@.str.86 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [4 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 willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() #3

; Function Attrs: nounwind uwtable
define dso_local i32 @fill_cmd_string(ptr noundef %0, i32 noundef %1, ptr noundef %2) #4 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 2048, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.nt_opts, ptr %16, i32 0, i32 34
  %18 = getelementptr inbounds [2048 x i8], ptr %17, i64 0, i64 0
  %19 = load ptr, ptr %7, align 8, !tbaa !5
  %20 = getelementptr inbounds ptr, ptr %19, i64 0
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %18, i64 noundef 2048, ptr noundef @.str.86, ptr noundef %21) #5
  store i32 %22, ptr %9, align 4, !tbaa !9
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = icmp slt i32 %23, 0
  br i1 %24, label %28, label %25

25:                                               ; preds = %3
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = icmp sge i32 %26, 2048
  br i1 %27, label %28, label %31

28:                                               ; preds = %25, %3
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str.87) #5
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %177

31:                                               ; preds = %25
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.nt_opts, ptr %32, i32 0, i32 34
  %34 = getelementptr inbounds [2048 x i8], ptr %33, i64 0, i64 0
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds i8, ptr %34, i64 %36
  store ptr %37, ptr %8, align 8, !tbaa !5
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = sub nsw i32 %39, %38
  store i32 %40, ptr %10, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %149, %31
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %152

45:                                               ; preds = %41
  %46 = load i32, ptr %14, align 4, !tbaa !9
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %45
  %49 = load i32, ptr %14, align 4, !tbaa !9
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr %14, align 4, !tbaa !9
  br label %149

51:                                               ; preds = %45
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = call i64 @strlen(ptr noundef %56) #6
  %58 = trunc i64 %57 to i32
  store i32 %58, ptr %9, align 4, !tbaa !9
  %59 = load i32, ptr %9, align 4, !tbaa !9
  %60 = add nsw i32 %59, 3
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = icmp sge i32 %60, %61
  br i1 %62, label %63, label %66

63:                                               ; preds = %51
  %64 = load ptr, ptr @stderr, align 8, !tbaa !5
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.87) #5
  store i32 1, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %177

66:                                               ; preds = %51
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %67

67:                                               ; preds = %93, %66
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = sub nsw i32 %69, 1
  %71 = icmp slt i32 %68, %70
  br i1 %71, label %72, label %96

72:                                               ; preds = %67
  %73 = call ptr @__ctype_b_loc() #7
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds ptr, ptr %75, i64 %77
  %79 = load ptr, ptr %78, align 8, !tbaa !5
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i8, ptr %79, i64 %81
  %83 = load i8, ptr %82, align 1, !tbaa !11
  %84 = sext i8 %83 to i32
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i16, ptr %74, i64 %85
  %87 = load i16, ptr %86, align 2, !tbaa !12
  %88 = zext i16 %87 to i32
  %89 = and i32 %88, 8192
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %72
  store i32 1, ptr %13, align 4, !tbaa !9
  br label %96

92:                                               ; preds = %72
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %11, align 4, !tbaa !9
  br label %67, !llvm.loop !14

96:                                               ; preds = %91, %67
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %109

99:                                               ; preds = %96
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load i32, ptr %10, align 4, !tbaa !9
  %102 = sext i32 %101 to i64
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %100, i64 noundef %102, ptr noundef @.str.88, ptr noundef %107) #5
  store i32 %108, ptr %9, align 4, !tbaa !9
  br label %119

109:                                              ; preds = %96
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i32, ptr %12, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %113, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %110, i64 noundef %112, ptr noundef @.str.89, ptr noundef %117) #5
  store i32 %118, ptr %9, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %109, %99
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = load i32, ptr %10, align 4, !tbaa !9
  %122 = sub nsw i32 %121, %120
  store i32 %122, ptr %10, align 4, !tbaa !9
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds ptr, ptr %123, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  %129 = call i32 @strncmp(ptr noundef %128, ptr noundef @.str.45, i64 noundef 3) #6
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %144, label %131

131:                                              ; preds = %119
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.nt_opts, ptr %132, i32 0, i32 33
  %134 = getelementptr inbounds %struct.str_list, ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 8, !tbaa !16
  %136 = icmp sgt i32 %135, 4
  br i1 %136, label %137, label %143

137:                                              ; preds = %131
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.nt_opts, ptr %138, i32 0, i32 33
  %140 = getelementptr inbounds %struct.str_list, ptr %139, i32 0, i32 0
  %141 = load i32, ptr %140, align 8, !tbaa !16
  %142 = sub nsw i32 %141, 2
  store i32 %142, ptr %14, align 4, !tbaa !9
  br label %143

143:                                              ; preds = %137, %131
  br label %144

144:                                              ; preds = %143, %119
  %145 = load i32, ptr %9, align 4, !tbaa !9
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds i8, ptr %146, i64 %147
  store ptr %148, ptr %8, align 8, !tbaa !5
  br label %149

149:                                              ; preds = %144, %48
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %12, align 4, !tbaa !9
  br label %41, !llvm.loop !19

152:                                              ; preds = %41
  %153 = load i32, ptr @g_debug, align 4, !tbaa !9
  %154 = icmp sgt i32 %153, 1
  br i1 %154, label %155, label %176

155:                                              ; preds = %152
  %156 = load ptr, ptr @stderr, align 8, !tbaa !5
  %157 = load i32, ptr %6, align 4, !tbaa !9
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.nt_opts, ptr %159, i32 0, i32 34
  %161 = getelementptr inbounds [2048 x i8], ptr %160, i64 0, i64 0
  %162 = ptrtoint ptr %158 to i64
  %163 = ptrtoint ptr %161 to i64
  %164 = sub i64 %162, %163
  %165 = trunc i64 %164 to i32
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.90, i32 noundef %157, i32 noundef %165) #5
  %167 = load i32, ptr @g_debug, align 4, !tbaa !9
  %168 = icmp sgt i32 %167, 2
  br i1 %168, label %169, label %175

169:                                              ; preds = %155
  %170 = load ptr, ptr @stderr, align 8, !tbaa !5
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.nt_opts, ptr %171, i32 0, i32 34
  %173 = getelementptr inbounds [2048 x i8], ptr %172, i64 0, i64 0
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef @.str.91, ptr noundef %173) #5
  br label %175

175:                                              ; preds = %169, %155
  br label %176

176:                                              ; preds = %175, %152
  store i32 0, ptr %4, align 4
  store i32 1, ptr %15, align 4
  br label %177

177:                                              ; preds = %176, %63, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %178 = load i32, ptr %4, align 4
  ret i32 %178
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !10, i64 240}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !7, i64 88, !7, i64 120, !10, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !6, i64 168, !18, i64 176, !18, i64 192, !18, i64 208, !18, i64 224, !18, i64 240, !7, i64 256}
!18 = !{!"", !10, i64 0, !6, i64 8}
!19 = distinct !{!19, !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.45 = external hidden unnamed_addr constant [9 x i8], align 1
@g_debug = external hidden local_unnamed_addr global i32, align 4
@.str.86 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nofree nounwind uwtable
define dso_local range(i32 0, 2) i32 @fill_cmd_string(ptr noundef %0, i32 noundef %1, ptr nocapture noundef readonly %2) local_unnamed_addr #3 {
  %4 = getelementptr inbounds i8, ptr %0, i64 256
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %4, i64 noundef 2048, ptr noundef nonnull @.str.86, ptr noundef %5) #4
  %or.cond = icmp ugt i32 %6, 2047
  br i1 %or.cond, label %7, label %10

7:                                                ; preds = %3
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.87) #5
  br label %71

10:                                               ; preds = %3
  %11 = zext nneg i32 %6 to i64
  %12 = getelementptr inbounds i8, ptr %4, i64 %11
  %13 = icmp sgt i32 %1, 1
  br i1 %13, label %.lr.ph70, label %._crit_edge

.lr.ph70:                                         ; preds = %10
  %14 = sub nuw nsw i32 2048, %6
  %15 = getelementptr inbounds i8, ptr %0, i64 240
  %wide.trip.count75 = zext nneg i32 %1 to i64
  br label %16

16:                                               ; preds = %.lr.ph70, %56
  %indvars.iv72 = phi i64 [ 1, %.lr.ph70 ], [ %indvars.iv.next73, %56 ]
  %.069 = phi i32 [ 0, %.lr.ph70 ], [ %.2, %56 ]
  %.04866 = phi i32 [ %14, %.lr.ph70 ], [ %.149, %56 ]
  %.05165 = phi ptr [ %12, %.lr.ph70 ], [ %.152, %56 ]
  %.not = icmp eq i32 %.069, 0
  br i1 %.not, label %19, label %17

17:                                               ; preds = %16
  %18 = add nsw i32 %.069, -1
  br label %56

19:                                               ; preds = %16
  %20 = getelementptr inbounds ptr, ptr %2, i64 %indvars.iv72
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %22 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %21) #6
  %23 = trunc i64 %22 to i32
  %24 = add nsw i32 %23, 3
  %.not57 = icmp slt i32 %24, %.04866
  br i1 %.not57, label %.preheader, label %28

.preheader:                                       ; preds = %19
  %.not6063 = icmp sgt i32 %23, 1
  br i1 %.not6063, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader
  %25 = add i64 %22, 4294967295
  %26 = tail call ptr @__ctype_b_loc() #7
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %wide.trip.count = and i64 %25, 4294967295
  br label %32

28:                                               ; preds = %19
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.87) #5
  br label %71

31:                                               ; preds = %32
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %32, !llvm.loop !9

32:                                               ; preds = %.lr.ph, %31
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %31 ]
  %33 = getelementptr inbounds i8, ptr %21, i64 %indvars.iv
  %34 = load i8, ptr %33, align 1, !tbaa !11
  %35 = sext i8 %34 to i64
  %36 = getelementptr inbounds i16, ptr %27, i64 %35
  %37 = load i16, ptr %36, align 2, !tbaa !12
  %38 = and i16 %37, 8192
  %.not58 = icmp eq i16 %38, 0
  br i1 %.not58, label %31, label %39

39:                                               ; preds = %32
  %40 = sext i32 %.04866 to i64
  %41 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %.05165, i64 noundef %40, ptr noundef nonnull @.str.88, ptr noundef nonnull %21) #4
  br label %44

.critedge:                                        ; preds = %31, %.preheader
  %42 = sext i32 %.04866 to i64
  %43 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %.05165, i64 noundef %42, ptr noundef nonnull @.str.89, ptr noundef %21) #4
  br label %44

44:                                               ; preds = %.critedge, %39
  %.050 = phi i32 [ %41, %39 ], [ %43, %.critedge ]
  %45 = sub nsw i32 %.04866, %.050
  %46 = getelementptr i8, ptr %20, i64 -8
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %47, ptr noundef nonnull dereferenceable(1) @.str.45, i64 noundef 3) #6
  %.not61 = icmp eq i32 %48, 0
  br i1 %.not61, label %49, label %53

49:                                               ; preds = %44
  %50 = load i32, ptr %15, align 8, !tbaa !14
  %51 = icmp sgt i32 %50, 4
  %52 = add nsw i32 %50, -2
  %spec.select = select i1 %51, i32 %52, i32 0
  br label %53

53:                                               ; preds = %49, %44
  %.1 = phi i32 [ 0, %44 ], [ %spec.select, %49 ]
  %54 = sext i32 %.050 to i64
  %55 = getelementptr inbounds i8, ptr %.05165, i64 %54
  br label %56

56:                                               ; preds = %53, %17
  %.152 = phi ptr [ %.05165, %17 ], [ %55, %53 ]
  %.149 = phi i32 [ %.04866, %17 ], [ %45, %53 ]
  %.2 = phi i32 [ %18, %17 ], [ %.1, %53 ]
  %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
  %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
  br i1 %exitcond76.not, label %._crit_edge, label %16, !llvm.loop !18

._crit_edge:                                      ; preds = %56, %10
  %.051.lcssa = phi ptr [ %12, %10 ], [ %.152, %56 ]
  %57 = load i32, ptr @g_debug, align 4, !tbaa !19
  %58 = icmp sgt i32 %57, 1
  br i1 %58, label %59, label %71

59:                                               ; preds = %._crit_edge
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = ptrtoint ptr %.051.lcssa to i64
  %62 = ptrtoint ptr %4 to i64
  %63 = sub i64 %61, %62
  %64 = trunc i64 %63 to i32
  %65 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.90, i32 noundef %1, i32 noundef %64) #5
  %66 = load i32, ptr @g_debug, align 4, !tbaa !19
  %67 = icmp sgt i32 %66, 2
  br i1 %67, label %68, label %71

68:                                               ; preds = %59
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  %70 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.91, ptr noundef nonnull %4) #5
  br label %71

71:                                               ; preds = %._crit_edge, %68, %59, %28, %7
  %.053 = phi i32 [ 1, %7 ], [ 1, %28 ], [ 0, %59 ], [ 0, %68 ], [ 0, %._crit_edge ]
  ret i32 %.053
}

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #0

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { nofree 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 #4 = { nounwind }
attributes #5 = { cold nounwind }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!15, !16, i64 240}
!15 = !{!"", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36, !16, i64 40, !16, i64 44, !16, i64 48, !16, i64 52, !16, i64 56, !16, i64 60, !16, i64 64, !16, i64 68, !16, i64 72, !16, i64 76, !16, i64 80, !16, i64 84, !7, i64 88, !7, i64 120, !16, i64 152, !16, i64 156, !16, i64 160, !16, i64 164, !6, i64 168, !17, i64 176, !17, i64 192, !17, i64 208, !17, i64 224, !17, i64 240, !7, i64 256}
!16 = !{!"int", !7, i64 0}
!17 = !{!"", !16, i64 0, !6, i64 8}
!18 = distinct !{!18, !10}
!19 = !{!16, !16, i64 0}


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