; 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.field_s = type { i32, i32, i32, i32, [20 x i8] }

@g_debug = external hidden global i32, align 4
@stdout = external global ptr, align 8
@.str.449 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.450 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.451 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.452 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.453 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.454 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.455 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.456 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.457 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.458 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.459 = external hidden unnamed_addr constant [6 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 i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @disp_raw_data(ptr noundef, i32 noundef, i32 noundef, i8 noundef signext, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @disp_nifti1_extension(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @disp_field(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) #4 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %24

20:                                               ; preds = %5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr @stdout, align 8, !tbaa !5
  %23 = call i32 @fputs(ptr noundef %21, ptr noundef %22)
  br label %24

24:                                               ; preds = %20, %5
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 0
  br i1 %26, label %27, label %35

27:                                               ; preds = %24
  %28 = load i32, ptr @g_debug, align 4, !tbaa !9
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %30, label %35

30:                                               ; preds = %27
  %31 = load ptr, ptr @stdout, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.449) #5
  %33 = load ptr, ptr @stdout, align 8, !tbaa !5
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.450) #5
  br label %35

35:                                               ; preds = %30, %27, %24
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %36, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %200, %35
  %38 = load i32, ptr %12, align 4, !tbaa !9
  %39 = load i32, ptr %9, align 4, !tbaa !9
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %41, label %205

41:                                               ; preds = %37
  %42 = load i32, ptr @g_debug, align 4, !tbaa !9
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %56

44:                                               ; preds = %41
  %45 = load ptr, ptr @stdout, align 8, !tbaa !5
  %46 = load ptr, ptr %11, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.field_s, ptr %46, i32 0, i32 4
  %48 = getelementptr inbounds [20 x i8], ptr %47, i64 0, i64 0
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.field_s, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 4, !tbaa !11
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.field_s, ptr %52, i32 0, i32 3
  %54 = load i32, ptr %53, align 4, !tbaa !13
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.451, i32 noundef 19, i32 noundef 19, ptr noundef %48, i32 noundef %51, i32 noundef %54) #5
  br label %56

56:                                               ; preds = %44, %41
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.field_s, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !14
  switch i32 %59, label %61 [
    i32 0, label %60
    i32 256, label %64
    i32 2, label %64
    i32 4, label %64
    i32 512, label %64
    i32 8, label %64
    i32 768, label %64
    i32 16, label %64
    i32 64, label %64
    i32 -4079, label %78
    i32 -4078, label %81
    i32 -4077, label %169
    i32 -4095, label %186
  ]

60:                                               ; preds = %56
  br label %61

61:                                               ; preds = %60, %56
  %62 = load ptr, ptr @stdout, align 8, !tbaa !5
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str.452) #5
  br label %199

64:                                               ; preds = %56, %56, %56, %56, %56, %56, %56, %56
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.field_s, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %67, align 4, !tbaa !11
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %65, i64 %69
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.field_s, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 4, !tbaa !14
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.field_s, ptr %74, i32 0, i32 3
  %76 = load i32, ptr %75, align 4, !tbaa !13
  %77 = call i32 @disp_raw_data(ptr noundef %70, i32 noundef %73, i32 noundef %76, i8 noundef signext 32, i32 noundef 1)
  br label %199

78:                                               ; preds = %56
  %79 = load ptr, ptr @stdout, align 8, !tbaa !5
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.453) #5
  br label %199

81:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %82 = load ptr, ptr %8, align 8, !tbaa !5
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.field_s, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !11
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %82, i64 %86
  %88 = load ptr, ptr %87, align 8, !tbaa !5
  store ptr %88, ptr %13, align 8, !tbaa !5
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %94, label %91

91:                                               ; preds = %81
  %92 = load ptr, ptr @stdout, align 8, !tbaa !5
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.454) #5
  store i32 5, ptr %15, align 4
  br label %168

94:                                               ; preds = %81
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %95

95:                                               ; preds = %118, %94
  %96 = load i32, ptr %14, align 4, !tbaa !9
  %97 = icmp sle i32 %96, 40
  br i1 %97, label %98, label %115

98:                                               ; preds = %95
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = load i8, ptr %99, align 1, !tbaa !15
  %101 = sext i8 %100 to i32
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %115

103:                                              ; preds = %98
  %104 = call ptr @__ctype_b_loc() #6
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load i8, ptr %106, align 1, !tbaa !15
  %108 = sext i8 %107 to i32
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i16, ptr %105, i64 %109
  %111 = load i16, ptr %110, align 2, !tbaa !16
  %112 = zext i16 %111 to i32
  %113 = and i32 %112, 16384
  %114 = icmp ne i32 %113, 0
  br label %115

115:                                              ; preds = %103, %98, %95
  %116 = phi i1 [ false, %98 ], [ false, %95 ], [ %114, %103 ]
  br i1 %116, label %117, label %123

117:                                              ; preds = %115
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %14, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %14, align 4, !tbaa !9
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i32 1
  store ptr %122, ptr %13, align 8, !tbaa !5
  br label %95, !llvm.loop !18

123:                                              ; preds = %115
  %124 = load i32, ptr %14, align 4, !tbaa !9
  %125 = icmp sgt i32 %124, 40
  br i1 %125, label %126, label %129

126:                                              ; preds = %123
  %127 = load ptr, ptr @stdout, align 8, !tbaa !5
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.455) #5
  br label %167

129:                                              ; preds = %123
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %135

132:                                              ; preds = %129
  %133 = load ptr, ptr @stdout, align 8, !tbaa !5
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.456) #5
  br label %166

135:                                              ; preds = %129
  %136 = load ptr, ptr %13, align 8, !tbaa !5
  %137 = load i8, ptr %136, align 1, !tbaa !15
  %138 = sext i8 %137 to i32
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %155

140:                                              ; preds = %135
  %141 = call ptr @__ctype_b_loc() #6
  %142 = load ptr, ptr %141, align 8, !tbaa !5
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = load i8, ptr %143, align 1, !tbaa !15
  %145 = sext i8 %144 to i32
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i16, ptr %142, i64 %146
  %148 = load i16, ptr %147, align 2, !tbaa !16
  %149 = zext i16 %148 to i32
  %150 = and i32 %149, 16384
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %155, label %152

152:                                              ; preds = %140
  %153 = load ptr, ptr @stdout, align 8, !tbaa !5
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str.457) #5
  br label %165

155:                                              ; preds = %140, %135
  %156 = load ptr, ptr @stdout, align 8, !tbaa !5
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = load ptr, ptr %11, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.field_s, ptr %158, i32 0, i32 1
  %160 = load i32, ptr %159, align 4, !tbaa !11
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds i8, ptr %157, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !5
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.458, ptr noundef %163) #5
  br label %165

165:                                              ; preds = %155, %152
  br label %166

166:                                              ; preds = %165, %132
  br label %167

167:                                              ; preds = %166, %126
  store i32 5, ptr %15, align 4
  br label %168

168:                                              ; preds = %167, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %199

169:                                              ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %171 = load ptr, ptr %11, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.field_s, ptr %171, i32 0, i32 1
  %173 = load i32, ptr %172, align 4, !tbaa !11
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i8, ptr %170, i64 %174
  %176 = load ptr, ptr %175, align 8, !tbaa !5
  store ptr %176, ptr %16, align 8, !tbaa !5
  %177 = load ptr, ptr %16, align 8, !tbaa !5
  %178 = icmp ne ptr %177, null
  br i1 %178, label %179, label %182

179:                                              ; preds = %169
  %180 = load ptr, ptr %16, align 8, !tbaa !5
  %181 = call i32 @disp_nifti1_extension(ptr noundef null, ptr noundef %180, i32 noundef 6)
  br label %185

182:                                              ; preds = %169
  %183 = load ptr, ptr @stdout, align 8, !tbaa !5
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef @.str.454) #5
  br label %185

185:                                              ; preds = %182, %179
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %199

186:                                              ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = load ptr, ptr %11, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.field_s, ptr %188, i32 0, i32 1
  %190 = load i32, ptr %189, align 4, !tbaa !11
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds i8, ptr %187, i64 %191
  store ptr %192, ptr %17, align 8, !tbaa !5
  %193 = load ptr, ptr @stdout, align 8, !tbaa !5
  %194 = load ptr, ptr %11, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.field_s, ptr %194, i32 0, i32 3
  %196 = load i32, ptr %195, align 4, !tbaa !13
  %197 = load ptr, ptr %17, align 8, !tbaa !5
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %193, ptr noundef @.str.459, i32 noundef %196, ptr noundef %197) #5
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %199

199:                                              ; preds = %186, %185, %168, %78, %64, %61
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %12, align 4, !tbaa !9
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %12, align 4, !tbaa !9
  %203 = load ptr, ptr %11, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.field_s, ptr %203, i32 1
  store ptr %204, ptr %11, align 8, !tbaa !5
  br label %37, !llvm.loop !20

205:                                              ; preds = %37
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  ret i32 0
}

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 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 = { "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(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 = !{!12, !10, i64 4}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !7, i64 16}
!13 = !{!12, !10, i64 12}
!14 = !{!12, !10, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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

@g_debug = external hidden local_unnamed_addr global i32, align 4
@stdout = external local_unnamed_addr global ptr, align 8
@.str.449 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.450 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.451 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.452 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.453 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.454 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.455 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.456 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.457 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.458 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.459 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @fputs(ptr nocapture noundef readonly, ptr nocapture noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @disp_raw_data(ptr noundef, i32 noundef, i32 noundef, i8 noundef signext, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @disp_nifti1_extension(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @disp_field(ptr noundef readonly %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %9, label %6

6:                                                ; preds = %5
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  %8 = tail call i32 @fputs(ptr noundef nonnull %0, ptr noundef %7)
  br label %9

9:                                                ; preds = %6, %5
  %10 = icmp ne i32 %4, 0
  %11 = load i32, ptr @g_debug, align 4
  %12 = icmp sgt i32 %11, 0
  %or.cond = select i1 %10, i1 %12, i1 false
  br i1 %or.cond, label %13, label %18

13:                                               ; preds = %9
  %14 = load ptr, ptr @stdout, align 8, !tbaa !5
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.449) #3
  %16 = load ptr, ptr @stdout, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.450) #3
  br label %18

18:                                               ; preds = %13, %9
  %19 = icmp sgt i32 %3, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %18, %107
  %.057 = phi ptr [ %109, %107 ], [ %1, %18 ]
  %.03856 = phi i32 [ %108, %107 ], [ 0, %18 ]
  %20 = load i32, ptr @g_debug, align 4, !tbaa !9
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %22, label %30

22:                                               ; preds = %.lr.ph
  %23 = load ptr, ptr @stdout, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %.057, i64 16
  %25 = getelementptr inbounds i8, ptr %.057, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !11
  %27 = getelementptr inbounds i8, ptr %.057, i64 12
  %28 = load i32, ptr %27, align 4, !tbaa !13
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.451, i32 noundef 19, i32 noundef 19, ptr noundef nonnull %24, i32 noundef %26, i32 noundef %28) #3
  br label %30

30:                                               ; preds = %22, %.lr.ph
  %31 = load i32, ptr %.057, align 4, !tbaa !14
  switch i32 %31, label %32 [
    i32 -4095, label %98
    i32 256, label %35
    i32 2, label %35
    i32 4, label %35
    i32 512, label %35
    i32 8, label %35
    i32 768, label %35
    i32 16, label %35
    i32 64, label %35
    i32 -4079, label %43
    i32 -4078, label %46
    i32 -4077, label %87
  ]

32:                                               ; preds = %30
  %33 = load ptr, ptr @stdout, align 8, !tbaa !5
  %34 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.452) #3
  br label %107

35:                                               ; preds = %30, %30, %30, %30, %30, %30, %30, %30
  %36 = getelementptr inbounds i8, ptr %.057, i64 4
  %37 = load i32, ptr %36, align 4, !tbaa !11
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %2, i64 %38
  %40 = getelementptr inbounds i8, ptr %.057, i64 12
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = tail call i32 @disp_raw_data(ptr noundef %39, i32 noundef %31, i32 noundef %41, i8 noundef signext 32, i32 noundef 1)
  br label %107

43:                                               ; preds = %30
  %44 = load ptr, ptr @stdout, align 8, !tbaa !5
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.453) #3
  br label %107

46:                                               ; preds = %30
  %47 = getelementptr inbounds i8, ptr %.057, i64 4
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i8, ptr %2, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %.not47 = icmp eq ptr %51, null
  br i1 %.not47, label %52, label %.preheader

52:                                               ; preds = %46
  %53 = load ptr, ptr @stdout, align 8, !tbaa !5
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef nonnull @.str.454) #3
  br label %107

.preheader:                                       ; preds = %46, %63
  %.03955 = phi i32 [ %64, %63 ], [ 0, %46 ]
  %.04054 = phi ptr [ %65, %63 ], [ %51, %46 ]
  %55 = load i8, ptr %.04054, align 1, !tbaa !15
  %.not48 = icmp eq i8 %55, 0
  br i1 %.not48, label %68, label %56

56:                                               ; preds = %.preheader
  %57 = tail call ptr @__ctype_b_loc() #4
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = sext i8 %55 to i64
  %60 = getelementptr inbounds i16, ptr %58, i64 %59
  %61 = load i16, ptr %60, align 2, !tbaa !16
  %62 = and i16 %61, 16384
  %.not49 = icmp eq i16 %62, 0
  br i1 %.not49, label %.thread, label %63

63:                                               ; preds = %56
  %64 = add nuw nsw i32 %.03955, 1
  %65 = getelementptr inbounds i8, ptr %.04054, i64 1
  %exitcond.not = icmp eq i32 %64, 41
  br i1 %exitcond.not, label %.critedge, label %.preheader, !llvm.loop !18

.critedge:                                        ; preds = %63
  %66 = load ptr, ptr @stdout, align 8, !tbaa !5
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.455) #3
  br label %107

68:                                               ; preds = %.preheader
  %69 = icmp eq i32 %.03955, 0
  br i1 %69, label %71, label %84

.thread:                                          ; preds = %56
  %70 = icmp eq i32 %.03955, 0
  br i1 %70, label %71, label %74

71:                                               ; preds = %.thread, %68
  %72 = load ptr, ptr @stdout, align 8, !tbaa !5
  %73 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.456) #3
  br label %107

74:                                               ; preds = %.thread
  %75 = tail call ptr @__ctype_b_loc() #4
  %76 = load ptr, ptr %75, align 8, !tbaa !5
  %77 = sext i8 %55 to i64
  %78 = getelementptr inbounds i16, ptr %76, i64 %77
  %79 = load i16, ptr %78, align 2, !tbaa !16
  %80 = and i16 %79, 16384
  %.not51 = icmp eq i16 %80, 0
  br i1 %.not51, label %81, label %84

81:                                               ; preds = %74
  %82 = load ptr, ptr @stdout, align 8, !tbaa !5
  %83 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.457) #3
  br label %107

84:                                               ; preds = %68, %74
  %85 = load ptr, ptr @stdout, align 8, !tbaa !5
  %86 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.458, ptr noundef nonnull %51) #3
  br label %107

87:                                               ; preds = %30
  %88 = getelementptr inbounds i8, ptr %.057, i64 4
  %89 = load i32, ptr %88, align 4, !tbaa !11
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i8, ptr %2, i64 %90
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %.not46 = icmp eq ptr %92, null
  br i1 %.not46, label %95, label %93

93:                                               ; preds = %87
  %94 = tail call i32 @disp_nifti1_extension(ptr noundef null, ptr noundef nonnull %92, i32 noundef 6)
  br label %107

95:                                               ; preds = %87
  %96 = load ptr, ptr @stdout, align 8, !tbaa !5
  %97 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.454) #3
  br label %107

98:                                               ; preds = %30
  %99 = getelementptr inbounds i8, ptr %.057, i64 4
  %100 = load i32, ptr %99, align 4, !tbaa !11
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i8, ptr %2, i64 %101
  %103 = load ptr, ptr @stdout, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %.057, i64 12
  %105 = load i32, ptr %104, align 4, !tbaa !13
  %106 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef nonnull @.str.459, i32 noundef %105, ptr noundef %102) #3
  br label %107

107:                                              ; preds = %93, %95, %52, %71, %84, %81, %.critedge, %32, %35, %43, %98
  %108 = add nuw nsw i32 %.03856, 1
  %109 = getelementptr inbounds i8, ptr %.057, i64 36
  %exitcond60.not = icmp eq i32 %108, %3
  br i1 %exitcond60.not, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %107, %18
  ret i32 0
}

attributes #0 = { 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 #1 = { 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 #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 = { nounwind }
attributes #4 = { 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 = !{!12, !10, i64 4}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !7, i64 16}
!13 = !{!12, !10, i64 12}
!14 = !{!12, !10, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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