; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/MINC/src/libminc/nifti (nifti1_io)

; 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.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
@.str.105 = external hidden unnamed_addr constant [5 x i8], align 1
@__const.nifti_type_and_names_match.func = external hidden unnamed_addr constant [27 x i8], align 16
@.str.119 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [50 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @nifti_find_file_extension(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @fileext_n_compare(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @nifti_type_and_names_match(ptr noundef %0, i32 noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [27 x i8], align 16
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 27, ptr %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.nifti_type_and_names_match.func, i64 27, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %21, label %13

13:                                               ; preds = %2
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %20

16:                                               ; preds = %13
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = getelementptr inbounds [27 x i8], ptr %6, i64 0, i64 0
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.119, ptr noundef %18) #5
  br label %20

20:                                               ; preds = %16, %13
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %229

21:                                               ; preds = %2
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.nifti_image, ptr %22, i32 0, i32 55
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = icmp ne ptr %24, null
  br i1 %25, label %36, label %26

26:                                               ; preds = %21
  %27 = load i32, ptr %5, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %33

29:                                               ; preds = %26
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = getelementptr inbounds [27 x i8], ptr %6, i64 0, i64 0
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.120, ptr noundef %31) #5
  br label %33

33:                                               ; preds = %29, %26
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %9, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %33, %21
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.nifti_image, ptr %37, i32 0, i32 56
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = icmp ne ptr %39, null
  br i1 %40, label %51, label %41

41:                                               ; preds = %36
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %48

44:                                               ; preds = %41
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = getelementptr inbounds [27 x i8], ptr %6, i64 0, i64 0
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.121, ptr noundef %46) #5
  br label %48

48:                                               ; preds = %44, %41
  %49 = load i32, ptr %9, align 4, !tbaa !9
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %9, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %48, %36
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.nifti_image, ptr %52, i32 0, i32 47
  %54 = load i32, ptr %53, align 8, !tbaa !17
  %55 = call i32 @is_valid_nifti_type(i32 noundef %54)
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %70, label %57

57:                                               ; preds = %51
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %67

60:                                               ; preds = %57
  %61 = load ptr, ptr @stderr, align 8, !tbaa !5
  %62 = getelementptr inbounds [27 x i8], ptr %6, i64 0, i64 0
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.nifti_image, ptr %63, i32 0, i32 47
  %65 = load i32, ptr %64, align 8, !tbaa !17
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.122, ptr noundef %62, i32 noundef %65) #5
  br label %67

67:                                               ; preds = %60, %57
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %9, align 4, !tbaa !9
  br label %70

70:                                               ; preds = %67, %51
  %71 = load i32, ptr %9, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %229

74:                                               ; preds = %70
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.nifti_image, ptr %75, i32 0, i32 55
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = call ptr @nifti_find_file_extension(ptr noundef %77)
  store ptr %78, ptr %7, align 8, !tbaa !5
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.nifti_image, ptr %79, i32 0, i32 56
  %81 = load ptr, ptr %80, align 8, !tbaa !16
  %82 = call ptr @nifti_find_file_extension(ptr noundef %81)
  store ptr %82, ptr %8, align 8, !tbaa !5
  %83 = load ptr, ptr %7, align 8, !tbaa !5
  %84 = icmp ne ptr %83, null
  br i1 %84, label %97, label %85

85:                                               ; preds = %74
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = icmp ne i32 %86, 0
  br i1 %87, label %88, label %94

88:                                               ; preds = %85
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.nifti_image, ptr %90, i32 0, i32 55
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.123, ptr noundef %92) #5
  br label %94

94:                                               ; preds = %88, %85
  %95 = load i32, ptr %9, align 4, !tbaa !9
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %9, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %94, %74
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = icmp ne ptr %98, null
  br i1 %99, label %112, label %100

100:                                              ; preds = %97
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %109

103:                                              ; preds = %100
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.nifti_image, ptr %105, i32 0, i32 56
  %107 = load ptr, ptr %106, align 8, !tbaa !16
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.124, ptr noundef %107) #5
  br label %109

109:                                              ; preds = %103, %100
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %109, %97
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %116

115:                                              ; preds = %112
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %229

116:                                              ; preds = %112
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.nifti_image, ptr %117, i32 0, i32 47
  %119 = load i32, ptr %118, align 8, !tbaa !17
  %120 = icmp eq i32 %119, 1
  br i1 %120, label %121, label %178

121:                                              ; preds = %116
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = call i32 @fileext_n_compare(ptr noundef %122, ptr noundef @.str.125, i32 noundef 4)
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %137

125:                                              ; preds = %121
  %126 = load i32, ptr %5, align 4, !tbaa !9
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %134

128:                                              ; preds = %125
  %129 = load ptr, ptr @stderr, align 8, !tbaa !5
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.nifti_image, ptr %130, i32 0, i32 55
  %132 = load ptr, ptr %131, align 8, !tbaa !11
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.126, ptr noundef %132) #5
  br label %134

134:                                              ; preds = %128, %125
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %9, align 4, !tbaa !9
  br label %137

137:                                              ; preds = %134, %121
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = call i32 @fileext_n_compare(ptr noundef %138, ptr noundef @.str.125, i32 noundef 4)
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %153

141:                                              ; preds = %137
  %142 = load i32, ptr %5, align 4, !tbaa !9
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %150

144:                                              ; preds = %141
  %145 = load ptr, ptr @stderr, align 8, !tbaa !5
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.nifti_image, ptr %146, i32 0, i32 56
  %148 = load ptr, ptr %147, align 8, !tbaa !16
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.127, ptr noundef %148) #5
  br label %150

150:                                              ; preds = %144, %141
  %151 = load i32, ptr %9, align 4, !tbaa !9
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %9, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %150, %137
  %154 = load ptr, ptr %4, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.nifti_image, ptr %154, i32 0, i32 55
  %156 = load ptr, ptr %155, align 8, !tbaa !11
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.nifti_image, ptr %157, i32 0, i32 56
  %159 = load ptr, ptr %158, align 8, !tbaa !16
  %160 = call i32 @strcmp(ptr noundef %156, ptr noundef %159) #6
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %177

162:                                              ; preds = %153
  %163 = load i32, ptr %5, align 4, !tbaa !9
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %174

165:                                              ; preds = %162
  %166 = load ptr, ptr @stderr, align 8, !tbaa !5
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.nifti_image, ptr %167, i32 0, i32 55
  %169 = load ptr, ptr %168, align 8, !tbaa !11
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.nifti_image, ptr %170, i32 0, i32 56
  %172 = load ptr, ptr %171, align 8, !tbaa !16
  %173 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef @.str.128, ptr noundef %169, ptr noundef %172) #5
  br label %174

174:                                              ; preds = %165, %162
  %175 = load i32, ptr %9, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %9, align 4, !tbaa !9
  br label %177

177:                                              ; preds = %174, %153
  br label %228

178:                                              ; preds = %116
  %179 = load ptr, ptr %4, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.nifti_image, ptr %179, i32 0, i32 47
  %181 = load i32, ptr %180, align 8, !tbaa !17
  %182 = icmp eq i32 %181, 2
  br i1 %182, label %188, label %183

183:                                              ; preds = %178
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.nifti_image, ptr %184, i32 0, i32 47
  %186 = load i32, ptr %185, align 8, !tbaa !17
  %187 = icmp eq i32 %186, 0
  br i1 %187, label %188, label %227

188:                                              ; preds = %183, %178
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = call i32 @fileext_n_compare(ptr noundef %189, ptr noundef @.str.129, i32 noundef 4)
  %191 = icmp ne i32 %190, 0
  br i1 %191, label %192, label %207

192:                                              ; preds = %188
  %193 = load i32, ptr %5, align 4, !tbaa !9
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %204

195:                                              ; preds = %192
  %196 = load ptr, ptr @stderr, align 8, !tbaa !5
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.nifti_image, ptr %197, i32 0, i32 47
  %199 = load i32, ptr %198, align 8, !tbaa !17
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.nifti_image, ptr %200, i32 0, i32 55
  %202 = load ptr, ptr %201, align 8, !tbaa !11
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef @.str.130, i32 noundef %199, ptr noundef %202) #5
  br label %204

204:                                              ; preds = %195, %192
  %205 = load i32, ptr %9, align 4, !tbaa !9
  %206 = add nsw i32 %205, 1
  store i32 %206, ptr %9, align 4, !tbaa !9
  br label %207

207:                                              ; preds = %204, %188
  %208 = load ptr, ptr %8, align 8, !tbaa !5
  %209 = call i32 @fileext_n_compare(ptr noundef %208, ptr noundef @.str.105, i32 noundef 4)
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %226

211:                                              ; preds = %207
  %212 = load i32, ptr %5, align 4, !tbaa !9
  %213 = icmp ne i32 %212, 0
  br i1 %213, label %214, label %223

214:                                              ; preds = %211
  %215 = load ptr, ptr @stderr, align 8, !tbaa !5
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.nifti_image, ptr %216, i32 0, i32 47
  %218 = load i32, ptr %217, align 8, !tbaa !17
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.nifti_image, ptr %219, i32 0, i32 56
  %221 = load ptr, ptr %220, align 8, !tbaa !16
  %222 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %215, ptr noundef @.str.131, i32 noundef %218, ptr noundef %221) #5
  br label %223

223:                                              ; preds = %214, %211
  %224 = load i32, ptr %9, align 4, !tbaa !9
  %225 = add nsw i32 %224, 1
  store i32 %225, ptr %9, align 4, !tbaa !9
  br label %226

226:                                              ; preds = %223, %207
  br label %227

227:                                              ; preds = %226, %183
  br label %228

228:                                              ; preds = %227, %177
  store i32 1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %229

229:                                              ; preds = %228, %115, %73, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 27, ptr %6) #5
  %230 = load i32, ptr %3, align 4
  ret i32 %230
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @is_valid_nifti_type(i32 noundef) #3

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

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 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 #5 = { nounwind }
attributes #6 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 632}
!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, !7, i64 32, !13, i64 64, !10, i64 72, !10, i64 76, !14, i64 80, !14, i64 84, !14, i64 88, !14, i64 92, !14, i64 96, !14, i64 100, !14, i64 104, !7, i64 108, !14, i64 140, !14, i64 144, !14, i64 148, !14, 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, !14, i64 188, !14, i64 192, !14, i64 196, !14, i64 200, !14, i64 204, !14, i64 208, !14, i64 212, !14, i64 216, !15, i64 220, !15, i64 284, !15, i64 348, !15, i64 412, !14, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !14, i64 496, !14, i64 500, !14, 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}
!13 = !{!"long", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"", !7, i64 0}
!16 = !{!12, !6, i64 640}
!17 = !{!12, !10, i64 488}


; 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.105 = external hidden unnamed_addr constant [5 x i8], align 1
@__const.nifti_type_and_names_match.func = external hidden unnamed_addr constant [27 x i8], align 16
@.str.119 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.120 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.121 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.122 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.124 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [50 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @nifti_find_file_extension(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @fileext_n_compare(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @nifti_type_and_names_match(ptr noundef readonly %0, i32 noundef %1) local_unnamed_addr #3 {
  %3 = alloca [27 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 27, ptr nonnull %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(27) %3, ptr noundef nonnull align 16 dereferenceable(27) @__const.nifti_type_and_names_match.func, i64 27, i1 false)
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %8

4:                                                ; preds = %2
  %.not54 = icmp eq i32 %1, 0
  br i1 %.not54, label %.thread88, label %5

5:                                                ; preds = %4
  %6 = load ptr, ptr @stderr, align 8, !tbaa !5
  %7 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str.119, ptr noundef nonnull %3) #6
  br label %.thread88

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %0, i64 632
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %.not55 = icmp eq ptr %10, null
  br i1 %.not55, label %11, label %15

11:                                               ; preds = %8
  %.not56 = icmp eq i32 %1, 0
  br i1 %.not56, label %.thread, label %12

12:                                               ; preds = %11
  %13 = load ptr, ptr @stderr, align 8, !tbaa !5
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.120, ptr noundef nonnull %3) #6
  br label %15

15:                                               ; preds = %12, %8
  %.0 = phi i32 [ 0, %8 ], [ 1, %12 ]
  %16 = getelementptr inbounds i8, ptr %0, i64 640
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %.not57 = icmp eq ptr %17, null
  br i1 %.not57, label %19, label %.thread84

.thread:                                          ; preds = %11
  %18 = getelementptr inbounds i8, ptr %0, i64 640
  br label %.thread84

19:                                               ; preds = %15
  %.not58 = icmp eq i32 %1, 0
  br i1 %.not58, label %.thread84, label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str.121, ptr noundef nonnull %3) #6
  br label %.thread84

.thread84:                                        ; preds = %.thread, %19, %20, %15
  %23 = phi ptr [ %16, %15 ], [ %16, %20 ], [ %16, %19 ], [ %18, %.thread ]
  %.1 = phi i32 [ %.0, %15 ], [ 1, %20 ], [ 1, %19 ], [ 1, %.thread ]
  %24 = getelementptr inbounds i8, ptr %0, i64 488
  %25 = load i32, ptr %24, align 8, !tbaa !16
  %26 = call i32 @is_valid_nifti_type(i32 noundef %25)
  %.not59 = icmp eq i32 %26, 0
  br i1 %.not59, label %27, label %32

27:                                               ; preds = %.thread84
  %.not60 = icmp eq i32 %1, 0
  br i1 %.not60, label %.thread88, label %28

28:                                               ; preds = %27
  %29 = load ptr, ptr @stderr, align 8, !tbaa !5
  %30 = load i32, ptr %24, align 8, !tbaa !16
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.122, ptr noundef nonnull %3, i32 noundef %30) #6
  br label %.thread88

32:                                               ; preds = %.thread84
  %.not61 = icmp eq i32 %.1, 0
  br i1 %.not61, label %33, label %.thread88

33:                                               ; preds = %32
  %34 = load ptr, ptr %9, align 8, !tbaa !9
  %35 = call ptr @nifti_find_file_extension(ptr noundef %34)
  %36 = load ptr, ptr %23, align 8, !tbaa !15
  %37 = call ptr @nifti_find_file_extension(ptr noundef %36)
  %.not62.not = icmp eq ptr %35, null
  br i1 %.not62.not, label %38, label %.thread100

38:                                               ; preds = %33
  %.not63 = icmp eq i32 %1, 0
  br i1 %.not63, label %.thread88, label %39

39:                                               ; preds = %38
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = load ptr, ptr %9, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.123, ptr noundef %41) #6
  %.not64 = icmp eq ptr %37, null
  br i1 %.not64, label %.thread103, label %.thread88

.thread100:                                       ; preds = %33
  %.not64101 = icmp eq ptr %37, null
  br i1 %.not64101, label %43, label %.thread102

43:                                               ; preds = %.thread100
  %.not65 = icmp eq i32 %1, 0
  br i1 %.not65, label %.thread88, label %.thread103

.thread103:                                       ; preds = %39, %43
  %44 = load ptr, ptr @stderr, align 8, !tbaa !5
  %45 = load ptr, ptr %23, align 8, !tbaa !15
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.124, ptr noundef %45) #6
  br label %.thread88

.thread102:                                       ; preds = %.thread100
  %47 = load i32, ptr %24, align 8, !tbaa !16
  switch i32 %47, label %.thread88 [
    i32 1, label %48
    i32 2, label %67
    i32 0, label %67
  ]

48:                                               ; preds = %.thread102
  %49 = call i32 @fileext_n_compare(ptr noundef nonnull %35, ptr noundef nonnull @.str.125, i32 noundef 4)
  %.not71 = icmp eq i32 %49, 0
  %.not72 = icmp eq i32 %1, 0
  %or.cond = or i1 %.not72, %.not71
  br i1 %or.cond, label %54, label %50

50:                                               ; preds = %48
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  %52 = load ptr, ptr %9, align 8, !tbaa !9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.126, ptr noundef %52) #6
  br label %54

54:                                               ; preds = %50, %48
  %55 = call i32 @fileext_n_compare(ptr noundef nonnull %37, ptr noundef nonnull @.str.125, i32 noundef 4)
  %.not73 = icmp eq i32 %55, 0
  %or.cond77 = or i1 %.not72, %.not73
  br i1 %or.cond77, label %60, label %56

56:                                               ; preds = %54
  %57 = load ptr, ptr @stderr, align 8, !tbaa !5
  %58 = load ptr, ptr %23, align 8, !tbaa !15
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str.127, ptr noundef %58) #6
  br label %60

60:                                               ; preds = %56, %54
  %61 = load ptr, ptr %9, align 8, !tbaa !9
  %62 = load ptr, ptr %23, align 8, !tbaa !15
  %63 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %61, ptr noundef nonnull dereferenceable(1) %62) #7
  %.not75 = icmp eq i32 %63, 0
  %or.cond78 = or i1 %.not72, %.not75
  br i1 %or.cond78, label %.thread88, label %64

64:                                               ; preds = %60
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef nonnull @.str.128, ptr noundef %61, ptr noundef %62) #6
  br label %.thread88

67:                                               ; preds = %.thread102, %.thread102
  %68 = call i32 @fileext_n_compare(ptr noundef nonnull %35, ptr noundef nonnull @.str.129, i32 noundef 4)
  %.not67 = icmp eq i32 %68, 0
  %.not68 = icmp eq i32 %1, 0
  %or.cond79 = or i1 %.not68, %.not67
  br i1 %or.cond79, label %74, label %69

69:                                               ; preds = %67
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = load i32, ptr %24, align 8, !tbaa !16
  %72 = load ptr, ptr %9, align 8, !tbaa !9
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.130, i32 noundef %71, ptr noundef %72) #6
  br label %74

74:                                               ; preds = %69, %67
  %75 = call i32 @fileext_n_compare(ptr noundef nonnull %37, ptr noundef nonnull @.str.105, i32 noundef 4)
  %.not69 = icmp eq i32 %75, 0
  %or.cond80 = or i1 %.not68, %.not69
  br i1 %or.cond80, label %.thread88, label %76

76:                                               ; preds = %74
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = load i32, ptr %24, align 8, !tbaa !16
  %79 = load ptr, ptr %23, align 8, !tbaa !15
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.131, i32 noundef %78, ptr noundef %79) #6
  br label %.thread88

.thread88:                                        ; preds = %39, %38, %43, %.thread103, %27, %28, %60, %74, %64, %.thread102, %76, %32, %4, %5
  %.051 = phi i32 [ -1, %5 ], [ -1, %4 ], [ -1, %32 ], [ 1, %76 ], [ 1, %.thread102 ], [ 1, %64 ], [ 1, %74 ], [ 1, %60 ], [ -1, %28 ], [ -1, %27 ], [ 0, %.thread103 ], [ 0, %43 ], [ 0, %38 ], [ 0, %39 ]
  call void @llvm.lifetime.end.p0(i64 27, ptr nonnull %3) #5
  ret i32 %.051
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @is_valid_nifti_type(i32 noundef) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 #5 = { nounwind }
attributes #6 = { cold 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 632}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !7, i64 32, !12, i64 64, !11, i64 72, !11, i64 76, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !13, i64 100, !13, i64 104, !7, i64 108, !13, i64 140, !13, i64 144, !13, i64 148, !13, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !13, i64 200, !13, i64 204, !13, i64 208, !13, i64 212, !13, i64 216, !14, i64 220, !14, i64 284, !14, i64 348, !14, i64 412, !13, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !13, i64 496, !13, i64 500, !13, i64 504, !7, i64 508, !7, i64 524, !7, i64 604, !6, i64 632, !6, i64 640, !11, i64 648, !11, i64 652, !11, i64 656, !6, i64 664, !11, i64 672, !6, i64 680, !11, i64 688}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"", !7, i64 0}
!15 = !{!10, !6, i64 640}
!16 = !{!10, !11, i64 488}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass