; LLVM IR from tangjz/acm-icpc :: 51nod (1564)

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

@n = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@ans = external dso_local global [100010 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = 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 i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  br label %10

10:                                               ; preds = %238, %0
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %13, label %239

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

14:                                               ; preds = %24, %13
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i32, ptr @a, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %30
  store i32 1061109567, ptr %31, align 4, !tbaa !5
  store i32 1061109567, ptr @a, align 16, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = mul i64 %33, 8
  call void @llvm.memset.p0.i64(ptr align 8 getelementptr inbounds (i64, ptr @ans, i64 1), i8 0, i64 %34, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %197, %27
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %41 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %41, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %42, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  store i32 %46, ptr %6, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %195, %40
  br label %48

48:                                               ; preds = %47
  br label %49

49:                                               ; preds = %71, %48
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = icmp sle i32 %54, %58
  br i1 %59, label %60, label %68

60:                                               ; preds = %49
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = icmp sge i32 %65, %66
  br label %68

68:                                               ; preds = %60, %49
  %69 = phi i1 [ false, %49 ], [ %67, %60 ]
  br i1 %69, label %70, label %74

70:                                               ; preds = %68
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = add nsw i32 %72, -1
  store i32 %73, ptr %4, align 4, !tbaa !5
  br label %49, !llvm.loop !11

74:                                               ; preds = %68
  br label %75

75:                                               ; preds = %97, %74
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = load i32, ptr %3, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = icmp sle i32 %80, %84
  br i1 %85, label %86, label %94

86:                                               ; preds = %75
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = icmp sge i32 %91, %92
  br label %94

94:                                               ; preds = %86, %75
  %95 = phi i1 [ false, %75 ], [ %93, %86 ]
  br i1 %95, label %96, label %100

96:                                               ; preds = %94
  br label %97

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

100:                                              ; preds = %94
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sub nsw i32 %101, %102
  %104 = add nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %107 = load i32, ptr %3, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = mul nsw i64 %111, %113
  store i64 %114, ptr %7, align 8, !tbaa !13
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %106, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %116 = load i64, ptr %115, align 8, !tbaa !13
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = sub nsw i32 %117, %118
  %120 = add nsw i32 %119, 1
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %121
  store i64 %116, ptr %122, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %3, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = icmp sgt i32 %127, %131
  br i1 %132, label %133, label %145

133:                                              ; preds = %100
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = load i32, ptr %3, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = icmp sgt i32 %138, %142
  br i1 %143, label %144, label %145

144:                                              ; preds = %133
  br label %196

145:                                              ; preds = %133, %100
  %146 = load i32, ptr %5, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = load i32, ptr %3, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = icmp sgt i32 %150, %154
  br i1 %155, label %179, label %156

156:                                              ; preds = %145
  %157 = load i32, ptr %4, align 4, !tbaa !5
  %158 = sub nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = load i32, ptr %3, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = icmp sle i32 %161, %165
  br i1 %166, label %167, label %187

167:                                              ; preds = %156
  %168 = load i32, ptr %4, align 4, !tbaa !5
  %169 = sub nsw i32 %168, 1
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = load i32, ptr %5, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = icmp sgt i32 %172, %177
  br i1 %178, label %179, label %187

179:                                              ; preds = %167, %145
  %180 = load i32, ptr %4, align 4, !tbaa !5
  %181 = add nsw i32 %180, -1
  store i32 %181, ptr %4, align 4, !tbaa !5
  %182 = load i32, ptr %4, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %183
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %184)
  %186 = load i32, ptr %185, align 4, !tbaa !5
  store i32 %186, ptr %6, align 4, !tbaa !5
  br label %195

187:                                              ; preds = %167, %156
  %188 = load i32, ptr %5, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %5, align 4, !tbaa !5
  %190 = load i32, ptr %5, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %191
  %193 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %192)
  %194 = load i32, ptr %193, align 4, !tbaa !5
  store i32 %194, ptr %6, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %187, %179
  br label %47, !llvm.loop !15

196:                                              ; preds = %144
  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
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %3, align 4, !tbaa !5
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %3, align 4, !tbaa !5
  br label %35, !llvm.loop !16

200:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %201 = load i32, ptr @n, align 4, !tbaa !5
  %202 = sub nsw i32 %201, 1
  store i32 %202, ptr %8, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %220, %200
  %204 = load i32, ptr %8, align 4, !tbaa !5
  %205 = icmp sge i32 %204, 1
  br i1 %205, label %207, label %206

206:                                              ; preds = %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %223

207:                                              ; preds = %203
  %208 = load i32, ptr %8, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %209
  %211 = load i32, ptr %8, align 4, !tbaa !5
  %212 = add nsw i32 %211, 1
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %213
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %210, ptr noundef nonnull align 8 dereferenceable(8) %214)
  %216 = load i64, ptr %215, align 8, !tbaa !13
  %217 = load i32, ptr %8, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %218
  store i64 %216, ptr %219, align 8, !tbaa !13
  br label %220

220:                                              ; preds = %207
  %221 = load i32, ptr %8, align 4, !tbaa !5
  %222 = add nsw i32 %221, -1
  store i32 %222, ptr %8, align 4, !tbaa !5
  br label %203, !llvm.loop !17

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

224:                                              ; preds = %235, %223
  %225 = load i32, ptr %9, align 4, !tbaa !5
  %226 = load i32, ptr @n, align 4, !tbaa !5
  %227 = icmp sle i32 %225, %226
  br i1 %227, label %229, label %228

228:                                              ; preds = %224
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %238

229:                                              ; preds = %224
  %230 = load i32, ptr %9, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %231
  %233 = load i64, ptr %232, align 8, !tbaa !13
  %234 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %233)
  br label %235

235:                                              ; preds = %229
  %236 = load i32, ptr %9, align 4, !tbaa !5
  %237 = add nsw i32 %236, 1
  store i32 %237, ptr %9, align 4, !tbaa !5
  br label %224, !llvm.loop !18

238:                                              ; preds = %228
  br label %10, !llvm.loop !19

239:                                              ; preds = %10
  ret i32 0
}

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #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, ...) #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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"

@n = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@ans = external dso_local global [100010 x i64], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = icmp eq i32 %3, 1
  br i1 %4, label %.preheader71, label %._crit_edge92

.loopexit:                                        ; preds = %.lr.ph91, %._crit_edge, %.preheader
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %6 = icmp eq i32 %5, 1
  br i1 %6, label %.preheader71, label %._crit_edge92, !llvm.loop !5

.preheader71:                                     ; preds = %0, %.loopexit
  %7 = load i32, ptr @n, align 4, !tbaa !7
  %.not78 = icmp slt i32 %7, 1
  br i1 %.not78, label %.preheader71.._crit_edge_crit_edge, label %.lr.ph

.preheader71.._crit_edge_crit_edge:               ; preds = %.preheader71
  %.pre116 = sext i32 %7 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.preheader71.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre116, %.preheader71.._crit_edge_crit_edge ], [ %16, %.lr.ph ]
  %8 = phi i32 [ %7, %.preheader71.._crit_edge_crit_edge ], [ %15, %.lr.ph ]
  %9 = add nsw i32 %8, 1
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %10
  store i32 1061109567, ptr %11, align 4, !tbaa !7
  store i32 1061109567, ptr @a, align 16, !tbaa !7
  %12 = shl nsw i64 %.pre-phi, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 getelementptr inbounds (i8, ptr @ans, i64 8), i8 0, i64 %12, i1 false)
  %.not6082 = icmp slt i32 %8, 1
  br i1 %.not6082, label %.loopexit, label %.lr.ph85

.lr.ph:                                           ; preds = %.preheader71, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.preheader71 ]
  %13 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %13)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %15 = load i32, ptr @n, align 4, !tbaa !7
  %16 = sext i32 %15 to i64
  %.not.not = icmp slt i64 %indvars.iv, %16
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader70:                                     ; preds = %50
  %17 = icmp sgt i32 %51, 1
  br i1 %17, label %.lr.ph88.preheader, label %.preheader

.lr.ph88.preheader:                               ; preds = %.preheader70
  %18 = zext nneg i32 %51 to i64
  br label %.lr.ph88

.lr.ph85:                                         ; preds = %._crit_edge, %50
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %50 ], [ 1, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %19 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv106
  br label %20

20:                                               ; preds = %48, %.lr.ph85
  %storemerge67.in = phi ptr [ %19, %.lr.ph85 ], [ %49, %48 ]
  %.047 = phi i64 [ %indvars.iv106, %.lr.ph85 ], [ %.249, %48 ]
  %.046 = phi i64 [ %indvars.iv106, %.lr.ph85 ], [ %.2, %48 ]
  %storemerge67 = load i32, ptr %storemerge67.in, align 4, !tbaa !7
  store i32 %storemerge67, ptr %1, align 4, !tbaa !7
  %21 = load i32, ptr %19, align 4, !tbaa !7
  %sext = shl i64 %.047, 32
  %22 = ashr exact i64 %sext, 32
  br label %23

23:                                               ; preds = %23, %20
  %indvars.iv100 = phi i64 [ %indvars.iv.next101, %23 ], [ %22, %20 ]
  %indvars.iv.next101 = add nsw i64 %indvars.iv100, -1
  %24 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next101
  %25 = load i32, ptr %24, align 4, !tbaa !7
  %.not62 = icmp sgt i32 %25, %21
  %.not63 = icmp slt i32 %25, %storemerge67
  %or.cond = select i1 %.not62, i1 true, i1 %.not63
  br i1 %or.cond, label %.critedge.preheader, label %23, !llvm.loop !12

.critedge.preheader:                              ; preds = %23
  %26 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next101
  %sext117 = shl i64 %.046, 32
  %27 = ashr exact i64 %sext117, 32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.preheader, %.critedge
  %indvars.iv103 = phi i64 [ %27, %.critedge.preheader ], [ %indvars.iv.next104, %.critedge ]
  %indvars.iv.next104 = add nsw i64 %indvars.iv103, 1
  %28 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next104
  %29 = load i32, ptr %28, align 4, !tbaa !7
  %.not64 = icmp sgt i32 %29, %21
  %.not65 = icmp slt i32 %29, %storemerge67
  %or.cond68 = select i1 %.not64, i1 true, i1 %.not65
  br i1 %or.cond68, label %.critedge2, label %.critedge, !llvm.loop !13

.critedge2:                                       ; preds = %.critedge
  %30 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv.next104
  %reass.sub = sub i64 %indvars.iv103, %indvars.iv100
  %31 = shl i64 %reass.sub, 32
  %sext118 = add i64 %31, 4294967296
  %32 = ashr exact i64 %sext118, 32
  %33 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %32
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %34 = sext i32 %21 to i64
  %35 = sext i32 %storemerge67 to i64
  %36 = mul nsw i64 %34, %35
  store i64 %36, ptr %2, align 8, !tbaa !14
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %38 = load i64, ptr %37, align 8, !tbaa !14
  store i64 %38, ptr %33, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  %39 = load i32, ptr %26, align 4, !tbaa !7
  %40 = load i32, ptr %19, align 4, !tbaa !7
  %41 = icmp sgt i32 %39, %40
  %.pre = load i32, ptr %30, align 4, !tbaa !7
  %42 = icmp sgt i32 %.pre, %40
  %or.cond121 = select i1 %41, i1 %42, i1 false
  br i1 %or.cond121, label %50, label %43

43:                                               ; preds = %.critedge2
  %44 = icmp sgt i32 %.pre, %40
  br i1 %44, label %48, label %45

45:                                               ; preds = %43
  %.not66 = icmp sle i32 %39, %40
  %46 = icmp sgt i32 %39, %.pre
  %or.cond69 = and i1 %.not66, %46
  br i1 %or.cond69, label %48, label %47

47:                                               ; preds = %45
  br label %48

48:                                               ; preds = %43, %45, %47
  %.sink = phi ptr [ %30, %47 ], [ %26, %45 ], [ %26, %43 ]
  %.249 = phi i64 [ %indvars.iv100, %47 ], [ %indvars.iv.next101, %45 ], [ %indvars.iv.next101, %43 ]
  %.2 = phi i64 [ %indvars.iv.next104, %47 ], [ %indvars.iv103, %45 ], [ %indvars.iv103, %43 ]
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %.sink)
  br label %20, !llvm.loop !16

50:                                               ; preds = %.critedge2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %51 = load i32, ptr @n, align 4, !tbaa !7
  %52 = sext i32 %51 to i64
  %.not60.not = icmp slt i64 %indvars.iv106, %52
  br i1 %.not60.not, label %.lr.ph85, label %.preheader70, !llvm.loop !17

.preheader.loopexit:                              ; preds = %.lr.ph88
  %.pre115 = load i32, ptr @n, align 4, !tbaa !7
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader70
  %53 = phi i32 [ %.pre115, %.preheader.loopexit ], [ %51, %.preheader70 ]
  %.not6189 = icmp slt i32 %53, 1
  br i1 %.not6189, label %.loopexit, label %.lr.ph91

.lr.ph88:                                         ; preds = %.lr.ph88.preheader, %.lr.ph88
  %indvars.iv109 = phi i64 [ %18, %.lr.ph88.preheader ], [ %indvars.iv.next110, %.lr.ph88 ]
  %indvars.iv.next110 = add nsw i64 %indvars.iv109, -1
  %54 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv.next110
  %55 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv109
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull align 8 dereferenceable(8) %55)
  %57 = load i64, ptr %56, align 8, !tbaa !14
  store i64 %57, ptr %54, align 8, !tbaa !14
  %58 = icmp ugt i64 %indvars.iv109, 2
  br i1 %58, label %.lr.ph88, label %.preheader.loopexit, !llvm.loop !18

.lr.ph91:                                         ; preds = %.preheader, %.lr.ph91
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %.lr.ph91 ], [ 1, %.preheader ]
  %59 = getelementptr inbounds [100010 x i64], ptr @ans, i64 0, i64 %indvars.iv112
  %60 = load i64, ptr %59, align 8, !tbaa !14
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %60)
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %62 = load i32, ptr @n, align 4, !tbaa !7
  %63 = sext i32 %62 to i64
  %.not61.not = icmp slt i64 %indvars.iv112, %63
  br i1 %.not61.not, label %.lr.ph91, label %.loopexit, !llvm.loop !19

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) 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 #1

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 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !9, i64 0}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}


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