; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-11-02 (D - Polynomial-time Reductions - lzy)

; 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.Edge = type { i32, ptr }

@e = external dso_local global ptr, align 8
@lnk = external dso_local global [109 x ptr], align 16
@E = external dso_local global [20009 x %struct.Edge], align 16
@T = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@g = external dso_local global [109 x [109 x i8]], align 16
@l = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@q = external dso_local global [109 x i32], align 16
@vis = external dso_local global [109 x i8], align 16
@tm = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@dn = external dso_local global [109 x i32], align 16
@lw = external dso_local global [109 x i32], align 16
@rt = external dso_local global [109 x i32], align 16
@z = external dso_local global [109 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %11

11:                                               ; preds = %258, %0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  %13 = icmp eq i32 %12, 2
  br i1 %13, label %14, label %263

14:                                               ; preds = %11
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %21, label %17

17:                                               ; preds = %14
  %18 = load i32, ptr @m, align 4, !tbaa !5
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  br label %263

21:                                               ; preds = %17, %14
  store ptr @E, ptr @e, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %31, %21
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp sle i32 %23, %24
  br i1 %25, label %27, label %26

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

27:                                               ; preds = %22
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [109 x ptr], ptr @lnk, i64 0, i64 %29
  store ptr null, ptr %30, align 8, !tbaa !9
  br label %31

31:                                               ; preds = %27
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !11

34:                                               ; preds = %26
  br label %35

35:                                               ; preds = %39, %34
  %36 = load i32, ptr @m, align 4, !tbaa !5
  %37 = add nsw i32 %36, -1
  store i32 %37, ptr @m, align 4, !tbaa !5
  %38 = icmp ne i32 %36, 0
  br i1 %38, label %39, label %55

39:                                               ; preds = %35
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @u, ptr noundef @v)
  %41 = load i32, ptr @v, align 4, !tbaa !5
  %42 = load ptr, ptr @e, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.Edge, ptr %42, i32 0, i32 0
  store i32 %41, ptr %43, align 8, !tbaa !13
  %44 = load i32, ptr @u, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [109 x ptr], ptr @lnk, i64 0, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = load ptr, ptr @e, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.Edge, ptr %48, i32 0, i32 1
  store ptr %47, ptr %49, align 8, !tbaa !15
  %50 = load ptr, ptr @e, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.Edge, ptr %50, i32 1
  store ptr %51, ptr @e, align 8, !tbaa !9
  %52 = load i32, ptr @u, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [109 x ptr], ptr @lnk, i64 0, i64 %53
  store ptr %50, ptr %54, align 8, !tbaa !9
  br label %35, !llvm.loop !16

55:                                               ; preds = %35
  call void @llvm.memset.p0.i64(ptr align 16 @dn, i8 0, i64 436, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @lw, i8 0, i64 436, i1 false)
  store i32 0, ptr @tm, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %70, %55
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp sle i32 %57, %58
  br i1 %59, label %61, label %60

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

61:                                               ; preds = %56
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [109 x i32], ptr @dn, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %69, label %67

67:                                               ; preds = %61
  %68 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z3dfsi(i32 noundef %68)
  br label %69

69:                                               ; preds = %67, %61
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %3, align 4, !tbaa !5
  br label %56, !llvm.loop !17

73:                                               ; preds = %60
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %95, %73
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = load i32, ptr @cnt, align 4, !tbaa !5
  %77 = icmp sle i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %98

79:                                               ; preds = %74
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [109 x i32], ptr @z, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp sgt i32 %83, 1
  br i1 %84, label %85, label %90

85:                                               ; preds = %79
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [109 x i32], ptr @z, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  br label %91

90:                                               ; preds = %79
  br label %91

91:                                               ; preds = %90, %85
  %92 = phi i32 [ %89, %85 ], [ 0, %90 ]
  %93 = load i32, ptr @ans, align 4, !tbaa !5
  %94 = add nsw i32 %93, %92
  store i32 %94, ptr @ans, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %91
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %4, align 4, !tbaa !5
  br label %74, !llvm.loop !18

98:                                               ; preds = %78
  call void @llvm.memset.p0.i64(ptr align 16 @g, i8 0, i64 11881, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %146, %98
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = load i32, ptr @n, align 4, !tbaa !5
  %102 = icmp sle i32 %100, %101
  br i1 %102, label %104, label %103

103:                                              ; preds = %99
  store i32 15, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %149

104:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [109 x ptr], ptr @lnk, i64 0, i64 %106
  %108 = load ptr, ptr %107, align 8, !tbaa !9
  store ptr %108, ptr %7, align 8, !tbaa !9
  br label %109

109:                                              ; preds = %141, %104
  %110 = load ptr, ptr %7, align 8, !tbaa !9
  %111 = icmp ne ptr %110, null
  br i1 %111, label %113, label %112

112:                                              ; preds = %109
  store i32 18, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %145

113:                                              ; preds = %109
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [109 x i32], ptr @rt, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = load ptr, ptr %7, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.Edge, ptr %118, i32 0, i32 0
  %120 = load i32, ptr %119, align 8, !tbaa !13
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [109 x i32], ptr @rt, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = icmp ne i32 %117, %123
  br i1 %124, label %125, label %140

125:                                              ; preds = %113
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [109 x i32], ptr @rt, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %130
  %132 = load ptr, ptr %7, align 8, !tbaa !9
  %133 = getelementptr inbounds %struct.Edge, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !13
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [109 x i32], ptr @rt, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [109 x i8], ptr %131, i64 0, i64 %138
  store i8 1, ptr %139, align 1, !tbaa !19
  br label %140

140:                                              ; preds = %125, %113
  br label %141

141:                                              ; preds = %140
  %142 = load ptr, ptr %7, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.Edge, ptr %142, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !15
  store ptr %144, ptr %7, align 8, !tbaa !9
  br label %109, !llvm.loop !21

145:                                              ; preds = %112
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %5, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %5, align 4, !tbaa !5
  br label %99, !llvm.loop !22

149:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %150

150:                                              ; preds = %224, %149
  %151 = load i32, ptr %8, align 4, !tbaa !5
  %152 = load i32, ptr @cnt, align 4, !tbaa !5
  %153 = icmp sle i32 %151, %152
  br i1 %153, label %155, label %154

154:                                              ; preds = %150
  store i32 21, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %227

155:                                              ; preds = %150
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 109, i1 false)
  store i32 0, ptr @r, align 4, !tbaa !5
  %156 = load i32, ptr %8, align 4, !tbaa !5
  %157 = load i32, ptr @r, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr @r, align 4, !tbaa !5
  %159 = sext i32 %157 to i64
  %160 = getelementptr inbounds [109 x i32], ptr @q, i64 0, i64 %159
  store i32 %156, ptr %160, align 4, !tbaa !5
  store i32 0, ptr @l, align 4, !tbaa !5
  br label %161

161:                                              ; preds = %220, %155
  %162 = load i32, ptr @l, align 4, !tbaa !5
  %163 = load i32, ptr @r, align 4, !tbaa !5
  %164 = icmp slt i32 %162, %163
  br i1 %164, label %165, label %223

165:                                              ; preds = %161
  %166 = load i32, ptr @l, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [109 x i32], ptr @q, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  store i32 %169, ptr @u, align 4, !tbaa !5
  store i32 1, ptr @v, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %216, %165
  %171 = load i32, ptr @v, align 4, !tbaa !5
  %172 = load i32, ptr @cnt, align 4, !tbaa !5
  %173 = icmp sle i32 %171, %172
  br i1 %173, label %174, label %219

174:                                              ; preds = %170
  %175 = load i32, ptr @u, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %176
  %178 = load i32, ptr @v, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [109 x i8], ptr %177, i64 0, i64 %179
  %181 = load i8, ptr %180, align 1, !tbaa !19, !range !23, !noundef !24
  %182 = trunc i8 %181 to i1
  br i1 %182, label %183, label %215

183:                                              ; preds = %174
  %184 = load i32, ptr @v, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [109 x i8], ptr @vis, i64 0, i64 %185
  %187 = load i8, ptr %186, align 1, !tbaa !19, !range !23, !noundef !24
  %188 = trunc i8 %187 to i1
  br i1 %188, label %189, label %206

189:                                              ; preds = %183
  %190 = load i32, ptr %8, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %191
  %193 = load i32, ptr @v, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [109 x i8], ptr %192, i64 0, i64 %194
  %196 = load i8, ptr %195, align 1, !tbaa !19, !range !23, !noundef !24
  %197 = trunc i8 %196 to i1
  br i1 %197, label %198, label %205

198:                                              ; preds = %189
  %199 = load i32, ptr %8, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %200
  %202 = load i32, ptr @v, align 4, !tbaa !5
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [109 x i8], ptr %201, i64 0, i64 %203
  store i8 0, ptr %204, align 1, !tbaa !19
  br label %205

205:                                              ; preds = %198, %189
  br label %214

206:                                              ; preds = %183
  %207 = load i32, ptr @v, align 4, !tbaa !5
  %208 = load i32, ptr @r, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr @r, align 4, !tbaa !5
  %210 = sext i32 %208 to i64
  %211 = getelementptr inbounds [109 x i32], ptr @q, i64 0, i64 %210
  store i32 %207, ptr %211, align 4, !tbaa !5
  %212 = sext i32 %207 to i64
  %213 = getelementptr inbounds [109 x i8], ptr @vis, i64 0, i64 %212
  store i8 1, ptr %213, align 1, !tbaa !19
  br label %214

214:                                              ; preds = %206, %205
  br label %215

215:                                              ; preds = %214, %174
  br label %216

216:                                              ; preds = %215
  %217 = load i32, ptr @v, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr @v, align 4, !tbaa !5
  br label %170, !llvm.loop !25

219:                                              ; preds = %170
  br label %220

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

223:                                              ; preds = %161
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %8, align 4, !tbaa !5
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %8, align 4, !tbaa !5
  br label %150, !llvm.loop !27

227:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %228

228:                                              ; preds = %255, %227
  %229 = load i32, ptr %9, align 4, !tbaa !5
  %230 = load i32, ptr @cnt, align 4, !tbaa !5
  %231 = icmp sle i32 %229, %230
  br i1 %231, label %233, label %232

232:                                              ; preds = %228
  store i32 30, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %258

233:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %234

234:                                              ; preds = %251, %233
  %235 = load i32, ptr %10, align 4, !tbaa !5
  %236 = load i32, ptr @cnt, align 4, !tbaa !5
  %237 = icmp sle i32 %235, %236
  br i1 %237, label %239, label %238

238:                                              ; preds = %234
  store i32 33, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %254

239:                                              ; preds = %234
  %240 = load i32, ptr %9, align 4, !tbaa !5
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %241
  %243 = load i32, ptr %10, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [109 x i8], ptr %242, i64 0, i64 %244
  %246 = load i8, ptr %245, align 1, !tbaa !19, !range !23, !noundef !24
  %247 = trunc i8 %246 to i1
  %248 = zext i1 %247 to i32
  %249 = load i32, ptr @ans, align 4, !tbaa !5
  %250 = add nsw i32 %249, %248
  store i32 %250, ptr @ans, align 4, !tbaa !5
  br label %251

251:                                              ; preds = %239
  %252 = load i32, ptr %10, align 4, !tbaa !5
  %253 = add nsw i32 %252, 1
  store i32 %253, ptr %10, align 4, !tbaa !5
  br label %234, !llvm.loop !28

254:                                              ; preds = %238
  br label %255

255:                                              ; preds = %254
  %256 = load i32, ptr %9, align 4, !tbaa !5
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %9, align 4, !tbaa !5
  br label %228, !llvm.loop !29

258:                                              ; preds = %232
  %259 = load i32, ptr @T, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr @T, align 4, !tbaa !5
  %261 = load i32, ptr @ans, align 4, !tbaa !5
  %262 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %260, i32 noundef %261)
  br label %11, !llvm.loop !30

263:                                              ; preds = %20, %11
  ret i32 0
}

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

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

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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: write) }
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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS4Edge", !6, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !12}
!29 = distinct !{!29, !12}
!30 = distinct !{!30, !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.Edge = type { i32, ptr }

@e = external dso_local local_unnamed_addr global ptr, align 8
@lnk = external dso_local local_unnamed_addr global [109 x ptr], align 16
@E = external dso_local global [20009 x %struct.Edge], align 16
@T = external dso_local local_unnamed_addr global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@u = external dso_local global i32, align 4
@v = external dso_local global i32, align 4
@g = external dso_local local_unnamed_addr global [109 x [109 x i8]], align 16
@l = external dso_local local_unnamed_addr global i32, align 4
@r = external dso_local local_unnamed_addr global i32, align 4
@q = external dso_local local_unnamed_addr global [109 x i32], align 16
@vis = external dso_local local_unnamed_addr global [109 x i8], align 16
@tm = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@dn = external dso_local local_unnamed_addr global [109 x i32], align 16
@lw = external dso_local local_unnamed_addr global [109 x i32], align 16
@rt = external dso_local local_unnamed_addr global [109 x i32], align 16
@z = external dso_local local_unnamed_addr global [109 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %2 = icmp eq i32 %1, 2
  br i1 %2, label %.lr.ph135, label %._crit_edge136

.lr.ph135:                                        ; preds = %0, %.preheader55.thread
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = icmp ne i32 %3, 0
  %5 = load i32, ptr @m, align 4
  %6 = icmp ne i32 %5, 0
  %or.cond = select i1 %4, i1 true, i1 %6
  br i1 %or.cond, label %7, label %._crit_edge136

7:                                                ; preds = %.lr.ph135
  store ptr @E, ptr @e, align 8, !tbaa !9
  %.not59 = icmp slt i32 %3, 1
  br i1 %.not59, label %.preheader57, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %7
  %8 = zext nneg i32 %3 to i64
  %9 = shl nuw nsw i64 %8, 3
  tail call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @lnk, i64 8), i8 0, i64 %9, i1 false), !tbaa !9
  br label %.preheader57

.preheader57:                                     ; preds = %.lr.ph.preheader, %7
  %10 = add nsw i32 %5, -1
  store i32 %10, ptr @m, align 4, !tbaa !5
  %.not4361 = icmp eq i32 %5, 0
  br i1 %.not4361, label %._crit_edge, label %.lr.ph62

.lr.ph62:                                         ; preds = %.preheader57, %.lr.ph62
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @u, ptr noundef nonnull @v)
  %12 = load i32, ptr @v, align 4, !tbaa !5
  %13 = load ptr, ptr @e, align 8, !tbaa !9
  store i32 %12, ptr %13, align 8, !tbaa !11
  %14 = load i32, ptr @u, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [109 x ptr], ptr @lnk, i64 0, i64 %15
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %13, i64 8
  store ptr %17, ptr %18, align 8, !tbaa !13
  %19 = getelementptr inbounds i8, ptr %13, i64 16
  store ptr %19, ptr @e, align 8, !tbaa !9
  store ptr %13, ptr %16, align 8, !tbaa !9
  %20 = load i32, ptr @m, align 4, !tbaa !5
  %21 = add nsw i32 %20, -1
  store i32 %21, ptr @m, align 4, !tbaa !5
  %.not43 = icmp eq i32 %20, 0
  br i1 %.not43, label %._crit_edge.loopexit, label %.lr.ph62, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %.lr.ph62
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader57
  %22 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %3, %.preheader57 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(436) @dn, i8 0, i64 436, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(436) @lw, i8 0, i64 436, i1 false)
  store i32 0, ptr @tm, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  %.not4463 = icmp slt i32 %22, 1
  br i1 %.not4463, label %.preheader56.thread, label %.lr.ph66

.preheader56.thread:                              ; preds = %._crit_edge
  store i32 0, ptr @ans, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(11881) @g, i8 0, i64 11881, i1 false)
  br label %.preheader55.thread

._crit_edge67:                                    ; preds = %40
  %.pre179 = load i32, ptr @cnt, align 4, !tbaa !5
  store i32 0, ptr @ans, align 4, !tbaa !5
  %.not4568 = icmp slt i32 %.pre179, 1
  br i1 %.not4568, label %43, label %.lr.ph71.preheader

.lr.ph71.preheader:                               ; preds = %._crit_edge67
  %23 = add nuw i32 %.pre179, 1
  %wide.trip.count = zext i32 %23 to i64
  %24 = zext nneg i32 %.pre179 to i64
  %min.iters.check209 = icmp ult i32 %.pre179, 8
  br i1 %min.iters.check209, label %.lr.ph71.preheader226, label %vector.ph210

.lr.ph71.preheader226:                            ; preds = %middle.block207, %.lr.ph71.preheader
  %indvars.iv147.ph = phi i64 [ 1, %.lr.ph71.preheader ], [ %ind.end213, %middle.block207 ]
  %.ph227 = phi i32 [ 0, %.lr.ph71.preheader ], [ %34, %middle.block207 ]
  br label %.lr.ph71

vector.ph210:                                     ; preds = %.lr.ph71.preheader
  %n.vec212 = and i64 %24, 2147483640
  %ind.end213 = or disjoint i64 %n.vec212, 1
  br label %vector.body215

vector.body215:                                   ; preds = %vector.body215, %vector.ph210
  %index216 = phi i64 [ 0, %vector.ph210 ], [ %index.next222, %vector.body215 ]
  %vec.phi217 = phi <4 x i32> [ zeroinitializer, %vector.ph210 ], [ %31, %vector.body215 ]
  %vec.phi218 = phi <4 x i32> [ zeroinitializer, %vector.ph210 ], [ %32, %vector.body215 ]
  %offset.idx219 = or disjoint i64 %index216, 1
  %25 = getelementptr inbounds [109 x i32], ptr @z, i64 0, i64 %offset.idx219
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  %wide.load220 = load <4 x i32>, ptr %25, align 4, !tbaa !5
  %wide.load221 = load <4 x i32>, ptr %26, align 4, !tbaa !5
  %27 = icmp sgt <4 x i32> %wide.load220, <i32 1, i32 1, i32 1, i32 1>
  %28 = icmp sgt <4 x i32> %wide.load221, <i32 1, i32 1, i32 1, i32 1>
  %29 = select <4 x i1> %27, <4 x i32> %wide.load220, <4 x i32> zeroinitializer
  %30 = select <4 x i1> %28, <4 x i32> %wide.load221, <4 x i32> zeroinitializer
  %31 = add <4 x i32> %29, %vec.phi217
  %32 = add <4 x i32> %30, %vec.phi218
  %index.next222 = add nuw i64 %index216, 8
  %33 = icmp eq i64 %index.next222, %n.vec212
  br i1 %33, label %middle.block207, label %vector.body215, !llvm.loop !16

middle.block207:                                  ; preds = %vector.body215
  %bin.rdx223 = add <4 x i32> %32, %31
  %34 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx223)
  %cmp.n224 = icmp eq i64 %n.vec212, %24
  br i1 %cmp.n224, label %._crit_edge72, label %.lr.ph71.preheader226

.lr.ph66:                                         ; preds = %._crit_edge, %40
  %35 = phi i32 [ %41, %40 ], [ %22, %._crit_edge ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %40 ], [ 1, %._crit_edge ]
  %36 = getelementptr inbounds [109 x i32], ptr @dn, i64 0, i64 %indvars.iv
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %.not54 = icmp eq i32 %37, 0
  br i1 %.not54, label %38, label %40

38:                                               ; preds = %.lr.ph66
  %39 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_Z3dfsi(i32 noundef %39)
  %.pre178 = load i32, ptr @n, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %.lr.ph66, %38
  %41 = phi i32 [ %35, %.lr.ph66 ], [ %.pre178, %38 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = sext i32 %41 to i64
  %.not44.not = icmp slt i64 %indvars.iv, %42
  br i1 %.not44.not, label %.lr.ph66, label %._crit_edge67, !llvm.loop !19

._crit_edge72:                                    ; preds = %.lr.ph71, %middle.block207
  %.lcssa201 = phi i32 [ %34, %middle.block207 ], [ %49, %.lr.ph71 ]
  store i32 %.lcssa201, ptr @ans, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %._crit_edge72, %._crit_edge67
  %.not4568184 = phi i1 [ %.not4568, %._crit_edge72 ], [ true, %._crit_edge67 ]
  %ans.promoted127 = phi i32 [ %.lcssa201, %._crit_edge72 ], [ 0, %._crit_edge67 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(11881) @g, i8 0, i64 11881, i1 false)
  %.not4681 = icmp slt i32 %41, 1
  br i1 %.not4681, label %.preheader56, label %.lr.ph84.preheader

.lr.ph84.preheader:                               ; preds = %43
  %44 = add nuw i32 %41, 1
  %wide.trip.count153 = zext i32 %44 to i64
  br label %.lr.ph84

.lr.ph71:                                         ; preds = %.lr.ph71.preheader226, %.lr.ph71
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.lr.ph71 ], [ %indvars.iv147.ph, %.lr.ph71.preheader226 ]
  %45 = phi i32 [ %49, %.lr.ph71 ], [ %.ph227, %.lr.ph71.preheader226 ]
  %46 = getelementptr inbounds [109 x i32], ptr @z, i64 0, i64 %indvars.iv147
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp sgt i32 %47, 1
  %spec.select = select i1 %48, i32 %47, i32 0
  %49 = add nsw i32 %spec.select, %45
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge72, label %.lr.ph71, !llvm.loop !20

.preheader56:                                     ; preds = %._crit_edge80, %43
  br i1 %.not4568184, label %.preheader55.thread, label %.lr.ph99.us.preheader

.lr.ph99.us.preheader:                            ; preds = %.preheader56
  %50 = add i32 %.pre179, 1
  %wide.trip.count166 = zext i32 %50 to i64
  br label %.lr.ph99.us

.lr.ph99.us:                                      ; preds = %.lr.ph99.us.preheader, %._crit_edge100.split.us113
  %indvars.iv163 = phi i64 [ 1, %.lr.ph99.us.preheader ], [ %indvars.iv.next164, %._crit_edge100.split.us113 ]
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(109) @vis, i8 0, i64 109, i1 false)
  %51 = trunc nuw nsw i64 %indvars.iv163 to i32
  store i32 %51, ptr @q, align 16, !tbaa !5
  br label %.lr.ph88.us

.lr.ph88.us:                                      ; preds = %.lr.ph99.us, %._crit_edge89.us
  %indvars.iv160 = phi i64 [ 0, %.lr.ph99.us ], [ %indvars.iv.next161, %._crit_edge89.us ]
  %52 = phi i32 [ 1, %.lr.ph99.us ], [ %77, %._crit_edge89.us ]
  %r.promoted9596.us = phi i32 [ 1, %.lr.ph99.us ], [ %r.promoted92.us, %._crit_edge89.us ]
  %53 = getelementptr inbounds [109 x i32], ptr @q, i64 0, i64 %indvars.iv160
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  br label %56

56:                                               ; preds = %76, %.lr.ph88.us
  %indvars.iv155 = phi i64 [ %indvars.iv.next156, %76 ], [ 1, %.lr.ph88.us ]
  %57 = phi i32 [ %77, %76 ], [ %52, %.lr.ph88.us ]
  %r.promoted93.us = phi i32 [ %r.promoted92.us, %76 ], [ %r.promoted9596.us, %.lr.ph88.us ]
  %58 = phi i32 [ %78, %76 ], [ %r.promoted9596.us, %.lr.ph88.us ]
  %59 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %55, i64 %indvars.iv155
  %60 = load i8, ptr %59, align 1, !tbaa !21, !range !23, !noundef !24
  %61 = trunc nuw i8 %60 to i1
  br i1 %61, label %62, label %76

62:                                               ; preds = %56
  %63 = getelementptr inbounds [109 x i8], ptr @vis, i64 0, i64 %indvars.iv155
  %64 = load i8, ptr %63, align 1, !tbaa !21, !range !23, !noundef !24
  %65 = trunc nuw i8 %64 to i1
  br i1 %65, label %71, label %66

66:                                               ; preds = %62
  %67 = add nsw i32 %58, 1
  %68 = sext i32 %58 to i64
  %69 = getelementptr inbounds [109 x i32], ptr @q, i64 0, i64 %68
  %70 = trunc nuw nsw i64 %indvars.iv155 to i32
  store i32 %70, ptr %69, align 4, !tbaa !5
  store i8 1, ptr %63, align 1, !tbaa !21
  br label %76

71:                                               ; preds = %62
  %72 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %indvars.iv163, i64 %indvars.iv155
  %73 = load i8, ptr %72, align 1, !tbaa !21, !range !23, !noundef !24
  %74 = trunc nuw i8 %73 to i1
  br i1 %74, label %75, label %76

75:                                               ; preds = %71
  store i8 0, ptr %72, align 1, !tbaa !21
  br label %76

76:                                               ; preds = %75, %71, %66, %56
  %77 = phi i32 [ %57, %56 ], [ %57, %71 ], [ %57, %75 ], [ %67, %66 ]
  %r.promoted92.us = phi i32 [ %r.promoted93.us, %56 ], [ %r.promoted93.us, %71 ], [ %r.promoted93.us, %75 ], [ %67, %66 ]
  %78 = phi i32 [ %58, %56 ], [ %58, %71 ], [ %58, %75 ], [ %67, %66 ]
  %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
  %exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count166
  br i1 %exitcond159.not, label %._crit_edge89.us, label %56, !llvm.loop !25

._crit_edge89.us:                                 ; preds = %76
  %indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
  %79 = sext i32 %r.promoted92.us to i64
  %80 = icmp slt i64 %indvars.iv.next161, %79
  br i1 %80, label %.lr.ph88.us, label %._crit_edge100.split.us113, !llvm.loop !26

._crit_edge100.split.us113:                       ; preds = %._crit_edge89.us
  %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
  %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166
  br i1 %exitcond167.not, label %.preheader55, label %.lr.ph99.us, !llvm.loop !27

.lr.ph84:                                         ; preds = %.lr.ph84.preheader, %._crit_edge80
  %indvars.iv150 = phi i64 [ 1, %.lr.ph84.preheader ], [ %indvars.iv.next151, %._crit_edge80 ]
  %81 = getelementptr inbounds [109 x ptr], ptr @lnk, i64 0, i64 %indvars.iv150
  %.03375 = load ptr, ptr %81, align 8, !tbaa !9
  %.not5276 = icmp eq ptr %.03375, null
  br i1 %.not5276, label %._crit_edge80, label %.lr.ph79

.lr.ph79:                                         ; preds = %.lr.ph84
  %82 = getelementptr inbounds [109 x i32], ptr @rt, i64 0, i64 %indvars.iv150
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  br label %85

._crit_edge80:                                    ; preds = %93, %.lr.ph84
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153
  br i1 %exitcond154.not, label %.preheader56, label %.lr.ph84, !llvm.loop !28

85:                                               ; preds = %.lr.ph79, %93
  %.03377 = phi ptr [ %.03375, %.lr.ph79 ], [ %.033, %93 ]
  %86 = load i32, ptr %.03377, align 8, !tbaa !11
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [109 x i32], ptr @rt, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %.not53 = icmp eq i32 %83, %89
  br i1 %.not53, label %93, label %90

90:                                               ; preds = %85
  %91 = sext i32 %89 to i64
  %92 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %84, i64 %91
  store i8 1, ptr %92, align 1, !tbaa !21
  br label %93

93:                                               ; preds = %85, %90
  %94 = getelementptr inbounds i8, ptr %.03377, i64 8
  %.033 = load ptr, ptr %94, align 8, !tbaa !9
  %.not52 = icmp eq ptr %.033, null
  br i1 %.not52, label %._crit_edge80, label %85, !llvm.loop !29

.preheader55:                                     ; preds = %._crit_edge100.split.us113
  %95 = trunc nuw nsw i64 %indvars.iv.next161 to i32
  store i32 %54, ptr @u, align 4, !tbaa !5
  store i32 %50, ptr @v, align 4, !tbaa !5
  store i32 %77, ptr @r, align 4, !tbaa !5
  store i32 %95, ptr @l, align 4, !tbaa !5
  br i1 %.not4568184, label %.preheader55.thread, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader55
  %96 = add nuw i32 %.pre179, 1
  %wide.trip.count176 = zext i32 %96 to i64
  %97 = add nsw i64 %wide.trip.count166, -1
  %min.iters.check = icmp ult i64 %97, 8
  %n.vec = and i64 %97, -8
  %ind.end = or disjoint i64 %n.vec, 1
  %cmp.n = icmp eq i64 %97, %n.vec
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge125
  %indvars.iv173 = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next174, %._crit_edge125 ]
  %.lcssa126129131 = phi i32 [ %ans.promoted127, %.preheader.preheader ], [ %.lcssa204, %._crit_edge125 ]
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.preheader
  %indvars.iv168.ph = phi i64 [ 1, %.preheader ], [ %ind.end, %middle.block ]
  %.ph = phi i32 [ %.lcssa126129131, %.preheader ], [ %106, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.preheader
  %98 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.lcssa126129131, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %98, %vector.ph ], [ %103, %vector.body ]
  %vec.phi205 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %104, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %99 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %indvars.iv173, i64 %offset.idx
  %100 = getelementptr inbounds i8, ptr %99, i64 4
  %wide.load = load <4 x i8>, ptr %99, align 1, !tbaa !21
  %wide.load206 = load <4 x i8>, ptr %100, align 1, !tbaa !21
  %101 = zext <4 x i8> %wide.load to <4 x i32>
  %102 = zext <4 x i8> %wide.load206 to <4 x i32>
  %103 = add <4 x i32> %vec.phi, %101
  %104 = add <4 x i32> %vec.phi205, %102
  %index.next = add nuw i64 %index, 8
  %105 = icmp eq i64 %index.next, %n.vec
  br i1 %105, label %middle.block, label %vector.body, !llvm.loop !30

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %104, %103
  %106 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  br i1 %cmp.n, label %._crit_edge125, label %scalar.ph.preheader

._crit_edge133.split:                             ; preds = %._crit_edge125
  store i32 %.lcssa204, ptr @ans, align 4, !tbaa !5
  br label %.preheader55.thread

.preheader55.thread:                              ; preds = %.preheader56, %.preheader56.thread, %._crit_edge133.split, %.preheader55
  %107 = phi i32 [ %.lcssa204, %._crit_edge133.split ], [ %ans.promoted127, %.preheader55 ], [ %ans.promoted127, %.preheader56 ], [ 0, %.preheader56.thread ]
  %108 = load i32, ptr @T, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr @T, align 4, !tbaa !5
  %110 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %109, i32 noundef %107)
  %111 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %112 = icmp eq i32 %111, 2
  br i1 %112, label %.lr.ph135, label %._crit_edge136, !llvm.loop !31

._crit_edge125:                                   ; preds = %scalar.ph, %middle.block
  %.lcssa204 = phi i32 [ %106, %middle.block ], [ %117, %scalar.ph ]
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %exitcond177.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count176
  br i1 %exitcond177.not, label %._crit_edge133.split, label %.preheader, !llvm.loop !32

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv168 = phi i64 [ %indvars.iv.next169, %scalar.ph ], [ %indvars.iv168.ph, %scalar.ph.preheader ]
  %113 = phi i32 [ %117, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %114 = getelementptr inbounds [109 x [109 x i8]], ptr @g, i64 0, i64 %indvars.iv173, i64 %indvars.iv168
  %115 = load i8, ptr %114, align 1, !tbaa !21, !range !23, !noundef !24
  %116 = zext nneg i8 %115 to i32
  %117 = add nsw i32 %113, %116
  %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
  %exitcond172.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count176
  br i1 %exitcond172.not, label %._crit_edge125, label %scalar.ph, !llvm.loop !33

._crit_edge136:                                   ; preds = %.preheader55.thread, %.lr.ph135, %0
  ret i32 0
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

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

!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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS4Edge", !6, i64 0, !10, i64 8}
!13 = !{!12, !10, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15, !18, !17}
!21 = !{!22, !22, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}
!27 = distinct !{!27, !15}
!28 = distinct !{!28, !15}
!29 = distinct !{!29, !15}
!30 = distinct !{!30, !15, !17, !18}
!31 = distinct !{!31, !15}
!32 = distinct !{!32, !15}
!33 = distinct !{!33, !15, !18, !17}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass