; LLVM IR from Tunghohin/Competitive_Coding :: Luogu/p2585.ll (Z3dfsi)

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

@tr = external dso_local global [500010 x [2 x i32]], align 16
@mx_dp = external dso_local global [500010 x [3 x i64]], align 16
@mn_dp = external dso_local global [500010 x [3 x i64]], align 16

; 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 @_Z3dfsi(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [500010 x [2 x i32]], ptr @tr, i64 0, i64 %19
  %21 = getelementptr inbounds [2 x i32], ptr %20, i64 0, i64 0
  %22 = load i32, ptr %21, align 8, !tbaa !5
  store i32 %22, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [500010 x [2 x i32]], ptr @tr, i64 0, i64 %24
  %26 = getelementptr inbounds [2 x i32], ptr %25, i64 0, i64 1
  %27 = load i32, ptr %26, align 4, !tbaa !5
  store i32 %27, ptr %4, align 4, !tbaa !5
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %32

30:                                               ; preds = %1
  %31 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %31)
  br label %32

32:                                               ; preds = %30, %1
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %37

35:                                               ; preds = %32
  %36 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %36)
  br label %37

37:                                               ; preds = %35, %32
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = icmp ne i32 %38, 0
  br i1 %39, label %68, label %40

40:                                               ; preds = %37
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %68, label %43

43:                                               ; preds = %40
  %44 = load i32, ptr %2, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %45
  %47 = getelementptr inbounds [3 x i64], ptr %46, i64 0, i64 1
  store i64 1, ptr %47, align 8, !tbaa !9
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %49
  %51 = getelementptr inbounds [3 x i64], ptr %50, i64 0, i64 1
  store i64 1, ptr %51, align 8, !tbaa !9
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %53
  %55 = getelementptr inbounds [3 x i64], ptr %54, i64 0, i64 0
  store i64 0, ptr %55, align 8, !tbaa !9
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %57
  %59 = getelementptr inbounds [3 x i64], ptr %58, i64 0, i64 0
  store i64 0, ptr %59, align 8, !tbaa !9
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %61
  %63 = getelementptr inbounds [3 x i64], ptr %62, i64 0, i64 2
  store i64 0, ptr %63, align 8, !tbaa !9
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %65
  %67 = getelementptr inbounds [3 x i64], ptr %66, i64 0, i64 2
  store i64 0, ptr %67, align 8, !tbaa !9
  store i32 1, ptr %5, align 4
  br label %239

68:                                               ; preds = %40, %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %70
  %72 = getelementptr inbounds [3 x i64], ptr %71, i64 0, i64 1
  %73 = load i64, ptr %72, align 8, !tbaa !9
  %74 = load i32, ptr %4, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %75
  %77 = getelementptr inbounds [3 x i64], ptr %76, i64 0, i64 2
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = add nsw i64 %73, %78
  store i64 %79, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %81
  %83 = getelementptr inbounds [3 x i64], ptr %82, i64 0, i64 2
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %86
  %88 = getelementptr inbounds [3 x i64], ptr %87, i64 0, i64 1
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = add nsw i64 %84, %89
  store i64 %90, ptr %7, align 8, !tbaa !9
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %92 = load i64, ptr %91, align 8, !tbaa !9
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %94
  %96 = getelementptr inbounds [3 x i64], ptr %95, i64 0, i64 0
  store i64 %92, ptr %96, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %98
  %100 = getelementptr inbounds [3 x i64], ptr %99, i64 0, i64 0
  %101 = load i64, ptr %100, align 8, !tbaa !9
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %103
  %105 = getelementptr inbounds [3 x i64], ptr %104, i64 0, i64 2
  %106 = load i64, ptr %105, align 8, !tbaa !9
  %107 = add nsw i64 %101, %106
  store i64 %107, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %108 = load i32, ptr %3, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %109
  %111 = getelementptr inbounds [3 x i64], ptr %110, i64 0, i64 2
  %112 = load i64, ptr %111, align 8, !tbaa !9
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %114
  %116 = getelementptr inbounds [3 x i64], ptr %115, i64 0, i64 0
  %117 = load i64, ptr %116, align 8, !tbaa !9
  %118 = add nsw i64 %112, %117
  store i64 %118, ptr %9, align 8, !tbaa !9
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %120 = load i64, ptr %119, align 8, !tbaa !9
  %121 = add nsw i64 %120, 1
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %123
  %125 = getelementptr inbounds [3 x i64], ptr %124, i64 0, i64 1
  store i64 %121, ptr %125, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %127
  %129 = getelementptr inbounds [3 x i64], ptr %128, i64 0, i64 1
  %130 = load i64, ptr %129, align 8, !tbaa !9
  %131 = load i32, ptr %4, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %132
  %134 = getelementptr inbounds [3 x i64], ptr %133, i64 0, i64 0
  %135 = load i64, ptr %134, align 8, !tbaa !9
  %136 = add nsw i64 %130, %135
  store i64 %136, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %137 = load i32, ptr %3, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %138
  %140 = getelementptr inbounds [3 x i64], ptr %139, i64 0, i64 0
  %141 = load i64, ptr %140, align 8, !tbaa !9
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %143
  %145 = getelementptr inbounds [3 x i64], ptr %144, i64 0, i64 1
  %146 = load i64, ptr %145, align 8, !tbaa !9
  %147 = add nsw i64 %141, %146
  store i64 %147, ptr %11, align 8, !tbaa !9
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = load i32, ptr %2, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %151
  %153 = getelementptr inbounds [3 x i64], ptr %152, i64 0, i64 2
  store i64 %149, ptr %153, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %154 = load i32, ptr %3, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %155
  %157 = getelementptr inbounds [3 x i64], ptr %156, i64 0, i64 1
  %158 = load i64, ptr %157, align 8, !tbaa !9
  %159 = load i32, ptr %4, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %160
  %162 = getelementptr inbounds [3 x i64], ptr %161, i64 0, i64 2
  %163 = load i64, ptr %162, align 8, !tbaa !9
  %164 = add nsw i64 %158, %163
  store i64 %164, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %165 = load i32, ptr %3, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %166
  %168 = getelementptr inbounds [3 x i64], ptr %167, i64 0, i64 2
  %169 = load i64, ptr %168, align 8, !tbaa !9
  %170 = load i32, ptr %4, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %171
  %173 = getelementptr inbounds [3 x i64], ptr %172, i64 0, i64 1
  %174 = load i64, ptr %173, align 8, !tbaa !9
  %175 = add nsw i64 %169, %174
  store i64 %175, ptr %13, align 8, !tbaa !9
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %177 = load i64, ptr %176, align 8, !tbaa !9
  %178 = load i32, ptr %2, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %179
  %181 = getelementptr inbounds [3 x i64], ptr %180, i64 0, i64 0
  store i64 %177, ptr %181, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  %182 = load i32, ptr %3, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %183
  %185 = getelementptr inbounds [3 x i64], ptr %184, i64 0, i64 0
  %186 = load i64, ptr %185, align 8, !tbaa !9
  %187 = load i32, ptr %4, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %188
  %190 = getelementptr inbounds [3 x i64], ptr %189, i64 0, i64 2
  %191 = load i64, ptr %190, align 8, !tbaa !9
  %192 = add nsw i64 %186, %191
  store i64 %192, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %193 = load i32, ptr %3, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %194
  %196 = getelementptr inbounds [3 x i64], ptr %195, i64 0, i64 2
  %197 = load i64, ptr %196, align 8, !tbaa !9
  %198 = load i32, ptr %4, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %199
  %201 = getelementptr inbounds [3 x i64], ptr %200, i64 0, i64 0
  %202 = load i64, ptr %201, align 8, !tbaa !9
  %203 = add nsw i64 %197, %202
  store i64 %203, ptr %15, align 8, !tbaa !9
  %204 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %205 = load i64, ptr %204, align 8, !tbaa !9
  %206 = add nsw i64 %205, 1
  %207 = load i32, ptr %2, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %208
  %210 = getelementptr inbounds [3 x i64], ptr %209, i64 0, i64 1
  store i64 %206, ptr %210, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %211 = load i32, ptr %3, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %212
  %214 = getelementptr inbounds [3 x i64], ptr %213, i64 0, i64 1
  %215 = load i64, ptr %214, align 8, !tbaa !9
  %216 = load i32, ptr %4, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %217
  %219 = getelementptr inbounds [3 x i64], ptr %218, i64 0, i64 0
  %220 = load i64, ptr %219, align 8, !tbaa !9
  %221 = add nsw i64 %215, %220
  store i64 %221, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %222 = load i32, ptr %3, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %223
  %225 = getelementptr inbounds [3 x i64], ptr %224, i64 0, i64 0
  %226 = load i64, ptr %225, align 8, !tbaa !9
  %227 = load i32, ptr %4, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %228
  %230 = getelementptr inbounds [3 x i64], ptr %229, i64 0, i64 1
  %231 = load i64, ptr %230, align 8, !tbaa !9
  %232 = add nsw i64 %226, %231
  store i64 %232, ptr %17, align 8, !tbaa !9
  %233 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %234 = load i64, ptr %233, align 8, !tbaa !9
  %235 = load i32, ptr %2, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %236
  %238 = getelementptr inbounds [3 x i64], ptr %237, i64 0, i64 2
  store i64 %234, ptr %238, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  store i32 0, ptr %5, align 4
  br label %239

239:                                              ; preds = %68, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %240 = load i32, ptr %5, align 4
  switch i32 %240, label %242 [
    i32 0, label %241
    i32 1, label %241
  ]

241:                                              ; preds = %239, %239
  ret void

242:                                              ; preds = %239
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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 = { 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 #3 = { 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}


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

@tr = external dso_local local_unnamed_addr global [500010 x [2 x i32]], align 16
@mx_dp = external dso_local local_unnamed_addr global [500010 x [3 x i64]], align 16
@mn_dp = external dso_local local_unnamed_addr global [500010 x [3 x i64]], align 16

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3dfsi(i32 noundef %0) local_unnamed_addr #1 {
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = sext i32 %0 to i64
  %15 = getelementptr inbounds [500010 x [2 x i32]], ptr @tr, i64 0, i64 %14
  %16 = load i32, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %15, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %20, label %19

19:                                               ; preds = %1
  tail call void @_Z3dfsi(i32 noundef %16)
  br label %20

20:                                               ; preds = %19, %1
  %.not46 = icmp eq i32 %18, 0
  br i1 %.not46, label %22, label %21

21:                                               ; preds = %20
  tail call void @_Z3dfsi(i32 noundef %18)
  br label %22

22:                                               ; preds = %21, %20
  %23 = or i32 %18, %16
  %or.cond.not = icmp eq i32 %23, 0
  br i1 %or.cond.not, label %24, label %31

24:                                               ; preds = %22
  %25 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %14
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  store i64 1, ptr %26, align 8, !tbaa !9
  %27 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %14
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  store i64 1, ptr %28, align 8, !tbaa !9
  store i64 0, ptr %25, align 8, !tbaa !9
  store i64 0, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds i8, ptr %25, i64 16
  store i64 0, ptr %29, align 8, !tbaa !9
  %30 = getelementptr inbounds i8, ptr %27, i64 16
  store i64 0, ptr %30, align 8, !tbaa !9
  br label %102

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  %32 = sext i32 %16 to i64
  %33 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %32
  %34 = getelementptr inbounds i8, ptr %33, i64 8
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = sext i32 %18 to i64
  %37 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %36
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  %39 = load i64, ptr %38, align 8, !tbaa !9
  %40 = add nsw i64 %39, %35
  store i64 %40, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  %41 = getelementptr inbounds i8, ptr %33, i64 16
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = getelementptr inbounds i8, ptr %37, i64 8
  %44 = load i64, ptr %43, align 8, !tbaa !9
  %45 = add nsw i64 %44, %42
  store i64 %45, ptr %3, align 8, !tbaa !9
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds [500010 x [3 x i64]], ptr @mx_dp, i64 0, i64 %14
  store i64 %47, ptr %48, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %49 = load i64, ptr %33, align 8, !tbaa !9
  %50 = load i64, ptr %38, align 8, !tbaa !9
  %51 = add nsw i64 %50, %49
  store i64 %51, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %52 = load i64, ptr %41, align 8, !tbaa !9
  %53 = load i64, ptr %37, align 8, !tbaa !9
  %54 = add nsw i64 %53, %52
  store i64 %54, ptr %5, align 8, !tbaa !9
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %56 = load i64, ptr %55, align 8, !tbaa !9
  %57 = add nsw i64 %56, 1
  %58 = getelementptr inbounds i8, ptr %48, i64 8
  store i64 %57, ptr %58, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  %59 = load i64, ptr %34, align 8, !tbaa !9
  %60 = load i64, ptr %37, align 8, !tbaa !9
  %61 = add nsw i64 %60, %59
  store i64 %61, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %62 = load i64, ptr %33, align 8, !tbaa !9
  %63 = load i64, ptr %43, align 8, !tbaa !9
  %64 = add nsw i64 %63, %62
  store i64 %64, ptr %7, align 8, !tbaa !9
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %66 = load i64, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds i8, ptr %48, i64 16
  store i64 %66, ptr %67, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %68 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %32
  %69 = getelementptr inbounds i8, ptr %68, i64 8
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %36
  %72 = getelementptr inbounds i8, ptr %71, i64 16
  %73 = load i64, ptr %72, align 8, !tbaa !9
  %74 = add nsw i64 %73, %70
  store i64 %74, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %75 = getelementptr inbounds i8, ptr %68, i64 16
  %76 = load i64, ptr %75, align 8, !tbaa !9
  %77 = getelementptr inbounds i8, ptr %71, i64 8
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = add nsw i64 %78, %76
  store i64 %79, ptr %9, align 8, !tbaa !9
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %81 = load i64, ptr %80, align 8, !tbaa !9
  %82 = getelementptr inbounds [500010 x [3 x i64]], ptr @mn_dp, i64 0, i64 %14
  store i64 %81, ptr %82, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %83 = load i64, ptr %68, align 8, !tbaa !9
  %84 = load i64, ptr %72, align 8, !tbaa !9
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  %86 = load i64, ptr %75, align 8, !tbaa !9
  %87 = load i64, ptr %71, align 8, !tbaa !9
  %88 = add nsw i64 %87, %86
  store i64 %88, ptr %11, align 8, !tbaa !9
  %89 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = add nsw i64 %90, 1
  %92 = getelementptr inbounds i8, ptr %82, i64 8
  store i64 %91, ptr %92, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  %93 = load i64, ptr %69, align 8, !tbaa !9
  %94 = load i64, ptr %71, align 8, !tbaa !9
  %95 = add nsw i64 %94, %93
  store i64 %95, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  %96 = load i64, ptr %68, align 8, !tbaa !9
  %97 = load i64, ptr %77, align 8, !tbaa !9
  %98 = add nsw i64 %97, %96
  store i64 %98, ptr %13, align 8, !tbaa !9
  %99 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %100 = load i64, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds i8, ptr %82, i64 16
  store i64 %100, ptr %101, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  br label %102

102:                                              ; preds = %31, %24
  ret void
}

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

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

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


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