; LLVM IR from tangjz/acm-icpc :: buaa/oj3rd (752)

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

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@l = external dso_local global [100010 x i32], align 16
@r = external dso_local global [100010 x i32], align 16
@ans = external dso_local global [100010 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = 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
  store i32 0, ptr %1, align 4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @t)
  br label %9

9:                                                ; preds = %201, %0
  %10 = load i32, ptr @t, align 4, !tbaa !5
  %11 = add nsw i32 %10, -1
  store i32 %11, ptr @t, align 4, !tbaa !5
  %12 = icmp ne i32 %10, 0
  br i1 %12, label %13, label %203

13:                                               ; preds = %9
  call void @llvm.memset.p0.i64(ptr align 16 @ans, i8 127, i64 400040, i1 false)
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %15

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

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %35

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr @a, i64 %22
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %23)
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %27
  store i32 %25, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %30
  store i32 %25, ptr %31, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %20
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !9

35:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %36

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

40:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %80

41:                                               ; preds = %36
  br label %42

42:                                               ; preds = %64, %41
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp sgt i32 %46, 1
  br i1 %47, label %48, label %62

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

62:                                               ; preds = %48, %42
  %63 = phi i1 [ false, %42 ], [ %61, %48 ]
  br i1 %63, label %64, label %76

64:                                               ; preds = %62
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = sub nsw i32 %68, 1
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %74
  store i32 %72, ptr %75, align 4, !tbaa !5
  br label %42, !llvm.loop !11

76:                                               ; preds = %62
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !12

80:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %81 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %81, ptr %4, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %123, %80
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %86, label %85

85:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %126

86:                                               ; preds = %82
  br label %87

87:                                               ; preds = %110, %86
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr @n, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %94, label %108

94:                                               ; preds = %87
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = icmp sge i32 %98, %106
  br label %108

108:                                              ; preds = %94, %87
  %109 = phi i1 [ false, %87 ], [ %107, %94 ]
  br i1 %109, label %110, label %122

110:                                              ; preds = %108
  %111 = load i32, ptr %4, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !5
  %115 = add nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %120
  store i32 %118, ptr %121, align 4, !tbaa !5
  br label %87, !llvm.loop !13

122:                                              ; preds = %108
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %4, align 4, !tbaa !5
  %125 = add nsw i32 %124, -1
  store i32 %125, ptr %4, align 4, !tbaa !5
  br label %82, !llvm.loop !14

126:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %162, %126
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = load i32, ptr @n, align 4, !tbaa !5
  %130 = icmp sle i32 %128, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %165

132:                                              ; preds = %127
  %133 = load i32, ptr %5, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr %5, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %138
  %140 = load i32, ptr %139, align 4, !tbaa !5
  %141 = sub nsw i32 %136, %140
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %143
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %146
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %144, ptr noundef nonnull align 4 dereferenceable(4) %147)
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %155
  %157 = load i32, ptr %156, align 4, !tbaa !5
  %158 = sub nsw i32 %153, %157
  %159 = add nsw i32 %158, 1
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %160
  store i32 %149, ptr %161, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %132
  %163 = load i32, ptr %5, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %5, align 4, !tbaa !5
  br label %127, !llvm.loop !15

165:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %166 = load i32, ptr @n, align 4, !tbaa !5
  %167 = sub nsw i32 %166, 1
  store i32 %167, ptr %6, align 4, !tbaa !5
  br label %168

168:                                              ; preds = %185, %165
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %172, label %171

171:                                              ; preds = %168
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %188

172:                                              ; preds = %168
  %173 = load i32, ptr %6, align 4, !tbaa !5
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %174
  %176 = load i32, ptr %6, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %178
  %180 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %175, ptr noundef nonnull align 4 dereferenceable(4) %179)
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = load i32, ptr %6, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %183
  store i32 %181, ptr %184, align 4, !tbaa !5
  br label %185

185:                                              ; preds = %172
  %186 = load i32, ptr %6, align 4, !tbaa !5
  %187 = add nsw i32 %186, -1
  store i32 %187, ptr %6, align 4, !tbaa !5
  br label %168, !llvm.loop !16

188:                                              ; preds = %171
  %189 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @m)
  br label %190

190:                                              ; preds = %194, %188
  %191 = load i32, ptr @m, align 4, !tbaa !5
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr @m, align 4, !tbaa !5
  %193 = icmp ne i32 %191, 0
  br i1 %193, label %194, label %201

194:                                              ; preds = %190
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %195 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %7)
  %196 = load i32, ptr %7, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %199)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %190, !llvm.loop !17

201:                                              ; preds = %190
  %202 = call i32 @putchar(i32 noundef 10)
  br label %9, !llvm.loop !18

203:                                              ; preds = %9
  ret i32 0
}

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

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

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

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

; 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

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

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 nounwind willreturn memory(argmem: write) }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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}
!18 = distinct !{!18, !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"

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@l = external dso_local local_unnamed_addr global [100010 x i32], align 16
@r = external dso_local local_unnamed_addr global [100010 x i32], align 16
@ans = external dso_local global [100010 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %3 = load i32, ptr @t, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  store i32 %4, ptr @t, align 4, !tbaa !5
  %.not81 = icmp eq i32 %3, 0
  br i1 %.not81, label %._crit_edge84, label %.lr.ph83

.lr.ph83:                                         ; preds = %0, %._crit_edge80
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400040) @ans, i8 127, i64 400040, i1 false)
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not4257 = icmp slt i32 %6, 1
  br i1 %.not4257, label %.preheader54, label %.lr.ph

.preheader55:                                     ; preds = %.lr.ph
  %.not4361 = icmp slt i32 %13, 1
  br i1 %.not4361, label %.preheader54, label %.preheader51.preheader

.preheader51.preheader:                           ; preds = %.preheader55
  %7 = add nuw i32 %13, 1
  %wide.trip.count = zext i32 %7 to i64
  br label %.preheader51

.lr.ph:                                           ; preds = %.lr.ph83, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %.lr.ph83 ]
  %8 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %8)
  %10 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %indvars.iv
  %11 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %11, ptr %10, align 4, !tbaa !5
  %12 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %indvars.iv
  store i32 %11, ptr %12, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %.not42.not = icmp slt i64 %indvars.iv, %14
  br i1 %.not42.not, label %.lr.ph, label %.preheader55, !llvm.loop !9

.preheader54:                                     ; preds = %.critedge, %.lr.ph83, %.preheader55
  %.not4361105 = phi i1 [ true, %.preheader55 ], [ true, %.lr.ph83 ], [ %.not4361, %.critedge ]
  %15 = phi i32 [ %13, %.preheader55 ], [ %6, %.lr.ph83 ], [ %13, %.critedge ]
  %.not4466 = icmp eq i32 %15, 0
  br i1 %.not4466, label %.preheader53, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader54
  %16 = sext i32 %15 to i64
  br label %.preheader

.preheader51:                                     ; preds = %.preheader51.preheader, %.critedge
  %indvars.iv88 = phi i64 [ 1, %.preheader51.preheader ], [ %indvars.iv.next89, %.critedge ]
  %17 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %indvars.iv88
  %.promoted = load i32, ptr %17, align 4, !tbaa !5
  %18 = icmp sgt i32 %.promoted, 1
  br i1 %18, label %.lr.ph59, label %.critedge

.lr.ph59:                                         ; preds = %.preheader51
  %19 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv88
  %20 = load i32, ptr %19, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %.lr.ph59, %27
  %22 = phi i32 [ %.promoted, %.lr.ph59 ], [ %29, %27 ]
  %23 = add nsw i32 %22, -1
  %24 = zext nneg i32 %23 to i64
  %25 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %.not49 = icmp slt i32 %20, %26
  br i1 %.not49, label %.critedge, label %27

27:                                               ; preds = %21
  %28 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %24
  %29 = load i32, ptr %28, align 4, !tbaa !5
  store i32 %29, ptr %17, align 4, !tbaa !5
  %30 = icmp sgt i32 %29, 1
  br i1 %30, label %21, label %.critedge, !llvm.loop !11

.critedge:                                        ; preds = %27, %21, %.preheader51
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
  br i1 %exitcond.not, label %.preheader54, label %.preheader51, !llvm.loop !12

.preheader53:                                     ; preds = %.critedge2, %.preheader54
  br i1 %.not4361105, label %.preheader52, label %.lr.ph70

.preheader:                                       ; preds = %.preheader.preheader, %.critedge2
  %indvars.iv91 = phi i64 [ %16, %.preheader.preheader ], [ %indvars.iv.next92, %.critedge2 ]
  %31 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %indvars.iv91
  %.promoted63 = load i32, ptr %31, align 4, !tbaa !5
  %32 = icmp slt i32 %.promoted63, %15
  br i1 %32, label %.lr.ph64, label %.critedge2

.lr.ph64:                                         ; preds = %.preheader
  %33 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv91
  %34 = load i32, ptr %33, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %.lr.ph64, %41
  %36 = phi i32 [ %.promoted63, %.lr.ph64 ], [ %43, %41 ]
  %37 = add nsw i32 %36, 1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %.not48 = icmp slt i32 %34, %40
  br i1 %.not48, label %.critedge2, label %41

41:                                               ; preds = %35
  %42 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %38
  %43 = load i32, ptr %42, align 4, !tbaa !5
  store i32 %43, ptr %31, align 4, !tbaa !5
  %44 = icmp slt i32 %43, %15
  br i1 %44, label %35, label %.critedge2, !llvm.loop !13

.critedge2:                                       ; preds = %41, %35, %.preheader
  %indvars.iv.next92 = add nsw i64 %indvars.iv91, -1
  %.not44 = icmp eq i64 %indvars.iv.next92, 0
  br i1 %.not44, label %.preheader53, label %.preheader, !llvm.loop !14

.preheader52:                                     ; preds = %.lr.ph70, %.preheader53
  %.lcssa56 = phi i32 [ %15, %.preheader53 ], [ %64, %.lr.ph70 ]
  %.not4673 = icmp eq i32 %.lcssa56, 1
  br i1 %.not4673, label %._crit_edge, label %.lr.ph76.preheader

.lr.ph76.preheader:                               ; preds = %.preheader52
  %45 = sext i32 %.lcssa56 to i64
  %46 = add nsw i64 %45, -1
  br label %.lr.ph76

.lr.ph70:                                         ; preds = %.preheader53, %.lr.ph70
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph70 ], [ 1, %.preheader53 ]
  %47 = getelementptr inbounds [100010 x i32], ptr @r, i64 0, i64 %indvars.iv94
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %indvars.iv94
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = add i32 %48, 1
  %52 = sub i32 %51, %50
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %53
  %55 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv94
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %54, ptr noundef nonnull align 4 dereferenceable(4) %55)
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = load i32, ptr %47, align 4, !tbaa !5
  %59 = load i32, ptr %49, align 4, !tbaa !5
  %60 = add i32 %58, 1
  %61 = sub i32 %60, %59
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %62
  store i32 %57, ptr %63, align 4, !tbaa !5
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %64 = load i32, ptr @n, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %.not45.not = icmp slt i64 %indvars.iv94, %65
  br i1 %.not45.not, label %.lr.ph70, label %.preheader52, !llvm.loop !15

._crit_edge:                                      ; preds = %.lr.ph76, %.preheader52
  %66 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
  %67 = load i32, ptr @m, align 4, !tbaa !5
  %68 = add nsw i32 %67, -1
  store i32 %68, ptr @m, align 4, !tbaa !5
  %.not4777 = icmp eq i32 %67, 0
  br i1 %.not4777, label %._crit_edge80, label %.lr.ph79

.lr.ph76:                                         ; preds = %.lr.ph76.preheader, %.lr.ph76
  %indvars.iv99 = phi i64 [ %45, %.lr.ph76.preheader ], [ %indvars.iv.next100, %.lr.ph76 ]
  %indvars.iv97 = phi i64 [ %46, %.lr.ph76.preheader ], [ %indvars.iv.next98, %.lr.ph76 ]
  %69 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %indvars.iv97
  %70 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %indvars.iv99
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %69, ptr noundef nonnull align 4 dereferenceable(4) %70)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  store i32 %72, ptr %69, align 4, !tbaa !5
  %indvars.iv.next98 = add nsw i64 %indvars.iv97, -1
  %.not46 = icmp eq i64 %indvars.iv.next98, 0
  %indvars.iv.next100 = add nsw i64 %indvars.iv99, -1
  br i1 %.not46, label %._crit_edge, label %.lr.ph76, !llvm.loop !16

.lr.ph79:                                         ; preds = %._crit_edge, %.lr.ph79
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100010 x i32], ptr @ans, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %77)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %79 = load i32, ptr @m, align 4, !tbaa !5
  %80 = add nsw i32 %79, -1
  store i32 %80, ptr @m, align 4, !tbaa !5
  %.not47 = icmp eq i32 %79, 0
  br i1 %.not47, label %._crit_edge80, label %.lr.ph79, !llvm.loop !17

._crit_edge80:                                    ; preds = %.lr.ph79, %._crit_edge
  %81 = call i32 @putchar(i32 noundef 10)
  %82 = load i32, ptr @t, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %82, 0
  br i1 %.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !18

._crit_edge84:                                    ; preds = %._crit_edge80, %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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

; 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

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

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 nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { 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}
!18 = distinct !{!18, !10}


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