; LLVM IR from tangjz/acm-icpc :: codeforces/complete (313E)

; 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
@m = external dso_local global i32, align 4
@a = external dso_local global [100000 x i32], align 16
@b = external dso_local global [100000 x i32], align 16
@aque = external dso_local global [100001 x i32], align 16
@bque = external dso_local global [100001 x i32], align 16
@ans = external dso_local global [100000 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  br label %10

10:                                               ; preds = %22, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @n, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %10
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3)
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %19, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %15
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !9

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

26:                                               ; preds = %38, %25
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  br i1 %29, label %31, label %30

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

31:                                               ; preds = %26
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5)
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100000 x i32], ptr @b, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %35, align 4, !tbaa !5
  br label %38

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

41:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  store i32 %43, ptr %6, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %110, %41
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %113

48:                                               ; preds = %44
  br label %49

49:                                               ; preds = %58, %48
  %50 = load i32, ptr @m, align 4, !tbaa !5
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sub nsw i32 %50, %51
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100000 x i32], ptr @b, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %75

58:                                               ; preds = %49
  %59 = load i32, ptr @m, align 4, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = sub nsw i32 %59, %60
  %62 = sub nsw i32 %61, 1
  %63 = load i32, ptr @bque, align 16, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr @bque, align 16, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %65
  store i32 %62, ptr %66, align 4, !tbaa !5
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sub nsw i32 %67, %68
  %70 = sub nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100000 x i32], ptr @b, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr %72, align 4, !tbaa !5
  br label %49, !llvm.loop !12

75:                                               ; preds = %49
  br label %76

76:                                               ; preds = %103, %75
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %109

82:                                               ; preds = %76
  %83 = load i32, ptr @bque, align 16, !tbaa !5
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %97

85:                                               ; preds = %82
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = load i32, ptr @bque, align 16, !tbaa !5
  %88 = add nsw i32 %87, -1
  store i32 %88, ptr @bque, align 16, !tbaa !5
  %89 = sext i32 %87 to i64
  %90 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = add nsw i32 %86, %91
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %94, align 4, !tbaa !5
  br label %103

97:                                               ; preds = %82
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = load i32, ptr @aque, align 16, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr @aque, align 16, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i32], ptr @aque, i64 0, i64 %101
  store i32 %98, ptr %102, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %97, %85
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr %106, align 4, !tbaa !5
  br label %76, !llvm.loop !13

109:                                              ; preds = %76
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  store i32 %112, ptr %6, align 4, !tbaa !5
  br label %44, !llvm.loop !14

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

114:                                              ; preds = %136, %113
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = load i32, ptr @aque, align 16, !tbaa !5
  %117 = icmp sle i32 %115, %116
  br i1 %117, label %119, label %118

118:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %139

119:                                              ; preds = %114
  %120 = load i32, ptr %7, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i32], ptr @aque, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = load i32, ptr @bque, align 16, !tbaa !5
  %125 = add nsw i32 %124, -1
  store i32 %125, ptr @bque, align 16, !tbaa !5
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = add nsw i32 %123, %128
  %130 = load i32, ptr @m, align 4, !tbaa !5
  %131 = sub nsw i32 %129, %130
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %133, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %119
  %137 = load i32, ptr %7, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %7, align 4, !tbaa !5
  br label %114, !llvm.loop !15

139:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %140 = load i32, ptr @m, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  store i32 %141, ptr %8, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %158, %139
  %143 = load i32, ptr %8, align 4, !tbaa !5
  %144 = icmp sge i32 %143, 0
  br i1 %144, label %146, label %145

145:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %161

146:                                              ; preds = %142
  br label %147

147:                                              ; preds = %154, %146
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = add nsw i32 %151, -1
  store i32 %152, ptr %150, align 4, !tbaa !5
  %153 = icmp ne i32 %151, 0
  br i1 %153, label %154, label %157

154:                                              ; preds = %147
  %155 = load i32, ptr %8, align 4, !tbaa !5
  %156 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %155)
  br label %147, !llvm.loop !16

157:                                              ; preds = %147
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %8, align 4, !tbaa !5
  %160 = add nsw i32 %159, -1
  store i32 %160, ptr %8, align 4, !tbaa !5
  br label %142, !llvm.loop !17

161:                                              ; preds = %145
  %162 = call i32 @putchar(i32 noundef 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

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

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #3

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 = { 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !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
@m = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [100000 x i32], align 16
@b = external dso_local local_unnamed_addr global [100000 x i32], align 16
@aque = external dso_local local_unnamed_addr global [100001 x i32], align 16
@bque = external dso_local local_unnamed_addr global [100001 x i32], align 16
@ans = external dso_local local_unnamed_addr global [100000 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  br label %._crit_edge38

._crit_edge:                                      ; preds = %.lr.ph
  %6 = icmp sgt i32 %14, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  br i1 %6, label %.lr.ph37, label %._crit_edge38

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.02334 = phi i32 [ %13, %.lr.ph ], [ 0, %0 ]
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr %10, align 4, !tbaa !5
  %13 = add nuw nsw i32 %.02334, 1
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge38:                                    ; preds = %.lr.ph37, %._crit_edge.thread, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  %16 = load i32, ptr @m, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader33.preheader, label %.preheader30

.preheader33.preheader:                           ; preds = %._crit_edge38
  %18 = zext nneg i32 %16 to i64
  br label %.preheader33

.lr.ph37:                                         ; preds = %._crit_edge, %.lr.ph37
  %.02235 = phi i32 [ %25, %.lr.ph37 ], [ 0, %._crit_edge ]
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100000 x i32], ptr @b, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %22, align 4, !tbaa !5
  %25 = add nuw nsw i32 %.02235, 1
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph37, label %._crit_edge38, !llvm.loop !11

..loopexit32_crit_edge:                           ; preds = %71
  store i32 0, ptr %42, align 4, !tbaa !5
  br label %.loopexit32

.loopexit32:                                      ; preds = %..loopexit32_crit_edge, %.preheader31
  %28 = icmp sgt i64 %indvars.iv, 1
  br i1 %28, label %.preheader33, label %.preheader30, !llvm.loop !12

.preheader33:                                     ; preds = %.preheader33.preheader, %.loopexit32
  %indvars.iv = phi i64 [ %18, %.preheader33.preheader ], [ %indvars.iv.next, %.loopexit32 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %29 = sub nuw nsw i64 %18, %indvars.iv
  %30 = getelementptr inbounds [100000 x i32], ptr @b, i64 0, i64 %29
  %.promoted = load i32, ptr %30, align 4, !tbaa !5
  %.not2639 = icmp eq i32 %.promoted, 0
  br i1 %.not2639, label %.preheader31, label %.lr.ph40.preheader

.lr.ph40.preheader:                               ; preds = %.preheader33
  %31 = trunc nuw nsw i64 %29 to i32
  %xtraiter = and i32 %.promoted, 1
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph40.prol.loopexit, label %.lr.ph40.prol

.lr.ph40.prol:                                    ; preds = %.lr.ph40.preheader
  %32 = load i32, ptr @bque, align 16, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr @bque, align 16, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %34
  store i32 %31, ptr %35, align 4, !tbaa !5
  %36 = add nsw i32 %.promoted, -1
  br label %.lr.ph40.prol.loopexit

.lr.ph40.prol.loopexit:                           ; preds = %.lr.ph40.prol, %.lr.ph40.preheader
  %.unr = phi i32 [ %.promoted, %.lr.ph40.preheader ], [ %36, %.lr.ph40.prol ]
  %37 = icmp eq i32 %.promoted, 1
  br i1 %37, label %..preheader31_crit_edge, label %.lr.ph40

.preheader30:                                     ; preds = %.loopexit32, %._crit_edge38
  %38 = load i32, ptr @aque, align 16, !tbaa !5
  %.not49 = icmp slt i32 %38, 1
  br i1 %.not49, label %.preheader29, label %.lr.ph51

.lr.ph51:                                         ; preds = %.preheader30
  %bque.promoted48 = load i32, ptr @bque, align 16, !tbaa !5
  %39 = sext i32 %bque.promoted48 to i64
  %40 = zext nneg i32 %38 to i64
  %xtraiter69 = and i64 %40, 1
  %41 = icmp eq i32 %38, 1
  br i1 %41, label %.preheader29.loopexit.unr-lcssa, label %.lr.ph51.new

.lr.ph51.new:                                     ; preds = %.lr.ph51
  %unroll_iter = and i64 %40, 2147483646
  br label %87

..preheader31_crit_edge:                          ; preds = %.lr.ph40, %.lr.ph40.prol.loopexit
  store i32 0, ptr %30, align 4, !tbaa !5
  br label %.preheader31

.preheader31:                                     ; preds = %..preheader31_crit_edge, %.preheader33
  %42 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next
  %.promoted41 = load i32, ptr %42, align 4, !tbaa !5
  %.not2742 = icmp eq i32 %.promoted41, 0
  br i1 %.not2742, label %.loopexit32, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %.preheader31
  %bque.promoted = load i32, ptr @bque, align 16, !tbaa !5
  %43 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %.lr.ph43

.lr.ph40:                                         ; preds = %.lr.ph40.prol.loopexit, %.lr.ph40
  %44 = phi i32 [ %53, %.lr.ph40 ], [ %.unr, %.lr.ph40.prol.loopexit ]
  %45 = load i32, ptr @bque, align 16, !tbaa !5
  %46 = add nsw i32 %45, 1
  store i32 %46, ptr @bque, align 16, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %47
  store i32 %31, ptr %48, align 4, !tbaa !5
  %49 = load i32, ptr @bque, align 16, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr @bque, align 16, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %51
  store i32 %31, ptr %52, align 4, !tbaa !5
  %53 = add nsw i32 %44, -2
  %.not26.1 = icmp eq i32 %53, 0
  br i1 %.not26.1, label %..preheader31_crit_edge, label %.lr.ph40, !llvm.loop !13

.lr.ph43:                                         ; preds = %.lr.ph43.preheader, %71
  %54 = phi i32 [ %73, %71 ], [ %.promoted41, %.lr.ph43.preheader ]
  %55 = phi i32 [ %72, %71 ], [ %bque.promoted, %.lr.ph43.preheader ]
  %.not28 = icmp eq i32 %55, 0
  br i1 %.not28, label %66, label %56

56:                                               ; preds = %.lr.ph43
  %57 = add nsw i32 %55, -1
  store i32 %57, ptr @bque, align 16, !tbaa !5
  %58 = sext i32 %55 to i64
  %59 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = add nsw i64 %indvars.iv.next, %61
  %63 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !5
  br label %71

66:                                               ; preds = %.lr.ph43
  %67 = load i32, ptr @aque, align 16, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr @aque, align 16, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100001 x i32], ptr @aque, i64 0, i64 %69
  store i32 %43, ptr %70, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %66, %56
  %72 = phi i32 [ 0, %66 ], [ %57, %56 ]
  %73 = add nsw i32 %54, -1
  %.not27 = icmp eq i32 %73, 0
  br i1 %.not27, label %..loopexit32_crit_edge, label %.lr.ph43, !llvm.loop !14

.preheader29.loopexit.unr-lcssa:                  ; preds = %87, %.lr.ph51
  %indvars.iv61.unr = phi i64 [ %39, %.lr.ph51 ], [ %indvars.iv.next62.1, %87 ]
  %indvars.iv59.unr = phi i64 [ 1, %.lr.ph51 ], [ %indvars.iv.next60.1, %87 ]
  %lcmp.mod70.not = icmp eq i64 %xtraiter69, 0
  br i1 %lcmp.mod70.not, label %.preheader29, label %.preheader29.loopexit.epilog-lcssa

.preheader29.loopexit.epilog-lcssa:               ; preds = %.preheader29.loopexit.unr-lcssa
  %74 = getelementptr inbounds [100001 x i32], ptr @aque, i64 0, i64 %indvars.iv59.unr
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = trunc i64 %indvars.iv61.unr to i32
  %77 = add i32 %76, -1
  store i32 %77, ptr @bque, align 16, !tbaa !5
  %78 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %indvars.iv61.unr
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sub i32 %75, %16
  %81 = add i32 %80, %79
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %83, align 4, !tbaa !5
  br label %.preheader29

.preheader29:                                     ; preds = %.preheader29.loopexit.epilog-lcssa, %.preheader29.loopexit.unr-lcssa, %.preheader30
  br i1 %17, label %.preheader.preheader, label %._crit_edge56

.preheader.preheader:                             ; preds = %.preheader29
  %86 = zext nneg i32 %16 to i64
  br label %.preheader

87:                                               ; preds = %87, %.lr.ph51.new
  %indvars.iv61 = phi i64 [ %39, %.lr.ph51.new ], [ %indvars.iv.next62.1, %87 ]
  %indvars.iv59 = phi i64 [ 1, %.lr.ph51.new ], [ %indvars.iv.next60.1, %87 ]
  %niter = phi i64 [ 0, %.lr.ph51.new ], [ %niter.next.1, %87 ]
  %88 = getelementptr inbounds [100001 x i32], ptr @aque, i64 0, i64 %indvars.iv59
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %indvars.iv.next62 = add nsw i64 %indvars.iv61, -1
  %90 = trunc nsw i64 %indvars.iv.next62 to i32
  store i32 %90, ptr @bque, align 16, !tbaa !5
  %91 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %indvars.iv61
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sub i32 %89, %16
  %94 = add i32 %93, %92
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %96, align 4, !tbaa !5
  %indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
  %99 = getelementptr inbounds [100001 x i32], ptr @aque, i64 0, i64 %indvars.iv.next60
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %indvars.iv.next62.1 = add nsw i64 %indvars.iv61, -2
  %101 = trunc nsw i64 %indvars.iv.next62.1 to i32
  store i32 %101, ptr @bque, align 16, !tbaa !5
  %102 = getelementptr inbounds [100001 x i32], ptr @bque, i64 0, i64 %indvars.iv.next62
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sub i32 %100, %16
  %105 = add i32 %104, %103
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %107, align 4, !tbaa !5
  %indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader29.loopexit.unr-lcssa, label %87, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph53, %.preheader
  %110 = icmp sgt i64 %indvars.iv66, 1
  br i1 %110, label %.preheader, label %._crit_edge56, !llvm.loop !16

.preheader:                                       ; preds = %.preheader.preheader, %.loopexit
  %indvars.iv66 = phi i64 [ %86, %.preheader.preheader ], [ %indvars.iv.next67, %.loopexit ]
  %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
  %111 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %indvars.iv.next67
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = add nsw i32 %112, -1
  store i32 %113, ptr %111, align 4, !tbaa !5
  %.not2552 = icmp eq i32 %112, 0
  br i1 %.not2552, label %.loopexit, label %.lr.ph53.preheader

.lr.ph53.preheader:                               ; preds = %.preheader
  %114 = trunc nuw nsw i64 %indvars.iv.next67 to i32
  br label %.lr.ph53

._crit_edge56:                                    ; preds = %.loopexit, %.preheader29
  %115 = call i32 @putchar(i32 noundef 10)
  ret i32 0

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %.lr.ph53
  %116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %114)
  %117 = load i32, ptr %111, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  store i32 %118, ptr %111, align 4, !tbaa !5
  %.not25 = icmp eq i32 %117, 0
  br i1 %.not25, label %.loopexit, label %.lr.ph53, !llvm.loop !17
}

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nofree 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 = { inlinehint mustprogress 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 #4 = { nounwind }

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

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


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