; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-11-01 (C - locker - dby)

; 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.Info = type { i16, i16, i16, i16 }

@n = external dso_local global i32, align 4
@f = external dso_local global [1005 x [10 x [10 x [10 x i16]]]], align 16
@s = external dso_local global [1005 x i8], align 16
@t = external dso_local global [1005 x i8], align 16
@q = external dso_local global [1005000 x %struct.Info], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i64, i32 noundef, i32 noundef) #0

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

23:                                               ; preds = %378, %376, %0
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @s, ptr noundef @t)
  %25 = icmp ne i32 %24, -1
  br i1 %25, label %26, label %379

26:                                               ; preds = %23
  %27 = call i64 @strlen(ptr noundef @t) #7
  %28 = trunc i64 %27 to i32
  store i32 %28, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %30
  store i8 48, ptr %31, align 1, !tbaa !9
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1005 x i8], ptr @t, i64 0, i64 %33
  store i8 49, ptr %34, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %35 = load i32, ptr @n, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %10, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %50, %26
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = add nsw i32 %39, 3
  %41 = icmp slt i32 %38, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %53

43:                                               ; preds = %37
  %44 = load i32, ptr %10, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [1005 x i8], ptr @t, i64 0, i64 %45
  store i8 48, ptr %46, align 1, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %48
  store i8 48, ptr %49, align 1, !tbaa !9
  br label %50

50:                                               ; preds = %43
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %10, align 4, !tbaa !5
  br label %37, !llvm.loop !10

53:                                               ; preds = %42
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = add nsw i32 %54, 3
  store i32 %55, ptr @n, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %101, %53
  %57 = load i32, ptr %11, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %61, label %60

60:                                               ; preds = %56
  store i32 7, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %104

61:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %97, %61
  %63 = load i32, ptr %13, align 4, !tbaa !5
  %64 = icmp slt i32 %63, 10
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  store i32 10, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %100

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %93, %66
  %68 = load i32, ptr %14, align 4, !tbaa !5
  %69 = icmp slt i32 %68, 10
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  store i32 13, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %96

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %89, %71
  %73 = load i32, ptr %15, align 4, !tbaa !5
  %74 = icmp slt i32 %73, 10
  br i1 %74, label %76, label %75

75:                                               ; preds = %72
  store i32 16, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %92

76:                                               ; preds = %72
  %77 = load i32, ptr %11, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %78
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %79, i64 0, i64 %81
  %83 = load i32, ptr %14, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [10 x [10 x i16]], ptr %82, i64 0, i64 %84
  %86 = load i32, ptr %15, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [10 x i16], ptr %85, i64 0, i64 %87
  store i16 -1, ptr %88, align 2, !tbaa !12
  br label %89

89:                                               ; preds = %76
  %90 = load i32, ptr %15, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %15, align 4, !tbaa !5
  br label %72, !llvm.loop !14

92:                                               ; preds = %75
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %14, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %14, align 4, !tbaa !5
  br label %67, !llvm.loop !15

96:                                               ; preds = %70
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %13, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %13, align 4, !tbaa !5
  br label %62, !llvm.loop !16

100:                                              ; preds = %65
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %11, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %11, align 4, !tbaa !5
  br label %56, !llvm.loop !17

104:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %117, %104
  %106 = load i32, ptr %16, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !9
  %110 = sext i8 %109 to i32
  %111 = load i32, ptr %16, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [1005 x i8], ptr @t, i64 0, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !9
  %115 = sext i8 %114 to i32
  %116 = icmp eq i32 %110, %115
  br i1 %116, label %117, label %120

117:                                              ; preds = %105
  %118 = load i32, ptr %16, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %16, align 4, !tbaa !5
  br label %105, !llvm.loop !18

120:                                              ; preds = %105
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = sub nsw i32 %121, 3
  %123 = load i32, ptr %16, align 4, !tbaa !5
  %124 = icmp eq i32 %122, %123
  br i1 %124, label %125, label %127

125:                                              ; preds = %120
  %126 = call i32 @puts(ptr noundef @.str.1)
  store i32 2, ptr %12, align 4
  br label %376, !llvm.loop !19

127:                                              ; preds = %120
  %128 = load i32, ptr %16, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %129
  %131 = load i32, ptr %16, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %132
  %134 = load i8, ptr %133, align 1, !tbaa !9
  %135 = sext i8 %134 to i32
  %136 = sub nsw i32 %135, 48
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %130, i64 0, i64 %137
  %139 = load i32, ptr %16, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %141
  %143 = load i8, ptr %142, align 1, !tbaa !9
  %144 = sext i8 %143 to i32
  %145 = sub nsw i32 %144, 48
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [10 x [10 x i16]], ptr %138, i64 0, i64 %146
  %148 = load i32, ptr %16, align 4, !tbaa !5
  %149 = add nsw i32 %148, 2
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %150
  %152 = load i8, ptr %151, align 1, !tbaa !9
  %153 = sext i8 %152 to i32
  %154 = sub nsw i32 %153, 48
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [10 x i16], ptr %147, i64 0, i64 %155
  store i16 0, ptr %156, align 2, !tbaa !12
  %157 = load i32, ptr %3, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %3, align 4, !tbaa !5
  %159 = sext i32 %157 to i64
  %160 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %159
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = load i32, ptr %16, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %163
  %165 = load i8, ptr %164, align 1, !tbaa !9
  %166 = sext i8 %165 to i32
  %167 = sub nsw i32 %166, 48
  %168 = load i32, ptr %16, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %170
  %172 = load i8, ptr %171, align 1, !tbaa !9
  %173 = sext i8 %172 to i32
  %174 = sub nsw i32 %173, 48
  %175 = load i32, ptr %16, align 4, !tbaa !5
  %176 = add nsw i32 %175, 2
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %177
  %179 = load i8, ptr %178, align 1, !tbaa !9
  %180 = sext i8 %179 to i32
  %181 = sub nsw i32 %180, 48
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %160, i32 noundef %161, i32 noundef %167, i32 noundef %174, i32 noundef %181)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %182 = load i32, ptr @n, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 3
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %184
  %186 = load i8, ptr %185, align 1, !tbaa !9
  %187 = sext i8 %186 to i32
  %188 = sub nsw i32 %187, 48
  store i32 %188, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %189 = load i32, ptr @n, align 4, !tbaa !5
  %190 = sub nsw i32 %189, 2
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %191
  %193 = load i8, ptr %192, align 1, !tbaa !9
  %194 = sext i8 %193 to i32
  %195 = sub nsw i32 %194, 48
  store i32 %195, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %196 = load i32, ptr @n, align 4, !tbaa !5
  %197 = sub nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %198
  %200 = load i8, ptr %199, align 1, !tbaa !9
  %201 = sext i8 %200 to i32
  %202 = sub nsw i32 %201, 48
  store i32 %202, ptr %19, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %374, %127
  %204 = load i32, ptr %2, align 4, !tbaa !5
  %205 = load i32, ptr %3, align 4, !tbaa !5
  %206 = icmp ne i32 %204, %205
  br i1 %206, label %207, label %375

207:                                              ; preds = %203
  %208 = load i32, ptr %2, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  store i32 %209, ptr %2, align 4, !tbaa !5
  %210 = sext i32 %208 to i64
  %211 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %210
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %9, ptr align 8 %211, i64 8, i1 false), !tbaa.struct !20
  %212 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 0
  %213 = load i16, ptr %212, align 2, !tbaa !21
  %214 = sext i16 %213 to i64
  %215 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %214
  %216 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 1
  %217 = load i16, ptr %216, align 2, !tbaa !23
  %218 = sext i16 %217 to i64
  %219 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %215, i64 0, i64 %218
  %220 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 2
  %221 = load i16, ptr %220, align 2, !tbaa !24
  %222 = sext i16 %221 to i64
  %223 = getelementptr inbounds [10 x [10 x i16]], ptr %219, i64 0, i64 %222
  %224 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 3
  %225 = load i16, ptr %224, align 2, !tbaa !25
  %226 = sext i16 %225 to i64
  %227 = getelementptr inbounds [10 x i16], ptr %223, i64 0, i64 %226
  %228 = load i16, ptr %227, align 2, !tbaa !12
  %229 = sext i16 %228 to i32
  store i32 %229, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 2, ptr %20, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %337, %207
  %231 = load i32, ptr %20, align 4, !tbaa !5
  %232 = icmp sge i32 %231, 0
  br i1 %232, label %234, label %233

233:                                              ; preds = %230
  store i32 23, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %340

234:                                              ; preds = %230
  %235 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 1
  %236 = load i16, ptr %235, align 2, !tbaa !23
  %237 = sext i16 %236 to i32
  store i32 %237, ptr %6, align 4, !tbaa !5
  %238 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 2
  %239 = load i16, ptr %238, align 2, !tbaa !24
  %240 = sext i16 %239 to i32
  store i32 %240, ptr %7, align 4, !tbaa !5
  %241 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 3
  %242 = load i16, ptr %241, align 2, !tbaa !25
  %243 = sext i16 %242 to i32
  store i32 %243, ptr %8, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %21, ptr align 2 %9, i64 8, i1 false), !tbaa.struct !20
  %244 = load i32, ptr %20, align 4, !tbaa !5
  %245 = load i64, ptr %21, align 2
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %5, i64 %245, i32 noundef 1, i32 noundef %244)
  %246 = load i32, ptr %5, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %247
  %249 = load i32, ptr %6, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %248, i64 0, i64 %250
  %252 = load i32, ptr %7, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [10 x [10 x i16]], ptr %251, i64 0, i64 %253
  %255 = load i32, ptr %8, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [10 x i16], ptr %254, i64 0, i64 %256
  %258 = load i16, ptr %257, align 2, !tbaa !12
  %259 = sext i16 %258 to i32
  %260 = icmp eq i32 %259, -1
  br i1 %260, label %261, label %285

261:                                              ; preds = %234
  %262 = load i32, ptr %4, align 4, !tbaa !5
  %263 = add nsw i32 %262, 1
  %264 = trunc i32 %263 to i16
  %265 = load i32, ptr %5, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %266
  %268 = load i32, ptr %6, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %267, i64 0, i64 %269
  %271 = load i32, ptr %7, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [10 x [10 x i16]], ptr %270, i64 0, i64 %272
  %274 = load i32, ptr %8, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [10 x i16], ptr %273, i64 0, i64 %275
  store i16 %264, ptr %276, align 2, !tbaa !12
  %277 = load i32, ptr %3, align 4, !tbaa !5
  %278 = add nsw i32 %277, 1
  store i32 %278, ptr %3, align 4, !tbaa !5
  %279 = sext i32 %277 to i64
  %280 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %279
  %281 = load i32, ptr %5, align 4, !tbaa !5
  %282 = load i32, ptr %6, align 4, !tbaa !5
  %283 = load i32, ptr %7, align 4, !tbaa !5
  %284 = load i32, ptr %8, align 4, !tbaa !5
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %280, i32 noundef %281, i32 noundef %282, i32 noundef %283, i32 noundef %284)
  br label %285

285:                                              ; preds = %261, %234
  %286 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 1
  %287 = load i16, ptr %286, align 2, !tbaa !23
  %288 = sext i16 %287 to i32
  store i32 %288, ptr %6, align 4, !tbaa !5
  %289 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 2
  %290 = load i16, ptr %289, align 2, !tbaa !24
  %291 = sext i16 %290 to i32
  store i32 %291, ptr %7, align 4, !tbaa !5
  %292 = getelementptr inbounds %struct.Info, ptr %9, i32 0, i32 3
  %293 = load i16, ptr %292, align 2, !tbaa !25
  %294 = sext i16 %293 to i32
  store i32 %294, ptr %8, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %22, ptr align 2 %9, i64 8, i1 false), !tbaa.struct !20
  %295 = load i32, ptr %20, align 4, !tbaa !5
  %296 = load i64, ptr %22, align 2
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %5, i64 %296, i32 noundef -1, i32 noundef %295)
  %297 = load i32, ptr %5, align 4, !tbaa !5
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %298
  %300 = load i32, ptr %6, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %299, i64 0, i64 %301
  %303 = load i32, ptr %7, align 4, !tbaa !5
  %304 = sext i32 %303 to i64
  %305 = getelementptr inbounds [10 x [10 x i16]], ptr %302, i64 0, i64 %304
  %306 = load i32, ptr %8, align 4, !tbaa !5
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [10 x i16], ptr %305, i64 0, i64 %307
  %309 = load i16, ptr %308, align 2, !tbaa !12
  %310 = sext i16 %309 to i32
  %311 = icmp eq i32 %310, -1
  br i1 %311, label %312, label %336

312:                                              ; preds = %285
  %313 = load i32, ptr %4, align 4, !tbaa !5
  %314 = add nsw i32 %313, 1
  %315 = trunc i32 %314 to i16
  %316 = load i32, ptr %5, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %317
  %319 = load i32, ptr %6, align 4, !tbaa !5
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %318, i64 0, i64 %320
  %322 = load i32, ptr %7, align 4, !tbaa !5
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [10 x [10 x i16]], ptr %321, i64 0, i64 %323
  %325 = load i32, ptr %8, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [10 x i16], ptr %324, i64 0, i64 %326
  store i16 %315, ptr %327, align 2, !tbaa !12
  %328 = load i32, ptr %3, align 4, !tbaa !5
  %329 = add nsw i32 %328, 1
  store i32 %329, ptr %3, align 4, !tbaa !5
  %330 = sext i32 %328 to i64
  %331 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %330
  %332 = load i32, ptr %5, align 4, !tbaa !5
  %333 = load i32, ptr %6, align 4, !tbaa !5
  %334 = load i32, ptr %7, align 4, !tbaa !5
  %335 = load i32, ptr %8, align 4, !tbaa !5
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %331, i32 noundef %332, i32 noundef %333, i32 noundef %334, i32 noundef %335)
  br label %336

336:                                              ; preds = %312, %285
  br label %337

337:                                              ; preds = %336
  %338 = load i32, ptr %20, align 4, !tbaa !5
  %339 = add nsw i32 %338, -1
  store i32 %339, ptr %20, align 4, !tbaa !5
  br label %230, !llvm.loop !26

340:                                              ; preds = %233
  %341 = load i32, ptr @n, align 4, !tbaa !5
  %342 = sub nsw i32 %341, 3
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %343
  %345 = load i32, ptr %17, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %344, i64 0, i64 %346
  %348 = load i32, ptr %18, align 4, !tbaa !5
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [10 x [10 x i16]], ptr %347, i64 0, i64 %349
  %351 = load i32, ptr %19, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [10 x i16], ptr %350, i64 0, i64 %352
  %354 = load i16, ptr %353, align 2, !tbaa !12
  %355 = sext i16 %354 to i32
  %356 = icmp ne i32 %355, -1
  br i1 %356, label %357, label %374

357:                                              ; preds = %340
  %358 = load i32, ptr @n, align 4, !tbaa !5
  %359 = sub nsw i32 %358, 3
  %360 = sext i32 %359 to i64
  %361 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %360
  %362 = load i32, ptr %17, align 4, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [10 x [10 x [10 x i16]]], ptr %361, i64 0, i64 %363
  %365 = load i32, ptr %18, align 4, !tbaa !5
  %366 = sext i32 %365 to i64
  %367 = getelementptr inbounds [10 x [10 x i16]], ptr %364, i64 0, i64 %366
  %368 = load i32, ptr %19, align 4, !tbaa !5
  %369 = sext i32 %368 to i64
  %370 = getelementptr inbounds [10 x i16], ptr %367, i64 0, i64 %369
  %371 = load i16, ptr %370, align 2, !tbaa !12
  %372 = sext i16 %371 to i32
  %373 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %372)
  br label %375

374:                                              ; preds = %340
  br label %203, !llvm.loop !27

375:                                              ; preds = %357, %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  store i32 0, ptr %12, align 4
  br label %376

376:                                              ; preds = %375, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %377 = load i32, ptr %12, align 4
  switch i32 %377, label %380 [
    i32 0, label %378
    i32 2, label %23
  ]

378:                                              ; preds = %376
  br label %23, !llvm.loop !19

379:                                              ; preds = %23
  ret i32 0

380:                                              ; preds = %376
  unreachable
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

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

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

declare i32 @puts(ptr noundef) #2

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

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

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

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


; 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.Info = type { i16, i16, i16, i16 }

@n = external dso_local local_unnamed_addr global i32, align 4
@f = external dso_local local_unnamed_addr global [1005 x [10 x [10 x [10 x i16]]]], align 16
@s = external dso_local global [1005 x i8], align 16
@t = external dso_local global [1005 x i8], align 16
@q = external dso_local global [1005000 x %struct.Info], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i64, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s, ptr noundef nonnull @t)
  %.not99 = icmp eq i32 %5, -1
  br i1 %.not99, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.loopexit
  %6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @t) #8
  %7 = trunc i64 %6 to i32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %sext = shl i64 %6, 32
  %8 = ashr exact i64 %sext, 32
  %9 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %8
  store i8 48, ptr %9, align 1, !tbaa !5
  %10 = getelementptr inbounds [1005 x i8], ptr @t, i64 0, i64 %8
  store i8 49, ptr %10, align 1, !tbaa !5
  %11 = add nsw i32 %7, 3
  %.07190 = shl i64 %6, 32
  %sext121 = add i64 %.07190, 4294967296
  %12 = ashr exact i64 %sext121, 32
  %scevgep = getelementptr i8, ptr @t, i64 %12
  %13 = add i32 %7, 2
  %smax = call i32 @llvm.smax.i32(i32 %11, i32 %13)
  %14 = add nsw i32 %smax, -2
  %15 = sub i32 %14, %7
  %16 = zext i32 %15 to i64
  %17 = add nuw nsw i64 %16, 1
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 48, i64 %17, i1 false), !tbaa !5
  %scevgep102 = getelementptr i8, ptr @s, i64 %12
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep102, i8 48, i64 %17, i1 false), !tbaa !5
  store i32 %11, ptr @n, align 4, !tbaa !8
  %18 = icmp sgt i32 %7, -3
  br i1 %18, label %.preheader84.preheader, label %.preheader85.preheader

.preheader84.preheader:                           ; preds = %.lr.ph
  %19 = zext nneg i32 %11 to i64
  %20 = mul nuw nsw i64 %19, 2000
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @f, i8 -1, i64 %20, i1 false), !tbaa !10
  br label %.preheader85.preheader

.preheader85.preheader:                           ; preds = %.preheader84.preheader, %.lr.ph
  br label %.preheader85

.preheader85:                                     ; preds = %.preheader85.preheader, %.preheader85
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader85 ], [ 0, %.preheader85.preheader ]
  %21 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %indvars.iv
  %22 = load i8, ptr %21, align 1, !tbaa !5
  %23 = getelementptr inbounds [1005 x i8], ptr @t, i64 0, i64 %indvars.iv
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %25 = icmp eq i8 %22, %24
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %25, label %.preheader85, label %26, !llvm.loop !12

26:                                               ; preds = %.preheader85
  %27 = trunc nuw nsw i64 %indvars.iv to i32
  %28 = icmp eq i32 %27, %7
  br i1 %28, label %29, label %31

29:                                               ; preds = %26
  %30 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.loopexit, !llvm.loop !14

31:                                               ; preds = %26
  %32 = sext i8 %22 to i64
  %33 = add nsw i64 %32, -48
  %34 = add nuw i64 %indvars.iv, 1
  %35 = and i64 %34, 4294967295
  %36 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !5
  %38 = sext i8 %37 to i64
  %39 = add nsw i64 %38, -48
  %40 = add nuw i64 %indvars.iv, 2
  %41 = and i64 %40, 4294967295
  %42 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !5
  %44 = sext i8 %43 to i64
  %45 = add nsw i64 %44, -48
  %46 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %indvars.iv, i64 %33, i64 %39, i64 %45
  store i16 0, ptr %46, align 2, !tbaa !10
  %47 = sext i8 %22 to i32
  %48 = add nsw i32 %47, -48
  %49 = sext i8 %37 to i32
  %50 = add nsw i32 %49, -48
  %51 = sext i8 %43 to i32
  %52 = add nsw i32 %51, -48
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) @q, i32 noundef %27, i32 noundef %48, i32 noundef %50, i32 noundef %52)
  %53 = load i32, ptr @n, align 4, !tbaa !8
  %54 = add nsw i32 %53, -3
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !5
  %58 = sext i8 %57 to i64
  %59 = add nsw i64 %58, -48
  %60 = add nsw i32 %53, -2
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !5
  %64 = sext i8 %63 to i64
  %65 = add nsw i64 %64, -48
  %66 = add nsw i32 %53, -1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [1005 x i8], ptr @s, i64 0, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !5
  %70 = sext i8 %69 to i64
  %71 = add nsw i64 %70, -48
  br label %72

72:                                               ; preds = %181, %31
  %indvars.iv118 = phi i64 [ %indvars.iv.next119, %181 ], [ 0, %31 ]
  %.069 = phi i32 [ %.3.2, %181 ], [ 1, %31 ]
  %73 = zext i32 %.069 to i64
  %.not80 = icmp eq i64 %indvars.iv118, %73
  br i1 %.not80, label %.loopexit, label %74

74:                                               ; preds = %72
  %75 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %indvars.iv118
  %.sroa.039.0.copyload = load i16, ptr %75, align 8, !tbaa !10
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %75, i64 2
  %.sroa.6.0.copyload = load i16, ptr %.sroa.6.0..sroa_idx, align 2, !tbaa !10
  %.sroa.9.0..sroa_idx = getelementptr inbounds i8, ptr %75, i64 4
  %.sroa.9.0.copyload = load i16, ptr %.sroa.9.0..sroa_idx, align 4, !tbaa !10
  %.sroa.12.0..sroa_idx = getelementptr inbounds i8, ptr %75, i64 6
  %.sroa.12.0.copyload = load i16, ptr %.sroa.12.0..sroa_idx, align 2, !tbaa !10
  %76 = sext i16 %.sroa.039.0.copyload to i64
  %77 = sext i16 %.sroa.6.0.copyload to i64
  %78 = sext i16 %.sroa.9.0.copyload to i64
  %79 = sext i16 %.sroa.12.0.copyload to i64
  %80 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %76, i64 %77, i64 %78, i64 %79
  %81 = load i16, ptr %80, align 2, !tbaa !10
  %82 = sext i16 %.sroa.6.0.copyload to i32
  %83 = sext i16 %.sroa.9.0.copyload to i32
  %84 = sext i16 %.sroa.12.0.copyload to i32
  %.sroa.12.0.insert.ext55 = zext i16 %.sroa.12.0.copyload to i64
  %.sroa.12.0.insert.shift56 = shl nuw i64 %.sroa.12.0.insert.ext55, 48
  %.sroa.9.0.insert.ext49 = zext i16 %.sroa.9.0.copyload to i64
  %.sroa.9.0.insert.shift50 = shl nuw nsw i64 %.sroa.9.0.insert.ext49, 32
  %.sroa.6.0.insert.ext43 = zext i16 %.sroa.6.0.copyload to i64
  %.sroa.6.0.insert.shift44 = shl nuw nsw i64 %.sroa.6.0.insert.ext43, 16
  %.sroa.039.0.insert.ext40 = zext i16 %.sroa.039.0.copyload to i64
  %.sroa.9.0.insert.insert52 = or disjoint i64 %.sroa.6.0.insert.shift44, %.sroa.039.0.insert.ext40
  %.sroa.6.0.insert.insert46 = or disjoint i64 %.sroa.9.0.insert.insert52, %.sroa.9.0.insert.shift50
  %.sroa.039.0.insert.insert42 = or disjoint i64 %.sroa.6.0.insert.insert46, %.sroa.12.0.insert.shift56
  %85 = add i16 %81, 1
  store i32 %82, ptr %2, align 4, !tbaa !8
  store i32 %83, ptr %3, align 4, !tbaa !8
  store i32 %84, ptr %4, align 4, !tbaa !8
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %1, i64 %.sroa.039.0.insert.insert42, i32 noundef 1, i32 noundef 2)
  %86 = load i32, ptr %1, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = load i32, ptr %2, align 4, !tbaa !8
  %89 = sext i32 %88 to i64
  %90 = load i32, ptr %3, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = load i32, ptr %4, align 4, !tbaa !8
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %87, i64 %89, i64 %91, i64 %93
  %95 = load i16, ptr %94, align 2, !tbaa !10
  %96 = icmp eq i16 %95, -1
  br i1 %96, label %97, label %101

97:                                               ; preds = %74
  store i16 %85, ptr %94, align 2, !tbaa !10
  %98 = add nsw i32 %.069, 1
  %99 = sext i32 %.069 to i64
  %100 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %99
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %100, i32 noundef %86, i32 noundef %88, i32 noundef %90, i32 noundef %92)
  br label %101

101:                                              ; preds = %97, %74
  %.2 = phi i32 [ %98, %97 ], [ %.069, %74 ]
  store i32 %82, ptr %2, align 4, !tbaa !8
  store i32 %83, ptr %3, align 4, !tbaa !8
  store i32 %84, ptr %4, align 4, !tbaa !8
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %1, i64 %.sroa.039.0.insert.insert42, i32 noundef -1, i32 noundef 2)
  %102 = load i32, ptr %1, align 4, !tbaa !8
  %103 = sext i32 %102 to i64
  %104 = load i32, ptr %2, align 4, !tbaa !8
  %105 = sext i32 %104 to i64
  %106 = load i32, ptr %3, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = load i32, ptr %4, align 4, !tbaa !8
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %103, i64 %105, i64 %107, i64 %109
  %111 = load i16, ptr %110, align 2, !tbaa !10
  %112 = icmp eq i16 %111, -1
  br i1 %112, label %113, label %117

113:                                              ; preds = %101
  store i16 %85, ptr %110, align 2, !tbaa !10
  %114 = add nsw i32 %.2, 1
  %115 = sext i32 %.2 to i64
  %116 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %115
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %116, i32 noundef %102, i32 noundef %104, i32 noundef %106, i32 noundef %108)
  br label %117

117:                                              ; preds = %101, %113
  %.3 = phi i32 [ %114, %113 ], [ %.2, %101 ]
  store i32 %82, ptr %2, align 4, !tbaa !8
  store i32 %83, ptr %3, align 4, !tbaa !8
  store i32 %84, ptr %4, align 4, !tbaa !8
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %1, i64 %.sroa.039.0.insert.insert42, i32 noundef 1, i32 noundef 1)
  %118 = load i32, ptr %1, align 4, !tbaa !8
  %119 = sext i32 %118 to i64
  %120 = load i32, ptr %2, align 4, !tbaa !8
  %121 = sext i32 %120 to i64
  %122 = load i32, ptr %3, align 4, !tbaa !8
  %123 = sext i32 %122 to i64
  %124 = load i32, ptr %4, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %119, i64 %121, i64 %123, i64 %125
  %127 = load i16, ptr %126, align 2, !tbaa !10
  %128 = icmp eq i16 %127, -1
  br i1 %128, label %129, label %133

129:                                              ; preds = %117
  store i16 %85, ptr %126, align 2, !tbaa !10
  %130 = add nsw i32 %.3, 1
  %131 = sext i32 %.3 to i64
  %132 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %131
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %132, i32 noundef %118, i32 noundef %120, i32 noundef %122, i32 noundef %124)
  br label %133

133:                                              ; preds = %129, %117
  %.2.1 = phi i32 [ %130, %129 ], [ %.3, %117 ]
  store i32 %82, ptr %2, align 4, !tbaa !8
  store i32 %83, ptr %3, align 4, !tbaa !8
  store i32 %84, ptr %4, align 4, !tbaa !8
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %1, i64 %.sroa.039.0.insert.insert42, i32 noundef -1, i32 noundef 1)
  %134 = load i32, ptr %1, align 4, !tbaa !8
  %135 = sext i32 %134 to i64
  %136 = load i32, ptr %2, align 4, !tbaa !8
  %137 = sext i32 %136 to i64
  %138 = load i32, ptr %3, align 4, !tbaa !8
  %139 = sext i32 %138 to i64
  %140 = load i32, ptr %4, align 4, !tbaa !8
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %135, i64 %137, i64 %139, i64 %141
  %143 = load i16, ptr %142, align 2, !tbaa !10
  %144 = icmp eq i16 %143, -1
  br i1 %144, label %145, label %149

145:                                              ; preds = %133
  store i16 %85, ptr %142, align 2, !tbaa !10
  %146 = add nsw i32 %.2.1, 1
  %147 = sext i32 %.2.1 to i64
  %148 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %147
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %148, i32 noundef %134, i32 noundef %136, i32 noundef %138, i32 noundef %140)
  br label %149

149:                                              ; preds = %145, %133
  %.3.1 = phi i32 [ %146, %145 ], [ %.2.1, %133 ]
  store i32 %82, ptr %2, align 4, !tbaa !8
  store i32 %83, ptr %3, align 4, !tbaa !8
  store i32 %84, ptr %4, align 4, !tbaa !8
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %1, i64 %.sroa.039.0.insert.insert42, i32 noundef 1, i32 noundef 0)
  %150 = load i32, ptr %1, align 4, !tbaa !8
  %151 = sext i32 %150 to i64
  %152 = load i32, ptr %2, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = load i32, ptr %3, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = load i32, ptr %4, align 4, !tbaa !8
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %151, i64 %153, i64 %155, i64 %157
  %159 = load i16, ptr %158, align 2, !tbaa !10
  %160 = icmp eq i16 %159, -1
  br i1 %160, label %161, label %165

161:                                              ; preds = %149
  store i16 %85, ptr %158, align 2, !tbaa !10
  %162 = add nsw i32 %.3.1, 1
  %163 = sext i32 %.3.1 to i64
  %164 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %163
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %164, i32 noundef %150, i32 noundef %152, i32 noundef %154, i32 noundef %156)
  br label %165

165:                                              ; preds = %161, %149
  %.2.2 = phi i32 [ %162, %161 ], [ %.3.1, %149 ]
  store i32 %82, ptr %2, align 4, !tbaa !8
  store i32 %83, ptr %3, align 4, !tbaa !8
  store i32 %84, ptr %4, align 4, !tbaa !8
  call void @_Z3chgRiS_S_S_4Infoii(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %1, i64 %.sroa.039.0.insert.insert42, i32 noundef -1, i32 noundef 0)
  %166 = load i32, ptr %1, align 4, !tbaa !8
  %167 = sext i32 %166 to i64
  %168 = load i32, ptr %2, align 4, !tbaa !8
  %169 = sext i32 %168 to i64
  %170 = load i32, ptr %3, align 4, !tbaa !8
  %171 = sext i32 %170 to i64
  %172 = load i32, ptr %4, align 4, !tbaa !8
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %167, i64 %169, i64 %171, i64 %173
  %175 = load i16, ptr %174, align 2, !tbaa !10
  %176 = icmp eq i16 %175, -1
  br i1 %176, label %177, label %181

177:                                              ; preds = %165
  store i16 %85, ptr %174, align 2, !tbaa !10
  %178 = add nsw i32 %.2.2, 1
  %179 = sext i32 %.2.2 to i64
  %180 = getelementptr inbounds [1005000 x %struct.Info], ptr @q, i64 0, i64 %179
  call void @_ZN4Info3iniEiiii(ptr noundef nonnull align 2 dereferenceable(8) %180, i32 noundef %166, i32 noundef %168, i32 noundef %170, i32 noundef %172)
  br label %181

181:                                              ; preds = %177, %165
  %.3.2 = phi i32 [ %178, %177 ], [ %.2.2, %165 ]
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %182 = load i32, ptr @n, align 4, !tbaa !8
  %183 = add nsw i32 %182, -3
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [1005 x [10 x [10 x [10 x i16]]]], ptr @f, i64 0, i64 %184, i64 %59, i64 %65, i64 %71
  %186 = load i16, ptr %185, align 2, !tbaa !10
  %.not81 = icmp eq i16 %186, -1
  br i1 %.not81, label %72, label %187, !llvm.loop !15

187:                                              ; preds = %181
  %188 = sext i16 %186 to i32
  %189 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %188)
  br label %.loopexit

.loopexit:                                        ; preds = %72, %187, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  %190 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s, ptr noundef nonnull @t)
  %.not = icmp eq i32 %190, -1
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.loopexit, %0
  ret i32 0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3

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

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

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

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

; 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.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 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 #1 = { mustprogress norecurse 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 = { 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 nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nocallback nofree nosync 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"short", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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