; 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 }
%struct.nifti_image = type { i32, i32, i32, i32, i32, i32, i32, i32, [8 x i32], i64, i32, i32, float, float, float, float, float, float, float, [8 x float], float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32, float, float, float, float, float, float, float, float, %struct.mat44, %struct.mat44, %struct.mat44, %struct.mat44, float, i32, i32, i32, i32, float, float, float, [16 x i8], [80 x i8], [24 x i8], ptr, ptr, i32, i32, i32, ptr, i32, ptr, i32 }
%struct.mat44 = type { [4 x [4 x float]] }

@stderr = external global ptr, align 8
@g_debug = external hidden global i32, align 4
@.str.227 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.235 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.236 = external hidden unnamed_addr constant [34 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 uwtable
define dso_local i32 @act_strip(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %7 = load i32, ptr @g_debug, align 4, !tbaa !9
  %8 = icmp sgt i32 %7, 2
  br i1 %8, label %9, label %16

9:                                                ; preds = %1
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.nt_opts, ptr %11, i32 0, i32 33
  %13 = getelementptr inbounds %struct.str_list, ptr %12, i32 0, i32 0
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef @.str.234, i32 noundef %14) #5
  br label %16

16:                                               ; preds = %9, %1
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.nt_opts, ptr %17, i32 0, i32 28
  %19 = load ptr, ptr %18, align 8, !tbaa !14
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %34

21:                                               ; preds = %16
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.nt_opts, ptr %22, i32 0, i32 33
  %24 = getelementptr inbounds %struct.str_list, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 8, !tbaa !11
  %26 = icmp ne i32 %25, 1
  br i1 %26, label %27, label %34

27:                                               ; preds = %21
  %28 = load ptr, ptr @stderr, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.nt_opts, ptr %29, i32 0, i32 33
  %31 = getelementptr inbounds %struct.str_list, ptr %30, i32 0, i32 0
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.227, i32 noundef %32) #5
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %123

34:                                               ; preds = %21, %16
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %109, %34
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.nt_opts, ptr %37, i32 0, i32 33
  %39 = getelementptr inbounds %struct.str_list, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !11
  %41 = icmp slt i32 %36, %40
  br i1 %41, label %42, label %112

42:                                               ; preds = %35
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.nt_opts, ptr %44, i32 0, i32 33
  %46 = getelementptr inbounds %struct.str_list, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds ptr, ptr %47, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = call ptr @nt_image_read(ptr noundef %43, ptr noundef %51, i32 noundef 1)
  store ptr %52, ptr %4, align 8, !tbaa !5
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %56, label %55

55:                                               ; preds = %42
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %123

56:                                               ; preds = %42
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = call i32 @nifti_free_extensions(ptr noundef %57)
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.nifti_image, ptr %59, i32 0, i32 53
  %61 = getelementptr inbounds [80 x i8], ptr %60, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 4 %61, i8 0, i64 80, i1 false)
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.nt_opts, ptr %62, i32 0, i32 28
  %64 = load ptr, ptr %63, align 8, !tbaa !14
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %81

66:                                               ; preds = %56
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.nt_opts, ptr %68, i32 0, i32 28
  %70 = load ptr, ptr %69, align 8, !tbaa !14
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.nt_opts, ptr %71, i32 0, i32 27
  %73 = load i32, ptr %72, align 4, !tbaa !16
  %74 = icmp ne i32 %73, 0
  %75 = xor i1 %74, true
  %76 = zext i1 %75 to i32
  %77 = call i32 @nifti_set_filenames(ptr noundef %67, ptr noundef %70, i32 noundef %76, i32 noundef 1)
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %66
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nifti_image_free(ptr noundef %80)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %123

81:                                               ; preds = %66, %56
  %82 = load i32, ptr @g_debug, align 4, !tbaa !9
  %83 = icmp sgt i32 %82, 1
  br i1 %83, label %84, label %90

84:                                               ; preds = %81
  %85 = load ptr, ptr @stderr, align 8, !tbaa !5
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.nifti_image, ptr %86, i32 0, i32 55
  %88 = load ptr, ptr %87, align 8, !tbaa !17
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.235, ptr noundef %88) #5
  br label %90

90:                                               ; preds = %84, %81
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nifti_image_write(ptr noundef %91)
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = call i32 @nifti_image_write_status(ptr noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %102

95:                                               ; preds = %90
  %96 = load ptr, ptr @stderr, align 8, !tbaa !5
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.nifti_image, ptr %97, i32 0, i32 55
  %99 = load ptr, ptr %98, align 8, !tbaa !17
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef @.str.232, ptr noundef %99) #5
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nifti_image_free(ptr noundef %101)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %123

102:                                              ; preds = %90
  %103 = load i32, ptr @g_debug, align 4, !tbaa !9
  %104 = icmp sgt i32 %103, 3
  br i1 %104, label %105, label %107

105:                                              ; preds = %102
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nifti_image_infodump(ptr noundef %106)
  br label %107

107:                                              ; preds = %105, %102
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  call void @nifti_image_free(ptr noundef %108)
  br label %109

109:                                              ; preds = %107
  %110 = load i32, ptr %5, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %5, align 4, !tbaa !9
  br label %35, !llvm.loop !22

112:                                              ; preds = %35
  %113 = load i32, ptr @g_debug, align 4, !tbaa !9
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %115, label %122

115:                                              ; preds = %112
  %116 = load ptr, ptr @stderr, align 8, !tbaa !5
  %117 = load ptr, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.nt_opts, ptr %117, i32 0, i32 33
  %119 = getelementptr inbounds %struct.str_list, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 8, !tbaa !11
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.236, i32 noundef %120) #5
  br label %122

122:                                              ; preds = %115, %112
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %123

123:                                              ; preds = %122, %95, %79, %55, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %124 = load i32, ptr %2, align 4
  ret i32 %124
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

declare void @nifti_image_free(ptr noundef) #4

declare i32 @nifti_set_filenames(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #4

declare i32 @nifti_image_write_status(ptr noundef) #4

declare i32 @nifti_free_extensions(ptr noundef) #4

declare void @nifti_image_write(ptr noundef) #4

declare void @nifti_image_infodump(ptr noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { "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 }

!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 240}
!12 = !{!"", !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, !13, i64 176, !13, i64 192, !13, i64 208, !13, i64 224, !13, i64 240, !7, i64 256}
!13 = !{!"", !10, i64 0, !6, i64 8}
!14 = !{!12, !6, i64 168}
!15 = !{!12, !6, i64 248}
!16 = !{!12, !10, i64 164}
!17 = !{!18, !6, i64 632}
!18 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !19, i64 64, !10, i64 72, !10, i64 76, !20, i64 80, !20, i64 84, !20, i64 88, !20, i64 92, !20, i64 96, !20, i64 100, !20, i64 104, !7, i64 108, !20, i64 140, !20, i64 144, !20, i64 148, !20, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !20, i64 188, !20, i64 192, !20, i64 196, !20, i64 200, !20, i64 204, !20, i64 208, !20, i64 212, !20, i64 216, !21, i64 220, !21, i64 284, !21, i64 348, !21, i64 412, !20, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !20, i64 496, !20, i64 500, !20, i64 504, !7, i64 508, !7, i64 524, !7, i64 604, !6, i64 632, !6, i64 640, !10, i64 648, !10, i64 652, !10, i64 656, !6, i64 664, !10, i64 672, !6, i64 680, !10, i64 688}
!19 = !{!"long", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!"", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"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"

@stderr = external local_unnamed_addr global ptr, align 8
@g_debug = external hidden local_unnamed_addr global i32, align 4
@.str.227 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.232 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.234 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.235 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.236 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @act_strip(ptr noundef %0) local_unnamed_addr #0 {
  %2 = load i32, ptr @g_debug, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 2
  br i1 %3, label %4, label %9

4:                                                ; preds = %1
  %5 = load ptr, ptr @stderr, align 8, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %0, i64 240
  %7 = load i32, ptr %6, align 8, !tbaa !11
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.234, i32 noundef %7) #4
  br label %9

9:                                                ; preds = %4, %1
  %10 = getelementptr inbounds i8, ptr %0, i64 168
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %.not = icmp eq ptr %11, null
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 240
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !11
  br i1 %.not, label %16, label %12

12:                                               ; preds = %9
  %.not31 = icmp eq i32 %.pre, 1
  br i1 %.not31, label %.lr.ph, label %13

13:                                               ; preds = %12
  %14 = load ptr, ptr @stderr, align 8, !tbaa !9
  %15 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.227, i32 noundef %.pre) #4
  br label %.loopexit

16:                                               ; preds = %9
  %17 = icmp sgt i32 %.pre, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %12, %16
  %18 = getelementptr inbounds i8, ptr %0, i64 240
  %19 = getelementptr inbounds i8, ptr %0, i64 248
  %20 = getelementptr inbounds i8, ptr %0, i64 164
  br label %21

21:                                               ; preds = %.lr.ph, %54
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %54 ]
  %22 = load ptr, ptr %19, align 8, !tbaa !15
  %23 = getelementptr inbounds ptr, ptr %22, i64 %indvars.iv
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = tail call ptr @nt_image_read(ptr noundef nonnull %0, ptr noundef %24, i32 noundef 1)
  %.not32 = icmp eq ptr %25, null
  br i1 %.not32, label %.loopexit, label %26

26:                                               ; preds = %21
  %27 = tail call i32 @nifti_free_extensions(ptr noundef nonnull %25) #5
  %28 = getelementptr inbounds i8, ptr %25, i64 524
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(80) %28, i8 0, i64 80, i1 false)
  %29 = load ptr, ptr %10, align 8, !tbaa !14
  %.not33 = icmp eq ptr %29, null
  br i1 %.not33, label %35, label %30

30:                                               ; preds = %26
  %31 = load i32, ptr %20, align 4, !tbaa !16
  %.not34 = icmp eq i32 %31, 0
  %32 = zext i1 %.not34 to i32
  %33 = tail call i32 @nifti_set_filenames(ptr noundef nonnull %25, ptr noundef nonnull %29, i32 noundef %32, i32 noundef 1) #5
  %.not35 = icmp eq i32 %33, 0
  br i1 %.not35, label %35, label %34

34:                                               ; preds = %30
  tail call void @nifti_image_free(ptr noundef nonnull %25) #5
  br label %.loopexit

35:                                               ; preds = %30, %26
  %36 = load i32, ptr @g_debug, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 1
  br i1 %37, label %38, label %43

38:                                               ; preds = %35
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %25, i64 632
  %41 = load ptr, ptr %40, align 8, !tbaa !17
  %42 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef nonnull @.str.235, ptr noundef %41) #4
  br label %43

43:                                               ; preds = %38, %35
  tail call void @nifti_image_write(ptr noundef nonnull %25) #5
  %44 = tail call i32 @nifti_image_write_status(ptr noundef nonnull %25) #5
  %.not36 = icmp eq i32 %44, 0
  br i1 %.not36, label %50, label %45

45:                                               ; preds = %43
  %46 = load ptr, ptr @stderr, align 8, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %25, i64 632
  %48 = load ptr, ptr %47, align 8, !tbaa !17
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.232, ptr noundef %48) #4
  tail call void @nifti_image_free(ptr noundef nonnull %25) #5
  br label %.loopexit

50:                                               ; preds = %43
  %51 = load i32, ptr @g_debug, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 3
  br i1 %52, label %53, label %54

53:                                               ; preds = %50
  tail call void @nifti_image_infodump(ptr noundef nonnull %25) #5
  br label %54

54:                                               ; preds = %53, %50
  tail call void @nifti_image_free(ptr noundef nonnull %25) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = load i32, ptr %18, align 8, !tbaa !11
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next, %56
  br i1 %57, label %21, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %54, %16
  %.lcssa = phi i32 [ %.pre, %16 ], [ %55, %54 ]
  %58 = load i32, ptr @g_debug, align 4, !tbaa !5
  %59 = icmp sgt i32 %58, 0
  br i1 %59, label %60, label %.loopexit

60:                                               ; preds = %._crit_edge
  %61 = load ptr, ptr @stderr, align 8, !tbaa !9
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull @.str.236, i32 noundef %.lcssa) #4
  br label %.loopexit

.loopexit:                                        ; preds = %21, %._crit_edge, %60, %45, %34, %13
  %.026 = phi i32 [ 1, %13 ], [ 1, %34 ], [ 1, %45 ], [ 0, %60 ], [ 0, %._crit_edge ], [ 1, %21 ]
  ret i32 %.026
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

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

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

declare void @nifti_image_free(ptr noundef) local_unnamed_addr #3

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

declare i32 @nifti_image_write_status(ptr noundef) local_unnamed_addr #3

declare i32 @nifti_free_extensions(ptr noundef) local_unnamed_addr #3

declare void @nifti_image_write(ptr noundef) local_unnamed_addr #3

declare void @nifti_image_infodump(ptr noundef) local_unnamed_addr #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { cold nounwind }
attributes #5 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 240}
!12 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !7, i64 88, !7, i64 120, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !10, i64 168, !13, i64 176, !13, i64 192, !13, i64 208, !13, i64 224, !13, i64 240, !7, i64 256}
!13 = !{!"", !6, i64 0, !10, i64 8}
!14 = !{!12, !10, i64 168}
!15 = !{!12, !10, i64 248}
!16 = !{!12, !6, i64 164}
!17 = !{!18, !10, i64 632}
!18 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !7, i64 32, !19, i64 64, !6, i64 72, !6, i64 76, !20, i64 80, !20, i64 84, !20, i64 88, !20, i64 92, !20, i64 96, !20, i64 100, !20, i64 104, !7, i64 108, !20, i64 140, !20, i64 144, !20, i64 148, !20, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184, !20, i64 188, !20, i64 192, !20, i64 196, !20, i64 200, !20, i64 204, !20, i64 208, !20, i64 212, !20, i64 216, !21, i64 220, !21, i64 284, !21, i64 348, !21, i64 412, !20, i64 476, !6, i64 480, !6, i64 484, !6, i64 488, !6, i64 492, !20, i64 496, !20, i64 500, !20, i64 504, !7, i64 508, !7, i64 524, !7, i64 604, !10, i64 632, !10, i64 640, !6, i64 648, !6, i64 652, !6, i64 656, !10, i64 664, !6, i64 672, !10, i64 680, !6, i64 688}
!19 = !{!"long", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!"", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


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