; LLVM IR from ashishzero/karma :: src/modules/core/lin_maths.ll (Z12next_simplexP4Vec2S0_Pj)

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

%union.Vec2 = type { %struct.anon.1 }
%struct.anon.1 = type { float, float }

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_Z4vec2ff(float noundef, float noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z8vec2_dot4Vec2S_(<2 x float>, <2 x float>) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z16vec2_determinant4Vec2S_(<2 x float>, <2 x float>) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Zmi4Vec2S_(<2 x float>, <2 x float>) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z12next_simplexP4Vec2S0_Pj(ptr noundef %0, ptr noundef %1, ptr noundef %2) #5 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %union.Vec2, align 4
  %9 = alloca %union.Vec2, align 4
  %10 = alloca %union.Vec2, align 4
  %11 = alloca %union.Vec2, align 4
  %12 = alloca %union.Vec2, align 4
  %13 = alloca %union.Vec2, align 4
  %14 = alloca float, align 4
  %15 = alloca %union.Vec2, align 4
  %16 = alloca %union.Vec2, align 4
  %17 = alloca %union.Vec2, align 4
  %18 = alloca %union.Vec2, align 4
  %19 = alloca %union.Vec2, align 4
  %20 = alloca %union.Vec2, align 4
  %21 = alloca %union.Vec2, align 4
  %22 = alloca %union.Vec2, align 4
  %23 = alloca %union.Vec2, align 4
  %24 = alloca float, align 4
  %25 = alloca %union.Vec2, align 4
  %26 = alloca %union.Vec2, align 4
  %27 = alloca %union.Vec2, align 4
  %28 = alloca %union.Vec2, align 4
  %29 = alloca %union.Vec2, align 4
  %30 = alloca %union.Vec2, align 4
  %31 = alloca float, align 4
  %32 = alloca %union.Vec2, align 4
  %33 = alloca %union.Vec2, align 4
  %34 = alloca %union.Vec2, align 4
  %35 = alloca %union.Vec2, align 4
  %36 = alloca float, align 4
  %37 = alloca %union.Vec2, align 4
  %38 = alloca %union.Vec2, align 4
  %39 = alloca %union.Vec2, align 4
  %40 = alloca %union.Vec2, align 4
  %41 = alloca %union.Vec2, align 4
  %42 = alloca %union.Vec2, align 4
  %43 = alloca %union.Vec2, align 4
  %44 = alloca float, align 4
  %45 = alloca %union.Vec2, align 4
  %46 = alloca %union.Vec2, align 4
  %47 = alloca %union.Vec2, align 4
  %48 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = load i32, ptr %49, align 4, !tbaa !9
  switch i32 %50, label %308 [
    i32 2, label %51
    i32 3, label %103
  ]

51:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %union.Vec2, ptr %52, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %53, i64 8, i1 false), !tbaa.struct !11
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %union.Vec2, ptr %54, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %55, i64 8, i1 false), !tbaa.struct !11
  %56 = getelementptr inbounds %union.Vec2, ptr %9, i32 0, i32 0
  %57 = load <2 x float>, ptr %56, align 4
  %58 = getelementptr inbounds %union.Vec2, ptr %10, i32 0, i32 0
  %59 = load <2 x float>, ptr %58, align 4
  %60 = call <2 x float> @_Zmi4Vec2S_(<2 x float> %57, <2 x float> %59)
  %61 = getelementptr inbounds %union.Vec2, ptr %8, i32 0, i32 0
  store <2 x float> %60, ptr %61, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %union.Vec2, ptr %62, i64 1
  %64 = call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %63)
  %65 = getelementptr inbounds %union.Vec2, ptr %11, i32 0, i32 0
  store <2 x float> %64, ptr %65, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %8, i64 8, i1 false), !tbaa.struct !11
  %66 = getelementptr inbounds %union.Vec2, ptr %12, i32 0, i32 0
  %67 = load <2 x float>, ptr %66, align 4
  %68 = getelementptr inbounds %union.Vec2, ptr %13, i32 0, i32 0
  %69 = load <2 x float>, ptr %68, align 4
  %70 = call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %67, <2 x float> %69)
  %71 = fcmp ogt float %70, 0.000000e+00
  br i1 %71, label %72, label %95

72:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds %union.Vec2, ptr %73, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %74, i64 8, i1 false), !tbaa.struct !11
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %union.Vec2, ptr %75, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %76, i64 8, i1 false), !tbaa.struct !11
  %77 = getelementptr inbounds %union.Vec2, ptr %15, i32 0, i32 0
  %78 = load <2 x float>, ptr %77, align 4
  %79 = getelementptr inbounds %union.Vec2, ptr %16, i32 0, i32 0
  %80 = load <2 x float>, ptr %79, align 4
  %81 = call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %78, <2 x float> %80)
  store float %81, ptr %14, align 4, !tbaa !13
  %82 = getelementptr inbounds %struct.anon.1, ptr %8, i32 0, i32 1
  %83 = load float, ptr %82, align 4, !tbaa !12
  %84 = fneg float %83
  %85 = load float, ptr %14, align 4, !tbaa !13
  %86 = fmul float %84, %85
  %87 = load ptr, ptr %6, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.anon.1, ptr %87, i32 0, i32 0
  store float %86, ptr %88, align 4, !tbaa !12
  %89 = getelementptr inbounds %struct.anon.1, ptr %8, i32 0, i32 0
  %90 = load float, ptr %89, align 4, !tbaa !12
  %91 = load float, ptr %14, align 4, !tbaa !13
  %92 = fmul float %90, %91
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.anon.1, ptr %93, i32 0, i32 1
  store float %92, ptr %94, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %102

95:                                               ; preds = %51
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %96, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !11
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %union.Vec2, ptr %97, i64 1
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %union.Vec2, ptr %99, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %100, ptr align 4 %98, i64 8, i1 false), !tbaa.struct !11
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %101, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %95, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %308

103:                                              ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %union.Vec2, ptr %104, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %105, i64 8, i1 false), !tbaa.struct !11
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %union.Vec2, ptr %106, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %107, i64 8, i1 false), !tbaa.struct !11
  %108 = getelementptr inbounds %union.Vec2, ptr %18, i32 0, i32 0
  %109 = load <2 x float>, ptr %108, align 4
  %110 = getelementptr inbounds %union.Vec2, ptr %19, i32 0, i32 0
  %111 = load <2 x float>, ptr %110, align 4
  %112 = call <2 x float> @_Zmi4Vec2S_(<2 x float> %109, <2 x float> %111)
  %113 = getelementptr inbounds %union.Vec2, ptr %17, i32 0, i32 0
  store <2 x float> %112, ptr %113, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %union.Vec2, ptr %114, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %115, i64 8, i1 false), !tbaa.struct !11
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %union.Vec2, ptr %116, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %117, i64 8, i1 false), !tbaa.struct !11
  %118 = getelementptr inbounds %union.Vec2, ptr %21, i32 0, i32 0
  %119 = load <2 x float>, ptr %118, align 4
  %120 = getelementptr inbounds %union.Vec2, ptr %22, i32 0, i32 0
  %121 = load <2 x float>, ptr %120, align 4
  %122 = call <2 x float> @_Zmi4Vec2S_(<2 x float> %119, <2 x float> %121)
  %123 = getelementptr inbounds %union.Vec2, ptr %20, i32 0, i32 0
  store <2 x float> %122, ptr %123, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %union.Vec2, ptr %124, i64 2
  %126 = call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %125)
  %127 = getelementptr inbounds %union.Vec2, ptr %23, i32 0, i32 0
  store <2 x float> %126, ptr %127, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !11
  %128 = getelementptr inbounds %union.Vec2, ptr %25, i32 0, i32 0
  %129 = load <2 x float>, ptr %128, align 4
  %130 = getelementptr inbounds %union.Vec2, ptr %26, i32 0, i32 0
  %131 = load <2 x float>, ptr %130, align 4
  %132 = call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %129, <2 x float> %131)
  store float %132, ptr %24, align 4, !tbaa !13
  %133 = getelementptr inbounds %struct.anon.1, ptr %20, i32 0, i32 1
  %134 = load float, ptr %133, align 4, !tbaa !12
  %135 = fneg float %134
  %136 = load float, ptr %24, align 4, !tbaa !13
  %137 = fmul float %135, %136
  %138 = getelementptr inbounds %struct.anon.1, ptr %20, i32 0, i32 0
  %139 = load float, ptr %138, align 4, !tbaa !12
  %140 = load float, ptr %24, align 4, !tbaa !13
  %141 = fmul float %139, %140
  %142 = call <2 x float> @_Z4vec2ff(float noundef %137, float noundef %141)
  %143 = getelementptr inbounds %union.Vec2, ptr %27, i32 0, i32 0
  store <2 x float> %142, ptr %143, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !11
  %144 = getelementptr inbounds %union.Vec2, ptr %27, i32 0, i32 0
  %145 = load <2 x float>, ptr %144, align 4
  %146 = getelementptr inbounds %union.Vec2, ptr %28, i32 0, i32 0
  %147 = load <2 x float>, ptr %146, align 4
  %148 = call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %145, <2 x float> %147)
  %149 = fcmp ogt float %148, 0.000000e+00
  br i1 %149, label %150, label %237

150:                                              ; preds = %103
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %20, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !11
  %151 = getelementptr inbounds %union.Vec2, ptr %29, i32 0, i32 0
  %152 = load <2 x float>, ptr %151, align 4
  %153 = getelementptr inbounds %union.Vec2, ptr %30, i32 0, i32 0
  %154 = load <2 x float>, ptr %153, align 4
  %155 = call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %152, <2 x float> %154)
  %156 = fcmp ogt float %155, 0.000000e+00
  br i1 %156, label %157, label %189

157:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #6
  %158 = load ptr, ptr %5, align 8, !tbaa !5
  %159 = getelementptr inbounds %union.Vec2, ptr %158, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %159, i64 8, i1 false), !tbaa.struct !11
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %union.Vec2, ptr %160, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %161, i64 8, i1 false), !tbaa.struct !11
  %162 = getelementptr inbounds %union.Vec2, ptr %32, i32 0, i32 0
  %163 = load <2 x float>, ptr %162, align 4
  %164 = getelementptr inbounds %union.Vec2, ptr %33, i32 0, i32 0
  %165 = load <2 x float>, ptr %164, align 4
  %166 = call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %163, <2 x float> %165)
  store float %166, ptr %31, align 4, !tbaa !13
  %167 = getelementptr inbounds %struct.anon.1, ptr %20, i32 0, i32 1
  %168 = load float, ptr %167, align 4, !tbaa !12
  %169 = fneg float %168
  %170 = load float, ptr %31, align 4, !tbaa !13
  %171 = fmul float %169, %170
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.anon.1, ptr %172, i32 0, i32 0
  store float %171, ptr %173, align 4, !tbaa !12
  %174 = getelementptr inbounds %struct.anon.1, ptr %20, i32 0, i32 0
  %175 = load float, ptr %174, align 4, !tbaa !12
  %176 = load float, ptr %31, align 4, !tbaa !13
  %177 = fmul float %175, %176
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.anon.1, ptr %178, i32 0, i32 1
  store float %177, ptr %179, align 4, !tbaa !12
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %union.Vec2, ptr %180, i64 0
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %union.Vec2, ptr %182, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %183, ptr align 4 %181, i64 8, i1 false), !tbaa.struct !11
  %184 = load ptr, ptr %5, align 8, !tbaa !5
  %185 = getelementptr inbounds %union.Vec2, ptr %184, i64 2
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = getelementptr inbounds %union.Vec2, ptr %186, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %187, ptr align 4 %185, i64 8, i1 false), !tbaa.struct !11
  %188 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 2, ptr %188, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #6
  br label %236

189:                                              ; preds = %150
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !11
  %190 = getelementptr inbounds %union.Vec2, ptr %34, i32 0, i32 0
  %191 = load <2 x float>, ptr %190, align 4
  %192 = getelementptr inbounds %union.Vec2, ptr %35, i32 0, i32 0
  %193 = load <2 x float>, ptr %192, align 4
  %194 = call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %191, <2 x float> %193)
  %195 = fcmp ogt float %194, 0.000000e+00
  br i1 %195, label %196, label %224

196:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #6
  %197 = load ptr, ptr %5, align 8, !tbaa !5
  %198 = getelementptr inbounds %union.Vec2, ptr %197, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 4 %198, i64 8, i1 false), !tbaa.struct !11
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = getelementptr inbounds %union.Vec2, ptr %199, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 4 %200, i64 8, i1 false), !tbaa.struct !11
  %201 = getelementptr inbounds %union.Vec2, ptr %37, i32 0, i32 0
  %202 = load <2 x float>, ptr %201, align 4
  %203 = getelementptr inbounds %union.Vec2, ptr %38, i32 0, i32 0
  %204 = load <2 x float>, ptr %203, align 4
  %205 = call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %202, <2 x float> %204)
  store float %205, ptr %36, align 4, !tbaa !13
  %206 = getelementptr inbounds %struct.anon.1, ptr %17, i32 0, i32 1
  %207 = load float, ptr %206, align 4, !tbaa !12
  %208 = fneg float %207
  %209 = load float, ptr %36, align 4, !tbaa !13
  %210 = fmul float %208, %209
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.anon.1, ptr %211, i32 0, i32 0
  store float %210, ptr %212, align 4, !tbaa !12
  %213 = getelementptr inbounds %struct.anon.1, ptr %17, i32 0, i32 0
  %214 = load float, ptr %213, align 4, !tbaa !12
  %215 = load float, ptr %36, align 4, !tbaa !13
  %216 = fmul float %214, %215
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.anon.1, ptr %217, i32 0, i32 1
  store float %216, ptr %218, align 4, !tbaa !12
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = getelementptr inbounds %union.Vec2, ptr %219, i64 2
  %221 = load ptr, ptr %5, align 8, !tbaa !5
  %222 = getelementptr inbounds %union.Vec2, ptr %221, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %222, ptr align 4 %220, i64 8, i1 false), !tbaa.struct !11
  %223 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 2, ptr %223, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #6
  br label %235

224:                                              ; preds = %189
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #6
  %225 = load ptr, ptr %5, align 8, !tbaa !5
  %226 = getelementptr inbounds %union.Vec2, ptr %225, i64 2
  %227 = call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %226)
  %228 = getelementptr inbounds %union.Vec2, ptr %39, i32 0, i32 0
  store <2 x float> %227, ptr %228, align 4
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %229, ptr align 4 %39, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  %230 = load ptr, ptr %5, align 8, !tbaa !5
  %231 = getelementptr inbounds %union.Vec2, ptr %230, i64 2
  %232 = load ptr, ptr %5, align 8, !tbaa !5
  %233 = getelementptr inbounds %union.Vec2, ptr %232, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %233, ptr align 4 %231, i64 8, i1 false), !tbaa.struct !11
  %234 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %234, align 4, !tbaa !9
  br label %235

235:                                              ; preds = %224, %196
  br label %236

236:                                              ; preds = %235, %157
  br label %304

237:                                              ; preds = %103
  %238 = getelementptr inbounds %struct.anon.1, ptr %17, i32 0, i32 1
  %239 = load float, ptr %238, align 4, !tbaa !12
  %240 = load float, ptr %24, align 4, !tbaa !13
  %241 = fmul float %239, %240
  %242 = getelementptr inbounds %struct.anon.1, ptr %17, i32 0, i32 0
  %243 = load float, ptr %242, align 4, !tbaa !12
  %244 = fneg float %243
  %245 = load float, ptr %24, align 4, !tbaa !13
  %246 = fmul float %244, %245
  %247 = call <2 x float> @_Z4vec2ff(float noundef %241, float noundef %246)
  %248 = getelementptr inbounds %union.Vec2, ptr %40, i32 0, i32 0
  store <2 x float> %247, ptr %248, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %41, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !11
  %249 = getelementptr inbounds %union.Vec2, ptr %40, i32 0, i32 0
  %250 = load <2 x float>, ptr %249, align 4
  %251 = getelementptr inbounds %union.Vec2, ptr %41, i32 0, i32 0
  %252 = load <2 x float>, ptr %251, align 4
  %253 = call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %250, <2 x float> %252)
  %254 = fcmp ogt float %253, 0.000000e+00
  br i1 %254, label %255, label %302

255:                                              ; preds = %237
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %42, ptr align 4 %17, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 4 %23, i64 8, i1 false), !tbaa.struct !11
  %256 = getelementptr inbounds %union.Vec2, ptr %42, i32 0, i32 0
  %257 = load <2 x float>, ptr %256, align 4
  %258 = getelementptr inbounds %union.Vec2, ptr %43, i32 0, i32 0
  %259 = load <2 x float>, ptr %258, align 4
  %260 = call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %257, <2 x float> %259)
  %261 = fcmp ogt float %260, 0.000000e+00
  br i1 %261, label %262, label %290

262:                                              ; preds = %255
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #6
  %263 = load ptr, ptr %5, align 8, !tbaa !5
  %264 = getelementptr inbounds %union.Vec2, ptr %263, i64 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %45, ptr align 4 %264, i64 8, i1 false), !tbaa.struct !11
  %265 = load ptr, ptr %5, align 8, !tbaa !5
  %266 = getelementptr inbounds %union.Vec2, ptr %265, i64 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %46, ptr align 4 %266, i64 8, i1 false), !tbaa.struct !11
  %267 = getelementptr inbounds %union.Vec2, ptr %45, i32 0, i32 0
  %268 = load <2 x float>, ptr %267, align 4
  %269 = getelementptr inbounds %union.Vec2, ptr %46, i32 0, i32 0
  %270 = load <2 x float>, ptr %269, align 4
  %271 = call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %268, <2 x float> %270)
  store float %271, ptr %44, align 4, !tbaa !13
  %272 = getelementptr inbounds %struct.anon.1, ptr %17, i32 0, i32 1
  %273 = load float, ptr %272, align 4, !tbaa !12
  %274 = fneg float %273
  %275 = load float, ptr %44, align 4, !tbaa !13
  %276 = fmul float %274, %275
  %277 = load ptr, ptr %6, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.anon.1, ptr %277, i32 0, i32 0
  store float %276, ptr %278, align 4, !tbaa !12
  %279 = getelementptr inbounds %struct.anon.1, ptr %17, i32 0, i32 0
  %280 = load float, ptr %279, align 4, !tbaa !12
  %281 = load float, ptr %44, align 4, !tbaa !13
  %282 = fmul float %280, %281
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.anon.1, ptr %283, i32 0, i32 1
  store float %282, ptr %284, align 4, !tbaa !12
  %285 = load ptr, ptr %5, align 8, !tbaa !5
  %286 = getelementptr inbounds %union.Vec2, ptr %285, i64 2
  %287 = load ptr, ptr %5, align 8, !tbaa !5
  %288 = getelementptr inbounds %union.Vec2, ptr %287, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %288, ptr align 4 %286, i64 8, i1 false), !tbaa.struct !11
  %289 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 2, ptr %289, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #6
  br label %301

290:                                              ; preds = %255
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #6
  %291 = load ptr, ptr %5, align 8, !tbaa !5
  %292 = getelementptr inbounds %union.Vec2, ptr %291, i64 2
  %293 = call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %292)
  %294 = getelementptr inbounds %union.Vec2, ptr %47, i32 0, i32 0
  store <2 x float> %293, ptr %294, align 4
  %295 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %295, ptr align 4 %47, i64 8, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #6
  %296 = load ptr, ptr %5, align 8, !tbaa !5
  %297 = getelementptr inbounds %union.Vec2, ptr %296, i64 2
  %298 = load ptr, ptr %5, align 8, !tbaa !5
  %299 = getelementptr inbounds %union.Vec2, ptr %298, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %299, ptr align 4 %297, i64 8, i1 false), !tbaa.struct !11
  %300 = load ptr, ptr %7, align 8, !tbaa !5
  store i32 1, ptr %300, align 4, !tbaa !9
  br label %301

301:                                              ; preds = %290, %262
  br label %303

302:                                              ; preds = %237
  store i1 true, ptr %4, align 1
  store i32 1, ptr %48, align 4
  br label %305

303:                                              ; preds = %301
  br label %304

304:                                              ; preds = %303, %236
  store i32 0, ptr %48, align 4
  br label %305

305:                                              ; preds = %304, %302
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  %306 = load i32, ptr %48, align 4
  switch i32 %306, label %311 [
    i32 0, label %307
    i32 1, label %309
  ]

307:                                              ; preds = %305
  br label %308

308:                                              ; preds = %307, %102, %3
  store i1 false, ptr %4, align 1
  br label %309

309:                                              ; preds = %308, %305
  %310 = load i1, ptr %4, align 1
  ret i1 %310

311:                                              ; preds = %305
  unreachable
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 nounwind uwtable "min-legal-vector-width"="64" "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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{i64 0, i64 8, !12}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !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: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_Z4vec2ff(float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z8vec2_dot4Vec2S_(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z16vec2_determinant4Vec2S_(<2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local <2 x float> @_Zmi4Vec2S_(<2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z12next_simplexP4Vec2S0_Pj(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef %2) local_unnamed_addr #3 {
  %4 = load i32, ptr %2, align 4, !tbaa !5
  switch i32 %4, label %.thread [
    i32 2, label %5
    i32 3, label %19
  ]

5:                                                ; preds = %3
  %.sroa.065.0.copyload = load <2 x float>, ptr %0, align 4, !tbaa !9
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.064.0.copyload = load <2 x float>, ptr %6, align 4, !tbaa !9
  %7 = tail call <2 x float> @_Zmi4Vec2S_(<2 x float> %.sroa.065.0.copyload, <2 x float> %.sroa.064.0.copyload)
  %8 = tail call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %6)
  %9 = tail call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %8, <2 x float> %7)
  %10 = fcmp ogt float %9, 0.000000e+00
  br i1 %10, label %11, label %17

11:                                               ; preds = %5
  %.sroa.058.0.copyload = load <2 x float>, ptr %6, align 4, !tbaa !9
  %.sroa.057.0.copyload = load <2 x float>, ptr %0, align 4, !tbaa !9
  %12 = tail call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %.sroa.058.0.copyload, <2 x float> %.sroa.057.0.copyload)
  %.sroa.066.4.vec.extract = extractelement <2 x float> %7, i64 1
  %13 = fneg float %.sroa.066.4.vec.extract
  %14 = fmul float %12, %13
  store float %14, ptr %1, align 4, !tbaa !9
  %.sroa.066.0.vec.extract = extractelement <2 x float> %7, i64 0
  %15 = fmul float %.sroa.066.0.vec.extract, %12
  %16 = getelementptr inbounds i8, ptr %1, i64 4
  store float %15, ptr %16, align 4, !tbaa !9
  br label %.thread

17:                                               ; preds = %5
  store <2 x float> %8, ptr %1, align 4, !tbaa !9
  %18 = load i64, ptr %6, align 4, !tbaa !9
  store i64 %18, ptr %0, align 4, !tbaa !9
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %.thread

19:                                               ; preds = %3
  %20 = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.044.0.copyload = load <2 x float>, ptr %20, align 4, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.043.0.copyload = load <2 x float>, ptr %21, align 4, !tbaa !9
  %22 = tail call <2 x float> @_Zmi4Vec2S_(<2 x float> %.sroa.044.0.copyload, <2 x float> %.sroa.043.0.copyload)
  %.sroa.035.0.copyload = load <2 x float>, ptr %0, align 4, !tbaa !9
  %.sroa.034.0.copyload = load <2 x float>, ptr %21, align 4, !tbaa !9
  %23 = tail call <2 x float> @_Zmi4Vec2S_(<2 x float> %.sroa.035.0.copyload, <2 x float> %.sroa.034.0.copyload)
  %24 = tail call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %21)
  %25 = tail call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %22, <2 x float> %23)
  %.sroa.036.4.vec.extract = extractelement <2 x float> %23, i64 1
  %26 = fneg float %.sroa.036.4.vec.extract
  %27 = fmul float %25, %26
  %.sroa.036.0.vec.extract = extractelement <2 x float> %23, i64 0
  %28 = fmul float %.sroa.036.0.vec.extract, %25
  %29 = tail call <2 x float> @_Z4vec2ff(float noundef %27, float noundef %28)
  %30 = tail call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %29, <2 x float> %24)
  %31 = fcmp ogt float %30, 0.000000e+00
  br i1 %31, label %32, label %55

32:                                               ; preds = %19
  %33 = tail call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %23, <2 x float> %24)
  %34 = fcmp ogt float %33, 0.000000e+00
  br i1 %34, label %35, label %42

35:                                               ; preds = %32
  %.sroa.016.0.copyload = load <2 x float>, ptr %21, align 4, !tbaa !9
  %.sroa.015.0.copyload = load <2 x float>, ptr %0, align 4, !tbaa !9
  %36 = tail call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %.sroa.016.0.copyload, <2 x float> %.sroa.015.0.copyload)
  %37 = fmul float %36, %26
  store float %37, ptr %1, align 4, !tbaa !9
  %38 = fmul float %.sroa.036.0.vec.extract, %36
  %39 = getelementptr inbounds i8, ptr %1, i64 4
  store float %38, ptr %39, align 4, !tbaa !9
  %40 = load i64, ptr %0, align 4, !tbaa !9
  store i64 %40, ptr %20, align 4, !tbaa !9
  %41 = load i64, ptr %21, align 4, !tbaa !9
  store i64 %41, ptr %0, align 4, !tbaa !9
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %.thread

42:                                               ; preds = %32
  %43 = tail call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %22, <2 x float> %24)
  %44 = fcmp ogt float %43, 0.000000e+00
  br i1 %44, label %45, label %52

45:                                               ; preds = %42
  %.sroa.010.0.copyload = load <2 x float>, ptr %21, align 4, !tbaa !9
  %.sroa.09.0.copyload = load <2 x float>, ptr %20, align 4, !tbaa !9
  %46 = tail call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %.sroa.010.0.copyload, <2 x float> %.sroa.09.0.copyload)
  %.sroa.045.4.vec.extract = extractelement <2 x float> %22, i64 1
  %47 = fneg float %.sroa.045.4.vec.extract
  %48 = fmul float %46, %47
  store float %48, ptr %1, align 4, !tbaa !9
  %.sroa.045.0.vec.extract = extractelement <2 x float> %22, i64 0
  %49 = fmul float %.sroa.045.0.vec.extract, %46
  %50 = getelementptr inbounds i8, ptr %1, i64 4
  store float %49, ptr %50, align 4, !tbaa !9
  %51 = load i64, ptr %21, align 4, !tbaa !9
  store i64 %51, ptr %0, align 4, !tbaa !9
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %.thread

52:                                               ; preds = %42
  %53 = tail call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %21)
  store <2 x float> %53, ptr %1, align 4, !tbaa !9
  %54 = load i64, ptr %21, align 4, !tbaa !9
  store i64 %54, ptr %0, align 4, !tbaa !9
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %.thread

55:                                               ; preds = %19
  %.sroa.045.4.vec.extract54 = extractelement <2 x float> %22, i64 1
  %56 = fmul float %.sroa.045.4.vec.extract54, %25
  %.sroa.045.0.vec.extract50 = extractelement <2 x float> %22, i64 0
  %57 = fneg float %.sroa.045.0.vec.extract50
  %58 = fmul float %25, %57
  %59 = tail call <2 x float> @_Z4vec2ff(float noundef %56, float noundef %58)
  %60 = tail call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %59, <2 x float> %24)
  %61 = fcmp ogt float %60, 0.000000e+00
  br i1 %61, label %62, label %.thread

62:                                               ; preds = %55
  %63 = tail call noundef float @_Z8vec2_dot4Vec2S_(<2 x float> %22, <2 x float> %24)
  %64 = fcmp ogt float %63, 0.000000e+00
  br i1 %64, label %65, label %72

65:                                               ; preds = %62
  %.sroa.02.0.copyload = load <2 x float>, ptr %21, align 4, !tbaa !9
  %.sroa.01.0.copyload = load <2 x float>, ptr %20, align 4, !tbaa !9
  %66 = tail call noundef float @_Z16vec2_determinant4Vec2S_(<2 x float> %.sroa.02.0.copyload, <2 x float> %.sroa.01.0.copyload)
  %67 = fneg float %.sroa.045.4.vec.extract54
  %68 = fmul float %66, %67
  store float %68, ptr %1, align 4, !tbaa !9
  %69 = fmul float %.sroa.045.0.vec.extract50, %66
  %70 = getelementptr inbounds i8, ptr %1, i64 4
  store float %69, ptr %70, align 4, !tbaa !9
  %71 = load i64, ptr %21, align 4, !tbaa !9
  store i64 %71, ptr %0, align 4, !tbaa !9
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %.thread

72:                                               ; preds = %62
  %73 = tail call <2 x float> @_ZngRK4Vec2(ptr noundef nonnull align 4 dereferenceable(8) %21)
  store <2 x float> %73, ptr %1, align 4, !tbaa !9
  %74 = load i64, ptr %21, align 4, !tbaa !9
  store i64 %74, ptr %0, align 4, !tbaa !9
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %.thread

.thread:                                          ; preds = %45, %52, %35, %65, %72, %3, %17, %11, %55
  %.1 = phi i1 [ true, %55 ], [ false, %11 ], [ false, %17 ], [ false, %3 ], [ false, %72 ], [ false, %65 ], [ false, %35 ], [ false, %52 ], [ false, %45 ]
  ret i1 %.1
}

attributes #0 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 nounwind uwtable "min-legal-vector-width"="64" "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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="64" "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 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}


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