; LLVM IR from tangjz/acm-icpc :: codechef/ACM15AMR (AMCAS)

; 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 { i32, i32 }
%struct.Cir = type { i32, i32, i32 }

@_ZL4area = external hidden global [3 x x86_fp80], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@A = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local global i32, align 4
@cnt = external dso_local global [3 x i64], align 16
@p = external dso_local global [100010 x %struct.Point], align 16
@c = external dso_local global [400040 x %struct.Cir], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.Cir, align 4
  %5 = alloca %struct.Cir, align 4
  %6 = alloca %struct.Cir, align 4
  %7 = alloca %struct.Cir, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca x86_fp80, align 16
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  br label %22

22:                                               ; preds = %360, %0
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m, ptr noundef @A, ptr noundef @q)
  %24 = icmp eq i32 %23, 4
  br i1 %24, label %25, label %378

25:                                               ; preds = %22
  store i32 0, ptr @tot, align 4, !tbaa !5
  store i64 0, ptr getelementptr inbounds ([3 x i64], ptr @cnt, i64 0, i64 2), align 16, !tbaa !9
  store i64 0, ptr getelementptr inbounds ([3 x i64], ptr @cnt, i64 0, i64 1), align 8, !tbaa !9
  store i64 0, ptr @cnt, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %41, %25
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = load i32, ptr @q, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %44

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %33
  %35 = getelementptr inbounds %struct.Point, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.Point, ptr %38, i32 0, i32 1
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %35, ptr noundef %39)
  br label %41

41:                                               ; preds = %31
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  br label %26, !llvm.loop !11

44:                                               ; preds = %30
  %45 = load i32, ptr @q, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.Point, ptr @p, i64 %46
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef @p, ptr noundef %47)
  %48 = load i32, ptr @q, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds %struct.Point, ptr @p, i64 %49
  %51 = call noundef ptr @_ZSt6uniqueIP5PointET_S2_S2_(ptr noundef @p, ptr noundef %50)
  %52 = ptrtoint ptr %51 to i64
  %53 = sub i64 %52, ptrtoint (ptr @p to i64)
  %54 = sdiv exact i64 %53, 8
  %55 = trunc i64 %54 to i32
  store i32 %55, ptr @q, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %189, %44
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = load i32, ptr @q, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %192

61:                                               ; preds = %56
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %63
  %65 = getelementptr inbounds %struct.Point, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !13
  %67 = icmp sgt i32 %66, 0
  br i1 %67, label %68, label %125

68:                                               ; preds = %61
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %70
  %72 = getelementptr inbounds %struct.Point, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !15
  %74 = icmp sgt i32 %73, 0
  br i1 %74, label %75, label %96

75:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #7
  %76 = getelementptr inbounds %struct.Cir, ptr %4, i32 0, i32 0
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.Point, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 8, !tbaa !13
  %82 = sub nsw i32 %81, 1
  store i32 %82, ptr %76, align 4, !tbaa !16
  %83 = getelementptr inbounds %struct.Cir, ptr %4, i32 0, i32 1
  %84 = load i32, ptr %3, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.Point, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !15
  %89 = sub nsw i32 %88, 1
  store i32 %89, ptr %83, align 4, !tbaa !18
  %90 = getelementptr inbounds %struct.Cir, ptr %4, i32 0, i32 2
  %91 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %91, ptr %90, align 4, !tbaa !19
  %92 = load i32, ptr @tot, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr @tot, align 4, !tbaa !5
  %94 = sext i32 %92 to i64
  %95 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %94
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %95, ptr align 4 %4, i64 12, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #7
  br label %96

96:                                               ; preds = %75, %68
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %98
  %100 = getelementptr inbounds %struct.Point, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 4, !tbaa !15
  %102 = load i32, ptr @m, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %104, label %124

104:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #7
  %105 = getelementptr inbounds %struct.Cir, ptr %5, i32 0, i32 0
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %107
  %109 = getelementptr inbounds %struct.Point, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !13
  %111 = sub nsw i32 %110, 1
  store i32 %111, ptr %105, align 4, !tbaa !16
  %112 = getelementptr inbounds %struct.Cir, ptr %5, i32 0, i32 1
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %114
  %116 = getelementptr inbounds %struct.Point, ptr %115, i32 0, i32 1
  %117 = load i32, ptr %116, align 4, !tbaa !15
  store i32 %117, ptr %112, align 4, !tbaa !18
  %118 = getelementptr inbounds %struct.Cir, ptr %5, i32 0, i32 2
  %119 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %119, ptr %118, align 4, !tbaa !19
  %120 = load i32, ptr @tot, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr @tot, align 4, !tbaa !5
  %122 = sext i32 %120 to i64
  %123 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %122
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %123, ptr align 4 %5, i64 12, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #7
  br label %124

124:                                              ; preds = %104, %96
  br label %125

125:                                              ; preds = %124, %61
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %127
  %129 = getelementptr inbounds %struct.Point, ptr %128, i32 0, i32 0
  %130 = load i32, ptr %129, align 8, !tbaa !13
  %131 = load i32, ptr @n, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %133, label %188

133:                                              ; preds = %125
  %134 = load i32, ptr %3, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %135
  %137 = getelementptr inbounds %struct.Point, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !15
  %139 = icmp sgt i32 %138, 0
  br i1 %139, label %140, label %160

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #7
  %141 = getelementptr inbounds %struct.Cir, ptr %6, i32 0, i32 0
  %142 = load i32, ptr %3, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %143
  %145 = getelementptr inbounds %struct.Point, ptr %144, i32 0, i32 0
  %146 = load i32, ptr %145, align 8, !tbaa !13
  store i32 %146, ptr %141, align 4, !tbaa !16
  %147 = getelementptr inbounds %struct.Cir, ptr %6, i32 0, i32 1
  %148 = load i32, ptr %3, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %149
  %151 = getelementptr inbounds %struct.Point, ptr %150, i32 0, i32 1
  %152 = load i32, ptr %151, align 4, !tbaa !15
  %153 = sub nsw i32 %152, 1
  store i32 %153, ptr %147, align 4, !tbaa !18
  %154 = getelementptr inbounds %struct.Cir, ptr %6, i32 0, i32 2
  %155 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %155, ptr %154, align 4, !tbaa !19
  %156 = load i32, ptr @tot, align 4, !tbaa !5
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr @tot, align 4, !tbaa !5
  %158 = sext i32 %156 to i64
  %159 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %158
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %159, ptr align 4 %6, i64 12, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #7
  br label %160

160:                                              ; preds = %140, %133
  %161 = load i32, ptr %3, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %162
  %164 = getelementptr inbounds %struct.Point, ptr %163, i32 0, i32 1
  %165 = load i32, ptr %164, align 4, !tbaa !15
  %166 = load i32, ptr @m, align 4, !tbaa !5
  %167 = icmp slt i32 %165, %166
  br i1 %167, label %168, label %187

168:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #7
  %169 = getelementptr inbounds %struct.Cir, ptr %7, i32 0, i32 0
  %170 = load i32, ptr %3, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.Point, ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 8, !tbaa !13
  store i32 %174, ptr %169, align 4, !tbaa !16
  %175 = getelementptr inbounds %struct.Cir, ptr %7, i32 0, i32 1
  %176 = load i32, ptr %3, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %177
  %179 = getelementptr inbounds %struct.Point, ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 4, !tbaa !15
  store i32 %180, ptr %175, align 4, !tbaa !18
  %181 = getelementptr inbounds %struct.Cir, ptr %7, i32 0, i32 2
  %182 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %182, ptr %181, align 4, !tbaa !19
  %183 = load i32, ptr @tot, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr @tot, align 4, !tbaa !5
  %185 = sext i32 %183 to i64
  %186 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %185
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %186, ptr align 4 %7, i64 12, i1 false), !tbaa.struct !20
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  br label %187

187:                                              ; preds = %168, %160
  br label %188

188:                                              ; preds = %187, %125
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %3, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %3, align 4, !tbaa !5
  br label %56, !llvm.loop !21

192:                                              ; preds = %60
  %193 = load i32, ptr @tot, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds %struct.Cir, ptr @c, i64 %194
  call void @_ZSt4sortIP3CirEvT_S2_(ptr noundef @c, ptr noundef %195)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %196

196:                                              ; preds = %338, %192
  %197 = load i32, ptr %8, align 4, !tbaa !5
  %198 = load i32, ptr @tot, align 4, !tbaa !5
  %199 = icmp slt i32 %197, %198
  br i1 %199, label %201, label %200

200:                                              ; preds = %196
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %340

201:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %202 = load i32, ptr %8, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %203
  %205 = getelementptr inbounds %struct.Cir, ptr %204, i32 0, i32 0
  store ptr %205, ptr %10, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %206 = load i32, ptr %8, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %207
  %209 = getelementptr inbounds %struct.Cir, ptr %208, i32 0, i32 1
  store ptr %209, ptr %11, align 8, !tbaa !22
  br label %210

210:                                              ; preds = %235, %201
  %211 = load i32, ptr %9, align 4, !tbaa !5
  %212 = load i32, ptr @tot, align 4, !tbaa !5
  %213 = icmp slt i32 %211, %212
  br i1 %213, label %214, label %232

214:                                              ; preds = %210
  %215 = load ptr, ptr %10, align 8, !tbaa !22
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = load i32, ptr %9, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %218
  %220 = getelementptr inbounds %struct.Cir, ptr %219, i32 0, i32 0
  %221 = load i32, ptr %220, align 4, !tbaa !16
  %222 = icmp eq i32 %216, %221
  br i1 %222, label %223, label %232

223:                                              ; preds = %214
  %224 = load ptr, ptr %11, align 8, !tbaa !22
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = load i32, ptr %9, align 4, !tbaa !5
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %227
  %229 = getelementptr inbounds %struct.Cir, ptr %228, i32 0, i32 1
  %230 = load i32, ptr %229, align 4, !tbaa !18
  %231 = icmp eq i32 %225, %230
  br label %232

232:                                              ; preds = %223, %214, %210
  %233 = phi i1 [ false, %214 ], [ false, %210 ], [ %231, %223 ]
  br i1 %233, label %234, label %238

234:                                              ; preds = %232
  br label %235

235:                                              ; preds = %234
  %236 = load i32, ptr %9, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %9, align 4, !tbaa !5
  br label %210, !llvm.loop !24

238:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %239 = load i32, ptr %8, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  %241 = load i32, ptr %9, align 4, !tbaa !5
  %242 = icmp eq i32 %240, %241
  br i1 %242, label %243, label %244

243:                                              ; preds = %238
  br label %298

244:                                              ; preds = %238
  %245 = load i32, ptr %8, align 4, !tbaa !5
  %246 = add nsw i32 %245, 2
  %247 = load i32, ptr %9, align 4, !tbaa !5
  %248 = icmp eq i32 %246, %247
  br i1 %248, label %249, label %295

249:                                              ; preds = %244
  %250 = load i32, ptr %8, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %251
  %253 = getelementptr inbounds %struct.Cir, ptr %252, i32 0, i32 2
  %254 = load i32, ptr %253, align 4, !tbaa !19
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %255
  %257 = getelementptr inbounds %struct.Point, ptr %256, i32 0, i32 0
  %258 = load i32, ptr %257, align 8, !tbaa !13
  %259 = load i32, ptr %8, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %261
  %263 = getelementptr inbounds %struct.Cir, ptr %262, i32 0, i32 2
  %264 = load i32, ptr %263, align 4, !tbaa !19
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %265
  %267 = getelementptr inbounds %struct.Point, ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 8, !tbaa !13
  %269 = icmp ne i32 %258, %268
  br i1 %269, label %270, label %291

270:                                              ; preds = %249
  %271 = load i32, ptr %8, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %272
  %274 = getelementptr inbounds %struct.Cir, ptr %273, i32 0, i32 2
  %275 = load i32, ptr %274, align 4, !tbaa !19
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %276
  %278 = getelementptr inbounds %struct.Point, ptr %277, i32 0, i32 1
  %279 = load i32, ptr %278, align 4, !tbaa !15
  %280 = load i32, ptr %8, align 4, !tbaa !5
  %281 = add nsw i32 %280, 1
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %282
  %284 = getelementptr inbounds %struct.Cir, ptr %283, i32 0, i32 2
  %285 = load i32, ptr %284, align 4, !tbaa !19
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %286
  %288 = getelementptr inbounds %struct.Point, ptr %287, i32 0, i32 1
  %289 = load i32, ptr %288, align 4, !tbaa !15
  %290 = icmp ne i32 %279, %289
  br label %291

291:                                              ; preds = %270, %249
  %292 = phi i1 [ false, %249 ], [ %290, %270 ]
  %293 = zext i1 %292 to i64
  %294 = select i1 %292, i32 2, i32 1
  br label %296

295:                                              ; preds = %244
  br label %296

296:                                              ; preds = %295, %291
  %297 = phi i32 [ %294, %291 ], [ 2, %295 ]
  br label %298

298:                                              ; preds = %296, %243
  %299 = phi i32 [ 0, %243 ], [ %297, %296 ]
  store i32 %299, ptr %12, align 4, !tbaa !5
  %300 = load ptr, ptr %10, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %301 = load i32, ptr @n, align 4, !tbaa !5
  %302 = load i32, ptr @A, align 4, !tbaa !5
  %303 = sub nsw i32 %301, %302
  store i32 %303, ptr %13, align 4, !tbaa !5
  %304 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %300, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %305 = load i32, ptr %304, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %306 = load ptr, ptr %10, align 8, !tbaa !22
  %307 = load i32, ptr %306, align 4, !tbaa !5
  %308 = load i32, ptr @A, align 4, !tbaa !5
  %309 = sub nsw i32 %307, %308
  %310 = add nsw i32 %309, 1
  store i32 %310, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  %311 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %312 = load i32, ptr %311, align 4, !tbaa !5
  %313 = sub nsw i32 %305, %312
  %314 = sext i32 %313 to i64
  %315 = add nsw i64 %314, 1
  %316 = load ptr, ptr %11, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  %317 = load i32, ptr @m, align 4, !tbaa !5
  %318 = load i32, ptr @A, align 4, !tbaa !5
  %319 = sub nsw i32 %317, %318
  store i32 %319, ptr %16, align 4, !tbaa !5
  %320 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %316, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %321 = load i32, ptr %320, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %322 = load ptr, ptr %11, align 8, !tbaa !22
  %323 = load i32, ptr %322, align 4, !tbaa !5
  %324 = load i32, ptr @A, align 4, !tbaa !5
  %325 = sub nsw i32 %323, %324
  %326 = add nsw i32 %325, 1
  store i32 %326, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  %327 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %328 = load i32, ptr %327, align 4, !tbaa !5
  %329 = sub nsw i32 %321, %328
  %330 = sext i32 %329 to i64
  %331 = add nsw i64 %330, 1
  %332 = mul nsw i64 %315, %331
  %333 = load i32, ptr %12, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [3 x i64], ptr @cnt, i64 0, i64 %334
  %336 = load i64, ptr %335, align 8, !tbaa !9
  %337 = add nsw i64 %336, %332
  store i64 %337, ptr %335, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %338

338:                                              ; preds = %298
  %339 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %339, ptr %8, align 4, !tbaa !5
  br label %196, !llvm.loop !25

340:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  store x86_fp80 0xK00000000000000000000, ptr %19, align 16, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %341

341:                                              ; preds = %357, %340
  %342 = load i32, ptr %20, align 4, !tbaa !5
  %343 = icmp slt i32 %342, 3
  br i1 %343, label %345, label %344

344:                                              ; preds = %341
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  br label %360

345:                                              ; preds = %341
  %346 = load i32, ptr %20, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [3 x x86_fp80], ptr @_ZL4area, i64 0, i64 %347
  %349 = load x86_fp80, ptr %348, align 16, !tbaa !26
  %350 = load i32, ptr %20, align 4, !tbaa !5
  %351 = sext i32 %350 to i64
  %352 = getelementptr inbounds [3 x i64], ptr @cnt, i64 0, i64 %351
  %353 = load i64, ptr %352, align 8, !tbaa !9
  %354 = sitofp i64 %353 to x86_fp80
  %355 = load x86_fp80, ptr %19, align 16, !tbaa !26
  %356 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %349, x86_fp80 %354, x86_fp80 %355)
  store x86_fp80 %356, ptr %19, align 16, !tbaa !26
  br label %357

357:                                              ; preds = %345
  %358 = load i32, ptr %20, align 4, !tbaa !5
  %359 = add nsw i32 %358, 1
  store i32 %359, ptr %20, align 4, !tbaa !5
  br label %341, !llvm.loop !28

360:                                              ; preds = %344
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %361 = load i32, ptr @n, align 4, !tbaa !5
  %362 = load i32, ptr @A, align 4, !tbaa !5
  %363 = sub nsw i32 %361, %362
  %364 = sext i32 %363 to i64
  %365 = add nsw i64 %364, 1
  %366 = load i32, ptr @m, align 4, !tbaa !5
  %367 = load i32, ptr @A, align 4, !tbaa !5
  %368 = sub nsw i32 %366, %367
  %369 = sext i32 %368 to i64
  %370 = add nsw i64 %369, 1
  %371 = mul nsw i64 %365, %370
  store i64 %371, ptr %21, align 8, !tbaa !9
  %372 = load x86_fp80, ptr %19, align 16, !tbaa !26
  %373 = load i64, ptr %21, align 8, !tbaa !9
  %374 = sitofp i64 %373 to x86_fp80
  %375 = fdiv x86_fp80 %372, %374
  %376 = fptrunc x86_fp80 %375 to double
  %377 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %376)
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  br label %22, !llvm.loop !29

378:                                              ; preds = %22
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5PointEvT_S2_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIP5PointET_S2_S2_(ptr noundef, ptr noundef) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3CirEvT_S2_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #6

declare i32 @printf(ptr noundef, ...) #1

attributes #0 = { mustprogress norecurse 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4}
!15 = !{!14, !6, i64 4}
!16 = !{!17, !6, i64 0}
!17 = !{!"_ZTS3Cir", !6, i64 0, !6, i64 4, !6, i64 8}
!18 = !{!17, !6, i64 4}
!19 = !{!17, !6, i64 8}
!20 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!21 = distinct !{!21, !12}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}
!26 = !{!27, !27, i64 0}
!27 = !{!"long double", !7, i64 0}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}


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

%struct.Point = type { i32, i32 }
%struct.Cir = type { i32, i32, i32 }

@_ZL4area = external hidden local_unnamed_addr global [3 x x86_fp80], align 16
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@A = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@tot = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global [3 x i64], align 16
@p = external dso_local global [100010 x %struct.Point], align 16
@c = external dso_local global [400040 x %struct.Cir], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @A, ptr noundef nonnull @q)
  %8 = icmp eq i32 %7, 4
  br i1 %8, label %.lr.ph89, label %._crit_edge90

.lr.ph89:                                         ; preds = %0, %.preheader
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) @cnt, i8 0, i64 24, i1 false)
  %9 = load i32, ptr @q, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %.lr.ph89.._crit_edge_crit_edge

.lr.ph89.._crit_edge_crit_edge:                   ; preds = %.lr.ph89
  %.pre104 = sext i32 %9 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph89.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre104, %.lr.ph89.._crit_edge_crit_edge ], [ %27, %.lr.ph ]
  %11 = getelementptr inbounds %struct.Point, ptr @p, i64 %.pre-phi
  call void @_ZSt4sortIP5PointEvT_S2_(ptr noundef nonnull @p, ptr noundef nonnull %11)
  %12 = load i32, ptr @q, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds %struct.Point, ptr @p, i64 %13
  %15 = call noundef ptr @_ZSt6uniqueIP5PointET_S2_S2_(ptr noundef nonnull @p, ptr noundef nonnull %14)
  %16 = ptrtoint ptr %15 to i64
  %17 = sub i64 %16, ptrtoint (ptr @p to i64)
  %18 = lshr exact i64 %17, 3
  %19 = trunc i64 %18 to i32
  store i32 %19, ptr @q, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br i1 %20, label %.lr.ph80, label %._crit_edge81

.lr.ph80:                                         ; preds = %._crit_edge
  %21 = load i32, ptr @m, align 4
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %wide.trip.count = and i64 %18, 2147483647
  br label %34

.lr.ph:                                           ; preds = %.lr.ph89, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph89 ]
  %23 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv
  %24 = getelementptr inbounds i8, ptr %23, i64 4
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %23, ptr noundef nonnull %24)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr @q, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge81:                                    ; preds = %80, %._crit_edge
  %29 = phi i32 [ %tot.promoted, %._crit_edge ], [ %81, %80 ]
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds %struct.Cir, ptr @c, i64 %30
  call void @_ZSt4sortIP3CirEvT_S2_(ptr noundef nonnull @c, ptr noundef nonnull %31)
  %32 = load i32, ptr @tot, align 4, !tbaa !5
  %33 = icmp sgt i32 %32, 0
  br i1 %33, label %.lr.ph85, label %.preheader

34:                                               ; preds = %.lr.ph80, %80
  %indvars.iv94 = phi i64 [ 0, %.lr.ph80 ], [ %indvars.iv.next95, %80 ]
  %35 = phi i32 [ %tot.promoted, %.lr.ph80 ], [ %81, %80 ]
  %36 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %indvars.iv94
  %37 = load i32, ptr %36, align 8, !tbaa !11
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %59

39:                                               ; preds = %34
  %40 = getelementptr inbounds i8, ptr %36, i64 4
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %50

43:                                               ; preds = %39
  %44 = add nsw i32 %37, -1
  %45 = add nsw i32 %41, -1
  %46 = add nsw i32 %35, 1
  store i32 %46, ptr @tot, align 4, !tbaa !5
  %47 = sext i32 %35 to i64
  %48 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %47
  store i32 %44, ptr %48, align 4, !tbaa !5
  %.sroa.436.0..sroa_idx = getelementptr inbounds i8, ptr %48, i64 4
  store i32 %45, ptr %.sroa.436.0..sroa_idx, align 4, !tbaa !5
  %.sroa.537.0..sroa_idx = getelementptr inbounds i8, ptr %48, i64 8
  %49 = trunc nuw nsw i64 %indvars.iv94 to i32
  store i32 %49, ptr %.sroa.537.0..sroa_idx, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %43, %39
  %51 = phi i32 [ %46, %43 ], [ %35, %39 ]
  %52 = icmp slt i32 %41, %21
  br i1 %52, label %53, label %59

53:                                               ; preds = %50
  %54 = add nsw i32 %37, -1
  %55 = add nsw i32 %51, 1
  store i32 %55, ptr @tot, align 4, !tbaa !5
  %56 = sext i32 %51 to i64
  %57 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  %.sroa.433.0..sroa_idx = getelementptr inbounds i8, ptr %57, i64 4
  store i32 %41, ptr %.sroa.433.0..sroa_idx, align 4, !tbaa !5
  %.sroa.534.0..sroa_idx = getelementptr inbounds i8, ptr %57, i64 8
  %58 = trunc nuw nsw i64 %indvars.iv94 to i32
  store i32 %58, ptr %.sroa.534.0..sroa_idx, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %50, %53, %34
  %60 = phi i32 [ %51, %50 ], [ %55, %53 ], [ %35, %34 ]
  %61 = icmp slt i32 %37, %22
  br i1 %61, label %62, label %80

62:                                               ; preds = %59
  %63 = getelementptr inbounds i8, ptr %36, i64 4
  %64 = load i32, ptr %63, align 4, !tbaa !13
  %65 = icmp sgt i32 %64, 0
  br i1 %65, label %66, label %72

66:                                               ; preds = %62
  %67 = add nsw i32 %64, -1
  %68 = add nsw i32 %60, 1
  store i32 %68, ptr @tot, align 4, !tbaa !5
  %69 = sext i32 %60 to i64
  %70 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %69
  store i32 %37, ptr %70, align 4, !tbaa !5
  %.sroa.430.0..sroa_idx = getelementptr inbounds i8, ptr %70, i64 4
  store i32 %67, ptr %.sroa.430.0..sroa_idx, align 4, !tbaa !5
  %.sroa.531.0..sroa_idx = getelementptr inbounds i8, ptr %70, i64 8
  %71 = trunc nuw nsw i64 %indvars.iv94 to i32
  store i32 %71, ptr %.sroa.531.0..sroa_idx, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %66, %62
  %73 = phi i32 [ %68, %66 ], [ %60, %62 ]
  %74 = icmp slt i32 %64, %21
  br i1 %74, label %75, label %80

75:                                               ; preds = %72
  %76 = add nsw i32 %73, 1
  store i32 %76, ptr @tot, align 4, !tbaa !5
  %77 = sext i32 %73 to i64
  %78 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %77
  store i32 %37, ptr %78, align 4, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %78, i64 4
  store i32 %64, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %78, i64 8
  %79 = trunc nuw nsw i64 %indvars.iv94 to i32
  store i32 %79, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %59, %75, %72
  %81 = phi i32 [ %60, %59 ], [ %76, %75 ], [ %73, %72 ]
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge81, label %34, !llvm.loop !14

.preheader:                                       ; preds = %.thread, %._crit_edge81
  %82 = load x86_fp80, ptr @_ZL4area, align 16, !tbaa !15
  %83 = load i64, ptr @cnt, align 16, !tbaa !17
  %84 = sitofp i64 %83 to x86_fp80
  %85 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %82, x86_fp80 %84, x86_fp80 0xK00000000000000000000)
  %86 = load x86_fp80, ptr getelementptr inbounds (i8, ptr @_ZL4area, i64 16), align 16, !tbaa !15
  %87 = load i64, ptr getelementptr inbounds (i8, ptr @cnt, i64 8), align 8, !tbaa !17
  %88 = sitofp i64 %87 to x86_fp80
  %89 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %86, x86_fp80 %88, x86_fp80 %85)
  %90 = load x86_fp80, ptr getelementptr inbounds (i8, ptr @_ZL4area, i64 32), align 16, !tbaa !15
  %91 = load i64, ptr getelementptr inbounds (i8, ptr @cnt, i64 16), align 16, !tbaa !17
  %92 = sitofp i64 %91 to x86_fp80
  %93 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %90, x86_fp80 %92, x86_fp80 %89)
  %94 = load i32, ptr @n, align 4, !tbaa !5
  %95 = load i32, ptr @A, align 4, !tbaa !5
  %96 = sub nsw i32 %94, %95
  %97 = sext i32 %96 to i64
  %98 = add nsw i64 %97, 1
  %99 = load i32, ptr @m, align 4, !tbaa !5
  %100 = sub nsw i32 %99, %95
  %101 = sext i32 %100 to i64
  %102 = add nsw i64 %101, 1
  %103 = mul nsw i64 %102, %98
  %104 = sitofp i64 %103 to x86_fp80
  %105 = fdiv x86_fp80 %93, %104
  %106 = fptrunc x86_fp80 %105 to double
  %107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %106)
  %108 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @A, ptr noundef nonnull @q)
  %109 = icmp eq i32 %108, 4
  br i1 %109, label %.lr.ph89, label %._crit_edge90, !llvm.loop !19

.lr.ph85:                                         ; preds = %._crit_edge81, %.thread
  %110 = phi i32 [ %185, %.thread ], [ %32, %._crit_edge81 ]
  %.06583 = phi i32 [ %.1.lcssa, %.thread ], [ 0, %._crit_edge81 ]
  %111 = sext i32 %.06583 to i64
  %112 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %111
  %113 = getelementptr inbounds i8, ptr %112, i64 4
  %114 = load i32, ptr %112, align 4, !tbaa !5
  %115 = sext i32 %110 to i64
  %116 = add nsw i32 %.06583, 1
  %smax = call i32 @llvm.smax.i32(i32 %110, i32 %116)
  br label %117

117:                                              ; preds = %.lr.ph85, %126
  %indvars.iv97 = phi i64 [ %111, %.lr.ph85 ], [ %indvars.iv.next98, %126 ]
  %118 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %indvars.iv97
  %119 = load i32, ptr %118, align 4, !tbaa !20
  %120 = icmp eq i32 %114, %119
  br i1 %120, label %121, label %.critedge.split.loop.exit

121:                                              ; preds = %117
  %122 = load i32, ptr %113, align 4, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %118, i64 4
  %124 = load i32, ptr %123, align 4, !tbaa !22
  %125 = icmp eq i32 %122, %124
  br i1 %125, label %126, label %.critedge.split.loop.exit108

126:                                              ; preds = %121
  %indvars.iv.next98 = add nsw i64 %indvars.iv97, 1
  %127 = icmp slt i64 %indvars.iv.next98, %115
  br i1 %127, label %117, label %.critedge, !llvm.loop !23

.critedge.split.loop.exit:                        ; preds = %117
  %128 = trunc nsw i64 %indvars.iv97 to i32
  br label %.critedge

.critedge.split.loop.exit108:                     ; preds = %121
  %129 = trunc nsw i64 %indvars.iv97 to i32
  br label %.critedge

.critedge:                                        ; preds = %126, %.critedge.split.loop.exit108, %.critedge.split.loop.exit
  %.1.lcssa = phi i32 [ %128, %.critedge.split.loop.exit ], [ %129, %.critedge.split.loop.exit108 ], [ %smax, %126 ]
  %130 = icmp eq i32 %116, %.1.lcssa
  br i1 %130, label %.thread, label %131

131:                                              ; preds = %.critedge
  %132 = add nsw i32 %.06583, 2
  %133 = icmp eq i32 %132, %.1.lcssa
  br i1 %133, label %134, label %.thread

134:                                              ; preds = %131
  %135 = getelementptr inbounds i8, ptr %112, i64 8
  %136 = load i32, ptr %135, align 4, !tbaa !24
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %137
  %139 = load i32, ptr %138, align 8, !tbaa !11
  %140 = sext i32 %116 to i64
  %141 = getelementptr inbounds [400040 x %struct.Cir], ptr @c, i64 0, i64 %140, i32 2
  %142 = load i32, ptr %141, align 4, !tbaa !24
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100010 x %struct.Point], ptr @p, i64 0, i64 %143
  %145 = load i32, ptr %144, align 8, !tbaa !11
  %.not = icmp eq i32 %139, %145
  br i1 %.not, label %.thread, label %146

146:                                              ; preds = %134
  %147 = getelementptr inbounds i8, ptr %138, i64 4
  %148 = load i32, ptr %147, align 4, !tbaa !13
  %149 = getelementptr inbounds i8, ptr %144, i64 4
  %150 = load i32, ptr %149, align 4, !tbaa !13
  %151 = icmp ne i32 %148, %150
  %cond.fr = freeze i1 %151
  %spec.select = select i1 %cond.fr, i64 2, i64 1
  br label %.thread

.thread:                                          ; preds = %146, %134, %131, %.critedge
  %152 = phi i64 [ 0, %.critedge ], [ 2, %131 ], [ 1, %134 ], [ %spec.select, %146 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %153 = load i32, ptr @n, align 4, !tbaa !5
  %154 = load i32, ptr @A, align 4, !tbaa !5
  %155 = sub nsw i32 %153, %154
  store i32 %155, ptr %1, align 4, !tbaa !5
  %156 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %112, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %157 = load i32, ptr %156, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %158 = load i32, ptr %112, align 4, !tbaa !5
  %159 = load i32, ptr @A, align 4, !tbaa !5
  %160 = add i32 %158, 1
  %161 = sub i32 %160, %159
  store i32 %161, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  %162 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = sub nsw i32 %157, %163
  %165 = sext i32 %164 to i64
  %166 = add nsw i64 %165, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %167 = load i32, ptr @m, align 4, !tbaa !5
  %168 = load i32, ptr @A, align 4, !tbaa !5
  %169 = sub nsw i32 %167, %168
  store i32 %169, ptr %4, align 4, !tbaa !5
  %170 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %113, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %171 = load i32, ptr %170, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  %172 = load i32, ptr %113, align 4, !tbaa !5
  %173 = load i32, ptr @A, align 4, !tbaa !5
  %174 = add i32 %172, 1
  %175 = sub i32 %174, %173
  store i32 %175, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  store i32 0, ptr %6, align 4, !tbaa !5
  %176 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = sub nsw i32 %171, %177
  %179 = sext i32 %178 to i64
  %180 = add nsw i64 %179, 1
  %181 = mul nsw i64 %180, %166
  %182 = getelementptr inbounds [3 x i64], ptr @cnt, i64 0, i64 %152
  %183 = load i64, ptr %182, align 8, !tbaa !17
  %184 = add nsw i64 %181, %183
  store i64 %184, ptr %182, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %185 = load i32, ptr @tot, align 4, !tbaa !5
  %186 = icmp slt i32 %.1.lcssa, %185
  br i1 %186, label %.lr.ph85, label %.preheader, !llvm.loop !25

._crit_edge90:                                    ; preds = %.preheader, %0
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP5PointEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIP5PointET_S2_S2_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP3CirEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #5

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

attributes #0 = { mustprogress norecurse 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS5Point", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"long double", !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = !{!21, !6, i64 0}
!21 = !{!"_ZTS3Cir", !6, i64 0, !6, i64 4, !6, i64 8}
!22 = !{!21, !6, i64 4}
!23 = distinct !{!23, !10}
!24 = !{!21, !6, i64 8}
!25 = distinct !{!25, !10}


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