; 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.mat33 = type { [3 x [3 x float]] }

; 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 double @sqrt(double noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @nifti_mat33_polar(ptr dead_on_unwind noalias writable sret(%struct.mat33) align 4 %0, ptr noundef byval(%struct.mat33) align 8 %1) #2 {
  %3 = alloca %struct.mat33, align 8
  %4 = alloca %struct.mat33, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.mat33, align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store float 1.000000e+00, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 8 %1, i64 36, i1 false), !tbaa.struct !11
  %12 = call float @nifti_mat33_determ(ptr noundef byval(%struct.mat33) align 8 %3)
  store float %12, ptr %7, align 4, !tbaa !5
  br label %13

13:                                               ; preds = %17, %2
  %14 = load float, ptr %7, align 4, !tbaa !5
  %15 = fpext float %14 to double
  %16 = fcmp oeq double %15, 0.000000e+00
  br i1 %16, label %17, label %42

17:                                               ; preds = %13
  %18 = call float @nifti_mat33_rownorm(ptr noundef byval(%struct.mat33) align 8 %3)
  %19 = fpext float %18 to double
  %20 = fadd double 1.000000e-03, %19
  %21 = fmul double 1.000000e-05, %20
  %22 = fptrunc double %21 to float
  store float %22, ptr %7, align 4, !tbaa !5
  %23 = load float, ptr %7, align 4, !tbaa !5
  %24 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %25 = getelementptr inbounds [3 x [3 x float]], ptr %24, i64 0, i64 0
  %26 = getelementptr inbounds [3 x float], ptr %25, i64 0, i64 0
  %27 = load float, ptr %26, align 4, !tbaa !5
  %28 = fadd float %27, %23
  store float %28, ptr %26, align 4, !tbaa !5
  %29 = load float, ptr %7, align 4, !tbaa !5
  %30 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %31 = getelementptr inbounds [3 x [3 x float]], ptr %30, i64 0, i64 1
  %32 = getelementptr inbounds [3 x float], ptr %31, i64 0, i64 1
  %33 = load float, ptr %32, align 4, !tbaa !5
  %34 = fadd float %33, %29
  store float %34, ptr %32, align 4, !tbaa !5
  %35 = load float, ptr %7, align 4, !tbaa !5
  %36 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %37 = getelementptr inbounds [3 x [3 x float]], ptr %36, i64 0, i64 2
  %38 = getelementptr inbounds [3 x float], ptr %37, i64 0, i64 2
  %39 = load float, ptr %38, align 4, !tbaa !5
  %40 = fadd float %39, %35
  store float %40, ptr %38, align 4, !tbaa !5
  %41 = call float @nifti_mat33_determ(ptr noundef byval(%struct.mat33) align 8 %3)
  store float %41, ptr %7, align 4, !tbaa !5
  br label %13, !llvm.loop !13

42:                                               ; preds = %13
  br label %43

43:                                               ; preds = %352, %42
  br label %44

44:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 36, ptr %11) #5
  call void @nifti_mat33_inverse(ptr dead_on_unwind writable sret(%struct.mat33) align 4 %11, ptr noundef byval(%struct.mat33) align 8 %3)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 4 %11, i64 36, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 36, ptr %11) #5
  %45 = load float, ptr %9, align 4, !tbaa !5
  %46 = fpext float %45 to double
  %47 = fcmp ogt double %46, 3.000000e-01
  br i1 %47, label %48, label %71

48:                                               ; preds = %44
  %49 = call float @nifti_mat33_rownorm(ptr noundef byval(%struct.mat33) align 8 %3)
  %50 = call float @nifti_mat33_colnorm(ptr noundef byval(%struct.mat33) align 8 %3)
  %51 = fmul float %49, %50
  %52 = fpext float %51 to double
  %53 = call double @sqrt(double noundef %52) #5
  %54 = fptrunc double %53 to float
  store float %54, ptr %5, align 4, !tbaa !5
  %55 = call float @nifti_mat33_rownorm(ptr noundef byval(%struct.mat33) align 8 %4)
  %56 = call float @nifti_mat33_colnorm(ptr noundef byval(%struct.mat33) align 8 %4)
  %57 = fmul float %55, %56
  %58 = fpext float %57 to double
  %59 = call double @sqrt(double noundef %58) #5
  %60 = fptrunc double %59 to float
  store float %60, ptr %6, align 4, !tbaa !5
  %61 = load float, ptr %6, align 4, !tbaa !5
  %62 = load float, ptr %5, align 4, !tbaa !5
  %63 = fdiv float %61, %62
  %64 = fpext float %63 to double
  %65 = call double @sqrt(double noundef %64) #5
  %66 = fptrunc double %65 to float
  store float %66, ptr %7, align 4, !tbaa !5
  %67 = load float, ptr %7, align 4, !tbaa !5
  %68 = fpext float %67 to double
  %69 = fdiv double 1.000000e+00, %68
  %70 = fptrunc double %69 to float
  store float %70, ptr %8, align 4, !tbaa !5
  br label %72

71:                                               ; preds = %44
  store float 1.000000e+00, ptr %8, align 4, !tbaa !5
  store float 1.000000e+00, ptr %7, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %71, %48
  %73 = load float, ptr %7, align 4, !tbaa !5
  %74 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %75 = getelementptr inbounds [3 x [3 x float]], ptr %74, i64 0, i64 0
  %76 = getelementptr inbounds [3 x float], ptr %75, i64 0, i64 0
  %77 = load float, ptr %76, align 4, !tbaa !5
  %78 = load float, ptr %8, align 4, !tbaa !5
  %79 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %80 = getelementptr inbounds [3 x [3 x float]], ptr %79, i64 0, i64 0
  %81 = getelementptr inbounds [3 x float], ptr %80, i64 0, i64 0
  %82 = load float, ptr %81, align 4, !tbaa !5
  %83 = fmul float %78, %82
  %84 = call float @llvm.fmuladd.f32(float %73, float %77, float %83)
  %85 = fpext float %84 to double
  %86 = fmul double 5.000000e-01, %85
  %87 = fptrunc double %86 to float
  %88 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %89 = getelementptr inbounds [3 x [3 x float]], ptr %88, i64 0, i64 0
  %90 = getelementptr inbounds [3 x float], ptr %89, i64 0, i64 0
  store float %87, ptr %90, align 4, !tbaa !5
  %91 = load float, ptr %7, align 4, !tbaa !5
  %92 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %93 = getelementptr inbounds [3 x [3 x float]], ptr %92, i64 0, i64 0
  %94 = getelementptr inbounds [3 x float], ptr %93, i64 0, i64 1
  %95 = load float, ptr %94, align 4, !tbaa !5
  %96 = load float, ptr %8, align 4, !tbaa !5
  %97 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %98 = getelementptr inbounds [3 x [3 x float]], ptr %97, i64 0, i64 1
  %99 = getelementptr inbounds [3 x float], ptr %98, i64 0, i64 0
  %100 = load float, ptr %99, align 4, !tbaa !5
  %101 = fmul float %96, %100
  %102 = call float @llvm.fmuladd.f32(float %91, float %95, float %101)
  %103 = fpext float %102 to double
  %104 = fmul double 5.000000e-01, %103
  %105 = fptrunc double %104 to float
  %106 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %107 = getelementptr inbounds [3 x [3 x float]], ptr %106, i64 0, i64 0
  %108 = getelementptr inbounds [3 x float], ptr %107, i64 0, i64 1
  store float %105, ptr %108, align 4, !tbaa !5
  %109 = load float, ptr %7, align 4, !tbaa !5
  %110 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %111 = getelementptr inbounds [3 x [3 x float]], ptr %110, i64 0, i64 0
  %112 = getelementptr inbounds [3 x float], ptr %111, i64 0, i64 2
  %113 = load float, ptr %112, align 4, !tbaa !5
  %114 = load float, ptr %8, align 4, !tbaa !5
  %115 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %116 = getelementptr inbounds [3 x [3 x float]], ptr %115, i64 0, i64 2
  %117 = getelementptr inbounds [3 x float], ptr %116, i64 0, i64 0
  %118 = load float, ptr %117, align 4, !tbaa !5
  %119 = fmul float %114, %118
  %120 = call float @llvm.fmuladd.f32(float %109, float %113, float %119)
  %121 = fpext float %120 to double
  %122 = fmul double 5.000000e-01, %121
  %123 = fptrunc double %122 to float
  %124 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %125 = getelementptr inbounds [3 x [3 x float]], ptr %124, i64 0, i64 0
  %126 = getelementptr inbounds [3 x float], ptr %125, i64 0, i64 2
  store float %123, ptr %126, align 4, !tbaa !5
  %127 = load float, ptr %7, align 4, !tbaa !5
  %128 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %129 = getelementptr inbounds [3 x [3 x float]], ptr %128, i64 0, i64 1
  %130 = getelementptr inbounds [3 x float], ptr %129, i64 0, i64 0
  %131 = load float, ptr %130, align 4, !tbaa !5
  %132 = load float, ptr %8, align 4, !tbaa !5
  %133 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %134 = getelementptr inbounds [3 x [3 x float]], ptr %133, i64 0, i64 0
  %135 = getelementptr inbounds [3 x float], ptr %134, i64 0, i64 1
  %136 = load float, ptr %135, align 4, !tbaa !5
  %137 = fmul float %132, %136
  %138 = call float @llvm.fmuladd.f32(float %127, float %131, float %137)
  %139 = fpext float %138 to double
  %140 = fmul double 5.000000e-01, %139
  %141 = fptrunc double %140 to float
  %142 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %143 = getelementptr inbounds [3 x [3 x float]], ptr %142, i64 0, i64 1
  %144 = getelementptr inbounds [3 x float], ptr %143, i64 0, i64 0
  store float %141, ptr %144, align 4, !tbaa !5
  %145 = load float, ptr %7, align 4, !tbaa !5
  %146 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %147 = getelementptr inbounds [3 x [3 x float]], ptr %146, i64 0, i64 1
  %148 = getelementptr inbounds [3 x float], ptr %147, i64 0, i64 1
  %149 = load float, ptr %148, align 4, !tbaa !5
  %150 = load float, ptr %8, align 4, !tbaa !5
  %151 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %152 = getelementptr inbounds [3 x [3 x float]], ptr %151, i64 0, i64 1
  %153 = getelementptr inbounds [3 x float], ptr %152, i64 0, i64 1
  %154 = load float, ptr %153, align 4, !tbaa !5
  %155 = fmul float %150, %154
  %156 = call float @llvm.fmuladd.f32(float %145, float %149, float %155)
  %157 = fpext float %156 to double
  %158 = fmul double 5.000000e-01, %157
  %159 = fptrunc double %158 to float
  %160 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %161 = getelementptr inbounds [3 x [3 x float]], ptr %160, i64 0, i64 1
  %162 = getelementptr inbounds [3 x float], ptr %161, i64 0, i64 1
  store float %159, ptr %162, align 4, !tbaa !5
  %163 = load float, ptr %7, align 4, !tbaa !5
  %164 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %165 = getelementptr inbounds [3 x [3 x float]], ptr %164, i64 0, i64 1
  %166 = getelementptr inbounds [3 x float], ptr %165, i64 0, i64 2
  %167 = load float, ptr %166, align 4, !tbaa !5
  %168 = load float, ptr %8, align 4, !tbaa !5
  %169 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %170 = getelementptr inbounds [3 x [3 x float]], ptr %169, i64 0, i64 2
  %171 = getelementptr inbounds [3 x float], ptr %170, i64 0, i64 1
  %172 = load float, ptr %171, align 4, !tbaa !5
  %173 = fmul float %168, %172
  %174 = call float @llvm.fmuladd.f32(float %163, float %167, float %173)
  %175 = fpext float %174 to double
  %176 = fmul double 5.000000e-01, %175
  %177 = fptrunc double %176 to float
  %178 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %179 = getelementptr inbounds [3 x [3 x float]], ptr %178, i64 0, i64 1
  %180 = getelementptr inbounds [3 x float], ptr %179, i64 0, i64 2
  store float %177, ptr %180, align 4, !tbaa !5
  %181 = load float, ptr %7, align 4, !tbaa !5
  %182 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %183 = getelementptr inbounds [3 x [3 x float]], ptr %182, i64 0, i64 2
  %184 = getelementptr inbounds [3 x float], ptr %183, i64 0, i64 0
  %185 = load float, ptr %184, align 4, !tbaa !5
  %186 = load float, ptr %8, align 4, !tbaa !5
  %187 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %188 = getelementptr inbounds [3 x [3 x float]], ptr %187, i64 0, i64 0
  %189 = getelementptr inbounds [3 x float], ptr %188, i64 0, i64 2
  %190 = load float, ptr %189, align 4, !tbaa !5
  %191 = fmul float %186, %190
  %192 = call float @llvm.fmuladd.f32(float %181, float %185, float %191)
  %193 = fpext float %192 to double
  %194 = fmul double 5.000000e-01, %193
  %195 = fptrunc double %194 to float
  %196 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %197 = getelementptr inbounds [3 x [3 x float]], ptr %196, i64 0, i64 2
  %198 = getelementptr inbounds [3 x float], ptr %197, i64 0, i64 0
  store float %195, ptr %198, align 4, !tbaa !5
  %199 = load float, ptr %7, align 4, !tbaa !5
  %200 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %201 = getelementptr inbounds [3 x [3 x float]], ptr %200, i64 0, i64 2
  %202 = getelementptr inbounds [3 x float], ptr %201, i64 0, i64 1
  %203 = load float, ptr %202, align 4, !tbaa !5
  %204 = load float, ptr %8, align 4, !tbaa !5
  %205 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %206 = getelementptr inbounds [3 x [3 x float]], ptr %205, i64 0, i64 1
  %207 = getelementptr inbounds [3 x float], ptr %206, i64 0, i64 2
  %208 = load float, ptr %207, align 4, !tbaa !5
  %209 = fmul float %204, %208
  %210 = call float @llvm.fmuladd.f32(float %199, float %203, float %209)
  %211 = fpext float %210 to double
  %212 = fmul double 5.000000e-01, %211
  %213 = fptrunc double %212 to float
  %214 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %215 = getelementptr inbounds [3 x [3 x float]], ptr %214, i64 0, i64 2
  %216 = getelementptr inbounds [3 x float], ptr %215, i64 0, i64 1
  store float %213, ptr %216, align 4, !tbaa !5
  %217 = load float, ptr %7, align 4, !tbaa !5
  %218 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %219 = getelementptr inbounds [3 x [3 x float]], ptr %218, i64 0, i64 2
  %220 = getelementptr inbounds [3 x float], ptr %219, i64 0, i64 2
  %221 = load float, ptr %220, align 4, !tbaa !5
  %222 = load float, ptr %8, align 4, !tbaa !5
  %223 = getelementptr inbounds %struct.mat33, ptr %4, i32 0, i32 0
  %224 = getelementptr inbounds [3 x [3 x float]], ptr %223, i64 0, i64 2
  %225 = getelementptr inbounds [3 x float], ptr %224, i64 0, i64 2
  %226 = load float, ptr %225, align 4, !tbaa !5
  %227 = fmul float %222, %226
  %228 = call float @llvm.fmuladd.f32(float %217, float %221, float %227)
  %229 = fpext float %228 to double
  %230 = fmul double 5.000000e-01, %229
  %231 = fptrunc double %230 to float
  %232 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %233 = getelementptr inbounds [3 x [3 x float]], ptr %232, i64 0, i64 2
  %234 = getelementptr inbounds [3 x float], ptr %233, i64 0, i64 2
  store float %231, ptr %234, align 4, !tbaa !5
  %235 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %236 = getelementptr inbounds [3 x [3 x float]], ptr %235, i64 0, i64 0
  %237 = getelementptr inbounds [3 x float], ptr %236, i64 0, i64 0
  %238 = load float, ptr %237, align 4, !tbaa !5
  %239 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %240 = getelementptr inbounds [3 x [3 x float]], ptr %239, i64 0, i64 0
  %241 = getelementptr inbounds [3 x float], ptr %240, i64 0, i64 0
  %242 = load float, ptr %241, align 4, !tbaa !5
  %243 = fsub float %238, %242
  %244 = fpext float %243 to double
  %245 = call double @llvm.fabs.f64(double %244)
  %246 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %247 = getelementptr inbounds [3 x [3 x float]], ptr %246, i64 0, i64 0
  %248 = getelementptr inbounds [3 x float], ptr %247, i64 0, i64 1
  %249 = load float, ptr %248, align 4, !tbaa !5
  %250 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %251 = getelementptr inbounds [3 x [3 x float]], ptr %250, i64 0, i64 0
  %252 = getelementptr inbounds [3 x float], ptr %251, i64 0, i64 1
  %253 = load float, ptr %252, align 4, !tbaa !5
  %254 = fsub float %249, %253
  %255 = fpext float %254 to double
  %256 = call double @llvm.fabs.f64(double %255)
  %257 = fadd double %245, %256
  %258 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %259 = getelementptr inbounds [3 x [3 x float]], ptr %258, i64 0, i64 0
  %260 = getelementptr inbounds [3 x float], ptr %259, i64 0, i64 2
  %261 = load float, ptr %260, align 4, !tbaa !5
  %262 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %263 = getelementptr inbounds [3 x [3 x float]], ptr %262, i64 0, i64 0
  %264 = getelementptr inbounds [3 x float], ptr %263, i64 0, i64 2
  %265 = load float, ptr %264, align 4, !tbaa !5
  %266 = fsub float %261, %265
  %267 = fpext float %266 to double
  %268 = call double @llvm.fabs.f64(double %267)
  %269 = fadd double %257, %268
  %270 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %271 = getelementptr inbounds [3 x [3 x float]], ptr %270, i64 0, i64 1
  %272 = getelementptr inbounds [3 x float], ptr %271, i64 0, i64 0
  %273 = load float, ptr %272, align 4, !tbaa !5
  %274 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %275 = getelementptr inbounds [3 x [3 x float]], ptr %274, i64 0, i64 1
  %276 = getelementptr inbounds [3 x float], ptr %275, i64 0, i64 0
  %277 = load float, ptr %276, align 4, !tbaa !5
  %278 = fsub float %273, %277
  %279 = fpext float %278 to double
  %280 = call double @llvm.fabs.f64(double %279)
  %281 = fadd double %269, %280
  %282 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %283 = getelementptr inbounds [3 x [3 x float]], ptr %282, i64 0, i64 1
  %284 = getelementptr inbounds [3 x float], ptr %283, i64 0, i64 1
  %285 = load float, ptr %284, align 4, !tbaa !5
  %286 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %287 = getelementptr inbounds [3 x [3 x float]], ptr %286, i64 0, i64 1
  %288 = getelementptr inbounds [3 x float], ptr %287, i64 0, i64 1
  %289 = load float, ptr %288, align 4, !tbaa !5
  %290 = fsub float %285, %289
  %291 = fpext float %290 to double
  %292 = call double @llvm.fabs.f64(double %291)
  %293 = fadd double %281, %292
  %294 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %295 = getelementptr inbounds [3 x [3 x float]], ptr %294, i64 0, i64 1
  %296 = getelementptr inbounds [3 x float], ptr %295, i64 0, i64 2
  %297 = load float, ptr %296, align 4, !tbaa !5
  %298 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %299 = getelementptr inbounds [3 x [3 x float]], ptr %298, i64 0, i64 1
  %300 = getelementptr inbounds [3 x float], ptr %299, i64 0, i64 2
  %301 = load float, ptr %300, align 4, !tbaa !5
  %302 = fsub float %297, %301
  %303 = fpext float %302 to double
  %304 = call double @llvm.fabs.f64(double %303)
  %305 = fadd double %293, %304
  %306 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %307 = getelementptr inbounds [3 x [3 x float]], ptr %306, i64 0, i64 2
  %308 = getelementptr inbounds [3 x float], ptr %307, i64 0, i64 0
  %309 = load float, ptr %308, align 4, !tbaa !5
  %310 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %311 = getelementptr inbounds [3 x [3 x float]], ptr %310, i64 0, i64 2
  %312 = getelementptr inbounds [3 x float], ptr %311, i64 0, i64 0
  %313 = load float, ptr %312, align 4, !tbaa !5
  %314 = fsub float %309, %313
  %315 = fpext float %314 to double
  %316 = call double @llvm.fabs.f64(double %315)
  %317 = fadd double %305, %316
  %318 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %319 = getelementptr inbounds [3 x [3 x float]], ptr %318, i64 0, i64 2
  %320 = getelementptr inbounds [3 x float], ptr %319, i64 0, i64 1
  %321 = load float, ptr %320, align 4, !tbaa !5
  %322 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %323 = getelementptr inbounds [3 x [3 x float]], ptr %322, i64 0, i64 2
  %324 = getelementptr inbounds [3 x float], ptr %323, i64 0, i64 1
  %325 = load float, ptr %324, align 4, !tbaa !5
  %326 = fsub float %321, %325
  %327 = fpext float %326 to double
  %328 = call double @llvm.fabs.f64(double %327)
  %329 = fadd double %317, %328
  %330 = getelementptr inbounds %struct.mat33, ptr %0, i32 0, i32 0
  %331 = getelementptr inbounds [3 x [3 x float]], ptr %330, i64 0, i64 2
  %332 = getelementptr inbounds [3 x float], ptr %331, i64 0, i64 2
  %333 = load float, ptr %332, align 4, !tbaa !5
  %334 = getelementptr inbounds %struct.mat33, ptr %3, i32 0, i32 0
  %335 = getelementptr inbounds [3 x [3 x float]], ptr %334, i64 0, i64 2
  %336 = getelementptr inbounds [3 x float], ptr %335, i64 0, i64 2
  %337 = load float, ptr %336, align 4, !tbaa !5
  %338 = fsub float %333, %337
  %339 = fpext float %338 to double
  %340 = call double @llvm.fabs.f64(double %339)
  %341 = fadd double %329, %340
  %342 = fptrunc double %341 to float
  store float %342, ptr %9, align 4, !tbaa !5
  %343 = load i32, ptr %10, align 4, !tbaa !9
  %344 = add nsw i32 %343, 1
  store i32 %344, ptr %10, align 4, !tbaa !9
  %345 = load i32, ptr %10, align 4, !tbaa !9
  %346 = icmp sgt i32 %345, 100
  br i1 %346, label %351, label %347

347:                                              ; preds = %72
  %348 = load float, ptr %9, align 4, !tbaa !5
  %349 = fpext float %348 to double
  %350 = fcmp olt double %349, 3.000000e-06
  br i1 %350, label %351, label %352

351:                                              ; preds = %347, %72
  br label %353

352:                                              ; preds = %347
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %3, ptr align 4 %0, i64 36, i1 false), !tbaa.struct !11
  br label %43

353:                                              ; preds = %351
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr %3) #5
  ret void
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nounwind uwtable
declare dso_local void @nifti_mat33_inverse(ptr dead_on_unwind noalias writable sret(%struct.mat33) align 4, ptr noundef byval(%struct.mat33) align 8) #2

; Function Attrs: nounwind uwtable
declare dso_local float @nifti_mat33_determ(ptr noundef byval(%struct.mat33) align 8) #2

; Function Attrs: nounwind uwtable
declare dso_local float @nifti_mat33_rownorm(ptr noundef byval(%struct.mat33) align 8) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

; Function Attrs: nounwind uwtable
declare dso_local float @nifti_mat33_colnorm(ptr noundef byval(%struct.mat33) align 8) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"float", !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 = !{i64 0, i64 36, !12}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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"

%struct.mat33 = type { [3 x [3 x float]] }

; 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 void @nifti_mat33_polar(ptr dead_on_unwind noalias nocapture writable sret(%struct.mat33) align 4 %0, ptr nocapture noundef readonly byval(%struct.mat33) align 8 %1) local_unnamed_addr #1 {
  %3 = alloca %struct.mat33, align 16
  %4 = alloca %struct.mat33, align 16
  %5 = alloca %struct.mat33, align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %3, ptr noundef nonnull align 8 dereferenceable(36) %1, i64 36, i1 false), !tbaa.struct !5
  %6 = tail call float @nifti_mat33_determ(ptr noundef nonnull byval(%struct.mat33) align 8 %1)
  %7 = fcmp oeq float %6, 0.000000e+00
  br i1 %7, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %2
  %8 = getelementptr inbounds i8, ptr %3, i64 16
  %9 = getelementptr inbounds i8, ptr %3, i64 32
  br label %22

.preheader:                                       ; preds = %22, %2
  %10 = getelementptr inbounds i8, ptr %4, i64 12
  %11 = getelementptr inbounds i8, ptr %4, i64 24
  %12 = getelementptr inbounds i8, ptr %4, i64 4
  %13 = getelementptr inbounds i8, ptr %3, i64 16
  %14 = getelementptr inbounds i8, ptr %4, i64 16
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = getelementptr inbounds i8, ptr %4, i64 28
  %17 = getelementptr inbounds i8, ptr %4, i64 8
  %18 = getelementptr inbounds i8, ptr %4, i64 20
  %19 = getelementptr inbounds i8, ptr %3, i64 32
  %20 = getelementptr inbounds i8, ptr %4, i64 32
  %21 = getelementptr inbounds i8, ptr %0, i64 32
  br label %36

22:                                               ; preds = %.lr.ph, %22
  %23 = tail call float @nifti_mat33_rownorm(ptr noundef nonnull byval(%struct.mat33) align 8 %3)
  %24 = fpext float %23 to double
  %25 = fadd double %24, 1.000000e-03
  %26 = fmul double %25, 1.000000e-05
  %27 = fptrunc double %26 to float
  %28 = load float, ptr %3, align 16, !tbaa !9
  %29 = fadd float %28, %27
  store float %29, ptr %3, align 16, !tbaa !9
  %30 = load float, ptr %8, align 16, !tbaa !9
  %31 = fadd float %30, %27
  store float %31, ptr %8, align 16, !tbaa !9
  %32 = load float, ptr %9, align 16, !tbaa !9
  %33 = fadd float %32, %27
  store float %33, ptr %9, align 16, !tbaa !9
  %34 = tail call float @nifti_mat33_determ(ptr noundef nonnull byval(%struct.mat33) align 8 %3)
  %35 = fcmp oeq float %34, 0.000000e+00
  br i1 %35, label %22, label %.preheader, !llvm.loop !11

36:                                               ; preds = %.preheader, %124
  %.028 = phi float [ %120, %124 ], [ 1.000000e+00, %.preheader ]
  %.0 = phi i32 [ %125, %124 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %5) #5
  call void @nifti_mat33_inverse(ptr dead_on_unwind nonnull writable sret(%struct.mat33) align 4 %5, ptr noundef nonnull byval(%struct.mat33) align 8 %3)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %4, ptr noundef nonnull align 4 dereferenceable(36) %5, i64 36, i1 false), !tbaa.struct !5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %5) #5
  %37 = fpext float %.028 to double
  %38 = fcmp ogt double %37, 3.000000e-01
  br i1 %38, label %39, label %48

39:                                               ; preds = %36
  %40 = call float @nifti_mat33_rownorm(ptr noundef nonnull byval(%struct.mat33) align 8 %3)
  %41 = call float @nifti_mat33_colnorm(ptr noundef nonnull byval(%struct.mat33) align 8 %3)
  %42 = fmul float %40, %41
  %sqrtf = call float @sqrtf(float noundef %42) #6
  %43 = call float @nifti_mat33_rownorm(ptr noundef nonnull byval(%struct.mat33) align 8 %4)
  %44 = call float @nifti_mat33_colnorm(ptr noundef nonnull byval(%struct.mat33) align 8 %4)
  %45 = fmul float %43, %44
  %sqrtf32 = call float @sqrtf(float noundef %45) #6
  %46 = fdiv float %sqrtf32, %sqrtf
  %sqrtf33 = call float @sqrtf(float noundef %46) #6
  %47 = fdiv float 1.000000e+00, %sqrtf33
  br label %48

48:                                               ; preds = %36, %39
  %.1 = phi float [ %sqrtf33, %39 ], [ 1.000000e+00, %36 ]
  %.029 = phi float [ %47, %39 ], [ 1.000000e+00, %36 ]
  %49 = load <4 x float>, ptr %4, align 16
  %50 = load float, ptr %10, align 4, !tbaa !9
  %51 = load float, ptr %11, align 8, !tbaa !9
  %52 = load float, ptr %12, align 4, !tbaa !9
  %53 = load <4 x float>, ptr %3, align 16, !tbaa !9
  %54 = insertelement <4 x float> poison, float %.029, i64 0
  %55 = shufflevector <4 x float> %54, <4 x float> poison, <4 x i32> zeroinitializer
  %56 = insertelement <4 x float> %49, float %50, i64 1
  %57 = insertelement <4 x float> %56, float %51, i64 2
  %58 = insertelement <4 x float> %57, float %52, i64 3
  %59 = fmul <4 x float> %55, %58
  %60 = insertelement <4 x float> poison, float %.1, i64 0
  %61 = shufflevector <4 x float> %60, <4 x float> poison, <4 x i32> zeroinitializer
  %62 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %61, <4 x float> %53, <4 x float> %59)
  %63 = fmul <4 x float> %62, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  store <4 x float> %63, ptr %0, align 4, !tbaa !9
  %64 = load <4 x float>, ptr %14, align 16
  %65 = load float, ptr %16, align 4, !tbaa !9
  %66 = load float, ptr %17, align 8, !tbaa !9
  %67 = load float, ptr %18, align 4, !tbaa !9
  %68 = load <4 x float>, ptr %13, align 16, !tbaa !9
  %69 = insertelement <4 x float> %64, float %65, i64 1
  %70 = insertelement <4 x float> %69, float %66, i64 2
  %71 = insertelement <4 x float> %70, float %67, i64 3
  %72 = fmul <4 x float> %55, %71
  %73 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %61, <4 x float> %68, <4 x float> %72)
  %74 = fmul <4 x float> %73, <float 5.000000e-01, float 5.000000e-01, float 5.000000e-01, float 5.000000e-01>
  store <4 x float> %74, ptr %15, align 4, !tbaa !9
  %75 = load float, ptr %19, align 16, !tbaa !9
  %76 = load float, ptr %20, align 16, !tbaa !9
  %77 = fmul float %.029, %76
  %78 = call float @llvm.fmuladd.f32(float %.1, float %75, float %77)
  %79 = fmul float %78, 5.000000e-01
  store float %79, ptr %21, align 4, !tbaa !9
  %80 = fsub <4 x float> %63, %53
  %81 = shufflevector <4 x float> %80, <4 x float> poison, <2 x i32> <i32 0, i32 1>
  %82 = call <2 x float> @llvm.fabs.v2f32(<2 x float> %81)
  %83 = fpext <2 x float> %82 to <2 x double>
  %shift = shufflevector <2 x double> %83, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %84 = fadd <2 x double> %shift, %83
  %85 = extractelement <2 x double> %84, i64 0
  %86 = fsub <4 x float> %63, %53
  %87 = extractelement <4 x float> %86, i64 2
  %88 = call float @llvm.fabs.f32(float %87)
  %89 = fpext float %88 to double
  %90 = fadd double %85, %89
  %91 = fsub <4 x float> %63, %53
  %92 = extractelement <4 x float> %91, i64 3
  %93 = call float @llvm.fabs.f32(float %92)
  %94 = fpext float %93 to double
  %95 = fadd double %90, %94
  %96 = fsub <4 x float> %74, %68
  %97 = extractelement <4 x float> %96, i64 0
  %98 = call float @llvm.fabs.f32(float %97)
  %99 = fpext float %98 to double
  %100 = fadd double %95, %99
  %101 = fsub <4 x float> %74, %68
  %102 = extractelement <4 x float> %101, i64 1
  %103 = call float @llvm.fabs.f32(float %102)
  %104 = fpext float %103 to double
  %105 = fadd double %100, %104
  %106 = fsub <4 x float> %74, %68
  %107 = extractelement <4 x float> %106, i64 2
  %108 = call float @llvm.fabs.f32(float %107)
  %109 = fpext float %108 to double
  %110 = fadd double %105, %109
  %111 = fsub <4 x float> %74, %68
  %112 = extractelement <4 x float> %111, i64 3
  %113 = call float @llvm.fabs.f32(float %112)
  %114 = fpext float %113 to double
  %115 = fadd double %110, %114
  %116 = fsub float %79, %75
  %117 = call float @llvm.fabs.f32(float %116)
  %118 = fpext float %117 to double
  %119 = fadd double %115, %118
  %120 = fptrunc double %119 to float
  %121 = icmp ugt i32 %.0, 99
  %122 = fpext float %120 to double
  %123 = fcmp olt double %122, 3.000000e-06
  %or.cond = select i1 %121, i1 true, i1 %123
  br i1 %or.cond, label %126, label %124

124:                                              ; preds = %48
  %125 = add nuw nsw i32 %.0, 1
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %3, ptr noundef nonnull align 4 dereferenceable(36) %0, i64 36, i1 false), !tbaa.struct !5
  br label %36

126:                                              ; preds = %48
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %3) #5
  ret void
}

; 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

; Function Attrs: nounwind uwtable
declare dso_local void @nifti_mat33_inverse(ptr dead_on_unwind noalias writable sret(%struct.mat33) align 4, ptr noundef byval(%struct.mat33) align 8) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local float @nifti_mat33_determ(ptr noundef byval(%struct.mat33) align 8) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local float @nifti_mat33_rownorm(ptr noundef byval(%struct.mat33) align 8) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local float @nifti_mat33_colnorm(ptr noundef byval(%struct.mat33) align 8) local_unnamed_addr #1

declare float @sqrtf(float) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fabs.v2f32(<2 x float>) #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { mustprogress nofree nounwind willreturn memory(write) "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" }

!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 = !{i64 0, i64 36, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass