; LLVM IR from Lodour/ACM-CheatSheet :: src/6_计算几何/3_多边形/5_小结.ll (Z14inside_polygon5pointS_iPS_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.point = type { double, double }

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z14inside_polygon5pointiPS_i(double, double, i32 noundef, ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z14inside_polygon5pointS_iPS_(double %0, double %1, double %2, double %3, i32 noundef %4, ptr noundef %5) #3 {
  %7 = alloca i32, align 4
  %8 = alloca %struct.point, align 8
  %9 = alloca %struct.point, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca [1000 x %struct.point], align 16
  %13 = alloca %struct.point, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.point, align 8
  %18 = alloca %struct.point, align 8
  %19 = alloca i32, align 4
  %20 = alloca %struct.point, align 8
  %21 = alloca %struct.point, align 8
  %22 = alloca %struct.point, align 8
  %23 = alloca %struct.point, align 8
  %24 = alloca %struct.point, align 8
  %25 = alloca %struct.point, align 8
  %26 = alloca %struct.point, align 8
  %27 = alloca %struct.point, align 8
  %28 = alloca %struct.point, align 8
  %29 = alloca %struct.point, align 8
  %30 = alloca %struct.point, align 8
  %31 = alloca %struct.point, align 8
  %32 = alloca %struct.point, align 8
  %33 = alloca %struct.point, align 8
  %34 = alloca %struct.point, align 8
  %35 = alloca %struct.point, align 8
  %36 = alloca %struct.point, align 8
  %37 = alloca %struct.point, align 8
  %38 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  store double %0, ptr %38, align 8
  %39 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  store double %1, ptr %39, align 8
  %40 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  store double %2, ptr %40, align 8
  %41 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  store double %3, ptr %41, align 8
  store i32 %4, ptr %10, align 4, !tbaa !5
  store ptr %5, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16000, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !11
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = load ptr, ptr %11, align 8, !tbaa !9
  %44 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 0
  %45 = load double, ptr %44, align 8
  %46 = getelementptr inbounds { double, double }, ptr %17, i32 0, i32 1
  %47 = load double, ptr %46, align 8
  %48 = call noundef i32 @_Z14inside_polygon5pointiPS_i(double %45, double %47, i32 noundef %42, ptr noundef %43, i32 noundef 1)
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %59

50:                                               ; preds = %6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !11
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !9
  %53 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 0
  %54 = load double, ptr %53, align 8
  %55 = getelementptr inbounds { double, double }, ptr %18, i32 0, i32 1
  %56 = load double, ptr %55, align 8
  %57 = call noundef i32 @_Z14inside_polygon5pointiPS_i(double %54, double %56, i32 noundef %51, ptr noundef %52, i32 noundef 1)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %50, %6
  store i32 0, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %280

60:                                               ; preds = %50
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %220, %60
  %62 = load i32, ptr %14, align 4, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %223

65:                                               ; preds = %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !11
  %66 = load ptr, ptr %11, align 8, !tbaa !9
  %67 = load i32, ptr %14, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds %struct.point, ptr %66, i64 %68
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %69, i64 16, i1 false), !tbaa.struct !11
  %70 = load ptr, ptr %11, align 8, !tbaa !9
  %71 = load i32, ptr %14, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = srem i32 %72, %73
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds %struct.point, ptr %70, i64 %75
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %23, ptr align 8 %76, i64 16, i1 false), !tbaa.struct !11
  %77 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 0
  %78 = load double, ptr %77, align 8
  %79 = getelementptr inbounds { double, double }, ptr %20, i32 0, i32 1
  %80 = load double, ptr %79, align 8
  %81 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 0
  %82 = load double, ptr %81, align 8
  %83 = getelementptr inbounds { double, double }, ptr %21, i32 0, i32 1
  %84 = load double, ptr %83, align 8
  %85 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %86 = load double, ptr %85, align 8
  %87 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %88 = load double, ptr %87, align 8
  %89 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 0
  %90 = load double, ptr %89, align 8
  %91 = getelementptr inbounds { double, double }, ptr %23, i32 0, i32 1
  %92 = load double, ptr %91, align 8
  %93 = call noundef i32 @_Z13opposite_side5pointS_S_S_(double %78, double %80, double %82, double %84, double %86, double %88, double %90, double %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %126

95:                                               ; preds = %65
  %96 = load ptr, ptr %11, align 8, !tbaa !9
  %97 = load i32, ptr %14, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %struct.point, ptr %96, i64 %98
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %24, ptr align 8 %99, i64 16, i1 false), !tbaa.struct !11
  %100 = load ptr, ptr %11, align 8, !tbaa !9
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = srem i32 %102, %103
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %struct.point, ptr %100, i64 %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %25, ptr align 8 %106, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %26, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %27, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !11
  %107 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 0
  %108 = load double, ptr %107, align 8
  %109 = getelementptr inbounds { double, double }, ptr %24, i32 0, i32 1
  %110 = load double, ptr %109, align 8
  %111 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %112 = load double, ptr %111, align 8
  %113 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %114 = load double, ptr %113, align 8
  %115 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 0
  %116 = load double, ptr %115, align 8
  %117 = getelementptr inbounds { double, double }, ptr %26, i32 0, i32 1
  %118 = load double, ptr %117, align 8
  %119 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 0
  %120 = load double, ptr %119, align 8
  %121 = getelementptr inbounds { double, double }, ptr %27, i32 0, i32 1
  %122 = load double, ptr %121, align 8
  %123 = call noundef i32 @_Z13opposite_side5pointS_S_S_(double %108, double %110, double %112, double %114, double %116, double %118, double %120, double %122)
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %95
  store i32 0, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %280

126:                                              ; preds = %95, %65
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !11
  %127 = load ptr, ptr %11, align 8, !tbaa !9
  %128 = load i32, ptr %14, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds %struct.point, ptr %127, i64 %129
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %130, i64 16, i1 false), !tbaa.struct !11
  %131 = load ptr, ptr %11, align 8, !tbaa !9
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = srem i32 %133, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds %struct.point, ptr %131, i64 %136
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %137, i64 16, i1 false), !tbaa.struct !11
  %138 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 0
  %139 = load double, ptr %138, align 8
  %140 = getelementptr inbounds { double, double }, ptr %28, i32 0, i32 1
  %141 = load double, ptr %140, align 8
  %142 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 0
  %143 = load double, ptr %142, align 8
  %144 = getelementptr inbounds { double, double }, ptr %29, i32 0, i32 1
  %145 = load double, ptr %144, align 8
  %146 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 0
  %147 = load double, ptr %146, align 8
  %148 = getelementptr inbounds { double, double }, ptr %30, i32 0, i32 1
  %149 = load double, ptr %148, align 8
  %150 = call noundef i32 @_Z13dot_online_in5pointS_S_(double %139, double %141, double %143, double %145, double %147, double %149)
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %157

152:                                              ; preds = %126
  %153 = load i32, ptr %16, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %16, align 4, !tbaa !5
  %155 = sext i32 %153 to i64
  %156 = getelementptr inbounds [1000 x %struct.point], ptr %12, i64 0, i64 %155
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %156, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !11
  br label %218

157:                                              ; preds = %126
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %31, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !11
  %158 = load ptr, ptr %11, align 8, !tbaa !9
  %159 = load i32, ptr %14, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds %struct.point, ptr %158, i64 %160
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %32, ptr align 8 %161, i64 16, i1 false), !tbaa.struct !11
  %162 = load ptr, ptr %11, align 8, !tbaa !9
  %163 = load i32, ptr %14, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = srem i32 %164, %165
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds %struct.point, ptr %162, i64 %167
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %168, i64 16, i1 false), !tbaa.struct !11
  %169 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 0
  %170 = load double, ptr %169, align 8
  %171 = getelementptr inbounds { double, double }, ptr %31, i32 0, i32 1
  %172 = load double, ptr %171, align 8
  %173 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 0
  %174 = load double, ptr %173, align 8
  %175 = getelementptr inbounds { double, double }, ptr %32, i32 0, i32 1
  %176 = load double, ptr %175, align 8
  %177 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 0
  %178 = load double, ptr %177, align 8
  %179 = getelementptr inbounds { double, double }, ptr %33, i32 0, i32 1
  %180 = load double, ptr %179, align 8
  %181 = call noundef i32 @_Z13dot_online_in5pointS_S_(double %170, double %172, double %174, double %176, double %178, double %180)
  %182 = icmp ne i32 %181, 0
  br i1 %182, label %183, label %188

183:                                              ; preds = %157
  %184 = load i32, ptr %16, align 4, !tbaa !5
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %16, align 4, !tbaa !5
  %186 = sext i32 %184 to i64
  %187 = getelementptr inbounds [1000 x %struct.point], ptr %12, i64 0, i64 %186
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %187, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !11
  br label %217

188:                                              ; preds = %157
  %189 = load ptr, ptr %11, align 8, !tbaa !9
  %190 = load i32, ptr %14, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds %struct.point, ptr %189, i64 %191
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %34, ptr align 8 %192, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %35, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %36, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !11
  %193 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 0
  %194 = load double, ptr %193, align 8
  %195 = getelementptr inbounds { double, double }, ptr %34, i32 0, i32 1
  %196 = load double, ptr %195, align 8
  %197 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %198 = load double, ptr %197, align 8
  %199 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %200 = load double, ptr %199, align 8
  %201 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %202 = load double, ptr %201, align 8
  %203 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %204 = load double, ptr %203, align 8
  %205 = call noundef i32 @_Z13dot_online_in5pointS_S_(double %194, double %196, double %198, double %200, double %202, double %204)
  %206 = icmp ne i32 %205, 0
  br i1 %206, label %207, label %216

207:                                              ; preds = %188
  %208 = load ptr, ptr %11, align 8, !tbaa !9
  %209 = load i32, ptr %14, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds %struct.point, ptr %208, i64 %210
  %212 = load i32, ptr %16, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %16, align 4, !tbaa !5
  %214 = sext i32 %212 to i64
  %215 = getelementptr inbounds [1000 x %struct.point], ptr %12, i64 0, i64 %214
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %215, ptr align 8 %211, i64 16, i1 false), !tbaa.struct !11
  br label %216

216:                                              ; preds = %207, %188
  br label %217

217:                                              ; preds = %216, %183
  br label %218

218:                                              ; preds = %217, %152
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %14, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %14, align 4, !tbaa !5
  br label %61, !llvm.loop !14

223:                                              ; preds = %61
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %276, %223
  %225 = load i32, ptr %14, align 4, !tbaa !5
  %226 = load i32, ptr %16, align 4, !tbaa !5
  %227 = icmp slt i32 %225, %226
  br i1 %227, label %228, label %279

228:                                              ; preds = %224
  %229 = load i32, ptr %14, align 4, !tbaa !5
  %230 = add nsw i32 %229, 1
  store i32 %230, ptr %15, align 4, !tbaa !5
  br label %231

231:                                              ; preds = %272, %228
  %232 = load i32, ptr %15, align 4, !tbaa !5
  %233 = load i32, ptr %16, align 4, !tbaa !5
  %234 = icmp slt i32 %232, %233
  br i1 %234, label %235, label %275

235:                                              ; preds = %231
  %236 = load i32, ptr %14, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [1000 x %struct.point], ptr %12, i64 0, i64 %237
  %239 = getelementptr inbounds %struct.point, ptr %238, i32 0, i32 0
  %240 = load double, ptr %239, align 16, !tbaa !16
  %241 = load i32, ptr %15, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [1000 x %struct.point], ptr %12, i64 0, i64 %242
  %244 = getelementptr inbounds %struct.point, ptr %243, i32 0, i32 0
  %245 = load double, ptr %244, align 16, !tbaa !16
  %246 = fadd double %240, %245
  %247 = fdiv double %246, 2.000000e+00
  %248 = getelementptr inbounds %struct.point, ptr %13, i32 0, i32 0
  store double %247, ptr %248, align 8, !tbaa !16
  %249 = load i32, ptr %14, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [1000 x %struct.point], ptr %12, i64 0, i64 %250
  %252 = getelementptr inbounds %struct.point, ptr %251, i32 0, i32 1
  %253 = load double, ptr %252, align 8, !tbaa !18
  %254 = load i32, ptr %15, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [1000 x %struct.point], ptr %12, i64 0, i64 %255
  %257 = getelementptr inbounds %struct.point, ptr %256, i32 0, i32 1
  %258 = load double, ptr %257, align 8, !tbaa !18
  %259 = fadd double %253, %258
  %260 = fdiv double %259, 2.000000e+00
  %261 = getelementptr inbounds %struct.point, ptr %13, i32 0, i32 1
  store double %260, ptr %261, align 8, !tbaa !18
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %37, ptr align 8 %13, i64 16, i1 false), !tbaa.struct !11
  %262 = load i32, ptr %10, align 4, !tbaa !5
  %263 = load ptr, ptr %11, align 8, !tbaa !9
  %264 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 0
  %265 = load double, ptr %264, align 8
  %266 = getelementptr inbounds { double, double }, ptr %37, i32 0, i32 1
  %267 = load double, ptr %266, align 8
  %268 = call noundef i32 @_Z14inside_polygon5pointiPS_i(double %265, double %267, i32 noundef %262, ptr noundef %263, i32 noundef 1)
  %269 = icmp ne i32 %268, 0
  br i1 %269, label %271, label %270

270:                                              ; preds = %235
  store i32 0, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %280

271:                                              ; preds = %235
  br label %272

272:                                              ; preds = %271
  %273 = load i32, ptr %15, align 4, !tbaa !5
  %274 = add nsw i32 %273, 1
  store i32 %274, ptr %15, align 4, !tbaa !5
  br label %231, !llvm.loop !19

275:                                              ; preds = %231
  br label %276

276:                                              ; preds = %275
  %277 = load i32, ptr %14, align 4, !tbaa !5
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %14, align 4, !tbaa !5
  br label %224, !llvm.loop !20

279:                                              ; preds = %224
  store i32 1, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %280

280:                                              ; preds = %279, %270, %125, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16000, ptr %12) #5
  %281 = load i32, ptr %7, align 4
  ret i32 %281
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z13opposite_side5pointS_S_S_(double, double, double, double, double, double, double, double) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z13dot_online_in5pointS_S_(double, double, double, double, double, double) #4

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

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

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


; 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.point = type { double, double }

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z14inside_polygon5pointiPS_i(double, double, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 2) i32 @_Z14inside_polygon5pointS_iPS_(double %0, double %1, double %2, double %3, i32 noundef %4, ptr noundef %5) local_unnamed_addr #2 {
  %7 = alloca [1000 x %struct.point], align 16
  call void @llvm.lifetime.start.p0(i64 16000, ptr nonnull %7) #4
  %8 = tail call noundef i32 @_Z14inside_polygon5pointiPS_i(double %0, double %1, i32 noundef %4, ptr noundef %5, i32 noundef 1)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %.loopexit102, label %9

9:                                                ; preds = %6
  %10 = tail call noundef i32 @_Z14inside_polygon5pointiPS_i(double %2, double %3, i32 noundef %4, ptr noundef %5, i32 noundef 1)
  %.not95 = icmp eq i32 %10, 0
  br i1 %.not95, label %.loopexit102, label %.preheader104

.preheader104:                                    ; preds = %9
  %11 = icmp sgt i32 %4, 0
  br i1 %11, label %.lr.ph.preheader, label %.loopexit102

.lr.ph.preheader:                                 ; preds = %.preheader104
  %12 = zext nneg i32 %4 to i64
  br label %.lr.ph

.preheader:                                       ; preds = %41
  %13 = icmp sgt i32 %.192, 0
  br i1 %13, label %.lr.ph112.preheader, label %.loopexit102

.lr.ph112.preheader:                              ; preds = %.preheader
  %14 = zext nneg i32 %.192 to i64
  %wide.trip.count126 = zext nneg i32 %.192 to i64
  br label %.lr.ph112

.lr.ph:                                           ; preds = %.lr.ph.preheader, %41
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %41 ]
  %.091107 = phi i32 [ 0, %.lr.ph.preheader ], [ %.192, %41 ]
  %15 = getelementptr inbounds %struct.point, ptr %5, i64 %indvars.iv
  %.sroa.029.0.copyload = load double, ptr %15, align 8, !tbaa !5
  %.sroa.230.0..sroa_idx = getelementptr inbounds i8, ptr %15, i64 8
  %.sroa.230.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = icmp eq i64 %indvars.iv.next, %12
  %17 = and i64 %indvars.iv.next, 4294967295
  %18 = select i1 %16, i64 0, i64 %17
  %19 = getelementptr inbounds %struct.point, ptr %5, i64 %18
  %.sroa.027.0.copyload = load double, ptr %19, align 8, !tbaa !5
  %.sroa.228.0..sroa_idx = getelementptr inbounds i8, ptr %19, i64 8
  %.sroa.228.0.copyload = load double, ptr %.sroa.228.0..sroa_idx, align 8, !tbaa !5
  %20 = tail call noundef i32 @_Z13opposite_side5pointS_S_S_(double %0, double %1, double %2, double %3, double %.sroa.029.0.copyload, double %.sroa.230.0.copyload, double %.sroa.027.0.copyload, double %.sroa.228.0.copyload)
  %.not97 = icmp eq i32 %20, 0
  br i1 %.not97, label %23, label %21

21:                                               ; preds = %.lr.ph
  %.sroa.025.0.copyload = load double, ptr %15, align 8, !tbaa !5
  %.sroa.226.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !5
  %.sroa.023.0.copyload = load double, ptr %19, align 8, !tbaa !5
  %.sroa.224.0.copyload = load double, ptr %.sroa.228.0..sroa_idx, align 8, !tbaa !5
  %22 = tail call noundef i32 @_Z13opposite_side5pointS_S_S_(double %.sroa.025.0.copyload, double %.sroa.226.0.copyload, double %.sroa.023.0.copyload, double %.sroa.224.0.copyload, double %0, double %1, double %2, double %3)
  %.not98 = icmp eq i32 %22, 0
  br i1 %.not98, label %23, label %.loopexit102

23:                                               ; preds = %21, %.lr.ph
  %.sroa.015.0.copyload = load double, ptr %15, align 8, !tbaa !5
  %.sroa.216.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !5
  %.sroa.013.0.copyload = load double, ptr %19, align 8, !tbaa !5
  %.sroa.214.0.copyload = load double, ptr %.sroa.228.0..sroa_idx, align 8, !tbaa !5
  %24 = tail call noundef i32 @_Z13dot_online_in5pointS_S_(double %0, double %1, double %.sroa.015.0.copyload, double %.sroa.216.0.copyload, double %.sroa.013.0.copyload, double %.sroa.214.0.copyload)
  %.not99 = icmp eq i32 %24, 0
  br i1 %.not99, label %29, label %25

25:                                               ; preds = %23
  %26 = add nsw i32 %.091107, 1
  %27 = sext i32 %.091107 to i64
  %28 = getelementptr inbounds [1000 x %struct.point], ptr %7, i64 0, i64 %27
  store double %0, ptr %28, align 16, !tbaa !5
  %.sroa.787.0..sroa_idx = getelementptr inbounds i8, ptr %28, i64 8
  store double %1, ptr %.sroa.787.0..sroa_idx, align 8, !tbaa !5
  br label %41

29:                                               ; preds = %23
  %.sroa.09.0.copyload = load double, ptr %15, align 8, !tbaa !5
  %.sroa.210.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !5
  %.sroa.07.0.copyload = load double, ptr %19, align 8, !tbaa !5
  %.sroa.28.0.copyload = load double, ptr %.sroa.228.0..sroa_idx, align 8, !tbaa !5
  %30 = tail call noundef i32 @_Z13dot_online_in5pointS_S_(double %2, double %3, double %.sroa.09.0.copyload, double %.sroa.210.0.copyload, double %.sroa.07.0.copyload, double %.sroa.28.0.copyload)
  %.not100 = icmp eq i32 %30, 0
  br i1 %.not100, label %35, label %31

31:                                               ; preds = %29
  %32 = add nsw i32 %.091107, 1
  %33 = sext i32 %.091107 to i64
  %34 = getelementptr inbounds [1000 x %struct.point], ptr %7, i64 0, i64 %33
  store double %2, ptr %34, align 16, !tbaa !5
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %34, i64 8
  store double %3, ptr %.sroa.7.0..sroa_idx, align 8, !tbaa !5
  br label %41

35:                                               ; preds = %29
  %.sroa.05.0.copyload = load double, ptr %15, align 8, !tbaa !5
  %.sroa.26.0.copyload = load double, ptr %.sroa.230.0..sroa_idx, align 8, !tbaa !5
  %36 = tail call noundef i32 @_Z13dot_online_in5pointS_S_(double %.sroa.05.0.copyload, double %.sroa.26.0.copyload, double %0, double %1, double %2, double %3)
  %.not101 = icmp eq i32 %36, 0
  br i1 %.not101, label %41, label %37

37:                                               ; preds = %35
  %38 = add nsw i32 %.091107, 1
  %39 = sext i32 %.091107 to i64
  %40 = getelementptr inbounds [1000 x %struct.point], ptr %7, i64 0, i64 %39
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %40, ptr noundef nonnull align 8 dereferenceable(16) %15, i64 16, i1 false), !tbaa.struct !9
  br label %41

41:                                               ; preds = %31, %37, %35, %25
  %.192 = phi i32 [ %26, %25 ], [ %32, %31 ], [ %38, %37 ], [ %.091107, %35 ]
  %exitcond.not = icmp eq i64 %indvars.iv.next, %12
  br i1 %exitcond.not, label %.preheader, label %.lr.ph, !llvm.loop !10

.loopexit:                                        ; preds = %47, %.lr.ph112
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
  br i1 %exitcond127.not, label %.loopexit102, label %.lr.ph112, !llvm.loop !12

.lr.ph112:                                        ; preds = %.lr.ph112.preheader, %.loopexit
  %indvars.iv123 = phi i64 [ 0, %.lr.ph112.preheader ], [ %indvars.iv.next124, %.loopexit ]
  %indvars.iv116 = phi i64 [ 1, %.lr.ph112.preheader ], [ %indvars.iv.next117, %.loopexit ]
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %42 = icmp ult i64 %indvars.iv.next124, %14
  br i1 %42, label %.lr.ph110, label %.loopexit

.lr.ph110:                                        ; preds = %.lr.ph112
  %43 = getelementptr inbounds [1000 x %struct.point], ptr %7, i64 0, i64 %indvars.iv123
  %44 = load double, ptr %43, align 16, !tbaa !13
  %45 = getelementptr inbounds i8, ptr %43, i64 8
  %46 = load double, ptr %45, align 8, !tbaa !15
  br label %48

47:                                               ; preds = %48
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count126
  br i1 %exitcond122.not, label %.loopexit, label %48, !llvm.loop !16

48:                                               ; preds = %.lr.ph110, %47
  %indvars.iv118 = phi i64 [ %indvars.iv116, %.lr.ph110 ], [ %indvars.iv.next119, %47 ]
  %49 = getelementptr inbounds [1000 x %struct.point], ptr %7, i64 0, i64 %indvars.iv118
  %50 = load double, ptr %49, align 16, !tbaa !13
  %51 = fadd double %44, %50
  %52 = fmul double %51, 5.000000e-01
  %53 = getelementptr inbounds i8, ptr %49, i64 8
  %54 = load double, ptr %53, align 8, !tbaa !15
  %55 = fadd double %46, %54
  %56 = fmul double %55, 5.000000e-01
  %57 = tail call noundef i32 @_Z14inside_polygon5pointiPS_i(double %52, double %56, i32 noundef %4, ptr noundef %5, i32 noundef 1)
  %.not96 = icmp eq i32 %57, 0
  br i1 %.not96, label %.loopexit102, label %47

.loopexit102:                                     ; preds = %21, %.loopexit, %48, %.preheader104, %.preheader, %6, %9
  %.0 = phi i32 [ 0, %9 ], [ 0, %6 ], [ 1, %.preheader ], [ 1, %.preheader104 ], [ 0, %48 ], [ 1, %.loopexit ], [ 0, %21 ]
  call void @llvm.lifetime.end.p0(i64 16000, ptr nonnull %7) #4
  ret i32 %.0
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z13opposite_side5pointS_S_S_(double, double, double, double, double, double, double, double) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z13dot_online_in5pointS_S_(double, double, double, double, double, double) local_unnamed_addr #3

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

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

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


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