; LLVM IR from thuhcsi/Crystal.TTVS :: Xface/XFace/src/XMath (Quaternion)

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

%"class.XMath::Quaternion" = type { float, float, float, 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: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN5XMath10Quaternion18FromRotationMatrixERNS_7Matrix4E(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(64) %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %7 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %8, i32 noundef 0)
  %10 = load float, ptr %9, align 4, !tbaa !9
  %11 = fadd float 1.000000e+00, %10
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %12, i32 noundef 5)
  %14 = load float, ptr %13, align 4, !tbaa !9
  %15 = fadd float %11, %14
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %16, i32 noundef 10)
  %18 = load float, ptr %17, align 4, !tbaa !9
  %19 = fadd float %15, %18
  store float %19, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %20 = load float, ptr %5, align 4, !tbaa !9
  %21 = fpext float %20 to double
  %22 = fcmp ogt double %21, 1.000000e-08
  br i1 %22, label %23, label %68

23:                                               ; preds = %2
  %24 = load float, ptr %5, align 4, !tbaa !9
  %25 = call noundef float @_ZSt4sqrtf(float noundef %24)
  %26 = fpext float %25 to double
  %27 = fmul double %26, 2.000000e+00
  store double %27, ptr %6, align 8, !tbaa !11
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %28, i32 noundef 9)
  %30 = load float, ptr %29, align 4, !tbaa !9
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %31, i32 noundef 6)
  %33 = load float, ptr %32, align 4, !tbaa !9
  %34 = fsub float %30, %33
  %35 = fpext float %34 to double
  %36 = load double, ptr %6, align 8, !tbaa !11
  %37 = fdiv double %35, %36
  %38 = fptrunc double %37 to float
  %39 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 0
  store float %38, ptr %39, align 4, !tbaa !13
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %40, i32 noundef 2)
  %42 = load float, ptr %41, align 4, !tbaa !9
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %43, i32 noundef 8)
  %45 = load float, ptr %44, align 4, !tbaa !9
  %46 = fsub float %42, %45
  %47 = fpext float %46 to double
  %48 = load double, ptr %6, align 8, !tbaa !11
  %49 = fdiv double %47, %48
  %50 = fptrunc double %49 to float
  %51 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 1
  store float %50, ptr %51, align 4, !tbaa !15
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %52, i32 noundef 4)
  %54 = load float, ptr %53, align 4, !tbaa !9
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %55, i32 noundef 1)
  %57 = load float, ptr %56, align 4, !tbaa !9
  %58 = fsub float %54, %57
  %59 = fpext float %58 to double
  %60 = load double, ptr %6, align 8, !tbaa !11
  %61 = fdiv double %59, %60
  %62 = fptrunc double %61 to float
  %63 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 2
  store float %62, ptr %63, align 4, !tbaa !16
  %64 = load double, ptr %6, align 8, !tbaa !11
  %65 = fmul double 2.500000e-01, %64
  %66 = fptrunc double %65 to float
  %67 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 3
  store float %66, ptr %67, align 4, !tbaa !17
  br label %262

68:                                               ; preds = %2
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %69, i32 noundef 0)
  %71 = load float, ptr %70, align 4, !tbaa !9
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %72, i32 noundef 5)
  %74 = load float, ptr %73, align 4, !tbaa !9
  %75 = fcmp ogt float %71, %74
  br i1 %75, label %76, label %140

76:                                               ; preds = %68
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %77, i32 noundef 0)
  %79 = load float, ptr %78, align 4, !tbaa !9
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %80, i32 noundef 10)
  %82 = load float, ptr %81, align 4, !tbaa !9
  %83 = fcmp ogt float %79, %82
  br i1 %83, label %84, label %140

84:                                               ; preds = %76
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %85, i32 noundef 0)
  %87 = load float, ptr %86, align 4, !tbaa !9
  %88 = fadd float 1.000000e+00, %87
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %89, i32 noundef 5)
  %91 = load float, ptr %90, align 4, !tbaa !9
  %92 = fsub float %88, %91
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %93, i32 noundef 10)
  %95 = load float, ptr %94, align 4, !tbaa !9
  %96 = fsub float %92, %95
  %97 = call noundef float @_ZSt4sqrtf(float noundef %96)
  %98 = fpext float %97 to double
  %99 = fmul double %98, 2.000000e+00
  store double %99, ptr %6, align 8, !tbaa !11
  %100 = load double, ptr %6, align 8, !tbaa !11
  %101 = fmul double 2.500000e-01, %100
  %102 = fptrunc double %101 to float
  %103 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 0
  store float %102, ptr %103, align 4, !tbaa !13
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %104, i32 noundef 4)
  %106 = load float, ptr %105, align 4, !tbaa !9
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %107, i32 noundef 1)
  %109 = load float, ptr %108, align 4, !tbaa !9
  %110 = fadd float %106, %109
  %111 = fpext float %110 to double
  %112 = load double, ptr %6, align 8, !tbaa !11
  %113 = fdiv double %111, %112
  %114 = fptrunc double %113 to float
  %115 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 1
  store float %114, ptr %115, align 4, !tbaa !15
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %116, i32 noundef 2)
  %118 = load float, ptr %117, align 4, !tbaa !9
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %119, i32 noundef 8)
  %121 = load float, ptr %120, align 4, !tbaa !9
  %122 = fadd float %118, %121
  %123 = fpext float %122 to double
  %124 = load double, ptr %6, align 8, !tbaa !11
  %125 = fdiv double %123, %124
  %126 = fptrunc double %125 to float
  %127 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 2
  store float %126, ptr %127, align 4, !tbaa !16
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %128, i32 noundef 9)
  %130 = load float, ptr %129, align 4, !tbaa !9
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %131, i32 noundef 6)
  %133 = load float, ptr %132, align 4, !tbaa !9
  %134 = fsub float %130, %133
  %135 = fpext float %134 to double
  %136 = load double, ptr %6, align 8, !tbaa !11
  %137 = fdiv double %135, %136
  %138 = fptrunc double %137 to float
  %139 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 3
  store float %138, ptr %139, align 4, !tbaa !17
  br label %261

140:                                              ; preds = %76, %68
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %141, i32 noundef 5)
  %143 = load float, ptr %142, align 4, !tbaa !9
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %144, i32 noundef 10)
  %146 = load float, ptr %145, align 4, !tbaa !9
  %147 = fcmp ogt float %143, %146
  br i1 %147, label %148, label %204

148:                                              ; preds = %140
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %149, i32 noundef 5)
  %151 = load float, ptr %150, align 4, !tbaa !9
  %152 = fadd float 1.000000e+00, %151
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %153, i32 noundef 0)
  %155 = load float, ptr %154, align 4, !tbaa !9
  %156 = fsub float %152, %155
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %157, i32 noundef 10)
  %159 = load float, ptr %158, align 4, !tbaa !9
  %160 = fsub float %156, %159
  %161 = call noundef float @_ZSt4sqrtf(float noundef %160)
  %162 = fpext float %161 to double
  %163 = fmul double %162, 2.000000e+00
  store double %163, ptr %6, align 8, !tbaa !11
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %164, i32 noundef 4)
  %166 = load float, ptr %165, align 4, !tbaa !9
  %167 = load ptr, ptr %4, align 8, !tbaa !5
  %168 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %167, i32 noundef 1)
  %169 = load float, ptr %168, align 4, !tbaa !9
  %170 = fadd float %166, %169
  %171 = fpext float %170 to double
  %172 = load double, ptr %6, align 8, !tbaa !11
  %173 = fdiv double %171, %172
  %174 = fptrunc double %173 to float
  %175 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 0
  store float %174, ptr %175, align 4, !tbaa !13
  %176 = load double, ptr %6, align 8, !tbaa !11
  %177 = fmul double 2.500000e-01, %176
  %178 = fptrunc double %177 to float
  %179 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 1
  store float %178, ptr %179, align 4, !tbaa !15
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %180, i32 noundef 9)
  %182 = load float, ptr %181, align 4, !tbaa !9
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %183, i32 noundef 6)
  %185 = load float, ptr %184, align 4, !tbaa !9
  %186 = fadd float %182, %185
  %187 = fpext float %186 to double
  %188 = load double, ptr %6, align 8, !tbaa !11
  %189 = fdiv double %187, %188
  %190 = fptrunc double %189 to float
  %191 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 2
  store float %190, ptr %191, align 4, !tbaa !16
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %192, i32 noundef 2)
  %194 = load float, ptr %193, align 4, !tbaa !9
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %195, i32 noundef 8)
  %197 = load float, ptr %196, align 4, !tbaa !9
  %198 = fsub float %194, %197
  %199 = fpext float %198 to double
  %200 = load double, ptr %6, align 8, !tbaa !11
  %201 = fdiv double %199, %200
  %202 = fptrunc double %201 to float
  %203 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 3
  store float %202, ptr %203, align 4, !tbaa !17
  br label %260

204:                                              ; preds = %140
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %205, i32 noundef 10)
  %207 = load float, ptr %206, align 4, !tbaa !9
  %208 = fadd float 1.000000e+00, %207
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %209, i32 noundef 0)
  %211 = load float, ptr %210, align 4, !tbaa !9
  %212 = fsub float %208, %211
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %213, i32 noundef 5)
  %215 = load float, ptr %214, align 4, !tbaa !9
  %216 = fsub float %212, %215
  %217 = call noundef float @_ZSt4sqrtf(float noundef %216)
  %218 = fpext float %217 to double
  %219 = fmul double %218, 2.000000e+00
  store double %219, ptr %6, align 8, !tbaa !11
  %220 = load ptr, ptr %4, align 8, !tbaa !5
  %221 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %220, i32 noundef 2)
  %222 = load float, ptr %221, align 4, !tbaa !9
  %223 = load ptr, ptr %4, align 8, !tbaa !5
  %224 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %223, i32 noundef 8)
  %225 = load float, ptr %224, align 4, !tbaa !9
  %226 = fadd float %222, %225
  %227 = fpext float %226 to double
  %228 = load double, ptr %6, align 8, !tbaa !11
  %229 = fdiv double %227, %228
  %230 = fptrunc double %229 to float
  %231 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 0
  store float %230, ptr %231, align 4, !tbaa !13
  %232 = load ptr, ptr %4, align 8, !tbaa !5
  %233 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %232, i32 noundef 9)
  %234 = load float, ptr %233, align 4, !tbaa !9
  %235 = load ptr, ptr %4, align 8, !tbaa !5
  %236 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %235, i32 noundef 6)
  %237 = load float, ptr %236, align 4, !tbaa !9
  %238 = fadd float %234, %237
  %239 = fpext float %238 to double
  %240 = load double, ptr %6, align 8, !tbaa !11
  %241 = fdiv double %239, %240
  %242 = fptrunc double %241 to float
  %243 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 1
  store float %242, ptr %243, align 4, !tbaa !15
  %244 = load double, ptr %6, align 8, !tbaa !11
  %245 = fmul double 2.500000e-01, %244
  %246 = fptrunc double %245 to float
  %247 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 2
  store float %246, ptr %247, align 4, !tbaa !16
  %248 = load ptr, ptr %4, align 8, !tbaa !5
  %249 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %248, i32 noundef 4)
  %250 = load float, ptr %249, align 4, !tbaa !9
  %251 = load ptr, ptr %4, align 8, !tbaa !5
  %252 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %251, i32 noundef 1)
  %253 = load float, ptr %252, align 4, !tbaa !9
  %254 = fsub float %250, %253
  %255 = fpext float %254 to double
  %256 = load double, ptr %6, align 8, !tbaa !11
  %257 = fdiv double %255, %256
  %258 = fptrunc double %257 to float
  %259 = getelementptr inbounds %"class.XMath::Quaternion", ptr %7, i32 0, i32 3
  store float %258, ptr %259, align 4, !tbaa !17
  br label %260

260:                                              ; preds = %204, %148
  br label %261

261:                                              ; preds = %260, %84
  br label %262

262:                                              ; preds = %261, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret ptr %7
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) #3

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN5XMath10QuaternionE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!15 = !{!14, !10, i64 4}
!16 = !{!14, !10, i64 8}
!17 = !{!14, !10, i64 12}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN5XMath10Quaternion18FromRotationMatrixERNS_7Matrix4E(ptr noundef nonnull returned writeonly align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(64) %1) local_unnamed_addr #0 align 2 {
  %3 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 0)
  %4 = load float, ptr %3, align 4, !tbaa !5
  %5 = fadd float %4, 1.000000e+00
  %6 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 5)
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = fadd float %5, %7
  %9 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 10)
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = fadd float %8, %10
  %12 = fpext float %11 to double
  %13 = fcmp ogt double %12, 1.000000e-08
  br i1 %13, label %14, label %45

14:                                               ; preds = %2
  %15 = tail call noundef float @_ZSt4sqrtf(float noundef %11)
  %16 = fpext float %15 to double
  %17 = fmul double %16, 2.000000e+00
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 9)
  %19 = load float, ptr %18, align 4, !tbaa !5
  %20 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 6)
  %21 = load float, ptr %20, align 4, !tbaa !5
  %22 = fsub float %19, %21
  %23 = fpext float %22 to double
  %24 = fdiv double %23, %17
  %25 = fptrunc double %24 to float
  store float %25, ptr %0, align 4, !tbaa !9
  %26 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 2)
  %27 = load float, ptr %26, align 4, !tbaa !5
  %28 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 8)
  %29 = load float, ptr %28, align 4, !tbaa !5
  %30 = fsub float %27, %29
  %31 = fpext float %30 to double
  %32 = fdiv double %31, %17
  %33 = fptrunc double %32 to float
  %34 = getelementptr inbounds i8, ptr %0, i64 4
  store float %33, ptr %34, align 4, !tbaa !11
  %35 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 4)
  %36 = load float, ptr %35, align 4, !tbaa !5
  %37 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 1)
  %38 = load float, ptr %37, align 4, !tbaa !5
  %39 = fsub float %36, %38
  %40 = fpext float %39 to double
  %41 = fdiv double %40, %17
  %42 = fptrunc double %41 to float
  %43 = getelementptr inbounds i8, ptr %0, i64 8
  store float %42, ptr %43, align 4, !tbaa !12
  %44 = fmul double %17, 2.500000e-01
  br label %183

45:                                               ; preds = %2
  %46 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 0)
  %47 = load float, ptr %46, align 4, !tbaa !5
  %48 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 5)
  %49 = load float, ptr %48, align 4, !tbaa !5
  %50 = fcmp ogt float %47, %49
  br i1 %50, label %51, label %97

51:                                               ; preds = %45
  %52 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 0)
  %53 = load float, ptr %52, align 4, !tbaa !5
  %54 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 10)
  %55 = load float, ptr %54, align 4, !tbaa !5
  %56 = fcmp ogt float %53, %55
  br i1 %56, label %57, label %97

57:                                               ; preds = %51
  %58 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 0)
  %59 = load float, ptr %58, align 4, !tbaa !5
  %60 = fadd float %59, 1.000000e+00
  %61 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 5)
  %62 = load float, ptr %61, align 4, !tbaa !5
  %63 = fsub float %60, %62
  %64 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 10)
  %65 = load float, ptr %64, align 4, !tbaa !5
  %66 = fsub float %63, %65
  %67 = tail call noundef float @_ZSt4sqrtf(float noundef %66)
  %68 = fpext float %67 to double
  %69 = fmul double %68, 2.000000e+00
  %70 = fmul double %69, 2.500000e-01
  %71 = fptrunc double %70 to float
  store float %71, ptr %0, align 4, !tbaa !9
  %72 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 4)
  %73 = load float, ptr %72, align 4, !tbaa !5
  %74 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 1)
  %75 = load float, ptr %74, align 4, !tbaa !5
  %76 = fadd float %73, %75
  %77 = fpext float %76 to double
  %78 = fdiv double %77, %69
  %79 = fptrunc double %78 to float
  %80 = getelementptr inbounds i8, ptr %0, i64 4
  store float %79, ptr %80, align 4, !tbaa !11
  %81 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 2)
  %82 = load float, ptr %81, align 4, !tbaa !5
  %83 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 8)
  %84 = load float, ptr %83, align 4, !tbaa !5
  %85 = fadd float %82, %84
  %86 = fpext float %85 to double
  %87 = fdiv double %86, %69
  %88 = fptrunc double %87 to float
  %89 = getelementptr inbounds i8, ptr %0, i64 8
  store float %88, ptr %89, align 4, !tbaa !12
  %90 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 9)
  %91 = load float, ptr %90, align 4, !tbaa !5
  %92 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 6)
  %93 = load float, ptr %92, align 4, !tbaa !5
  %94 = fsub float %91, %93
  %95 = fpext float %94 to double
  %96 = fdiv double %95, %69
  br label %183

97:                                               ; preds = %51, %45
  %98 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 5)
  %99 = load float, ptr %98, align 4, !tbaa !5
  %100 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 10)
  %101 = load float, ptr %100, align 4, !tbaa !5
  %102 = fcmp ogt float %99, %101
  br i1 %102, label %103, label %143

103:                                              ; preds = %97
  %104 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 5)
  %105 = load float, ptr %104, align 4, !tbaa !5
  %106 = fadd float %105, 1.000000e+00
  %107 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 0)
  %108 = load float, ptr %107, align 4, !tbaa !5
  %109 = fsub float %106, %108
  %110 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 10)
  %111 = load float, ptr %110, align 4, !tbaa !5
  %112 = fsub float %109, %111
  %113 = tail call noundef float @_ZSt4sqrtf(float noundef %112)
  %114 = fpext float %113 to double
  %115 = fmul double %114, 2.000000e+00
  %116 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 4)
  %117 = load float, ptr %116, align 4, !tbaa !5
  %118 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 1)
  %119 = load float, ptr %118, align 4, !tbaa !5
  %120 = fadd float %117, %119
  %121 = fpext float %120 to double
  %122 = fdiv double %121, %115
  %123 = fmul double %115, 2.500000e-01
  %124 = insertelement <2 x double> poison, double %122, i64 0
  %125 = insertelement <2 x double> %124, double %123, i64 1
  %126 = fptrunc <2 x double> %125 to <2 x float>
  store <2 x float> %126, ptr %0, align 4, !tbaa !5
  %127 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 9)
  %128 = load float, ptr %127, align 4, !tbaa !5
  %129 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 6)
  %130 = load float, ptr %129, align 4, !tbaa !5
  %131 = fadd float %128, %130
  %132 = fpext float %131 to double
  %133 = fdiv double %132, %115
  %134 = fptrunc double %133 to float
  %135 = getelementptr inbounds i8, ptr %0, i64 8
  store float %134, ptr %135, align 4, !tbaa !12
  %136 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 2)
  %137 = load float, ptr %136, align 4, !tbaa !5
  %138 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 8)
  %139 = load float, ptr %138, align 4, !tbaa !5
  %140 = fsub float %137, %139
  %141 = fpext float %140 to double
  %142 = fdiv double %141, %115
  br label %183

143:                                              ; preds = %97
  %144 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 10)
  %145 = load float, ptr %144, align 4, !tbaa !5
  %146 = fadd float %145, 1.000000e+00
  %147 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 0)
  %148 = load float, ptr %147, align 4, !tbaa !5
  %149 = fsub float %146, %148
  %150 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 5)
  %151 = load float, ptr %150, align 4, !tbaa !5
  %152 = fsub float %149, %151
  %153 = tail call noundef float @_ZSt4sqrtf(float noundef %152)
  %154 = fpext float %153 to double
  %155 = fmul double %154, 2.000000e+00
  %156 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 2)
  %157 = load float, ptr %156, align 4, !tbaa !5
  %158 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 8)
  %159 = load float, ptr %158, align 4, !tbaa !5
  %160 = fadd float %157, %159
  %161 = fpext float %160 to double
  %162 = fdiv double %161, %155
  %163 = fptrunc double %162 to float
  store float %163, ptr %0, align 4, !tbaa !9
  %164 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 9)
  %165 = load float, ptr %164, align 4, !tbaa !5
  %166 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 6)
  %167 = load float, ptr %166, align 4, !tbaa !5
  %168 = fadd float %165, %167
  %169 = fpext float %168 to double
  %170 = fdiv double %169, %155
  %171 = getelementptr inbounds i8, ptr %0, i64 4
  %172 = fmul double %155, 2.500000e-01
  %173 = insertelement <2 x double> poison, double %170, i64 0
  %174 = insertelement <2 x double> %173, double %172, i64 1
  %175 = fptrunc <2 x double> %174 to <2 x float>
  store <2 x float> %175, ptr %171, align 4, !tbaa !5
  %176 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 4)
  %177 = load float, ptr %176, align 4, !tbaa !5
  %178 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN5XMath7Matrix4ixEi(ptr noundef nonnull align 4 dereferenceable(64) %1, i32 noundef 1)
  %179 = load float, ptr %178, align 4, !tbaa !5
  %180 = fsub float %177, %179
  %181 = fpext float %180 to double
  %182 = fdiv double %181, %155
  br label %183

183:                                              ; preds = %57, %143, %103, %14
  %.sink62 = phi double [ %96, %57 ], [ %182, %143 ], [ %142, %103 ], [ %44, %14 ]
  %184 = fptrunc double %.sink62 to float
  %185 = getelementptr inbounds i8, ptr %0, i64 12
  store float %184, ptr %185, align 4, !tbaa !13
  ret ptr %0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { inlinehint mustprogress 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" }

!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++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN5XMath10QuaternionE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = !{!10, !6, i64 12}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass