; LLVM IR from tangjz/acm-icpc :: lydsy (1007)

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

%struct.Line = type { i32, i32, i32 }

@line = external dso_local global [50001 x %struct.Line], align 16
@q = external dso_local global [50001 x %struct.Line], align 16
@n = external dso_local global i32, align 4
@out = external dso_local global [50001 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
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z5CrossRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

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

5:                                                ; preds = %14, %0
  %6 = load i32, ptr %2, align 4, !tbaa !5
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = icmp sle i32 %6, %7
  br i1 %8, label %9, label %17

9:                                                ; preds = %5
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %11
  %13 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN4Line4readEi(ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef %13)
  br label %14

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

17:                                               ; preds = %5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %20
  call void @_ZSt4sortIP4LineEvT_S2_(ptr noundef getelementptr inbounds ([50001 x %struct.Line], ptr @line, i64 0, i64 1), ptr noundef %21)
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = add nsw i32 %22, 1
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %24
  %26 = call noundef ptr @_ZSt6uniqueIP4LineET_S2_S2_(ptr noundef getelementptr inbounds ([50001 x %struct.Line], ptr @line, i64 0, i64 1), ptr noundef %25)
  %27 = ptrtoint ptr %26 to i64
  %28 = sub i64 %27, ptrtoint (ptr getelementptr inbounds ([50001 x %struct.Line], ptr @line, i64 0, i64 1) to i64)
  %29 = sdiv exact i64 %28, 12
  %30 = trunc i64 %29 to i32
  store i32 %30, ptr @n, align 4, !tbaa !5
  store i32 1, ptr %2, align 4, !tbaa !5
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %72, %17
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %35, label %75

35:                                               ; preds = %31
  br label %36

36:                                               ; preds = %61, %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 2
  br i1 %38, label %39, label %59

39:                                               ; preds = %36
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sub nsw i32 %40, 1
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %42
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sub nsw i32 %44, 2
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %46
  %48 = call noundef double @_Z5CrossRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12) %43, ptr noundef nonnull align 4 dereferenceable(12) %47)
  %49 = load i32, ptr %3, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %51
  %53 = load i32, ptr %2, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %54
  %56 = call noundef double @_Z5CrossRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12) %52, ptr noundef nonnull align 4 dereferenceable(12) %55)
  %57 = fsub double %56, 1.000000e-15
  %58 = fcmp ogt double %48, %57
  br label %59

59:                                               ; preds = %39, %36
  %60 = phi i1 [ false, %36 ], [ %58, %39 ]
  br i1 %60, label %61, label %64

61:                                               ; preds = %59
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = add nsw i32 %62, -1
  store i32 %63, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !11

64:                                               ; preds = %59
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %66
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %70
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %71, ptr align 4 %67, i64 12, i1 false), !tbaa.struct !12
  br label %72

72:                                               ; preds = %64
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !13

75:                                               ; preds = %31
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %89, %75
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = load i32, ptr %3, align 4, !tbaa !5
  %79 = icmp slt i32 %77, %78
  br i1 %79, label %80, label %92

80:                                               ; preds = %76
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %82
  %84 = getelementptr inbounds %struct.Line, ptr %83, i32 0, i32 2
  %85 = load i32, ptr %84, align 4, !tbaa !14
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %87
  store i32 %85, ptr %88, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %80
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %2, align 4, !tbaa !5
  br label %76, !llvm.loop !16

92:                                               ; preds = %76
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %94
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef getelementptr inbounds ([50001 x i32], ptr @out, i64 0, i64 1), ptr noundef %95)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %106, %92
  %97 = load i32, ptr %2, align 4, !tbaa !5
  %98 = load i32, ptr %3, align 4, !tbaa !5
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %100, label %109

100:                                              ; preds = %96
  %101 = load i32, ptr %2, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %104)
  br label %106

106:                                              ; preds = %100
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %2, align 4, !tbaa !5
  br label %96, !llvm.loop !17

109:                                              ; preds = %96
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Line4readEi(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4LineEvT_S2_(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIP4LineET_S2_S2_(ptr noundef, ptr noundef) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

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

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

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

%struct.Line = type { i32, i32, i32 }

@line = external dso_local global [50001 x %struct.Line], align 16
@q = external dso_local global [50001 x %struct.Line], align 16
@n = external dso_local global i32, align 4
@out = external dso_local global [50001 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
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_Z5CrossRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not29 = icmp slt i32 %2, 1
  br i1 %.not29, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %3 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %indvars.iv
  %4 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_ZN4Line4readEi(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef %4)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = sext i32 %5 to i64
  %.not.not = icmp slt i64 %indvars.iv, %6
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %2, %0 ], [ %5, %.lr.ph ]
  %7 = add nsw i32 %.lcssa, 1
  %8 = sext i32 %7 to i64
  %9 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %8
  tail call void @_ZSt4sortIP4LineEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @line, i64 12), ptr noundef nonnull %9)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = add nsw i32 %10, 1
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %12
  %14 = tail call noundef ptr @_ZSt6uniqueIP4LineET_S2_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @line, i64 12), ptr noundef nonnull %13)
  %15 = ptrtoint ptr %14 to i64
  %16 = sub i64 %15, ptrtoint (ptr getelementptr inbounds (i8, ptr @line, i64 12) to i64)
  %17 = sdiv exact i64 %16, 12
  %18 = trunc i64 %17 to i32
  store i32 %18, ptr @n, align 4, !tbaa !5
  %.not2731 = icmp slt i32 %18, 1
  br i1 %.not2731, label %._crit_edge37.thread, label %.preheader28

.preheader28:                                     ; preds = %._crit_edge, %.critedge
  %indvars.iv48 = phi i64 [ %indvars.iv.next49, %.critedge ], [ 1, %._crit_edge ]
  %.033 = phi i32 [ %71, %.critedge ], [ 1, %._crit_edge ]
  %19 = getelementptr inbounds [50001 x %struct.Line], ptr @line, i64 0, i64 %indvars.iv48
  %20 = zext i32 %.033 to i64
  %smin = tail call i32 @llvm.smin.i32(i32 %.033, i32 2)
  br label %59

.preheader:                                       ; preds = %.critedge
  %21 = icmp sgt i32 %.1.lcssa, 0
  br i1 %21, label %.lr.ph36.preheader, label %._crit_edge37.thread

.lr.ph36.preheader:                               ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %71 to i64
  %min.iters.check = icmp ult i32 %71, 10
  br i1 %min.iters.check, label %.lr.ph36.preheader66, label %vector.ph

.lr.ph36.preheader66:                             ; preds = %vector.body, %.lr.ph36.preheader
  %indvars.iv51.ph = phi i64 [ 1, %.lr.ph36.preheader ], [ %ind.end, %vector.body ]
  br label %.lr.ph36

vector.ph:                                        ; preds = %.lr.ph36.preheader
  %22 = add nsw i64 %wide.trip.count, -1
  %n.mod.vf = and i64 %22, 7
  %23 = icmp eq i64 %n.mod.vf, 0
  %24 = select i1 %23, i64 8, i64 %n.mod.vf
  %n.vec = sub nsw i64 %22, %24
  %ind.end = add nsw i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %25 = or disjoint i64 %index, 2
  %26 = or disjoint i64 %index, 3
  %27 = or disjoint i64 %index, 4
  %28 = or disjoint i64 %index, 5
  %29 = or disjoint i64 %index, 6
  %30 = or disjoint i64 %index, 7
  %31 = add i64 %index, 8
  %32 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %offset.idx, i32 2
  %33 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %25, i32 2
  %34 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %26, i32 2
  %35 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %27, i32 2
  %36 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %28, i32 2
  %37 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %29, i32 2
  %38 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %30, i32 2
  %39 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %31, i32 2
  %40 = load i32, ptr %32, align 4, !tbaa !11
  %41 = load i32, ptr %33, align 16, !tbaa !11
  %42 = load i32, ptr %34, align 4, !tbaa !11
  %43 = load i32, ptr %35, align 8, !tbaa !11
  %44 = insertelement <4 x i32> poison, i32 %40, i64 0
  %45 = insertelement <4 x i32> %44, i32 %41, i64 1
  %46 = insertelement <4 x i32> %45, i32 %42, i64 2
  %47 = insertelement <4 x i32> %46, i32 %43, i64 3
  %48 = load i32, ptr %36, align 4, !tbaa !11
  %49 = load i32, ptr %37, align 16, !tbaa !11
  %50 = load i32, ptr %38, align 4, !tbaa !11
  %51 = load i32, ptr %39, align 8, !tbaa !11
  %52 = insertelement <4 x i32> poison, i32 %48, i64 0
  %53 = insertelement <4 x i32> %52, i32 %49, i64 1
  %54 = insertelement <4 x i32> %53, i32 %50, i64 2
  %55 = insertelement <4 x i32> %54, i32 %51, i64 3
  %56 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %offset.idx
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  store <4 x i32> %47, ptr %56, align 4, !tbaa !5
  store <4 x i32> %55, ptr %57, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %58 = icmp eq i64 %index.next, %n.vec
  br i1 %58, label %.lr.ph36.preheader66, label %vector.body, !llvm.loop !13

59:                                               ; preds = %.preheader28, %62
  %indvars.iv45 = phi i64 [ %20, %.preheader28 ], [ %63, %62 ]
  %60 = trunc nuw i64 %indvars.iv45 to i32
  %61 = icmp sgt i32 %60, 2
  br i1 %61, label %62, label %.critedge

62:                                               ; preds = %59
  %63 = add nsw i64 %indvars.iv45, -1
  %64 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %63
  %65 = add nsw i64 %indvars.iv45, -2
  %66 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %65
  %67 = tail call noundef double @_Z5CrossRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12) %64, ptr noundef nonnull align 4 dereferenceable(12) %66)
  %68 = tail call noundef double @_Z5CrossRK4LineS1_(ptr noundef nonnull align 4 dereferenceable(12) %64, ptr noundef nonnull align 4 dereferenceable(12) %19)
  %69 = fadd double %68, -1.000000e-15
  %70 = fcmp ogt double %67, %69
  br i1 %70, label %59, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %59, %62
  %.1.lcssa = phi i32 [ %smin, %59 ], [ %60, %62 ]
  %71 = add nsw i32 %.1.lcssa, 1
  %72 = sext i32 %.1.lcssa to i64
  %73 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %72
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %73, ptr noundef nonnull align 4 dereferenceable(12) %19, i64 12, i1 false), !tbaa.struct !17
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %.not27.not = icmp slt i64 %indvars.iv48, %75
  br i1 %.not27.not, label %.preheader28, label %.preheader, !llvm.loop !18

.lr.ph36:                                         ; preds = %.lr.ph36.preheader66, %.lr.ph36
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph36 ], [ %indvars.iv51.ph, %.lr.ph36.preheader66 ]
  %76 = getelementptr inbounds [50001 x %struct.Line], ptr @q, i64 0, i64 %indvars.iv51, i32 2
  %77 = load i32, ptr %76, align 4, !tbaa !11
  %78 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %indvars.iv51
  store i32 %77, ptr %78, align 4, !tbaa !5
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge37, label %.lr.ph36, !llvm.loop !19

._crit_edge37.thread:                             ; preds = %.preheader, %._crit_edge
  %.0.lcssa60.ph = phi i32 [ %71, %.preheader ], [ 1, %._crit_edge ]
  %79 = sext i32 %.0.lcssa60.ph to i64
  %80 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %79
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @out, i64 4), ptr noundef nonnull %80)
  br label %._crit_edge41

._crit_edge37:                                    ; preds = %.lr.ph36
  %81 = zext nneg i32 %71 to i64
  %82 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %81
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @out, i64 4), ptr noundef nonnull %82)
  br i1 %21, label %.lr.ph40.preheader, label %._crit_edge41

.lr.ph40.preheader:                               ; preds = %._crit_edge37
  %wide.trip.count57 = zext nneg i32 %71 to i64
  br label %.lr.ph40

.lr.ph40:                                         ; preds = %.lr.ph40.preheader, %.lr.ph40
  %indvars.iv54 = phi i64 [ 1, %.lr.ph40.preheader ], [ %indvars.iv.next55, %.lr.ph40 ]
  %83 = getelementptr inbounds [50001 x i32], ptr @out, i64 0, i64 %indvars.iv54
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %84)
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count57
  br i1 %exitcond58.not, label %._crit_edge41, label %.lr.ph40, !llvm.loop !20

._crit_edge41:                                    ; preds = %.lr.ph40, %._crit_edge37.thread, %._crit_edge37
  %86 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Line4readEi(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIP4LineEvT_S2_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIP4LineET_S2_S2_(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6

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

!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 = !{!12, !6, i64 8}
!12 = !{!"_ZTS4Line", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !15, !14}
!20 = distinct !{!20, !10}


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