; LLVM IR from tangjz/acm-icpc :: TDL_training/2016-03-20 (J - Draw Straight Walk - tjz)

; 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
@pre = external dso_local global [100001 x i32], align 16
@r = external dso_local global [100001 x i32], align 16
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@dep = external dso_local global [100001 x i32], align 16
@delta = external dso_local global [100001 x i32], align 16
@e = external dso_local global [100001 x [2 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3pfsi(i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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
  store i32 0, ptr %1, align 4
  br label %6

6:                                                ; preds = %13, %0
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds i32, ptr @pre, i64 %8
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %9)
  %11 = icmp ne i32 %10, -1
  br i1 %11, label %12, label %16

12:                                               ; preds = %6
  br label %13

13:                                               ; preds = %12
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @n, align 4, !tbaa !5
  br label %6, !llvm.loop !9

16:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %17 = load i32, ptr @n, align 4, !tbaa !5
  %18 = sub nsw i32 %17, 1
  store i32 %18, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %67, %16
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = icmp sge i32 %20, 0
  br i1 %21, label %23, label %22

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

23:                                               ; preds = %19
  br label %24

24:                                               ; preds = %43, %23
  %25 = load i32, ptr @R, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %27, label %41

27:                                               ; preds = %24
  %28 = load i32, ptr @R, align 4, !tbaa !5
  %29 = sub nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp slt i32 %35, %39
  br label %41

41:                                               ; preds = %27, %24
  %42 = phi i1 [ false, %24 ], [ %40, %27 ]
  br i1 %42, label %43, label %46

43:                                               ; preds = %41
  %44 = load i32, ptr @R, align 4, !tbaa !5
  %45 = add nsw i32 %44, -1
  store i32 %45, ptr @R, align 4, !tbaa !5
  br label %24, !llvm.loop !11

46:                                               ; preds = %41
  %47 = load i32, ptr @R, align 4, !tbaa !5
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %49, label %55

49:                                               ; preds = %46
  %50 = load i32, ptr @R, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 1
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  br label %57

55:                                               ; preds = %46
  %56 = load i32, ptr @n, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %55, %49
  %58 = phi i32 [ %54, %49 ], [ %56, %55 ]
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @r, i64 0, i64 %60
  store i32 %58, ptr %61, align 4, !tbaa !5
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = load i32, ptr @R, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr @R, align 4, !tbaa !5
  %65 = sext i32 %63 to i64
  %66 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %65
  store i32 %62, ptr %66, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %57
  %68 = load i32, ptr %2, align 4, !tbaa !5
  %69 = add nsw i32 %68, -1
  store i32 %69, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !12

70:                                               ; preds = %22
  call void @llvm.memset.p0.i64(ptr align 16 @e, i8 -1, i64 800008, i1 false)
  %71 = load i32, ptr @n, align 4, !tbaa !5
  call void @_Z3dfsii(i32 noundef 0, i32 noundef %71)
  call void @_Z3pfsi(i32 noundef 0)
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %72 = load i32, ptr @R, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr @R, align 4, !tbaa !5
  %74 = sext i32 %72 to i64
  %75 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %74
  store i32 0, ptr %75, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %151, %70
  %77 = load i32, ptr @L, align 4, !tbaa !5
  %78 = load i32, ptr @R, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %152

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %81 = load i32, ptr @L, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr @L, align 4, !tbaa !5
  %83 = sext i32 %81 to i64
  %84 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  store i32 %85, ptr %4, align 4, !tbaa !5
  %86 = load i32, ptr %3, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp slt i32 %86, %90
  br i1 %91, label %92, label %98

92:                                               ; preds = %80
  %93 = call i32 @putchar(i32 noundef 10)
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  store i32 %97, ptr %3, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %92, %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %109, %98
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [100001 x i32], ptr @delta, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = icmp slt i32 %100, %104
  br i1 %105, label %107, label %106

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

107:                                              ; preds = %99
  %108 = call i32 @putchar(i32 noundef 32)
  br label %109

109:                                              ; preds = %107
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %5, align 4, !tbaa !5
  br label %99, !llvm.loop !13

112:                                              ; preds = %106
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %116)
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100001 x [2 x i32]], ptr @e, i64 0, i64 %119
  %121 = getelementptr inbounds [2 x i32], ptr %120, i64 0, i64 0
  %122 = load i32, ptr %121, align 8, !tbaa !5
  %123 = icmp ne i32 %122, -1
  br i1 %123, label %124, label %134

124:                                              ; preds = %112
  %125 = load i32, ptr %4, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [100001 x [2 x i32]], ptr @e, i64 0, i64 %126
  %128 = getelementptr inbounds [2 x i32], ptr %127, i64 0, i64 0
  %129 = load i32, ptr %128, align 8, !tbaa !5
  %130 = load i32, ptr @R, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr @R, align 4, !tbaa !5
  %132 = sext i32 %130 to i64
  %133 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %132
  store i32 %129, ptr %133, align 4, !tbaa !5
  br label %134

134:                                              ; preds = %124, %112
  %135 = load i32, ptr %4, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100001 x [2 x i32]], ptr @e, i64 0, i64 %136
  %138 = getelementptr inbounds [2 x i32], ptr %137, i64 0, i64 1
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = icmp ne i32 %139, -1
  br i1 %140, label %141, label %151

141:                                              ; preds = %134
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100001 x [2 x i32]], ptr @e, i64 0, i64 %143
  %145 = getelementptr inbounds [2 x i32], ptr %144, i64 0, i64 1
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = load i32, ptr @R, align 4, !tbaa !5
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr @R, align 4, !tbaa !5
  %149 = sext i32 %147 to i64
  %150 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %149
  store i32 %146, ptr %150, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %141, %134
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %76, !llvm.loop !14

152:                                              ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret i32 0
}

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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}


; 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 local_unnamed_addr global i32, align 4
@pre = external dso_local global [100001 x i32], align 16
@r = external dso_local local_unnamed_addr global [100001 x i32], align 16
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local local_unnamed_addr global [100001 x i32], align 16
@dep = external dso_local local_unnamed_addr global [100001 x i32], align 16
@delta = external dso_local local_unnamed_addr global [100001 x i32], align 16
@e = external dso_local local_unnamed_addr global [100001 x [2 x i32]], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3pfsi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = load i32, ptr @n, align 4, !tbaa !5
  %2 = sext i32 %1 to i64
  %3 = getelementptr inbounds i32, ptr @pre, i64 %2
  %4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %.not26 = icmp eq i32 %4, -1
  br i1 %.not26, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = add nsw i32 %5, 1
  store i32 %6, ptr @n, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds i32, ptr @pre, i64 %7
  %9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %8)
  %.not = icmp eq i32 %9, -1
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %thread-pre-split.preheader, label %.lr.ph44.preheader

thread-pre-split.preheader:                       ; preds = %._crit_edge
  %R.promoted = load i32, ptr @R, align 4, !tbaa !5
  %12 = zext nneg i32 %10 to i64
  br label %thread-pre-split

._crit_edge36:                                    ; preds = %.critedge.thread
  store i32 %33, ptr @R, align 4, !tbaa !5
  br label %.lr.ph44.preheader

.lr.ph44.preheader:                               ; preds = %._crit_edge, %._crit_edge36
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800008) @e, i8 -1, i64 800008, i1 false)
  tail call void @_Z3dfsii(i32 noundef 0, i32 noundef %10)
  tail call void @_Z3pfsi(i32 noundef 0)
  store i32 1, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @que, align 16, !tbaa !5
  br label %.lr.ph44

thread-pre-split:                                 ; preds = %thread-pre-split.preheader, %.critedge.thread
  %indvars.iv47 = phi i64 [ %12, %thread-pre-split.preheader ], [ %indvars.iv.next48, %.critedge.thread ]
  %.pr3234 = phi i32 [ %R.promoted, %thread-pre-split.preheader ], [ %33, %.critedge.thread ]
  %indvars.iv.next48 = add nsw i64 %indvars.iv47, -1
  %13 = icmp sgt i32 %.pr3234, 0
  br i1 %13, label %.lr.ph27, label %.critedge.thread

.lr.ph27:                                         ; preds = %thread-pre-split
  %14 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %indvars.iv.next48
  %15 = load i32, ptr %14, align 4, !tbaa !5
  %16 = zext nneg i32 %.pr3234 to i64
  br label %17

17:                                               ; preds = %.lr.ph27, %23
  %indvars.iv = phi i64 [ %16, %.lr.ph27 ], [ %indvars.iv.next, %23 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %18 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %indvars.iv.next
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %.not56 = icmp slt i32 %22, %15
  br i1 %.not56, label %23, label %25

23:                                               ; preds = %17
  %24 = icmp ugt i64 %indvars.iv, 1
  br i1 %24, label %17, label %.critedge.thread, !llvm.loop !11

25:                                               ; preds = %17
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  %27 = add i64 %indvars.iv, 4294967295
  %28 = and i64 %27, 4294967295
  %29 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %28
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %23, %thread-pre-split, %25
  %.lcssa2553 = phi i32 [ %26, %25 ], [ %.pr3234, %thread-pre-split ], [ 0, %23 ]
  %30 = phi ptr [ %29, %25 ], [ @n, %thread-pre-split ], [ @n, %23 ]
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = getelementptr inbounds [100001 x i32], ptr @r, i64 0, i64 %indvars.iv.next48
  store i32 %31, ptr %32, align 4, !tbaa !5
  %33 = add nsw i32 %.lcssa2553, 1
  %34 = sext i32 %.lcssa2553 to i64
  %35 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %34
  %36 = trunc nuw nsw i64 %indvars.iv.next48 to i32
  store i32 %36, ptr %35, align 4, !tbaa !5
  %37 = icmp sgt i64 %indvars.iv47, 1
  br i1 %37, label %thread-pre-split, label %._crit_edge36, !llvm.loop !12

.lr.ph44:                                         ; preds = %.lr.ph44.preheader, %74
  %38 = phi i32 [ %76, %74 ], [ 0, %.lr.ph44.preheader ]
  %.01742 = phi i32 [ %.1, %74 ], [ 0, %.lr.ph44.preheader ]
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr @L, align 4, !tbaa !5
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100001 x i32], ptr @dep, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = icmp slt i32 %.01742, %45
  br i1 %46, label %47, label %50

47:                                               ; preds = %.lr.ph44
  %48 = tail call i32 @putchar(i32 noundef 10)
  %49 = load i32, ptr %44, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %47, %.lr.ph44
  %.1 = phi i32 [ %49, %47 ], [ %.01742, %.lr.ph44 ]
  %51 = getelementptr inbounds [100001 x i32], ptr @delta, i64 0, i64 %43
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = icmp sgt i32 %52, 0
  br i1 %53, label %.lr.ph40, label %._crit_edge41

._crit_edge41:                                    ; preds = %.lr.ph40, %50
  %54 = getelementptr inbounds [100001 x i32], ptr @pre, i64 0, i64 %43
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %55)
  %57 = getelementptr inbounds [100001 x [2 x i32]], ptr @e, i64 0, i64 %43
  %58 = load i32, ptr %57, align 8, !tbaa !5
  %.not23 = icmp eq i32 %58, -1
  %.pre.pre = load i32, ptr @R, align 4, !tbaa !5
  br i1 %.not23, label %67, label %63

.lr.ph40:                                         ; preds = %50, %.lr.ph40
  %.038 = phi i32 [ %60, %.lr.ph40 ], [ 0, %50 ]
  %59 = tail call i32 @putchar(i32 noundef 32)
  %60 = add nuw nsw i32 %.038, 1
  %61 = load i32, ptr %51, align 4, !tbaa !5
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %.lr.ph40, label %._crit_edge41, !llvm.loop !13

63:                                               ; preds = %._crit_edge41
  %64 = add nsw i32 %.pre.pre, 1
  store i32 %64, ptr @R, align 4, !tbaa !5
  %65 = sext i32 %.pre.pre to i64
  %66 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %65
  store i32 %58, ptr %66, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %63, %._crit_edge41
  %.pre = phi i32 [ %64, %63 ], [ %.pre.pre, %._crit_edge41 ]
  %68 = getelementptr inbounds i8, ptr %57, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %.not24 = icmp eq i32 %69, -1
  br i1 %.not24, label %74, label %70

70:                                               ; preds = %67
  %71 = add nsw i32 %.pre, 1
  store i32 %71, ptr @R, align 4, !tbaa !5
  %72 = sext i32 %.pre to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %72
  store i32 %69, ptr %73, align 4, !tbaa !5
  br label %74

74:                                               ; preds = %70, %67
  %75 = phi i32 [ %71, %70 ], [ %.pre, %67 ]
  %76 = load i32, ptr @L, align 4, !tbaa !5
  %77 = icmp slt i32 %76, %75
  br i1 %77, label %.lr.ph44, label %._crit_edge45, !llvm.loop !14

._crit_edge45:                                    ; preds = %74
  ret i32 0
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4

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

attributes #0 = { 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 #1 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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" }

!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}


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