; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseWarpAffine.ll (ZN4Simd4Base17WarpAffineNearest8SetRangeEPKNS_5PointIfEE)

; 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.Simd::WarpAffine" = type { %"struct.Simd::Deletable", %"struct.Simd::WarpAffParam", i8, i64, i64, %"struct.Simd::Array" }
%"struct.Simd::Deletable" = type { ptr }
%"struct.Simd::WarpAffParam" = type { i32, [6 x float], [6 x float], [4 x i8], i64, i64, i64, i64, i64, i64, i64, i64 }
%"struct.Simd::Array" = type { ptr, i64 }
%"class.Simd::Base::WarpAffineNearest" = type { %"class.Simd::WarpAffine", %"struct.Simd::Array.0", %"struct.Simd::Array.0", ptr }
%"struct.Simd::Array.0" = type { ptr, i64 }
%"struct.Simd::Point" = type { 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 uwtable
define dso_local void @_ZN4Simd4Base17WarpAffineNearest8SetRangeEPKNS_5PointIfEE(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr noundef %1) unnamed_addr #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %26 = getelementptr inbounds %"class.Simd::WarpAffine", ptr %25, i32 0, i32 1
  store ptr %26, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.Simd::WarpAffParam", ptr %27, i32 0, i32 7
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr %6, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !15
  br label %31

31:                                               ; preds = %46, %2
  %32 = load i64, ptr %7, align 8, !tbaa !15
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.Simd::WarpAffParam", ptr %33, i32 0, i32 8
  %35 = load i64, ptr %34, align 8, !tbaa !16
  %36 = icmp ult i64 %32, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %49

38:                                               ; preds = %31
  %39 = load i32, ptr %6, align 4, !tbaa !13
  %40 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 1
  %41 = load i64, ptr %7, align 8, !tbaa !15
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %40, i64 noundef %41)
  store i32 %39, ptr %42, align 4, !tbaa !13
  %43 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 2
  %44 = load i64, ptr %7, align 8, !tbaa !15
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %43, i64 noundef %44)
  store i32 0, ptr %45, align 4, !tbaa !13
  br label %46

46:                                               ; preds = %38
  %47 = load i64, ptr %7, align 8, !tbaa !15
  %48 = add i64 %47, 1
  store i64 %48, ptr %7, align 8, !tbaa !15
  br label %31, !llvm.loop !17

49:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %50

50:                                               ; preds = %237, %49
  %51 = load i32, ptr %8, align 4, !tbaa !13
  %52 = icmp slt i32 %51, 4
  br i1 %52, label %54, label %53

53:                                               ; preds = %50
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %240

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load i32, ptr %8, align 4, !tbaa !13
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds %"struct.Simd::Point", ptr %55, i64 %57
  store ptr %58, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load i32, ptr %8, align 4, !tbaa !13
  %61 = add nsw i32 %60, 1
  %62 = and i32 %61, 3
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %"struct.Simd::Point", ptr %59, i64 %63
  store ptr %64, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %65 = load ptr, ptr %10, align 8, !tbaa !5
  %66 = getelementptr inbounds %"struct.Simd::Point", ptr %65, i32 0, i32 1
  %67 = load float, ptr %66, align 4, !tbaa !19
  %68 = load ptr, ptr %11, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.Simd::Point", ptr %68, i32 0, i32 1
  %70 = load float, ptr %69, align 4, !tbaa !19
  %71 = call noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef %67, float noundef %70)
  %72 = call noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef %71, float noundef 0.000000e+00)
  store float %72, ptr %12, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %"struct.Simd::Point", ptr %73, i32 0, i32 1
  %75 = load float, ptr %74, align 4, !tbaa !19
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds %"struct.Simd::Point", ptr %76, i32 0, i32 1
  %78 = load float, ptr %77, align 4, !tbaa !19
  %79 = call noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef %75, float noundef %78)
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %"struct.Simd::WarpAffParam", ptr %80, i32 0, i32 8
  %82 = load i64, ptr %81, align 8, !tbaa !16
  %83 = uitofp i64 %82 to float
  %84 = call noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef %79, float noundef %83)
  store float %84, ptr %13, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %85 = load float, ptr %12, align 4, !tbaa !22
  %86 = call noundef i32 @_ZN4Simd5RoundEf(float noundef %85)
  store i32 %86, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %87 = load float, ptr %13, align 4, !tbaa !22
  %88 = call noundef i32 @_ZN4Simd5RoundEf(float noundef %87)
  store i32 %88, ptr %15, align 4, !tbaa !13
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %"struct.Simd::Point", ptr %89, i32 0, i32 1
  %91 = load float, ptr %90, align 4, !tbaa !19
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds %"struct.Simd::Point", ptr %92, i32 0, i32 1
  %94 = load float, ptr %93, align 4, !tbaa !19
  %95 = fcmp oeq float %91, %94
  br i1 %95, label %96, label %97

96:                                               ; preds = %54
  store i32 7, ptr %9, align 4
  br label %234

97:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds %"struct.Simd::Point", ptr %98, i32 0, i32 0
  %100 = load float, ptr %99, align 4, !tbaa !23
  %101 = load ptr, ptr %10, align 8, !tbaa !5
  %102 = getelementptr inbounds %"struct.Simd::Point", ptr %101, i32 0, i32 0
  %103 = load float, ptr %102, align 4, !tbaa !23
  %104 = fsub float %100, %103
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.Simd::Point", ptr %105, i32 0, i32 1
  %107 = load float, ptr %106, align 4, !tbaa !19
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.Simd::Point", ptr %108, i32 0, i32 1
  %110 = load float, ptr %109, align 4, !tbaa !19
  %111 = fsub float %107, %110
  %112 = fdiv float %104, %111
  store float %112, ptr %16, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %113 = load ptr, ptr %10, align 8, !tbaa !5
  %114 = getelementptr inbounds %"struct.Simd::Point", ptr %113, i32 0, i32 0
  %115 = load float, ptr %114, align 4, !tbaa !23
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = getelementptr inbounds %"struct.Simd::Point", ptr %116, i32 0, i32 1
  %118 = load float, ptr %117, align 4, !tbaa !19
  %119 = load float, ptr %16, align 4, !tbaa !22
  %120 = fneg float %118
  %121 = call float @llvm.fmuladd.f32(float %120, float %119, float %115)
  store float %121, ptr %17, align 4, !tbaa !22
  %122 = load float, ptr %16, align 4, !tbaa !22
  %123 = call noundef float @_ZSt3absf(float noundef %122)
  %124 = fcmp ole float %123, 1.000000e+00
  br i1 %124, label %125, label %169

125:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %126 = load i32, ptr %14, align 4, !tbaa !13
  store i32 %126, ptr %18, align 4, !tbaa !13
  br label %127

127:                                              ; preds = %165, %125
  %128 = load i32, ptr %18, align 4, !tbaa !13
  %129 = load i32, ptr %15, align 4, !tbaa !13
  %130 = icmp slt i32 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %168

132:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %133 = load i32, ptr %18, align 4, !tbaa !13
  %134 = sitofp i32 %133 to float
  %135 = load float, ptr %16, align 4, !tbaa !22
  %136 = load float, ptr %17, align 4, !tbaa !22
  %137 = call float @llvm.fmuladd.f32(float %134, float %135, float %136)
  %138 = call noundef i32 @_ZN4Simd5RoundEf(float noundef %137)
  store i32 %138, ptr %19, align 4, !tbaa !13
  %139 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 1
  %140 = load i32, ptr %18, align 4, !tbaa !13
  %141 = sext i32 %140 to i64
  %142 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %139, i64 noundef %141)
  %143 = load i32, ptr %142, align 4, !tbaa !13
  %144 = load i32, ptr %19, align 4, !tbaa !13
  %145 = call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %144, i32 noundef 0)
  %146 = call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %143, i32 noundef %145)
  %147 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 1
  %148 = load i32, ptr %18, align 4, !tbaa !13
  %149 = sext i32 %148 to i64
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %147, i64 noundef %149)
  store i32 %146, ptr %150, align 4, !tbaa !13
  %151 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 2
  %152 = load i32, ptr %18, align 4, !tbaa !13
  %153 = sext i32 %152 to i64
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %151, i64 noundef %153)
  %155 = load i32, ptr %154, align 4, !tbaa !13
  %156 = load i32, ptr %19, align 4, !tbaa !13
  %157 = add nsw i32 %156, 1
  %158 = load i32, ptr %6, align 4, !tbaa !13
  %159 = call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %157, i32 noundef %158)
  %160 = call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %155, i32 noundef %159)
  %161 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 2
  %162 = load i32, ptr %18, align 4, !tbaa !13
  %163 = sext i32 %162 to i64
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %161, i64 noundef %163)
  store i32 %160, ptr %164, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %165

165:                                              ; preds = %132
  %166 = load i32, ptr %18, align 4, !tbaa !13
  %167 = add nsw i32 %166, 1
  store i32 %167, ptr %18, align 4, !tbaa !13
  br label %127, !llvm.loop !24

168:                                              ; preds = %131
  br label %233

169:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %170 = load i32, ptr %14, align 4, !tbaa !13
  store i32 %170, ptr %20, align 4, !tbaa !13
  br label %171

171:                                              ; preds = %229, %169
  %172 = load i32, ptr %20, align 4, !tbaa !13
  %173 = load i32, ptr %15, align 4, !tbaa !13
  %174 = icmp slt i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %232

176:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %177 = load float, ptr %17, align 4, !tbaa !22
  %178 = load i32, ptr %20, align 4, !tbaa !13
  %179 = sitofp i32 %178 to float
  %180 = fsub float %179, 5.000000e-01
  %181 = load float, ptr %12, align 4, !tbaa !22
  %182 = load float, ptr %13, align 4, !tbaa !22
  %183 = call noundef float @_ZN4Simd13RestrictRangeIfEET_S1_S1_S1_(float noundef %180, float noundef %181, float noundef %182)
  %184 = load float, ptr %16, align 4, !tbaa !22
  %185 = call float @llvm.fmuladd.f32(float %183, float %184, float %177)
  store float %185, ptr %21, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %186 = load float, ptr %17, align 4, !tbaa !22
  %187 = load i32, ptr %20, align 4, !tbaa !13
  %188 = sitofp i32 %187 to float
  %189 = fadd float %188, 5.000000e-01
  %190 = load float, ptr %12, align 4, !tbaa !22
  %191 = load float, ptr %13, align 4, !tbaa !22
  %192 = call noundef float @_ZN4Simd13RestrictRangeIfEET_S1_S1_S1_(float noundef %189, float noundef %190, float noundef %191)
  %193 = load float, ptr %16, align 4, !tbaa !22
  %194 = call float @llvm.fmuladd.f32(float %192, float %193, float %186)
  store float %194, ptr %22, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %195 = load float, ptr %21, align 4, !tbaa !22
  %196 = load float, ptr %22, align 4, !tbaa !22
  %197 = call noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef %195, float noundef %196)
  %198 = call noundef i32 @_ZN4Simd5RoundEf(float noundef %197)
  store i32 %198, ptr %23, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %199 = load float, ptr %21, align 4, !tbaa !22
  %200 = load float, ptr %22, align 4, !tbaa !22
  %201 = call noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef %199, float noundef %200)
  %202 = call noundef i32 @_ZN4Simd5RoundEf(float noundef %201)
  store i32 %202, ptr %24, align 4, !tbaa !13
  %203 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 1
  %204 = load i32, ptr %20, align 4, !tbaa !13
  %205 = sext i32 %204 to i64
  %206 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %203, i64 noundef %205)
  %207 = load i32, ptr %206, align 4, !tbaa !13
  %208 = load i32, ptr %23, align 4, !tbaa !13
  %209 = call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %208, i32 noundef 0)
  %210 = call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %207, i32 noundef %209)
  %211 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 1
  %212 = load i32, ptr %20, align 4, !tbaa !13
  %213 = sext i32 %212 to i64
  %214 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %211, i64 noundef %213)
  store i32 %210, ptr %214, align 4, !tbaa !13
  %215 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 2
  %216 = load i32, ptr %20, align 4, !tbaa !13
  %217 = sext i32 %216 to i64
  %218 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %215, i64 noundef %217)
  %219 = load i32, ptr %218, align 4, !tbaa !13
  %220 = load i32, ptr %24, align 4, !tbaa !13
  %221 = add nsw i32 %220, 1
  %222 = load i32, ptr %6, align 4, !tbaa !13
  %223 = call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %221, i32 noundef %222)
  %224 = call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %219, i32 noundef %223)
  %225 = getelementptr inbounds %"class.Simd::Base::WarpAffineNearest", ptr %25, i32 0, i32 2
  %226 = load i32, ptr %20, align 4, !tbaa !13
  %227 = sext i32 %226 to i64
  %228 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %225, i64 noundef %227)
  store i32 %224, ptr %228, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %229

229:                                              ; preds = %176
  %230 = load i32, ptr %20, align 4, !tbaa !13
  %231 = add nsw i32 %230, 1
  store i32 %231, ptr %20, align 4, !tbaa !13
  br label %171, !llvm.loop !25

232:                                              ; preds = %175
  br label %233

233:                                              ; preds = %232, %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  store i32 0, ptr %9, align 4
  br label %234

234:                                              ; preds = %233, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  %235 = load i32, ptr %9, align 4
  switch i32 %235, label %241 [
    i32 0, label %236
    i32 7, label %237
  ]

236:                                              ; preds = %234
  br label %237

237:                                              ; preds = %236, %234
  %238 = load i32, ptr %8, align 4, !tbaa !13
  %239 = add nsw i32 %238, 1
  store i32 %239, ptr %8, align 4, !tbaa !13
  br label %50, !llvm.loop !26

240:                                              ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void

241:                                              ; preds = %234
  unreachable
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #2 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef, float noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef, float noundef) #2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZN4Simd5RoundEf(float noundef) #3

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef, i32 noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef, i32 noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd13RestrictRangeIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { alwaysinline 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 #3 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !12, i64 80}
!10 = !{!"_ZTSN4Simd12WarpAffParamE", !11, i64 0, !7, i64 4, !7, i64 28, !7, i64 52, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112}
!11 = !{!"_ZTS19SimdWarpAffineFlags", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!10, !12, i64 88}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!20, !21, i64 4}
!20 = !{!"_ZTSN4Simd5PointIfEE", !21, i64 0, !21, i64 4}
!21 = !{!"float", !7, i64 0}
!22 = !{!21, !21, i64 0}
!23 = !{!20, !21, i64 0}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.Simd::Point" = type { float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base17WarpAffineNearest8SetRangeEPKNS_5PointIfEE(ptr noundef nonnull align 8 dereferenceable(208) %0, ptr nocapture noundef readonly %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 88
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = trunc i64 %4 to i32
  %6 = getelementptr inbounds i8, ptr %0, i64 96
  %7 = load i64, ptr %6, align 8, !tbaa !11
  %.not = icmp eq i64 %7, 0
  br i1 %.not, label %.preheader76, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 168
  %9 = getelementptr inbounds i8, ptr %0, i64 184
  br label %12

.preheader76:                                     ; preds = %12, %2
  %10 = getelementptr inbounds i8, ptr %0, i64 168
  %11 = getelementptr inbounds i8, ptr %0, i64 184
  br label %19

12:                                               ; preds = %.lr.ph, %12
  %.077 = phi i64 [ 0, %.lr.ph ], [ %15, %12 ]
  %13 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %8, i64 noundef %.077)
  store i32 %5, ptr %13, align 4, !tbaa !12
  %14 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %.077)
  store i32 0, ptr %14, align 4, !tbaa !12
  %15 = add nuw i64 %.077, 1
  %16 = load i64, ptr %6, align 8, !tbaa !11
  %17 = icmp ult i64 %15, %16
  br i1 %17, label %12, label %.preheader76, !llvm.loop !14

18:                                               ; preds = %.loopexit
  ret void

19:                                               ; preds = %.preheader76, %.loopexit
  %indvars.iv90 = phi i64 [ 0, %.preheader76 ], [ %indvars.iv.next91, %.loopexit ]
  %20 = getelementptr inbounds %"struct.Simd::Point", ptr %1, i64 %indvars.iv90
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %21 = and i64 %indvars.iv.next91, 3
  %22 = getelementptr inbounds %"struct.Simd::Point", ptr %1, i64 %21
  %23 = getelementptr inbounds i8, ptr %20, i64 4
  %24 = load float, ptr %23, align 4, !tbaa !16
  %25 = getelementptr inbounds i8, ptr %22, i64 4
  %26 = load float, ptr %25, align 4, !tbaa !16
  %27 = tail call noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef %24, float noundef %26)
  %28 = tail call noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef %27, float noundef 0.000000e+00)
  %29 = load float, ptr %23, align 4, !tbaa !16
  %30 = load float, ptr %25, align 4, !tbaa !16
  %31 = tail call noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef %29, float noundef %30)
  %32 = load i64, ptr %6, align 8, !tbaa !11
  %33 = uitofp i64 %32 to float
  %34 = tail call noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef %31, float noundef %33)
  %35 = tail call noundef i32 @_ZN4Simd5RoundEf(float noundef %28)
  %36 = tail call noundef i32 @_ZN4Simd5RoundEf(float noundef %34)
  %37 = load float, ptr %25, align 4, !tbaa !16
  %38 = load float, ptr %23, align 4, !tbaa !16
  %39 = fcmp oeq float %37, %38
  br i1 %39, label %.loopexit, label %40

40:                                               ; preds = %19
  %41 = load float, ptr %22, align 4, !tbaa !19
  %42 = load float, ptr %20, align 4, !tbaa !19
  %43 = fsub float %41, %42
  %44 = fsub float %37, %38
  %45 = fdiv float %43, %44
  %46 = fneg float %38
  %47 = tail call float @llvm.fmuladd.f32(float %46, float %45, float %42)
  %48 = tail call noundef float @_ZSt3absf(float noundef %45)
  %49 = fcmp ugt float %48, 1.000000e+00
  %50 = icmp slt i32 %35, %36
  br i1 %49, label %.preheader, label %.preheader74

.preheader74:                                     ; preds = %40
  br i1 %50, label %.lr.ph79.preheader, label %.loopexit

.lr.ph79.preheader:                               ; preds = %.preheader74
  %51 = sext i32 %35 to i64
  br label %.lr.ph79

.preheader:                                       ; preds = %40
  br i1 %50, label %.lr.ph81.preheader, label %.loopexit

.lr.ph81.preheader:                               ; preds = %.preheader
  %52 = sext i32 %35 to i64
  br label %.lr.ph81

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %.lr.ph79
  %indvars.iv = phi i64 [ %51, %.lr.ph79.preheader ], [ %indvars.iv.next, %.lr.ph79 ]
  %53 = trunc nsw i64 %indvars.iv to i32
  %54 = sitofp i32 %53 to float
  %55 = tail call float @llvm.fmuladd.f32(float %54, float %45, float %47)
  %56 = tail call noundef i32 @_ZN4Simd5RoundEf(float noundef %55)
  %57 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %indvars.iv)
  %58 = load i32, ptr %57, align 4, !tbaa !12
  %59 = tail call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %56, i32 noundef 0)
  %60 = tail call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %58, i32 noundef %59)
  %61 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %indvars.iv)
  store i32 %60, ptr %61, align 4, !tbaa !12
  %62 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %indvars.iv)
  %63 = load i32, ptr %62, align 4, !tbaa !12
  %64 = add nsw i32 %56, 1
  %65 = tail call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %64, i32 noundef %5)
  %66 = tail call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %63, i32 noundef %65)
  %67 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %indvars.iv)
  store i32 %66, ptr %67, align 4, !tbaa !12
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %36, %lftr.wideiv
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph79, !llvm.loop !20

.lr.ph81:                                         ; preds = %.lr.ph81.preheader, %.lr.ph81
  %indvars.iv85 = phi i64 [ %52, %.lr.ph81.preheader ], [ %indvars.iv.next86, %.lr.ph81 ]
  %68 = trunc nsw i64 %indvars.iv85 to i32
  %69 = sitofp i32 %68 to float
  %70 = fadd float %69, -5.000000e-01
  %71 = tail call noundef float @_ZN4Simd13RestrictRangeIfEET_S1_S1_S1_(float noundef %70, float noundef %28, float noundef %34)
  %72 = tail call float @llvm.fmuladd.f32(float %71, float %45, float %47)
  %73 = fadd float %69, 5.000000e-01
  %74 = tail call noundef float @_ZN4Simd13RestrictRangeIfEET_S1_S1_S1_(float noundef %73, float noundef %28, float noundef %34)
  %75 = tail call float @llvm.fmuladd.f32(float %74, float %45, float %47)
  %76 = tail call noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef %72, float noundef %75)
  %77 = tail call noundef i32 @_ZN4Simd5RoundEf(float noundef %76)
  %78 = tail call noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef %72, float noundef %75)
  %79 = tail call noundef i32 @_ZN4Simd5RoundEf(float noundef %78)
  %80 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %indvars.iv85)
  %81 = load i32, ptr %80, align 4, !tbaa !12
  %82 = tail call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %77, i32 noundef 0)
  %83 = tail call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %81, i32 noundef %82)
  %84 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %indvars.iv85)
  store i32 %83, ptr %84, align 4, !tbaa !12
  %85 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %indvars.iv85)
  %86 = load i32, ptr %85, align 4, !tbaa !12
  %87 = add nsw i32 %79, 1
  %88 = tail call noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef %87, i32 noundef %5)
  %89 = tail call noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef %86, i32 noundef %88)
  %90 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %indvars.iv85)
  store i32 %89, ptr %90, align 4, !tbaa !12
  %indvars.iv.next86 = add nsw i64 %indvars.iv85, 1
  %lftr.wideiv88 = trunc i64 %indvars.iv.next86 to i32
  %exitcond89.not = icmp eq i32 %36, %lftr.wideiv88
  br i1 %exitcond89.not, label %.loopexit, label %.lr.ph81, !llvm.loop !21

.loopexit:                                        ; preds = %.lr.ph79, %.lr.ph81, %.preheader74, %.preheader, %19
  %exitcond93.not = icmp eq i64 %indvars.iv.next91, 4
  br i1 %exitcond93.not, label %18, label %19, !llvm.loop !22
}

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4Simd5ArrayIiEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd3MaxIfEET_S1_S1_(float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd3MinIfEET_S1_S1_(float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef i32 @_ZN4Simd5RoundEf(float noundef) local_unnamed_addr #2

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

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Simd3MinIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4Simd3MaxIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4Simd13RestrictRangeIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { alwaysinline 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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !10, i64 80}
!6 = !{!"_ZTSN4Simd12WarpAffParamE", !7, i64 0, !8, i64 4, !8, i64 28, !8, i64 52, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112}
!7 = !{!"_ZTS19SimdWarpAffineFlags", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !10, i64 88}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !18, i64 4}
!17 = !{!"_ZTSN4Simd5PointIfEE", !18, i64 0, !18, i64 4}
!18 = !{!"float", !8, i64 0}
!19 = !{!17, !18, i64 0}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}


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