; LLVM IR from smv1999/CompetitiveProgrammingQuestionBank :: Dynamic Programming (Floyed- Warshall)

; 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 [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@n = external dso_local global i32, align 4
@i = external dso_local global i32, align 4
@j = external dso_local global i32, align 4
@D = external dso_local global [100 x [100 x i32]], align 16
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@PI = external dso_local global [100 x [100 x i32]], align 16
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@k = external dso_local global i32, align 4
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %2 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @n)
  store i32 1, ptr @i, align 4, !tbaa !5
  br label %4

4:                                                ; preds = %45, %0
  %5 = load i32, ptr @i, align 4, !tbaa !5
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp sle i32 %5, %6
  br i1 %7, label %8, label %48

8:                                                ; preds = %4
  store i32 1, ptr @j, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %40, %8
  %10 = load i32, ptr @j, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = icmp sle i32 %10, %11
  br i1 %12, label %13, label %43

13:                                               ; preds = %9
  %14 = load i32, ptr @i, align 4, !tbaa !5
  %15 = load i32, ptr @j, align 4, !tbaa !5
  %16 = icmp eq i32 %14, %15
  br i1 %16, label %17, label %24

17:                                               ; preds = %13
  %18 = load i32, ptr @i, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %19
  %21 = load i32, ptr @j, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100 x i32], ptr %20, i64 0, i64 %22
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %24

24:                                               ; preds = %17, %13
  %25 = load i32, ptr @i, align 4, !tbaa !5
  %26 = load i32, ptr @j, align 4, !tbaa !5
  %27 = icmp ne i32 %25, %26
  br i1 %27, label %28, label %39

28:                                               ; preds = %24
  %29 = load i32, ptr @i, align 4, !tbaa !5
  %30 = load i32, ptr @j, align 4, !tbaa !5
  %31 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %29, i32 noundef %30)
  %32 = load i32, ptr @i, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %33
  %35 = load i32, ptr @j, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100 x i32], ptr %34, i64 0, i64 %36
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %37)
  br label %39

39:                                               ; preds = %28, %24
  br label %40

40:                                               ; preds = %39
  %41 = load i32, ptr @j, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr @j, align 4, !tbaa !5
  br label %9, !llvm.loop !9

43:                                               ; preds = %9
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %45

45:                                               ; preds = %43
  %46 = load i32, ptr @i, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr @i, align 4, !tbaa !5
  br label %4, !llvm.loop !11

48:                                               ; preds = %4
  store i32 1, ptr @i, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %74, %48
  %50 = load i32, ptr @i, align 4, !tbaa !5
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = icmp sle i32 %50, %51
  br i1 %52, label %53, label %77

53:                                               ; preds = %49
  store i32 1, ptr @j, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %69, %53
  %55 = load i32, ptr @j, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %58, label %72

58:                                               ; preds = %54
  %59 = load i32, ptr @i, align 4, !tbaa !5
  %60 = load i32, ptr @j, align 4, !tbaa !5
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %59, i32 noundef %60)
  %62 = load i32, ptr @i, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %63
  %65 = load i32, ptr @j, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100 x i32], ptr %64, i64 0, i64 %66
  %68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %67)
  br label %69

69:                                               ; preds = %58
  %70 = load i32, ptr @j, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr @j, align 4, !tbaa !5
  br label %54, !llvm.loop !12

72:                                               ; preds = %54
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %74

74:                                               ; preds = %72
  %75 = load i32, ptr @i, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @i, align 4, !tbaa !5
  br label %49, !llvm.loop !13

77:                                               ; preds = %49
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  store i32 1, ptr @i, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %102, %77
  %80 = load i32, ptr @i, align 4, !tbaa !5
  %81 = load i32, ptr @n, align 4, !tbaa !5
  %82 = icmp sle i32 %80, %81
  br i1 %82, label %83, label %105

83:                                               ; preds = %79
  store i32 1, ptr @j, align 4, !tbaa !5
  br label %84

84:                                               ; preds = %97, %83
  %85 = load i32, ptr @j, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = icmp sle i32 %85, %86
  br i1 %87, label %88, label %100

88:                                               ; preds = %84
  %89 = load i32, ptr @i, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %90
  %92 = load i32, ptr @j, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100 x i32], ptr %91, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %95)
  br label %97

97:                                               ; preds = %88
  %98 = load i32, ptr @j, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr @j, align 4, !tbaa !5
  br label %84, !llvm.loop !14

100:                                              ; preds = %84
  %101 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %102

102:                                              ; preds = %100
  %103 = load i32, ptr @i, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr @i, align 4, !tbaa !5
  br label %79, !llvm.loop !15

105:                                              ; preds = %79
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  store i32 1, ptr @i, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %130, %105
  %108 = load i32, ptr @i, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = icmp sle i32 %108, %109
  br i1 %110, label %111, label %133

111:                                              ; preds = %107
  store i32 1, ptr @j, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %125, %111
  %113 = load i32, ptr @j, align 4, !tbaa !5
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = icmp sle i32 %113, %114
  br i1 %115, label %116, label %128

116:                                              ; preds = %112
  %117 = load i32, ptr @i, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %118
  %120 = load i32, ptr @j, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100 x i32], ptr %119, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %123)
  br label %125

125:                                              ; preds = %116
  %126 = load i32, ptr @j, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr @j, align 4, !tbaa !5
  br label %112, !llvm.loop !16

128:                                              ; preds = %112
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %130

130:                                              ; preds = %128
  %131 = load i32, ptr @i, align 4, !tbaa !5
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr @i, align 4, !tbaa !5
  br label %107, !llvm.loop !17

133:                                              ; preds = %107
  store i32 1, ptr @k, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %216, %133
  %135 = load i32, ptr @k, align 4, !tbaa !5
  %136 = load i32, ptr @n, align 4, !tbaa !5
  %137 = icmp sle i32 %135, %136
  br i1 %137, label %138, label %219

138:                                              ; preds = %134
  store i32 1, ptr @i, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %212, %138
  %140 = load i32, ptr @i, align 4, !tbaa !5
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = icmp sle i32 %140, %141
  br i1 %142, label %143, label %215

143:                                              ; preds = %139
  store i32 1, ptr @j, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %208, %143
  %145 = load i32, ptr @j, align 4, !tbaa !5
  %146 = load i32, ptr @n, align 4, !tbaa !5
  %147 = icmp sle i32 %145, %146
  br i1 %147, label %148, label %211

148:                                              ; preds = %144
  %149 = load i32, ptr @i, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %150
  %152 = load i32, ptr @j, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100 x i32], ptr %151, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = load i32, ptr @i, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %157
  %159 = load i32, ptr @k, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100 x i32], ptr %158, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = load i32, ptr @k, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %164
  %166 = load i32, ptr @j, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100 x i32], ptr %165, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = add nsw i32 %162, %169
  %171 = icmp sgt i32 %155, %170
  br i1 %171, label %172, label %207

172:                                              ; preds = %148
  %173 = load i32, ptr @i, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %174
  %176 = load i32, ptr @k, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [100 x i32], ptr %175, i64 0, i64 %177
  %179 = load i32, ptr %178, align 4, !tbaa !5
  %180 = load i32, ptr @k, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %181
  %183 = load i32, ptr @j, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [100 x i32], ptr %182, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = add nsw i32 %179, %186
  %188 = load i32, ptr @i, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %189
  %191 = load i32, ptr @j, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [100 x i32], ptr %190, i64 0, i64 %192
  store i32 %187, ptr %193, align 4, !tbaa !5
  %194 = load i32, ptr @k, align 4, !tbaa !5
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %195
  %197 = load i32, ptr @j, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100 x i32], ptr %196, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = load i32, ptr @i, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %202
  %204 = load i32, ptr @j, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100 x i32], ptr %203, i64 0, i64 %205
  store i32 %200, ptr %206, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %172, %148
  br label %208

208:                                              ; preds = %207
  %209 = load i32, ptr @j, align 4, !tbaa !5
  %210 = add nsw i32 %209, 1
  store i32 %210, ptr @j, align 4, !tbaa !5
  br label %144, !llvm.loop !18

211:                                              ; preds = %144
  br label %212

212:                                              ; preds = %211
  %213 = load i32, ptr @i, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr @i, align 4, !tbaa !5
  br label %139, !llvm.loop !19

215:                                              ; preds = %139
  br label %216

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

219:                                              ; preds = %134
  %220 = call i32 (ptr, ...) @printf(ptr noundef @.str.8)
  store i32 1, ptr @i, align 4, !tbaa !5
  br label %221

221:                                              ; preds = %244, %219
  %222 = load i32, ptr @i, align 4, !tbaa !5
  %223 = load i32, ptr @n, align 4, !tbaa !5
  %224 = icmp sle i32 %222, %223
  br i1 %224, label %225, label %247

225:                                              ; preds = %221
  store i32 1, ptr @j, align 4, !tbaa !5
  br label %226

226:                                              ; preds = %239, %225
  %227 = load i32, ptr @j, align 4, !tbaa !5
  %228 = load i32, ptr @n, align 4, !tbaa !5
  %229 = icmp sle i32 %227, %228
  br i1 %229, label %230, label %242

230:                                              ; preds = %226
  %231 = load i32, ptr @i, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %232
  %234 = load i32, ptr @j, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [100 x i32], ptr %233, i64 0, i64 %235
  %237 = load i32, ptr %236, align 4, !tbaa !5
  %238 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %237)
  br label %239

239:                                              ; preds = %230
  %240 = load i32, ptr @j, align 4, !tbaa !5
  %241 = add nsw i32 %240, 1
  store i32 %241, ptr @j, align 4, !tbaa !5
  br label %226, !llvm.loop !21

242:                                              ; preds = %226
  %243 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %244

244:                                              ; preds = %242
  %245 = load i32, ptr @i, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr @i, align 4, !tbaa !5
  br label %221, !llvm.loop !22

247:                                              ; preds = %221
  %248 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  store i32 1, ptr @i, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %272, %247
  %250 = load i32, ptr @i, align 4, !tbaa !5
  %251 = load i32, ptr @n, align 4, !tbaa !5
  %252 = icmp sle i32 %250, %251
  br i1 %252, label %253, label %275

253:                                              ; preds = %249
  store i32 1, ptr @j, align 4, !tbaa !5
  br label %254

254:                                              ; preds = %267, %253
  %255 = load i32, ptr @j, align 4, !tbaa !5
  %256 = load i32, ptr @n, align 4, !tbaa !5
  %257 = icmp sle i32 %255, %256
  br i1 %257, label %258, label %270

258:                                              ; preds = %254
  %259 = load i32, ptr @i, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %260
  %262 = load i32, ptr @j, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [100 x i32], ptr %261, i64 0, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %265)
  br label %267

267:                                              ; preds = %258
  %268 = load i32, ptr @j, align 4, !tbaa !5
  %269 = add nsw i32 %268, 1
  store i32 %269, ptr @j, align 4, !tbaa !5
  br label %254, !llvm.loop !23

270:                                              ; preds = %254
  %271 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %272

272:                                              ; preds = %270
  %273 = load i32, ptr @i, align 4, !tbaa !5
  %274 = add nsw i32 %273, 1
  store i32 %274, ptr @i, align 4, !tbaa !5
  br label %249, !llvm.loop !24

275:                                              ; preds = %249
  %276 = load i32, ptr %1, align 4
  ret i32 %276
}

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

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

attributes #0 = { 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 = { "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" }

!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/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}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !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 [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@n = external dso_local global i32, align 4
@i = external dso_local local_unnamed_addr global i32, align 4
@j = external dso_local local_unnamed_addr global i32, align 4
@D = external dso_local global [100 x [100 x i32]], align 16
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [27 x i8], align 1
@PI = external dso_local global [100 x [100 x i32]], align 16
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [14 x i8], align 1
@k = external dso_local local_unnamed_addr global i32, align 4
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
  store i32 1, ptr @i, align 4, !tbaa !5
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %.not51 = icmp slt i32 %3, 1
  br i1 %.not51, label %._crit_edge57, label %.preheader48

.preheader48:                                     ; preds = %0, %._crit_edge
  %.pre111 = phi i32 [ %25, %._crit_edge ], [ 1, %0 ]
  %4 = phi i32 [ %26, %._crit_edge ], [ %3, %0 ]
  store i32 1, ptr @j, align 4, !tbaa !5
  %.not3849 = icmp slt i32 %4, 1
  br i1 %.not3849, label %._crit_edge, label %.lr.ph

.preheader47:                                     ; preds = %._crit_edge
  store i32 1, ptr @i, align 4, !tbaa !5
  %.not1256 = icmp slt i32 %26, 1
  br i1 %.not1256, label %._crit_edge57, label %.preheader46

.lr.ph:                                           ; preds = %.preheader48, %18
  %5 = phi i32 [ %19, %18 ], [ %4, %.preheader48 ]
  %6 = phi i32 [ %21, %18 ], [ %.pre111, %.preheader48 ]
  %storemerge3750 = phi i32 [ %22, %18 ], [ 1, %.preheader48 ]
  %7 = icmp eq i32 %6, %storemerge3750
  br i1 %7, label %.thread, label %10

.thread:                                          ; preds = %.lr.ph
  %8 = sext i32 %6 to i64
  %9 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %8, i64 %8
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %18

10:                                               ; preds = %.lr.ph
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6, i32 noundef %storemerge3750)
  %12 = load i32, ptr @i, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = load i32, ptr @j, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %13, i64 %15
  %17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %16)
  %.pre = load i32, ptr @i, align 4, !tbaa !5
  %.pre112 = load i32, ptr @j, align 4, !tbaa !5
  %.pre113 = load i32, ptr @n, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %.thread, %10
  %19 = phi i32 [ %5, %.thread ], [ %.pre113, %10 ]
  %20 = phi i32 [ %6, %.thread ], [ %.pre112, %10 ]
  %21 = phi i32 [ %6, %.thread ], [ %.pre, %10 ]
  %22 = add nsw i32 %20, 1
  store i32 %22, ptr @j, align 4, !tbaa !5
  %.not38.not = icmp slt i32 %20, %19
  br i1 %.not38.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %18, %.preheader48
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %24 = load i32, ptr @i, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @i, align 4, !tbaa !5
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %.not.not = icmp slt i32 %24, %26
  br i1 %.not.not, label %.preheader48, label %.preheader47, !llvm.loop !11

.preheader46:                                     ; preds = %.preheader47, %._crit_edge55
  %27 = phi i32 [ %42, %._crit_edge55 ], [ %26, %.preheader47 ]
  store i32 1, ptr @j, align 4, !tbaa !5
  %.not3652 = icmp slt i32 %27, 1
  br i1 %.not3652, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %.preheader46, %.lr.ph54
  %storemerge3553 = phi i32 [ %37, %.lr.ph54 ], [ 1, %.preheader46 ]
  %28 = load i32, ptr @i, align 4, !tbaa !5
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %28, i32 noundef %storemerge3553)
  %30 = load i32, ptr @i, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = load i32, ptr @j, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %31, i64 %33
  %35 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %34)
  %36 = load i32, ptr @j, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @j, align 4, !tbaa !5
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %.not36.not = icmp slt i32 %36, %38
  br i1 %.not36.not, label %.lr.ph54, label %._crit_edge55, !llvm.loop !12

._crit_edge55:                                    ; preds = %.lr.ph54, %.preheader46
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %40 = load i32, ptr @i, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @i, align 4, !tbaa !5
  %42 = load i32, ptr @n, align 4, !tbaa !5
  %.not12.not = icmp slt i32 %40, %42
  br i1 %.not12.not, label %.preheader46, label %._crit_edge57, !llvm.loop !13

._crit_edge57:                                    ; preds = %._crit_edge55, %0, %.preheader47
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  store i32 1, ptr @i, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %.not1462 = icmp slt i32 %44, 1
  br i1 %.not1462, label %._crit_edge63, label %.preheader45

.preheader45:                                     ; preds = %._crit_edge57, %._crit_edge61
  %45 = phi i32 [ %58, %._crit_edge61 ], [ %44, %._crit_edge57 ]
  store i32 1, ptr @j, align 4, !tbaa !5
  %.not3458 = icmp slt i32 %45, 1
  br i1 %.not3458, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %.preheader45, %.lr.ph60
  %storemerge3359 = phi i32 [ %53, %.lr.ph60 ], [ 1, %.preheader45 ]
  %46 = load i32, ptr @i, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = sext i32 %storemerge3359 to i64
  %49 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %47, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %50)
  %52 = load i32, ptr @j, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @j, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %.not34.not = icmp slt i32 %52, %54
  br i1 %.not34.not, label %.lr.ph60, label %._crit_edge61, !llvm.loop !14

._crit_edge61:                                    ; preds = %.lr.ph60, %.preheader45
  %55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %56 = load i32, ptr @i, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr @i, align 4, !tbaa !5
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %.not14.not = icmp slt i32 %56, %58
  br i1 %.not14.not, label %.preheader45, label %._crit_edge63, !llvm.loop !15

._crit_edge63:                                    ; preds = %._crit_edge61, %._crit_edge57
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  store i32 1, ptr @i, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %.not1668 = icmp slt i32 %60, 1
  br i1 %.not1668, label %.preheader43.thread, label %.preheader44

.preheader44:                                     ; preds = %._crit_edge63, %._crit_edge67
  %61 = phi i32 [ %75, %._crit_edge67 ], [ %60, %._crit_edge63 ]
  store i32 1, ptr @j, align 4, !tbaa !5
  %.not3264 = icmp slt i32 %61, 1
  br i1 %.not3264, label %._crit_edge67, label %.lr.ph66

.preheader43:                                     ; preds = %._crit_edge67
  %.not1879 = icmp slt i32 %75, 1
  br i1 %.not1879, label %.preheader43.thread, label %.preheader42.preheader

.preheader42.preheader:                           ; preds = %.preheader43
  %62 = add nuw i32 %75, 1
  %wide.trip.count109 = zext i32 %62 to i64
  br label %.preheader42

.lr.ph66:                                         ; preds = %.preheader44, %.lr.ph66
  %storemerge3165 = phi i32 [ %70, %.lr.ph66 ], [ 1, %.preheader44 ]
  %63 = load i32, ptr @i, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = sext i32 %storemerge3165 to i64
  %66 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %64, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %67)
  %69 = load i32, ptr @j, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr @j, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  %.not32.not = icmp slt i32 %69, %71
  br i1 %.not32.not, label %.lr.ph66, label %._crit_edge67, !llvm.loop !16

._crit_edge67:                                    ; preds = %.lr.ph66, %.preheader44
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %73 = load i32, ptr @i, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr @i, align 4, !tbaa !5
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %.not16.not = icmp slt i32 %73, %75
  br i1 %.not16.not, label %.preheader44, label %.preheader43, !llvm.loop !17

.preheader42:                                     ; preds = %.preheader42.preheader, %._crit_edge76.split
  %indvars.iv106 = phi i64 [ 1, %.preheader42.preheader ], [ %indvars.iv.next107, %._crit_edge76.split ]
  br label %.preheader41

.preheader41:                                     ; preds = %.preheader42, %._crit_edge72
  %indvars.iv101 = phi i64 [ 1, %.preheader42 ], [ %indvars.iv.next102, %._crit_edge72 ]
  %76 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %indvars.iv101, i64 %indvars.iv106
  br label %77

77:                                               ; preds = %.preheader41, %89
  %indvars.iv = phi i64 [ 1, %.preheader41 ], [ %indvars.iv.next, %89 ]
  %78 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %indvars.iv101, i64 %indvars.iv
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %76, align 4, !tbaa !5
  %81 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %indvars.iv106, i64 %indvars.iv
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = add nsw i32 %82, %80
  %84 = icmp sgt i32 %79, %83
  br i1 %84, label %85, label %89

85:                                               ; preds = %77
  store i32 %83, ptr %78, align 4, !tbaa !5
  %86 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %indvars.iv106, i64 %indvars.iv
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %indvars.iv101, i64 %indvars.iv
  store i32 %87, ptr %88, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %77, %85
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count109
  br i1 %exitcond.not, label %._crit_edge72, label %77, !llvm.loop !18

._crit_edge72:                                    ; preds = %89
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count109
  br i1 %exitcond105.not, label %._crit_edge76.split, label %.preheader41, !llvm.loop !19

._crit_edge76.split:                              ; preds = %._crit_edge72
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109
  br i1 %exitcond110.not, label %._crit_edge81.split, label %.preheader42, !llvm.loop !20

._crit_edge81.split:                              ; preds = %._crit_edge76.split
  store i32 %62, ptr @j, align 4, !tbaa !5
  store i32 %62, ptr @i, align 4, !tbaa !5
  br label %.preheader43.thread

.preheader43.thread:                              ; preds = %._crit_edge63, %._crit_edge81.split, %.preheader43
  %storemerge17.lcssa = phi i32 [ %62, %._crit_edge81.split ], [ 1, %.preheader43 ], [ 1, %._crit_edge63 ]
  store i32 %storemerge17.lcssa, ptr @k, align 4, !tbaa !5
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8)
  store i32 1, ptr @i, align 4, !tbaa !5
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %.not2088 = icmp slt i32 %91, 1
  br i1 %.not2088, label %._crit_edge89, label %.preheader40

.preheader40:                                     ; preds = %.preheader43.thread, %._crit_edge87
  %92 = phi i32 [ %105, %._crit_edge87 ], [ %91, %.preheader43.thread ]
  store i32 1, ptr @j, align 4, !tbaa !5
  %.not2684 = icmp slt i32 %92, 1
  br i1 %.not2684, label %._crit_edge87, label %.lr.ph86

.lr.ph86:                                         ; preds = %.preheader40, %.lr.ph86
  %storemerge2585 = phi i32 [ %100, %.lr.ph86 ], [ 1, %.preheader40 ]
  %93 = load i32, ptr @i, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = sext i32 %storemerge2585 to i64
  %96 = getelementptr inbounds [100 x [100 x i32]], ptr @D, i64 0, i64 %94, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %97)
  %99 = load i32, ptr @j, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr @j, align 4, !tbaa !5
  %101 = load i32, ptr @n, align 4, !tbaa !5
  %.not26.not = icmp slt i32 %99, %101
  br i1 %.not26.not, label %.lr.ph86, label %._crit_edge87, !llvm.loop !21

._crit_edge87:                                    ; preds = %.lr.ph86, %.preheader40
  %102 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %103 = load i32, ptr @i, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr @i, align 4, !tbaa !5
  %105 = load i32, ptr @n, align 4, !tbaa !5
  %.not20.not = icmp slt i32 %103, %105
  br i1 %.not20.not, label %.preheader40, label %._crit_edge89, !llvm.loop !22

._crit_edge89:                                    ; preds = %._crit_edge87, %.preheader43.thread
  %106 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  store i32 1, ptr @i, align 4, !tbaa !5
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %.not2294 = icmp slt i32 %107, 1
  br i1 %.not2294, label %._crit_edge95, label %.preheader

.preheader:                                       ; preds = %._crit_edge89, %._crit_edge93
  %108 = phi i32 [ %121, %._crit_edge93 ], [ %107, %._crit_edge89 ]
  store i32 1, ptr @j, align 4, !tbaa !5
  %.not2490 = icmp slt i32 %108, 1
  br i1 %.not2490, label %._crit_edge93, label %.lr.ph92

.lr.ph92:                                         ; preds = %.preheader, %.lr.ph92
  %storemerge2391 = phi i32 [ %116, %.lr.ph92 ], [ 1, %.preheader ]
  %109 = load i32, ptr @i, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = sext i32 %storemerge2391 to i64
  %112 = getelementptr inbounds [100 x [100 x i32]], ptr @PI, i64 0, i64 %110, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %113)
  %115 = load i32, ptr @j, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr @j, align 4, !tbaa !5
  %117 = load i32, ptr @n, align 4, !tbaa !5
  %.not24.not = icmp slt i32 %115, %117
  br i1 %.not24.not, label %.lr.ph92, label %._crit_edge93, !llvm.loop !23

._crit_edge93:                                    ; preds = %.lr.ph92, %.preheader
  %118 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %119 = load i32, ptr @i, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr @i, align 4, !tbaa !5
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %.not22.not = icmp slt i32 %119, %121
  br i1 %.not22.not, label %.preheader, label %._crit_edge95, !llvm.loop !24

._crit_edge95:                                    ; preds = %._crit_edge93, %._crit_edge89
  ret i32 0
}

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

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

attributes #0 = { nofree 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 = { 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" }

!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/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}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}


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