; LLVM IR from DionysiosB/CodeForces :: 0200-0299 (218B-Airport)

; 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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 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 ptr, align 8
  %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 ptr, align 8
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %21, i64 4)
  %23 = extractvalue { i64, i1 } %22, 1
  %24 = extractvalue { i64, i1 } %22, 0
  %25 = select i1 %23, i64 -1, i64 %24
  %26 = call noalias noundef nonnull ptr @_Znam(i64 noundef %25) #8
  store ptr %26, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %38, %0
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %41

32:                                               ; preds = %27
  %33 = load ptr, ptr %4, align 8, !tbaa !9
  %34 = load i32, ptr %5, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i32, ptr %33, i64 %35
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %36)
  br label %38

38:                                               ; preds = %32
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %5, align 4, !tbaa !5
  br label %27, !llvm.loop !11

41:                                               ; preds = %31
  %42 = load ptr, ptr %4, align 8, !tbaa !9
  %43 = load ptr, ptr %4, align 8, !tbaa !9
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr %43, i64 %45
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %42, ptr noundef %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %47 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %47, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %100, %41
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = icmp slt i32 %49, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  store i32 5, ptr %10, align 4
  br label %103

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %54 = load ptr, ptr %4, align 8, !tbaa !9
  %55 = load i32, ptr %9, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr %54, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = icmp sle i32 %58, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %53
  br label %70

62:                                               ; preds = %53
  %63 = load ptr, ptr %4, align 8, !tbaa !9
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i32, ptr %63, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sub nsw i32 %67, %68
  br label %70

70:                                               ; preds = %62, %61
  %71 = phi i32 [ 0, %61 ], [ %69, %62 ]
  store i32 %71, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %72 = load ptr, ptr %4, align 8, !tbaa !9
  %73 = load i32, ptr %9, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %72, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  store i32 %76, ptr %12, align 4, !tbaa !5
  %77 = load i32, ptr %12, align 4, !tbaa !5
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = add nsw i32 %77, %78
  %80 = add nsw i32 %79, 1
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = load i32, ptr %11, align 4, !tbaa !5
  %83 = sub nsw i32 %81, %82
  %84 = mul nsw i32 %80, %83
  %85 = sdiv i32 %84, 2
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = add nsw i32 %86, %85
  store i32 %87, ptr %7, align 4, !tbaa !5
  %88 = load i32, ptr %12, align 4, !tbaa !5
  %89 = load i32, ptr %11, align 4, !tbaa !5
  %90 = sub nsw i32 %88, %89
  %91 = load i32, ptr %6, align 4, !tbaa !5
  %92 = sub nsw i32 %91, %90
  store i32 %92, ptr %6, align 4, !tbaa !5
  %93 = load i32, ptr %6, align 4, !tbaa !5
  %94 = icmp sle i32 %93, 0
  br i1 %94, label %95, label %96

95:                                               ; preds = %70
  store i32 5, ptr %10, align 4
  br label %97

96:                                               ; preds = %70
  store i32 0, ptr %10, align 4
  br label %97

97:                                               ; preds = %96, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  %98 = load i32, ptr %10, align 4
  switch i32 %98, label %103 [
    i32 0, label %99
  ]

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %9, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %9, align 4, !tbaa !5
  br label %48, !llvm.loop !13

103:                                              ; preds = %97, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %105, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %106 = load ptr, ptr %4, align 8, !tbaa !9
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %106, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = add nsw i32 1, %111
  %113 = sext i32 %112 to i64
  %114 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %113, i64 4)
  %115 = extractvalue { i64, i1 } %114, 1
  %116 = extractvalue { i64, i1 } %114, 0
  %117 = select i1 %115, i64 -1, i64 %116
  %118 = call noalias noundef nonnull ptr @_Znam(i64 noundef %117) #8
  store ptr %118, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %134, %104
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = load ptr, ptr %4, align 8, !tbaa !9
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds i32, ptr %121, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = icmp sle i32 %120, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %119
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %137

129:                                              ; preds = %119
  %130 = load ptr, ptr %13, align 8, !tbaa !9
  %131 = load i32, ptr %14, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i32, ptr %130, i64 %132
  store i32 0, ptr %133, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %129
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %14, align 4, !tbaa !5
  br label %119, !llvm.loop !14

137:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %164, %137
  %139 = load i32, ptr %15, align 4, !tbaa !5
  %140 = load i32, ptr %3, align 4, !tbaa !5
  %141 = icmp slt i32 %139, %140
  br i1 %141, label %143, label %142

142:                                              ; preds = %138
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %167

143:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %160, %143
  %145 = load i32, ptr %16, align 4, !tbaa !5
  %146 = load ptr, ptr %4, align 8, !tbaa !9
  %147 = load i32, ptr %15, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i32, ptr %146, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp sle i32 %145, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %144
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %163

153:                                              ; preds = %144
  %154 = load ptr, ptr %13, align 8, !tbaa !9
  %155 = load i32, ptr %16, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i32, ptr %154, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %157, align 4, !tbaa !5
  br label %160

160:                                              ; preds = %153
  %161 = load i32, ptr %16, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %16, align 4, !tbaa !5
  br label %144, !llvm.loop !15

163:                                              ; preds = %152
  br label %164

164:                                              ; preds = %163
  %165 = load i32, ptr %15, align 4, !tbaa !5
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %15, align 4, !tbaa !5
  br label %138, !llvm.loop !16

167:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %168 = load ptr, ptr %4, align 8, !tbaa !9
  %169 = load i32, ptr %3, align 4, !tbaa !5
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %168, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !5
  store i32 %173, ptr %17, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %200, %167
  %175 = load i32, ptr %17, align 4, !tbaa !5
  %176 = icmp sgt i32 %175, 0
  br i1 %176, label %178, label %177

177:                                              ; preds = %174
  store i32 17, ptr %10, align 4
  br label %203

178:                                              ; preds = %174
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %179 = load ptr, ptr %13, align 8, !tbaa !9
  %180 = load i32, ptr %17, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i32, ptr %179, i64 %181
  %183 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %182, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %184 = load i32, ptr %183, align 4, !tbaa !5
  store i32 %184, ptr %18, align 4, !tbaa !5
  %185 = load i32, ptr %17, align 4, !tbaa !5
  %186 = load i32, ptr %18, align 4, !tbaa !5
  %187 = mul nsw i32 %185, %186
  %188 = load i32, ptr %8, align 4, !tbaa !5
  %189 = add nsw i32 %188, %187
  store i32 %189, ptr %8, align 4, !tbaa !5
  %190 = load i32, ptr %18, align 4, !tbaa !5
  %191 = load i32, ptr %6, align 4, !tbaa !5
  %192 = sub nsw i32 %191, %190
  store i32 %192, ptr %6, align 4, !tbaa !5
  %193 = load i32, ptr %6, align 4, !tbaa !5
  %194 = icmp sle i32 %193, 0
  br i1 %194, label %195, label %196

195:                                              ; preds = %178
  store i32 17, ptr %10, align 4
  br label %197

196:                                              ; preds = %178
  store i32 0, ptr %10, align 4
  br label %197

197:                                              ; preds = %196, %195
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  %198 = load i32, ptr %10, align 4
  switch i32 %198, label %203 [
    i32 0, label %199
  ]

199:                                              ; preds = %197
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %17, align 4, !tbaa !5
  %202 = add nsw i32 %201, -1
  store i32 %202, ptr %17, align 4, !tbaa !5
  br label %174, !llvm.loop !17

203:                                              ; preds = %197, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %204

204:                                              ; preds = %203
  %205 = load i32, ptr %8, align 4, !tbaa !5
  %206 = load i32, ptr %7, align 4, !tbaa !5
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %205, i32 noundef %206)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %208 = load i32, ptr %1, align 4
  ret i32 %208
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

; 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 uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

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

declare i32 @printf(ptr noundef, ...) #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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %5 = load i32, ptr %2, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %7 = icmp slt i32 %5, 0
  %8 = shl nsw i64 %6, 2
  %9 = select i1 %7, i64 -1, i64 %8
  %10 = call noalias noundef nonnull ptr @_Znam(i64 noundef %9) #8
  %11 = icmp sgt i32 %5, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.pre-phi = phi i64 [ %6, %0 ], [ %19, %.lr.ph ]
  %12 = getelementptr inbounds i32, ptr %10, i64 %.pre-phi
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %10, ptr noundef nonnull %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.lr.ph72.preheader, label %._crit_edge73

.lr.ph72.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %14 to i64
  br label %.lr.ph72

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

.lr.ph72:                                         ; preds = %.lr.ph72, %.lr.ph72.preheader
  %indvars.iv100 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next101, %.lr.ph72 ]
  %.05370 = phi i32 [ 0, %.lr.ph72.preheader ], [ %30, %.lr.ph72 ]
  %21 = phi i32 [ %13, %.lr.ph72.preheader ], [ %31, %.lr.ph72 ]
  %22 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv100
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %.not = icmp sgt i32 %23, %21
  %24 = sub nsw i32 %23, %21
  %spec.select = select i1 %.not, i32 %24, i32 0
  %25 = add i32 %23, 1
  %26 = add i32 %25, %spec.select
  %27 = sub nsw i32 %23, %spec.select
  %28 = mul nsw i32 %26, %27
  %29 = sdiv i32 %28, 2
  %30 = add nsw i32 %29, %.05370
  %31 = sub nsw i32 %21, %27
  %32 = icmp slt i32 %31, 1
  %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count
  %or.cond = select i1 %32, i1 true, i1 %exitcond.not
  br i1 %or.cond, label %._crit_edge73, label %.lr.ph72, !llvm.loop !11

._crit_edge73:                                    ; preds = %.lr.ph72, %._crit_edge
  %.1 = phi i32 [ 0, %._crit_edge ], [ %30, %.lr.ph72 ]
  store i32 %13, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %14 to i64
  %34 = getelementptr i32, ptr %10, i64 %33
  %35 = getelementptr i8, ptr %34, i64 -4
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = icmp slt i32 %36, -1
  %40 = shl nsw i64 %38, 2
  %41 = select i1 %39, i64 -1, i64 %40
  %42 = call noalias noundef nonnull ptr @_Znam(i64 noundef %41) #8
  %.not6381 = icmp slt i32 %36, 1
  br i1 %.not6381, label %.preheader66, label %.lr.ph84.preheader

.lr.ph84.preheader:                               ; preds = %._crit_edge73
  %scevgep = getelementptr i8, ptr %42, i64 4
  %43 = zext nneg i32 %36 to i64
  %44 = shl nuw nsw i64 %43, 2
  call void @llvm.memset.p0.i64(ptr align 4 %scevgep, i8 0, i64 %44, i1 false), !tbaa !5
  br label %.preheader66

.preheader66:                                     ; preds = %.lr.ph84.preheader, %._crit_edge73
  br i1 %15, label %.preheader65.preheader, label %.preheader

.preheader65.preheader:                           ; preds = %.preheader66
  %wide.trip.count114 = zext nneg i32 %14 to i64
  br label %.preheader65

.preheader65:                                     ; preds = %.preheader65.preheader, %._crit_edge88
  %indvars.iv111 = phi i64 [ 0, %.preheader65.preheader ], [ %indvars.iv.next112, %._crit_edge88 ]
  %45 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv111
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %.not6485 = icmp slt i32 %46, 1
  br i1 %.not6485, label %._crit_edge88, label %.lr.ph87.preheader

.lr.ph87.preheader:                               ; preds = %.preheader65
  %47 = add nuw i32 %46, 1
  %wide.trip.count109 = zext i32 %47 to i64
  %48 = zext nneg i32 %46 to i64
  %min.iters.check = icmp ult i32 %46, 8
  br i1 %min.iters.check, label %.lr.ph87.preheader125, label %vector.ph

.lr.ph87.preheader125:                            ; preds = %middle.block, %.lr.ph87.preheader
  %indvars.iv106.ph = phi i64 [ 1, %.lr.ph87.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph87

vector.ph:                                        ; preds = %.lr.ph87.preheader
  %n.vec = and i64 %48, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %49 = getelementptr inbounds i32, ptr %42, i64 %offset.idx
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %wide.load = load <4 x i32>, ptr %49, align 4, !tbaa !5
  %wide.load124 = load <4 x i32>, ptr %50, align 4, !tbaa !5
  %51 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %52 = add nsw <4 x i32> %wide.load124, <i32 1, i32 1, i32 1, i32 1>
  store <4 x i32> %51, ptr %49, align 4, !tbaa !5
  store <4 x i32> %52, ptr %50, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %53 = icmp eq i64 %index.next, %n.vec
  br i1 %53, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %48
  br i1 %cmp.n, label %._crit_edge88, label %.lr.ph87.preheader125

.preheader:                                       ; preds = %._crit_edge88, %.preheader66
  %54 = icmp sgt i32 %36, 0
  br i1 %54, label %.lr.ph92.preheader, label %._crit_edge93

.lr.ph92.preheader:                               ; preds = %.preheader
  %55 = zext nneg i32 %36 to i64
  br label %.lr.ph92

._crit_edge88:                                    ; preds = %.lr.ph87, %middle.block, %.preheader65
  %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count114
  br i1 %exitcond115.not, label %.preheader, label %.preheader65, !llvm.loop !15

.lr.ph87:                                         ; preds = %.lr.ph87.preheader125, %.lr.ph87
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %.lr.ph87 ], [ %indvars.iv106.ph, %.lr.ph87.preheader125 ]
  %56 = getelementptr inbounds i32, ptr %42, i64 %indvars.iv106
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %56, align 4, !tbaa !5
  %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_edge88, label %.lr.ph87, !llvm.loop !16

.lr.ph92:                                         ; preds = %.lr.ph92, %.lr.ph92.preheader
  %indvars.iv116 = phi i64 [ %55, %.lr.ph92.preheader ], [ %indvars.iv.next117, %.lr.ph92 ]
  %.05490 = phi i32 [ 0, %.lr.ph92.preheader ], [ %64, %.lr.ph92 ]
  %59 = getelementptr inbounds i32, ptr %42, i64 %indvars.iv116
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %59, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = trunc nuw nsw i64 %indvars.iv116 to i32
  %63 = mul nsw i32 %61, %62
  %64 = add nsw i32 %63, %.05490
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sub nsw i32 %65, %61
  store i32 %66, ptr %3, align 4, !tbaa !5
  %67 = icmp sgt i32 %66, 0
  %indvars.iv.next117 = add nsw i64 %indvars.iv116, -1
  %68 = icmp sgt i64 %indvars.iv116, 1
  %or.cond121 = and i1 %67, %68
  br i1 %or.cond121, label %.lr.ph92, label %._crit_edge93, !llvm.loop !17

._crit_edge93:                                    ; preds = %.lr.ph92, %.preheader
  %.155 = phi i32 [ 0, %.preheader ], [ %64, %.lr.ph92 ]
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.155, i32 noundef %.1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) 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 uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) 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 #5

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

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

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

!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, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
!17 = distinct !{!17, !10}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass