; LLVM IR from sourceryinstitute/MORFEUS-Source :: src/FV/src/mesh_optimize/OptMS (SMvalid)

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

; 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 @SMorient3D(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca double, align 8
  %34 = alloca double, align 8
  %35 = alloca double, align 8
  %36 = alloca double, align 8
  %37 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store double 1.000000e-13, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %38 = load ptr, ptr %7, align 8, !tbaa !5
  %39 = getelementptr inbounds double, ptr %38, i64 0
  %40 = load double, ptr %39, align 8, !tbaa !9
  store double %40, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds double, ptr %41, i64 1
  %43 = load double, ptr %42, align 8, !tbaa !9
  store double %43, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds double, ptr %44, i64 2
  %46 = load double, ptr %45, align 8, !tbaa !9
  store double %46, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds double, ptr %47, i64 0
  %49 = load double, ptr %48, align 8, !tbaa !9
  store double %49, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = getelementptr inbounds double, ptr %50, i64 1
  %52 = load double, ptr %51, align 8, !tbaa !9
  store double %52, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds double, ptr %53, i64 2
  %55 = load double, ptr %54, align 8, !tbaa !9
  store double %55, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds double, ptr %56, i64 0
  %58 = load double, ptr %57, align 8, !tbaa !9
  store double %58, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds double, ptr %59, i64 1
  %61 = load double, ptr %60, align 8, !tbaa !9
  store double %61, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  %63 = getelementptr inbounds double, ptr %62, i64 2
  %64 = load double, ptr %63, align 8, !tbaa !9
  store double %64, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds double, ptr %65, i64 0
  %67 = load double, ptr %66, align 8, !tbaa !9
  store double %67, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds double, ptr %68, i64 1
  %70 = load double, ptr %69, align 8, !tbaa !9
  store double %70, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = getelementptr inbounds double, ptr %71, i64 2
  %73 = load double, ptr %72, align 8, !tbaa !9
  store double %73, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %74 = load double, ptr %17, align 8, !tbaa !9
  %75 = load double, ptr %14, align 8, !tbaa !9
  %76 = fsub double %74, %75
  store double %76, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %77 = load double, ptr %20, align 8, !tbaa !9
  %78 = load double, ptr %14, align 8, !tbaa !9
  %79 = fsub double %77, %78
  store double %79, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %80 = load double, ptr %23, align 8, !tbaa !9
  %81 = load double, ptr %14, align 8, !tbaa !9
  %82 = fsub double %80, %81
  store double %82, ptr %28, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %83 = load double, ptr %18, align 8, !tbaa !9
  %84 = load double, ptr %15, align 8, !tbaa !9
  %85 = fsub double %83, %84
  store double %85, ptr %29, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %86 = load double, ptr %21, align 8, !tbaa !9
  %87 = load double, ptr %15, align 8, !tbaa !9
  %88 = fsub double %86, %87
  store double %88, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %89 = load double, ptr %24, align 8, !tbaa !9
  %90 = load double, ptr %15, align 8, !tbaa !9
  %91 = fsub double %89, %90
  store double %91, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #4
  %92 = load double, ptr %19, align 8, !tbaa !9
  %93 = load double, ptr %16, align 8, !tbaa !9
  %94 = fsub double %92, %93
  store double %94, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #4
  %95 = load double, ptr %22, align 8, !tbaa !9
  %96 = load double, ptr %16, align 8, !tbaa !9
  %97 = fsub double %95, %96
  store double %97, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #4
  %98 = load double, ptr %25, align 8, !tbaa !9
  %99 = load double, ptr %16, align 8, !tbaa !9
  %100 = fsub double %98, %99
  store double %100, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #4
  %101 = load double, ptr %26, align 8, !tbaa !9
  %102 = load double, ptr %30, align 8, !tbaa !9
  %103 = fmul double %101, %102
  %104 = load double, ptr %34, align 8, !tbaa !9
  %105 = load double, ptr %27, align 8, !tbaa !9
  %106 = load double, ptr %31, align 8, !tbaa !9
  %107 = fmul double %105, %106
  %108 = load double, ptr %32, align 8, !tbaa !9
  %109 = fmul double %107, %108
  %110 = call double @llvm.fmuladd.f64(double %103, double %104, double %109)
  %111 = load double, ptr %28, align 8, !tbaa !9
  %112 = load double, ptr %29, align 8, !tbaa !9
  %113 = fmul double %111, %112
  %114 = load double, ptr %33, align 8, !tbaa !9
  %115 = call double @llvm.fmuladd.f64(double %113, double %114, double %110)
  %116 = load double, ptr %32, align 8, !tbaa !9
  %117 = load double, ptr %30, align 8, !tbaa !9
  %118 = fmul double %116, %117
  %119 = load double, ptr %28, align 8, !tbaa !9
  %120 = fneg double %118
  %121 = call double @llvm.fmuladd.f64(double %120, double %119, double %115)
  %122 = load double, ptr %33, align 8, !tbaa !9
  %123 = load double, ptr %31, align 8, !tbaa !9
  %124 = fmul double %122, %123
  %125 = load double, ptr %26, align 8, !tbaa !9
  %126 = fneg double %124
  %127 = call double @llvm.fmuladd.f64(double %126, double %125, double %121)
  %128 = load double, ptr %34, align 8, !tbaa !9
  %129 = load double, ptr %29, align 8, !tbaa !9
  %130 = fmul double %128, %129
  %131 = load double, ptr %27, align 8, !tbaa !9
  %132 = fneg double %130
  %133 = call double @llvm.fmuladd.f64(double %132, double %131, double %127)
  store double %133, ptr %35, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #4
  %134 = load double, ptr %14, align 8, !tbaa !9
  %135 = load double, ptr %17, align 8, !tbaa !9
  %136 = fsub double %134, %135
  %137 = load double, ptr %14, align 8, !tbaa !9
  %138 = load double, ptr %17, align 8, !tbaa !9
  %139 = fsub double %137, %138
  %140 = load double, ptr %15, align 8, !tbaa !9
  %141 = load double, ptr %18, align 8, !tbaa !9
  %142 = fsub double %140, %141
  %143 = load double, ptr %15, align 8, !tbaa !9
  %144 = load double, ptr %18, align 8, !tbaa !9
  %145 = fsub double %143, %144
  %146 = fmul double %142, %145
  %147 = call double @llvm.fmuladd.f64(double %136, double %139, double %146)
  %148 = load double, ptr %16, align 8, !tbaa !9
  %149 = load double, ptr %19, align 8, !tbaa !9
  %150 = fsub double %148, %149
  %151 = load double, ptr %16, align 8, !tbaa !9
  %152 = load double, ptr %19, align 8, !tbaa !9
  %153 = fsub double %151, %152
  %154 = call double @llvm.fmuladd.f64(double %150, double %153, double %147)
  %155 = call double @sqrt(double noundef %154) #4
  %156 = load double, ptr %14, align 8, !tbaa !9
  %157 = load double, ptr %20, align 8, !tbaa !9
  %158 = fsub double %156, %157
  %159 = load double, ptr %14, align 8, !tbaa !9
  %160 = load double, ptr %20, align 8, !tbaa !9
  %161 = fsub double %159, %160
  %162 = load double, ptr %15, align 8, !tbaa !9
  %163 = load double, ptr %21, align 8, !tbaa !9
  %164 = fsub double %162, %163
  %165 = load double, ptr %15, align 8, !tbaa !9
  %166 = load double, ptr %21, align 8, !tbaa !9
  %167 = fsub double %165, %166
  %168 = fmul double %164, %167
  %169 = call double @llvm.fmuladd.f64(double %158, double %161, double %168)
  %170 = load double, ptr %16, align 8, !tbaa !9
  %171 = load double, ptr %22, align 8, !tbaa !9
  %172 = fsub double %170, %171
  %173 = load double, ptr %16, align 8, !tbaa !9
  %174 = load double, ptr %22, align 8, !tbaa !9
  %175 = fsub double %173, %174
  %176 = call double @llvm.fmuladd.f64(double %172, double %175, double %169)
  %177 = call double @sqrt(double noundef %176) #4
  %178 = fadd double %155, %177
  %179 = load double, ptr %14, align 8, !tbaa !9
  %180 = load double, ptr %23, align 8, !tbaa !9
  %181 = fsub double %179, %180
  %182 = load double, ptr %14, align 8, !tbaa !9
  %183 = load double, ptr %23, align 8, !tbaa !9
  %184 = fsub double %182, %183
  %185 = load double, ptr %15, align 8, !tbaa !9
  %186 = load double, ptr %24, align 8, !tbaa !9
  %187 = fsub double %185, %186
  %188 = load double, ptr %15, align 8, !tbaa !9
  %189 = load double, ptr %24, align 8, !tbaa !9
  %190 = fsub double %188, %189
  %191 = fmul double %187, %190
  %192 = call double @llvm.fmuladd.f64(double %181, double %184, double %191)
  %193 = load double, ptr %16, align 8, !tbaa !9
  %194 = load double, ptr %25, align 8, !tbaa !9
  %195 = fsub double %193, %194
  %196 = load double, ptr %16, align 8, !tbaa !9
  %197 = load double, ptr %25, align 8, !tbaa !9
  %198 = fsub double %196, %197
  %199 = call double @llvm.fmuladd.f64(double %195, double %198, double %192)
  %200 = call double @sqrt(double noundef %199) #4
  %201 = fadd double %178, %200
  %202 = load double, ptr %17, align 8, !tbaa !9
  %203 = load double, ptr %20, align 8, !tbaa !9
  %204 = fsub double %202, %203
  %205 = load double, ptr %17, align 8, !tbaa !9
  %206 = load double, ptr %20, align 8, !tbaa !9
  %207 = fsub double %205, %206
  %208 = load double, ptr %18, align 8, !tbaa !9
  %209 = load double, ptr %21, align 8, !tbaa !9
  %210 = fsub double %208, %209
  %211 = load double, ptr %18, align 8, !tbaa !9
  %212 = load double, ptr %21, align 8, !tbaa !9
  %213 = fsub double %211, %212
  %214 = fmul double %210, %213
  %215 = call double @llvm.fmuladd.f64(double %204, double %207, double %214)
  %216 = load double, ptr %19, align 8, !tbaa !9
  %217 = load double, ptr %22, align 8, !tbaa !9
  %218 = fsub double %216, %217
  %219 = load double, ptr %19, align 8, !tbaa !9
  %220 = load double, ptr %22, align 8, !tbaa !9
  %221 = fsub double %219, %220
  %222 = call double @llvm.fmuladd.f64(double %218, double %221, double %215)
  %223 = call double @sqrt(double noundef %222) #4
  %224 = fadd double %201, %223
  %225 = load double, ptr %17, align 8, !tbaa !9
  %226 = load double, ptr %23, align 8, !tbaa !9
  %227 = fsub double %225, %226
  %228 = load double, ptr %17, align 8, !tbaa !9
  %229 = load double, ptr %23, align 8, !tbaa !9
  %230 = fsub double %228, %229
  %231 = load double, ptr %18, align 8, !tbaa !9
  %232 = load double, ptr %24, align 8, !tbaa !9
  %233 = fsub double %231, %232
  %234 = load double, ptr %18, align 8, !tbaa !9
  %235 = load double, ptr %24, align 8, !tbaa !9
  %236 = fsub double %234, %235
  %237 = fmul double %233, %236
  %238 = call double @llvm.fmuladd.f64(double %227, double %230, double %237)
  %239 = load double, ptr %19, align 8, !tbaa !9
  %240 = load double, ptr %25, align 8, !tbaa !9
  %241 = fsub double %239, %240
  %242 = load double, ptr %19, align 8, !tbaa !9
  %243 = load double, ptr %25, align 8, !tbaa !9
  %244 = fsub double %242, %243
  %245 = call double @llvm.fmuladd.f64(double %241, double %244, double %238)
  %246 = call double @sqrt(double noundef %245) #4
  %247 = fadd double %224, %246
  %248 = load double, ptr %20, align 8, !tbaa !9
  %249 = load double, ptr %23, align 8, !tbaa !9
  %250 = fsub double %248, %249
  %251 = load double, ptr %20, align 8, !tbaa !9
  %252 = load double, ptr %23, align 8, !tbaa !9
  %253 = fsub double %251, %252
  %254 = load double, ptr %21, align 8, !tbaa !9
  %255 = load double, ptr %24, align 8, !tbaa !9
  %256 = fsub double %254, %255
  %257 = load double, ptr %21, align 8, !tbaa !9
  %258 = load double, ptr %24, align 8, !tbaa !9
  %259 = fsub double %257, %258
  %260 = fmul double %256, %259
  %261 = call double @llvm.fmuladd.f64(double %250, double %253, double %260)
  %262 = load double, ptr %22, align 8, !tbaa !9
  %263 = load double, ptr %25, align 8, !tbaa !9
  %264 = fsub double %262, %263
  %265 = load double, ptr %22, align 8, !tbaa !9
  %266 = load double, ptr %25, align 8, !tbaa !9
  %267 = fsub double %265, %266
  %268 = call double @llvm.fmuladd.f64(double %264, double %267, double %261)
  %269 = call double @sqrt(double noundef %268) #4
  %270 = fadd double %247, %269
  %271 = fdiv double %270, 6.000000e+00
  store double %271, ptr %36, align 8, !tbaa !9
  %272 = load double, ptr %36, align 8, !tbaa !9
  %273 = call double @llvm.fabs.f64(double %272)
  %274 = fcmp olt double %273, 1.000000e-15
  br i1 %274, label %275, label %277

275:                                              ; preds = %5
  %276 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %276, align 4, !tbaa !11
  store i32 0, ptr %12, align 4, !tbaa !11
  store i32 0, ptr %6, align 4
  store i32 1, ptr %37, align 4
  br label %302

277:                                              ; preds = %5
  %278 = load double, ptr %36, align 8, !tbaa !9
  %279 = load double, ptr %36, align 8, !tbaa !9
  %280 = fmul double %278, %279
  %281 = load double, ptr %36, align 8, !tbaa !9
  %282 = fmul double %280, %281
  %283 = load double, ptr %35, align 8, !tbaa !9
  %284 = fdiv double %283, %282
  store double %284, ptr %35, align 8, !tbaa !9
  br label %285

285:                                              ; preds = %277
  %286 = load double, ptr %35, align 8, !tbaa !9
  %287 = load double, ptr %13, align 8, !tbaa !9
  %288 = fcmp ogt double %286, %287
  br i1 %288, label %289, label %291

289:                                              ; preds = %285
  %290 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 1, ptr %290, align 4, !tbaa !11
  br label %301

291:                                              ; preds = %285
  %292 = load double, ptr %35, align 8, !tbaa !9
  %293 = load double, ptr %13, align 8, !tbaa !9
  %294 = fneg double %293
  %295 = fcmp olt double %292, %294
  br i1 %295, label %296, label %298

296:                                              ; preds = %291
  %297 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 -1, ptr %297, align 4, !tbaa !11
  br label %300

298:                                              ; preds = %291
  %299 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %299, align 4, !tbaa !11
  br label %300

300:                                              ; preds = %298, %296
  br label %301

301:                                              ; preds = %300, %289
  store i32 0, ptr %12, align 4, !tbaa !11
  store i32 0, ptr %6, align 4
  store i32 1, ptr %37, align 4
  br label %302

302:                                              ; preds = %301, %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %303 = load i32, ptr %6, align 4
  ret i32 %303
}

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local noundef i32 @SMorient3D(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #0 {
  %6 = load double, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  %8 = load double, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = load double, ptr %1, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = load double, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %1, i64 16
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = load double, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %2, i64 8
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = load double, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %3, i64 8
  %23 = load double, ptr %22, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %3, i64 16
  %25 = load double, ptr %24, align 8, !tbaa !5
  %26 = insertelement <2 x double> poison, double %6, i64 0
  %27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
  %28 = insertelement <2 x double> poison, double %11, i64 0
  %29 = insertelement <2 x double> %28, double %16, i64 1
  %30 = fsub <2 x double> %27, %29
  %31 = insertelement <2 x double> poison, double %8, i64 0
  %32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
  %33 = insertelement <2 x double> poison, double %13, i64 0
  %34 = insertelement <2 x double> %33, double %18, i64 1
  %35 = fsub <2 x double> %32, %34
  %36 = fmul <2 x double> %35, %35
  %37 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %30, <2 x double> %30, <2 x double> %36)
  %38 = insertelement <2 x double> poison, double %10, i64 0
  %39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
  %40 = insertelement <2 x double> poison, double %15, i64 0
  %41 = insertelement <2 x double> %40, double %20, i64 1
  %42 = fsub <2 x double> %39, %41
  %43 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %42, <2 x double> %42, <2 x double> %37)
  %44 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %43)
  %shift = shufflevector <2 x double> %44, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %45 = fadd <2 x double> %44, %shift
  %46 = extractelement <2 x double> %45, i64 0
  %47 = fsub double %6, %21
  %48 = fsub double %8, %23
  %49 = fmul double %48, %48
  %50 = tail call double @llvm.fmuladd.f64(double %47, double %47, double %49)
  %51 = fsub double %10, %25
  %52 = tail call double @llvm.fmuladd.f64(double %51, double %51, double %50)
  %sqrt135 = tail call double @llvm.sqrt.f64(double %52)
  %53 = fadd double %46, %sqrt135
  %54 = fsub double %11, %16
  %55 = fsub double %13, %18
  %56 = fmul double %55, %55
  %57 = tail call double @llvm.fmuladd.f64(double %54, double %54, double %56)
  %58 = fsub double %15, %20
  %59 = tail call double @llvm.fmuladd.f64(double %58, double %58, double %57)
  %sqrt134 = tail call double @llvm.sqrt.f64(double %59)
  %60 = fadd double %sqrt134, %53
  %61 = fsub double %11, %21
  %62 = fsub double %13, %23
  %63 = fmul double %62, %62
  %64 = tail call double @llvm.fmuladd.f64(double %61, double %61, double %63)
  %65 = fsub double %15, %25
  %66 = tail call double @llvm.fmuladd.f64(double %65, double %65, double %64)
  %sqrt133 = tail call double @llvm.sqrt.f64(double %66)
  %67 = fadd double %sqrt133, %60
  %68 = fsub double %16, %21
  %69 = fsub double %18, %23
  %70 = fmul double %69, %69
  %71 = tail call double @llvm.fmuladd.f64(double %68, double %68, double %70)
  %72 = fsub double %20, %25
  %73 = tail call double @llvm.fmuladd.f64(double %72, double %72, double %71)
  %sqrt = tail call double @llvm.sqrt.f64(double %73)
  %74 = fadd double %sqrt, %67
  %75 = fdiv double %74, 6.000000e+00
  %76 = tail call double @llvm.fabs.f64(double %75)
  %77 = fcmp olt double %76, 1.000000e-15
  br i1 %77, label %109, label %78

78:                                               ; preds = %5
  %79 = fsub double %13, %8
  %80 = fsub double %25, %10
  %81 = fneg double %80
  %82 = fmul double %79, %81
  %83 = fsub double %16, %6
  %84 = fsub double %23, %8
  %85 = fsub double %20, %10
  %86 = fneg double %85
  %87 = fmul double %84, %86
  %88 = fsub double %11, %6
  %89 = fsub double %18, %8
  %90 = fsub double %15, %10
  %91 = fneg double %90
  %92 = fmul double %89, %91
  %93 = fsub double %21, %6
  %94 = fmul double %79, %93
  %95 = fmul double %88, %89
  %96 = fmul double %83, %84
  %97 = fmul double %90, %96
  %98 = tail call double @llvm.fmuladd.f64(double %95, double %80, double %97)
  %99 = tail call double @llvm.fmuladd.f64(double %94, double %85, double %98)
  %100 = tail call double @llvm.fmuladd.f64(double %92, double %93, double %99)
  %101 = tail call double @llvm.fmuladd.f64(double %87, double %88, double %100)
  %102 = tail call double @llvm.fmuladd.f64(double %82, double %83, double %101)
  %103 = fmul double %75, %75
  %104 = fmul double %75, %103
  %105 = fdiv double %102, %104
  %106 = fcmp ogt double %105, 1.000000e-13
  br i1 %106, label %109, label %107

107:                                              ; preds = %78
  %108 = fcmp olt double %105, -1.000000e-13
  %. = sext i1 %108 to i32
  br label %109

109:                                              ; preds = %107, %78, %5
  %.sink = phi i32 [ 0, %5 ], [ 1, %78 ], [ %., %107 ]
  store i32 %.sink, ptr %4, align 4, !tbaa !9
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #2

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}


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