; LLVM IR from UtkarshPathrabe/Competitive-Coding :: SPOJ Solutions (MFISH)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = zext i32 %28 to i64
  %30 = call ptr @llvm.stacksave.p0()
  store ptr %30, ptr %8, align 8
  %31 = alloca i32, i64 %29, align 16
  store i64 %29, ptr %9, align 8
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = zext i32 %32 to i64
  %34 = alloca i32, i64 %33, align 16
  store i64 %33, ptr %10, align 8
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = zext i32 %35 to i64
  %37 = alloca i32, i64 %36, align 16
  store i64 %36, ptr %11, align 8
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %55, %0
  %40 = load i32, ptr %12, align 4, !tbaa !5
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %58

44:                                               ; preds = %39
  %45 = load i32, ptr %12, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %34, i64 %46
  store i32 0, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %12, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds i32, ptr %37, i64 %49
  store i32 0, ptr %50, align 4, !tbaa !5
  %51 = load i32, ptr %12, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %31, i64 %52
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %53)
  br label %55

55:                                               ; preds = %44
  %56 = load i32, ptr %12, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %12, align 4, !tbaa !5
  br label %39, !llvm.loop !9

58:                                               ; preds = %43
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %72, %58
  %61 = load i32, ptr %13, align 4, !tbaa !5
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

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

65:                                               ; preds = %60
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %4, ptr noundef %5)
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr %4, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i32, ptr %34, i64 %70
  store i32 %67, ptr %71, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %65
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %13, align 4, !tbaa !5
  br label %60, !llvm.loop !11

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

76:                                               ; preds = %239, %75
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %242

81:                                               ; preds = %76
  %82 = load i32, ptr %14, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds i32, ptr %34, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %221

87:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %88 = load i32, ptr %14, align 4, !tbaa !5
  %89 = load i32, ptr %14, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %34, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sub nsw i32 %88, %92
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %18, align 4, !tbaa !5
  %95 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %96 = load i32, ptr %95, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  store i32 %96, ptr %17, align 4, !tbaa !5
  %97 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %97, ptr %16, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %116, %87
  %99 = load i32, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %100 = load i32, ptr %17, align 4, !tbaa !5
  %101 = load i32, ptr %14, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %34, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = add nsw i32 %100, %104
  store i32 %105, ptr %19, align 4, !tbaa !5
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = icmp slt i32 %99, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br i1 %108, label %109, label %119

109:                                              ; preds = %98
  %110 = load i32, ptr %16, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %31, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = load i32, ptr %15, align 4, !tbaa !5
  %115 = add nsw i32 %114, %113
  store i32 %115, ptr %15, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %109
  %117 = load i32, ptr %16, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %16, align 4, !tbaa !5
  br label %98, !llvm.loop !12

119:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %120 = load i32, ptr %16, align 4, !tbaa !5
  store i32 %120, ptr %20, align 4, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !5
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %138, label %123

123:                                              ; preds = %119
  %124 = load i32, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %125 = load i32, ptr %17, align 4, !tbaa !5
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds i32, ptr %34, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = add nsw i32 %125, %129
  %131 = sub nsw i32 %130, 1
  store i32 %131, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %132 = load i32, ptr %2, align 4, !tbaa !5
  %133 = sub nsw i32 %132, 1
  store i32 %133, ptr %22, align 4, !tbaa !5
  %134 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %37, i64 %136
  store i32 %124, ptr %137, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %159

138:                                              ; preds = %119
  %139 = load i32, ptr %15, align 4, !tbaa !5
  %140 = load i32, ptr %17, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds i32, ptr %37, i64 %142
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = add nsw i32 %139, %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %146 = load i32, ptr %17, align 4, !tbaa !5
  %147 = load i32, ptr %14, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %34, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = add nsw i32 %146, %150
  %152 = sub nsw i32 %151, 1
  store i32 %152, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %153 = load i32, ptr %2, align 4, !tbaa !5
  %154 = sub nsw i32 %153, 1
  store i32 %154, ptr %24, align 4, !tbaa !5
  %155 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %23, ptr noundef nonnull align 4 dereferenceable(4) %24)
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds i32, ptr %37, i64 %157
  store i32 %145, ptr %158, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %159

159:                                              ; preds = %138, %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %160 = load i32, ptr %17, align 4, !tbaa !5
  %161 = load i32, ptr %14, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %34, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = add nsw i32 %160, %164
  store i32 %165, ptr %25, align 4, !tbaa !5
  %166 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %167 = load i32, ptr %166, align 4, !tbaa !5
  store i32 %167, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %168

168:                                              ; preds = %216, %159
  %169 = load i32, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %170 = load i32, ptr %14, align 4, !tbaa !5
  %171 = load i32, ptr %14, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds i32, ptr %34, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %175 = add nsw i32 %170, %174
  store i32 %175, ptr %26, align 4, !tbaa !5
  %176 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = icmp slt i32 %169, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br i1 %178, label %179, label %219

179:                                              ; preds = %168
  %180 = load i32, ptr %15, align 4, !tbaa !5
  %181 = load i32, ptr %16, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr %31, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = add nsw i32 %180, %184
  %186 = load i32, ptr %16, align 4, !tbaa !5
  %187 = load i32, ptr %14, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds i32, ptr %34, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = sub nsw i32 %186, %190
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds i32, ptr %31, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = sub nsw i32 %185, %194
  store i32 %195, ptr %15, align 4, !tbaa !5
  %196 = load i32, ptr %16, align 4, !tbaa !5
  %197 = sub nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds i32, ptr %37, i64 %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %200 = load i32, ptr %16, align 4, !tbaa !5
  %201 = load i32, ptr %14, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds i32, ptr %34, i64 %202
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = sub nsw i32 %200, %204
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds i32, ptr %37, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = load i32, ptr %15, align 4, !tbaa !5
  %210 = add nsw i32 %208, %209
  store i32 %210, ptr %27, align 4, !tbaa !5
  %211 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %199, ptr noundef nonnull align 4 dereferenceable(4) %27)
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = load i32, ptr %16, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds i32, ptr %37, i64 %214
  store i32 %212, ptr %215, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  br label %216

216:                                              ; preds = %179
  %217 = load i32, ptr %16, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %16, align 4, !tbaa !5
  br label %168, !llvm.loop !13

219:                                              ; preds = %168
  %220 = load i32, ptr %20, align 4, !tbaa !5
  store i32 %220, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %238

221:                                              ; preds = %81
  %222 = load i32, ptr %14, align 4, !tbaa !5
  %223 = icmp sgt i32 %222, 0
  br i1 %223, label %224, label %237

224:                                              ; preds = %221
  %225 = load i32, ptr %14, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds i32, ptr %37, i64 %226
  %228 = load i32, ptr %14, align 4, !tbaa !5
  %229 = sub nsw i32 %228, 1
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds i32, ptr %37, i64 %230
  %232 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %227, ptr noundef nonnull align 4 dereferenceable(4) %231)
  %233 = load i32, ptr %232, align 4, !tbaa !5
  %234 = load i32, ptr %14, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds i32, ptr %37, i64 %235
  store i32 %233, ptr %236, align 4, !tbaa !5
  br label %237

237:                                              ; preds = %224, %221
  br label %238

238:                                              ; preds = %237, %219
  br label %239

239:                                              ; preds = %238
  %240 = load i32, ptr %14, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr %14, align 4, !tbaa !5
  br label %76, !llvm.loop !14

242:                                              ; preds = %80
  %243 = load i32, ptr %2, align 4, !tbaa !5
  %244 = sub nsw i32 %243, 1
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds i32, ptr %37, i64 %245
  %247 = load i32, ptr %246, align 4, !tbaa !5
  %248 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %247)
  store i32 0, ptr %1, align 4
  %249 = load ptr, ptr %8, align 8
  call void @llvm.stackrestore.p0(ptr %249)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %250 = load i32, ptr %1, align 4
  ret i32 %250
}

; 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
declare ptr @llvm.stacksave.p0() #2

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

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

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

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


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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca [0 x i32], align 16
  %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 i32, align 4
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  %16 = tail call ptr @llvm.stacksave.p0()
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %invariant.gep = getelementptr i8, ptr %1, i64 -4
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph64, label %.preheader

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

.preheader:                                       ; preds = %.lr.ph64, %._crit_edge
  %invariant.gep77 = getelementptr i8, ptr %1, i64 -4
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 0
  br i1 %29, label %.lr.ph81.preheader, label %.preheader.._crit_edge82_crit_edge

.preheader.._crit_edge82_crit_edge:               ; preds = %.preheader
  %.pre = sext i32 %28 to i64
  br label %._crit_edge82

.lr.ph81.preheader:                               ; preds = %.preheader
  %invariant.gep97 = getelementptr i8, ptr %1, i64 -4
  br label %.lr.ph81

.lr.ph64:                                         ; preds = %._crit_edge, %.lr.ph64
  %.05462 = phi i32 [ %34, %.lr.ph64 ], [ 0, %._crit_edge ]
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %gep = getelementptr i32, ptr %invariant.gep, i64 %33
  store i32 %31, ptr %gep, align 4, !tbaa !5
  %34 = add nuw nsw i32 %.05462, 1
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %.lr.ph64, label %.preheader, !llvm.loop !11

._crit_edge82:                                    ; preds = %96, %.preheader.._crit_edge82_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge82_crit_edge ], [ %98, %96 ]
  %37 = getelementptr i32, ptr %1, i64 %.pre-phi
  %38 = getelementptr i8, ptr %37, i64 -4
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %39)
  call void @llvm.stackrestore.p0(ptr %16)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  ret i32 0

.lr.ph81:                                         ; preds = %.lr.ph81.preheader, %96
  %indvars.iv93 = phi i64 [ 0, %.lr.ph81.preheader ], [ %indvars.iv.next94, %96 ]
  %.080 = phi i32 [ 0, %.lr.ph81.preheader ], [ %.2, %96 ]
  %41 = load i32, ptr %1, align 16, !tbaa !5
  %.not = icmp eq i32 %41, 0
  br i1 %.not, label %90, label %42

42:                                               ; preds = %.lr.ph81
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %43 = trunc i64 %indvars.iv93 to i32
  %44 = add i32 %43, 1
  %45 = sub i32 %44, %41
  store i32 %45, ptr %7, align 4, !tbaa !5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %47 = load i32, ptr %46, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %48 = add nsw i32 %47, %41
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 %48, ptr %8, align 4, !tbaa !5
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp slt i32 %47, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br i1 %51, label %.lr.ph68.preheader, label %._crit_edge69

.lr.ph68.preheader:                               ; preds = %42
  %52 = sext i32 %47 to i64
  br label %.lr.ph68

.lr.ph68:                                         ; preds = %.lr.ph68.preheader, %.lr.ph68
  %indvars.iv87 = phi i64 [ %52, %.lr.ph68.preheader ], [ %indvars.iv.next88, %.lr.ph68 ]
  %.05165 = phi i32 [ 0, %.lr.ph68.preheader ], [ %54, %.lr.ph68 ]
  %53 = load i32, ptr %1, align 16, !tbaa !5
  %54 = add nsw i32 %53, %.05165
  %indvars.iv.next88 = add nsw i64 %indvars.iv87, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 %48, ptr %8, align 4, !tbaa !5
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = icmp slt i64 %indvars.iv.next88, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  br i1 %58, label %.lr.ph68, label %._crit_edge69.loopexit, !llvm.loop !12

._crit_edge69.loopexit:                           ; preds = %.lr.ph68
  %59 = trunc nsw i64 %indvars.iv.next88 to i32
  br label %._crit_edge69

._crit_edge69:                                    ; preds = %._crit_edge69.loopexit, %42
  %.051.lcssa = phi i32 [ 0, %42 ], [ %54, %._crit_edge69.loopexit ]
  %.049.lcssa = phi i32 [ %47, %42 ], [ %59, %._crit_edge69.loopexit ]
  %.not58 = icmp eq i32 %.080, 0
  br i1 %.not58, label %60, label %65

60:                                               ; preds = %._crit_edge69
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %61 = add nsw i32 %48, -1
  store i32 %61, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %10, align 4, !tbaa !5
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i32 %.051.lcssa, ptr %1, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br label %73

65:                                               ; preds = %._crit_edge69
  %66 = sext i32 %47 to i64
  %gep78 = getelementptr i32, ptr %invariant.gep77, i64 %66
  %67 = load i32, ptr %gep78, align 4, !tbaa !5
  %68 = add nsw i32 %67, %.051.lcssa
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #5
  %69 = add nsw i32 %48, -1
  store i32 %69, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #5
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = add nsw i32 %70, -1
  store i32 %71, ptr %12, align 4, !tbaa !5
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
  store i32 %68, ptr %1, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #5
  br label %73

73:                                               ; preds = %65, %60
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #5
  store i32 %48, ptr %13, align 4, !tbaa !5
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %75 = load i32, ptr %74, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #5
  %76 = trunc nuw nsw i64 %indvars.iv93 to i32
  %77 = add nsw i32 %41, %76
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  store i32 %77, ptr %14, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp slt i32 %75, %79
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  br i1 %80, label %.lr.ph75.preheader, label %._crit_edge76

.lr.ph75.preheader:                               ; preds = %73
  %81 = sext i32 %75 to i64
  br label %.lr.ph75

.lr.ph75:                                         ; preds = %.lr.ph75.preheader, %.lr.ph75
  %indvars.iv90 = phi i64 [ %81, %.lr.ph75.preheader ], [ %indvars.iv.next91, %.lr.ph75 ]
  %gep98 = getelementptr i32, ptr %invariant.gep97, i64 %indvars.iv90
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #5
  %82 = load i32, ptr %1, align 16, !tbaa !5
  %83 = add nsw i32 %82, %.051.lcssa
  store i32 %83, ptr %15, align 4, !tbaa !5
  %84 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %gep98, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %85 = load i32, ptr %84, align 4, !tbaa !5
  store i32 %85, ptr %1, align 16, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  %indvars.iv.next91 = add nsw i64 %indvars.iv90, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #5
  store i32 %77, ptr %14, align 4, !tbaa !5
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next91, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #5
  br i1 %89, label %.lr.ph75, label %._crit_edge76, !llvm.loop !13

._crit_edge76:                                    ; preds = %.lr.ph75, %73
  store i32 %.049.lcssa, ptr %6, align 4, !tbaa !5
  br label %96

90:                                               ; preds = %.lr.ph81
  %.not57 = icmp eq i64 %indvars.iv93, 0
  br i1 %.not57, label %96, label %91

91:                                               ; preds = %90
  %92 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv93
  %93 = getelementptr i8, ptr %92, i64 -4
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %92, ptr noundef nonnull align 4 dereferenceable(4) %93)
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %1, align 16, !tbaa !5
  br label %96

96:                                               ; preds = %._crit_edge76, %91, %90
  %.2 = phi i32 [ 1, %._crit_edge76 ], [ %.080, %91 ], [ %.080, %90 ]
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = icmp slt i64 %indvars.iv.next94, %98
  br i1 %99, label %.lr.ph81, label %._crit_edge82, !llvm.loop !14
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

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

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

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


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