; 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
@stdout = external global ptr, align 8
@.str.464 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.465 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.466 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.467 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.468 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.469 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.470 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.471 = external hidden unnamed_addr constant [3 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_disp_ci(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #4
  store i8 32, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.nt_opts, ptr %9, i32 0, i32 20
  %11 = load i32, ptr %10, align 8, !tbaa !10
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %13, label %14

13:                                               ; preds = %1
  store i8 10, ptr %5, align 1, !tbaa !9
  br label %14

14:                                               ; preds = %13, %1
  %15 = load i32, ptr @g_debug, align 4, !tbaa !14
  %16 = icmp sgt i32 %15, 2
  br i1 %16, label %17, label %41

17:                                               ; preds = %14
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.nt_opts, ptr %18, i32 0, i32 18
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %41

22:                                               ; preds = %17
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.nt_opts, ptr %24, i32 0, i32 22
  %26 = getelementptr inbounds [8 x i32], ptr %25, i64 0, i64 1
  %27 = load i32, ptr %26, align 4, !tbaa !14
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.nt_opts, ptr %28, i32 0, i32 22
  %30 = getelementptr inbounds [8 x i32], ptr %29, i64 0, i64 2
  %31 = load i32, ptr %30, align 8, !tbaa !14
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.nt_opts, ptr %32, i32 0, i32 22
  %34 = getelementptr inbounds [8 x i32], ptr %33, i64 0, i64 3
  %35 = load i32, ptr %34, align 4, !tbaa !14
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.nt_opts, ptr %36, i32 0, i32 33
  %38 = getelementptr inbounds %struct.str_list, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 8, !tbaa !16
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef @.str.464, i32 noundef %27, i32 noundef %31, i32 noundef %35, i32 noundef %39) #4
  br label %56

41:                                               ; preds = %17, %14
  %42 = load i32, ptr @g_debug, align 4, !tbaa !14
  %43 = icmp sgt i32 %42, 2
  br i1 %43, label %44, label %55

44:                                               ; preds = %41
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.nt_opts, ptr %46, i32 0, i32 33
  %48 = getelementptr inbounds %struct.str_list, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !16
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef @.str.465, i32 noundef %49) #4
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.nt_opts, ptr %51, i32 0, i32 22
  %53 = getelementptr inbounds [8 x i32], ptr %52, i64 0, i64 0
  %54 = call i32 @disp_raw_data(ptr noundef %53, i32 noundef 8, i32 noundef 8, i8 noundef signext 32, i32 noundef 1)
  br label %55

55:                                               ; preds = %44, %41
  br label %56

56:                                               ; preds = %55, %22
  store i32 0, ptr %6, align 4, !tbaa !14
  br label %57

57:                                               ; preds = %195, %56
  %58 = load i32, ptr %6, align 4, !tbaa !14
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.nt_opts, ptr %59, i32 0, i32 33
  %61 = getelementptr inbounds %struct.str_list, ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !16
  %63 = icmp slt i32 %58, %62
  br i1 %63, label %64, label %198

64:                                               ; preds = %57
  store i32 0, ptr %8, align 4, !tbaa !14
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = load ptr, ptr %2, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.nt_opts, ptr %66, i32 0, i32 33
  %68 = getelementptr inbounds %struct.str_list, ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !17
  %70 = load i32, ptr %6, align 4, !tbaa !14
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds ptr, ptr %69, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = call ptr @nt_image_read(ptr noundef %65, ptr noundef %73, i32 noundef 0)
  store ptr %74, ptr %3, align 8, !tbaa !5
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %78, label %77

77:                                               ; preds = %64
  br label %195

78:                                               ; preds = %64
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.nt_opts, ptr %79, i32 0, i32 18
  %81 = load i32, ptr %80, align 8, !tbaa !15
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %96

83:                                               ; preds = %78
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.nifti_image, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 8, !tbaa !18
  %87 = icmp ne i32 %86, 4
  br i1 %87, label %88, label %96

88:                                               ; preds = %83
  %89 = load ptr, ptr @stderr, align 8, !tbaa !5
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.nifti_image, ptr %90, i32 0, i32 55
  %92 = load ptr, ptr %91, align 8, !tbaa !23
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.466, ptr noundef %92) #4
  %94 = load i32, ptr %8, align 4, !tbaa !14
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %8, align 4, !tbaa !14
  br label %96

96:                                               ; preds = %88, %83, %78
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.nifti_image, ptr %97, i32 0, i32 11
  %99 = load i32, ptr %98, align 4, !tbaa !24
  switch i32 %99, label %113 [
    i32 256, label %100
    i32 4, label %100
    i32 8, label %100
    i32 2, label %100
    i32 512, label %100
    i32 768, label %100
    i32 16, label %100
    i32 64, label %100
  ]

100:                                              ; preds = %96, %96, %96, %96, %96, %96, %96, %96
  %101 = load i32, ptr @g_debug, align 4, !tbaa !14
  %102 = icmp sgt i32 %101, 1
  br i1 %102, label %103, label %112

103:                                              ; preds = %100
  %104 = load ptr, ptr @stderr, align 8, !tbaa !5
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.nifti_image, ptr %105, i32 0, i32 11
  %107 = load i32, ptr %106, align 4, !tbaa !24
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.nifti_image, ptr %108, i32 0, i32 10
  %110 = load i32, ptr %109, align 8, !tbaa !25
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.467, i32 noundef %107, i32 noundef %110) #4
  br label %112

112:                                              ; preds = %103, %100
  br label %124

113:                                              ; preds = %96
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.nifti_image, ptr %115, i32 0, i32 55
  %117 = load ptr, ptr %116, align 8, !tbaa !23
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.nifti_image, ptr %118, i32 0, i32 11
  %120 = load i32, ptr %119, align 4, !tbaa !24
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str.468, ptr noundef %117, i32 noundef %120) #4
  %122 = load i32, ptr %8, align 4, !tbaa !14
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %8, align 4, !tbaa !14
  br label %124

124:                                              ; preds = %113, %112
  %125 = load i32, ptr %8, align 4, !tbaa !14
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %129

127:                                              ; preds = %124
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  call void @nifti_image_free(ptr noundef %128)
  br label %195

129:                                              ; preds = %124
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = load ptr, ptr %2, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.nt_opts, ptr %131, i32 0, i32 22
  %133 = getelementptr inbounds [8 x i32], ptr %132, i64 0, i64 0
  %134 = call i32 @nifti_read_collapsed_image(ptr noundef %130, ptr noundef %133, ptr noundef %4)
  store i32 %134, ptr %7, align 4, !tbaa !14
  %135 = load i32, ptr %7, align 4, !tbaa !14
  %136 = icmp slt i32 %135, 0
  br i1 %136, label %140, label %137

137:                                              ; preds = %129
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = icmp ne ptr %138, null
  br i1 %139, label %149, label %140

140:                                              ; preds = %137, %129
  %141 = load ptr, ptr @stderr, align 8, !tbaa !5
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.nifti_image, ptr %142, i32 0, i32 55
  %144 = load ptr, ptr %143, align 8, !tbaa !23
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.469, ptr noundef %144) #4
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %146) #4
  store ptr null, ptr %4, align 8, !tbaa !5
  %147 = load i32, ptr %8, align 4, !tbaa !14
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %8, align 4, !tbaa !14
  br label %149

149:                                              ; preds = %140, %137
  %150 = load i32, ptr %8, align 4, !tbaa !14
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %154

152:                                              ; preds = %149
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  call void @nifti_image_free(ptr noundef %153)
  br label %195

154:                                              ; preds = %149
  %155 = load i32, ptr @g_debug, align 4, !tbaa !14
  %156 = icmp sgt i32 %155, 0
  br i1 %156, label %157, label %182

157:                                              ; preds = %154
  %158 = load ptr, ptr @stdout, align 8, !tbaa !5
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.nifti_image, ptr %159, i32 0, i32 55
  %161 = load ptr, ptr %160, align 8, !tbaa !23
  %162 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %158, ptr noundef @.str.470, ptr noundef %161) #4
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.nt_opts, ptr %163, i32 0, i32 18
  %165 = load i32, ptr %164, align 8, !tbaa !15
  %166 = icmp ne i32 %165, 0
  br i1 %166, label %167, label %173

167:                                              ; preds = %157
  %168 = load ptr, ptr %2, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.nt_opts, ptr %168, i32 0, i32 22
  %170 = getelementptr inbounds [8 x i32], ptr %169, i64 0, i64 0
  %171 = getelementptr inbounds i32, ptr %170, i64 1
  %172 = call i32 @disp_raw_data(ptr noundef %171, i32 noundef 8, i32 noundef 3, i8 noundef signext 32, i32 noundef 0)
  br label %179

173:                                              ; preds = %157
  %174 = load ptr, ptr %2, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.nt_opts, ptr %174, i32 0, i32 22
  %176 = getelementptr inbounds [8 x i32], ptr %175, i64 0, i64 0
  %177 = getelementptr inbounds i32, ptr %176, i64 1
  %178 = call i32 @disp_raw_data(ptr noundef %177, i32 noundef 8, i32 noundef 7, i8 noundef signext 32, i32 noundef 0)
  br label %179

179:                                              ; preds = %173, %167
  %180 = load ptr, ptr @stdout, align 8, !tbaa !5
  %181 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %180, ptr noundef @.str.471) #4
  br label %182

182:                                              ; preds = %179, %154
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.nifti_image, ptr %184, i32 0, i32 11
  %186 = load i32, ptr %185, align 4, !tbaa !24
  %187 = load i32, ptr %7, align 4, !tbaa !14
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.nifti_image, ptr %188, i32 0, i32 10
  %190 = load i32, ptr %189, align 8, !tbaa !25
  %191 = sdiv i32 %187, %190
  %192 = load i8, ptr %5, align 1, !tbaa !9
  %193 = call i32 @disp_raw_data(ptr noundef %183, i32 noundef %186, i32 noundef %191, i8 noundef signext %192, i32 noundef 1)
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  call void @nifti_image_free(ptr noundef %194)
  br label %195

195:                                              ; preds = %182, %152, %127, %77
  %196 = load i32, ptr %6, align 4, !tbaa !14
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %6, align 4, !tbaa !14
  br label %57, !llvm.loop !26

198:                                              ; preds = %57
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %199) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret i32 0
}

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

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

; 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) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

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

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 = { 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 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 80}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !7, i64 88, !7, i64 120, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !6, i64 168, !13, i64 176, !13, i64 192, !13, i64 208, !13, i64 224, !13, i64 240, !7, i64 256}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !12, i64 0, !6, i64 8}
!14 = !{!12, !12, i64 0}
!15 = !{!11, !12, i64 72}
!16 = !{!11, !12, i64 240}
!17 = !{!11, !6, i64 248}
!18 = !{!19, !12, i64 0}
!19 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !7, i64 32, !20, i64 64, !12, i64 72, !12, i64 76, !21, i64 80, !21, i64 84, !21, i64 88, !21, i64 92, !21, i64 96, !21, i64 100, !21, i64 104, !7, i64 108, !21, i64 140, !21, i64 144, !21, i64 148, !21, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180, !12, i64 184, !21, i64 188, !21, i64 192, !21, i64 196, !21, i64 200, !21, i64 204, !21, i64 208, !21, i64 212, !21, i64 216, !22, i64 220, !22, i64 284, !22, i64 348, !22, i64 412, !21, i64 476, !12, i64 480, !12, i64 484, !12, i64 488, !12, i64 492, !21, i64 496, !21, i64 500, !21, i64 504, !7, i64 508, !7, i64 524, !7, i64 604, !6, i64 632, !6, i64 640, !12, i64 648, !12, i64 652, !12, i64 656, !6, i64 664, !12, i64 672, !6, i64 680, !12, i64 688}
!20 = !{!"long", !7, i64 0}
!21 = !{!"float", !7, i64 0}
!22 = !{!"", !7, i64 0}
!23 = !{!19, !6, i64 632}
!24 = !{!19, !12, i64 76}
!25 = !{!19, !12, i64 72}
!26 = distinct !{!26, !27}
!27 = !{!"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
@stdout = external local_unnamed_addr global ptr, align 8
@.str.464 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.465 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.466 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.467 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.468 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.469 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.470 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.471 = external hidden unnamed_addr constant [3 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: nounwind uwtable
define dso_local noundef i32 @act_disp_ci(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  store ptr null, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 80
  %4 = load i32, ptr %3, align 8, !tbaa !9
  %.not = icmp eq i32 %4, 0
  %spec.select = select i1 %.not, i8 32, i8 10
  %5 = load i32, ptr @g_debug, align 4, !tbaa !13
  %6 = icmp sgt i32 %5, 2
  br i1 %6, label %7, label %27

7:                                                ; preds = %1
  %8 = getelementptr inbounds i8, ptr %0, i64 72
  %9 = load i32, ptr %8, align 8, !tbaa !14
  %.not46 = icmp eq i32 %9, 0
  %10 = load ptr, ptr @stderr, align 8, !tbaa !5
  br i1 %.not46, label %21, label %11

11:                                               ; preds = %7
  %12 = getelementptr inbounds i8, ptr %0, i64 92
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  %15 = load i32, ptr %14, align 8, !tbaa !13
  %16 = getelementptr inbounds i8, ptr %0, i64 100
  %17 = load i32, ptr %16, align 4, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %0, i64 240
  %19 = load i32, ptr %18, align 8, !tbaa !15
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.464, i32 noundef %13, i32 noundef %15, i32 noundef %17, i32 noundef %19) #6
  br label %27

21:                                               ; preds = %7
  %22 = getelementptr inbounds i8, ptr %0, i64 240
  %23 = load i32, ptr %22, align 8, !tbaa !15
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.465, i32 noundef %23) #6
  %25 = getelementptr inbounds i8, ptr %0, i64 88
  %26 = tail call i32 @disp_raw_data(ptr noundef nonnull %25, i32 noundef 8, i32 noundef 8, i8 noundef signext 32, i32 noundef 1)
  br label %27

27:                                               ; preds = %1, %21, %11
  %28 = getelementptr inbounds i8, ptr %0, i64 240
  %29 = load i32, ptr %28, align 8, !tbaa !15
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %27
  %31 = getelementptr inbounds i8, ptr %0, i64 248
  %32 = getelementptr inbounds i8, ptr %0, i64 72
  %33 = getelementptr inbounds i8, ptr %0, i64 88
  %34 = getelementptr inbounds i8, ptr %0, i64 92
  br label %35

35:                                               ; preds = %.lr.ph, %94
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %94 ]
  %36 = load ptr, ptr %31, align 8, !tbaa !16
  %37 = getelementptr inbounds ptr, ptr %36, i64 %indvars.iv
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = call ptr @nt_image_read(ptr noundef nonnull %0, ptr noundef %38, i32 noundef 0)
  %.not47 = icmp eq ptr %39, null
  br i1 %.not47, label %94, label %40

40:                                               ; preds = %35
  %41 = load i32, ptr %32, align 8, !tbaa !14
  %.not48 = icmp eq i32 %41, 0
  br i1 %.not48, label %49, label %42

42:                                               ; preds = %40
  %43 = load i32, ptr %39, align 8, !tbaa !17
  %.not49 = icmp eq i32 %43, 4
  br i1 %.not49, label %49, label %44

44:                                               ; preds = %42
  %45 = load ptr, ptr @stderr, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %39, i64 632
  %47 = load ptr, ptr %46, align 8, !tbaa !22
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.466, ptr noundef %47) #6
  br label %49

49:                                               ; preds = %44, %42, %40
  %.not50 = phi i1 [ false, %44 ], [ true, %42 ], [ true, %40 ]
  %50 = getelementptr inbounds i8, ptr %39, i64 76
  %51 = load i32, ptr %50, align 4, !tbaa !23
  switch i32 %51, label %.thread53 [
    i32 256, label %52
    i32 4, label %52
    i32 8, label %52
    i32 2, label %52
    i32 512, label %52
    i32 768, label %52
    i32 16, label %52
    i32 64, label %52
  ]

52:                                               ; preds = %49, %49, %49, %49, %49, %49, %49, %49
  %53 = load i32, ptr @g_debug, align 4, !tbaa !13
  %54 = icmp sgt i32 %53, 1
  br i1 %54, label %55, label %64

55:                                               ; preds = %52
  %56 = load ptr, ptr @stderr, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %39, i64 72
  %58 = load i32, ptr %57, align 8, !tbaa !24
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.467, i32 noundef %51, i32 noundef %58) #6
  br label %64

.thread53:                                        ; preds = %49
  %60 = load ptr, ptr @stderr, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %39, i64 632
  %62 = load ptr, ptr %61, align 8, !tbaa !22
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.468, ptr noundef %62, i32 noundef %51) #6
  br label %.sink.split

64:                                               ; preds = %52, %55
  br i1 %.not50, label %65, label %.sink.split

65:                                               ; preds = %64
  %66 = call i32 @nifti_read_collapsed_image(ptr noundef nonnull %39, ptr noundef nonnull %33, ptr noundef nonnull %2) #5
  %67 = icmp sgt i32 %66, -1
  %68 = load ptr, ptr %2, align 8
  %69 = icmp ne ptr %68, null
  %or.cond = select i1 %67, i1 %69, i1 false
  br i1 %or.cond, label %.critedge, label %70

70:                                               ; preds = %65
  %71 = load ptr, ptr @stderr, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %39, i64 632
  %73 = load ptr, ptr %72, align 8, !tbaa !22
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.469, ptr noundef %73) #6
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %75) #5
  store ptr null, ptr %2, align 8, !tbaa !5
  br label %.sink.split

.critedge:                                        ; preds = %65
  %76 = load i32, ptr @g_debug, align 4, !tbaa !13
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %78, label %87

78:                                               ; preds = %.critedge
  %79 = load ptr, ptr @stdout, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %39, i64 632
  %81 = load ptr, ptr %80, align 8, !tbaa !22
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef nonnull @.str.470, ptr noundef %81) #5
  %83 = load i32, ptr %32, align 8, !tbaa !14
  %.not52 = icmp eq i32 %83, 0
  %. = select i1 %.not52, i32 7, i32 3
  %84 = call i32 @disp_raw_data(ptr noundef nonnull %34, i32 noundef 8, i32 noundef %., i8 noundef signext 32, i32 noundef 0)
  %85 = load ptr, ptr @stdout, align 8, !tbaa !5
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.471) #5
  %.pre = load ptr, ptr %2, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %78, %.critedge
  %88 = phi ptr [ %.pre, %78 ], [ %68, %.critedge ]
  %89 = load i32, ptr %50, align 4, !tbaa !23
  %90 = getelementptr inbounds i8, ptr %39, i64 72
  %91 = load i32, ptr %90, align 8, !tbaa !24
  %92 = sdiv i32 %66, %91
  %93 = call i32 @disp_raw_data(ptr noundef %88, i32 noundef %89, i32 noundef %92, i8 noundef signext %spec.select, i32 noundef 1)
  br label %.sink.split

.sink.split:                                      ; preds = %64, %.thread53, %70, %87
  call void @nifti_image_free(ptr noundef nonnull %39) #5
  br label %94

94:                                               ; preds = %.sink.split, %35
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %95 = load i32, ptr %28, align 8, !tbaa !15
  %96 = sext i32 %95 to i64
  %97 = icmp slt i64 %indvars.iv.next, %96
  br i1 %97, label %35, label %._crit_edge.loopexit, !llvm.loop !25

._crit_edge.loopexit:                             ; preds = %94
  %.pre58 = load ptr, ptr %2, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %27
  %98 = phi ptr [ %.pre58, %._crit_edge.loopexit ], [ null, %27 ]
  call void @free(ptr noundef %98) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret i32 0
}

; 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 i32 @disp_raw_data(ptr noundef, i32 noundef, i32 noundef, i8 noundef signext, i32 noundef) local_unnamed_addr #1

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

declare void @nifti_image_free(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress 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 = { 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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { cold 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, !11, i64 80}
!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, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !7, i64 88, !7, i64 120, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !6, i64 168, !12, i64 176, !12, i64 192, !12, i64 208, !12, i64 224, !12, i64 240, !7, i64 256}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !11, i64 0, !6, i64 8}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 72}
!15 = !{!10, !11, i64 240}
!16 = !{!10, !6, i64 248}
!17 = !{!18, !11, i64 0}
!18 = !{!"", !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, !19, i64 64, !11, i64 72, !11, 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, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, 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, !11, i64 480, !11, i64 484, !11, i64 488, !11, 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, !11, i64 648, !11, i64 652, !11, i64 656, !6, i64 664, !11, i64 672, !6, i64 680, !11, i64 688}
!19 = !{!"long", !7, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!"", !7, i64 0}
!22 = !{!18, !6, i64 632}
!23 = !{!18, !11, i64 76}
!24 = !{!18, !11, i64 72}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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