; LLVM IR from tangjz/acm-icpc :: self_training/2015-04-17 (J)

; 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.Node = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@rmx = external dso_local global i32, align 4
@x = external dso_local global [100010 x %struct.Node], align 16
@y = external dso_local global [100010 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmp1RK4NodeS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmp2RK4NodeS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #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
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @p, ptr noundef @k)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %7

7:                                                ; preds = %27, %0
  %8 = load i32, ptr %2, align 4, !tbaa !5
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = icmp slt i32 %8, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %7
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %14
  %16 = getelementptr inbounds %struct.Node, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %18
  %20 = getelementptr inbounds %struct.Node, ptr %19, i32 0, i32 1
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %16, ptr noundef %20)
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %24
  %26 = getelementptr inbounds %struct.Node, ptr %25, i32 0, i32 2
  store i32 %22, ptr %26, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %12
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %2, align 4, !tbaa !5
  br label %7, !llvm.loop !11

30:                                               ; preds = %11
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.Node, ptr @x, i64 %32
  call void @_ZSt4sortIP4NodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef @x, ptr noundef %33, ptr noundef @_Z4cmp1RK4NodeS1_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %51, %30
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

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

39:                                               ; preds = %34
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.Node, ptr %43, i32 0, i32 3
  store i32 %40, ptr %44, align 4, !tbaa !13
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %46
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100010 x %struct.Node], ptr @y, i64 0, i64 %49
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %50, ptr align 16 %47, i64 16, i1 false), !tbaa.struct !14
  br label %51

51:                                               ; preds = %39
  %52 = load i32, ptr %3, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %3, align 4, !tbaa !5
  br label %34, !llvm.loop !15

54:                                               ; preds = %38
  %55 = load i32, ptr @p, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %struct.Node, ptr @x, i64 %56
  %58 = load i32, ptr @k, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = sub i64 0, %59
  %61 = getelementptr inbounds %struct.Node, ptr %57, i64 %60
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %struct.Node, ptr @x, i64 %63
  call void @_ZSt4sortIP4NodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef %61, ptr noundef %64, ptr noundef @_Z4cmp2RK4NodeS1_)
  %65 = load i32, ptr @n, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  store i32 %66, ptr @rmx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %67 = load i32, ptr @p, align 4, !tbaa !5
  %68 = load i32, ptr @k, align 4, !tbaa !5
  %69 = sub nsw i32 %67, %68
  store i32 %69, ptr %4, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %97, %54
  %71 = load i32, ptr %4, align 4, !tbaa !5
  %72 = load i32, ptr @p, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

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

75:                                               ; preds = %70
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.Node, ptr %78, i32 0, i32 2
  %80 = load i32, ptr %79, align 8, !tbaa !9
  %81 = add nsw i32 %80, 1
  %82 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %81)
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.Node, ptr %85, i32 0, i32 3
  %87 = load i32, ptr %86, align 4, !tbaa !13
  %88 = load i32, ptr @rmx, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %90, label %96

90:                                               ; preds = %75
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %92
  %94 = getelementptr inbounds %struct.Node, ptr %93, i32 0, i32 3
  %95 = load i32, ptr %94, align 4, !tbaa !13
  store i32 %95, ptr @rmx, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %90, %75
  br label %97

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

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

101:                                              ; preds = %127, %100
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = load i32, ptr @p, align 4, !tbaa !5
  %104 = load i32, ptr @k, align 4, !tbaa !5
  %105 = sub nsw i32 %103, %104
  %106 = icmp sle i32 %102, %105
  br i1 %106, label %108, label %107

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

108:                                              ; preds = %101
  %109 = load i32, ptr @rmx, align 4, !tbaa !5
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = sub nsw i32 %109, %110
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [100010 x %struct.Node], ptr @y, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.Node, ptr %113, i32 0, i32 2
  %115 = load i32, ptr %114, align 8, !tbaa !9
  %116 = add nsw i32 %115, 1
  %117 = load i32, ptr %5, align 4, !tbaa !5
  %118 = load i32, ptr @p, align 4, !tbaa !5
  %119 = load i32, ptr @k, align 4, !tbaa !5
  %120 = sub nsw i32 %118, %119
  %121 = icmp eq i32 %117, %120
  %122 = zext i1 %121 to i64
  %123 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !17
  %125 = sext i8 %124 to i32
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %116, i32 noundef %125)
  br label %127

127:                                              ; preds = %108
  %128 = load i32, ptr %5, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %5, align 4, !tbaa !5
  br label %101, !llvm.loop !18

130:                                              ; preds = %107
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #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 uwtable
declare dso_local void @_ZSt4sortIP4NodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef, ptr noundef, ptr noundef) #4

; 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) #5

declare i32 @printf(ptr noundef, ...) #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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 12}
!14 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !12}


; 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.Node = type { i32, i32, i32, i32 }

@n = external dso_local global i32, align 4
@p = external dso_local global i32, align 4
@k = external dso_local global i32, align 4
@rmx = external dso_local local_unnamed_addr global i32, align 4
@x = external dso_local global [100010 x %struct.Node], align 16
@y = external dso_local local_unnamed_addr global [100010 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmp1RK4NodeS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4cmp2RK4NodeS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #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, ptr noundef nonnull @p, ptr noundef nonnull @k)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 0
  br i1 %3, label %.lr.ph, label %.._crit_edge_crit_edge

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre50 = sext i32 %2 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi51 = phi i64 [ %.pre50, %.._crit_edge_crit_edge ], [ %14, %.lr.ph ]
  %4 = getelementptr inbounds %struct.Node, ptr @x, i64 %.pre-phi51
  tail call void @_ZSt4sortIP4NodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @x, ptr noundef nonnull %4, ptr noundef nonnull @_Z4cmp1RK4NodeS1_)
  %5 = load i32, ptr @n, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph32.preheader, label %._crit_edge33

.lr.ph32.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %5 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %7 = icmp eq i32 %5, 1
  br i1 %7, label %._crit_edge33.loopexit.unr-lcssa, label %.lr.ph32.preheader.new

.lr.ph32.preheader.new:                           ; preds = %.lr.ph32.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph32

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %8 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %indvars.iv
  %9 = getelementptr inbounds i8, ptr %8, i64 4
  %10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %8, ptr noundef nonnull %9)
  %11 = getelementptr inbounds i8, ptr %8, i64 8
  %12 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %12, ptr %11, align 8, !tbaa !9
  %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
  %15 = icmp slt i64 %indvars.iv.next, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge33.loopexit.unr-lcssa:                 ; preds = %.lr.ph32, %.lr.ph32.preheader
  %indvars.iv43.unr = phi i64 [ 0, %.lr.ph32.preheader ], [ %indvars.iv.next44.1, %.lr.ph32 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge33, label %.lr.ph32.epil

.lr.ph32.epil:                                    ; preds = %._crit_edge33.loopexit.unr-lcssa
  %16 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %indvars.iv43.unr
  %17 = getelementptr inbounds i8, ptr %16, i64 12
  %18 = trunc nuw nsw i64 %indvars.iv43.unr to i32
  store i32 %18, ptr %17, align 4, !tbaa !13
  %19 = getelementptr inbounds [100010 x %struct.Node], ptr @y, i64 0, i64 %indvars.iv43.unr
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %19, ptr noundef nonnull align 16 dereferenceable(16) %16, i64 16, i1 false), !tbaa.struct !14
  br label %._crit_edge33

._crit_edge33:                                    ; preds = %.lr.ph32.epil, %._crit_edge33.loopexit.unr-lcssa, %._crit_edge
  %20 = load i32, ptr @p, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds %struct.Node, ptr @x, i64 %21
  %23 = load i32, ptr @k, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = sub nsw i64 0, %24
  %26 = getelementptr inbounds %struct.Node, ptr %22, i64 %25
  %27 = sext i32 %5 to i64
  %28 = getelementptr inbounds %struct.Node, ptr @x, i64 %27
  tail call void @_ZSt4sortIP4NodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull %26, ptr noundef nonnull %28, ptr noundef nonnull @_Z4cmp2RK4NodeS1_)
  %29 = load i32, ptr @n, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr @rmx, align 4, !tbaa !5
  %31 = load i32, ptr @p, align 4, !tbaa !5
  %32 = load i32, ptr @k, align 4, !tbaa !5
  %33 = sub i32 %31, %32
  %34 = icmp sgt i32 %32, 0
  br i1 %34, label %.lr.ph37.preheader, label %.preheader

.lr.ph37.preheader:                               ; preds = %._crit_edge33
  %35 = sext i32 %33 to i64
  br label %.lr.ph37

.lr.ph32:                                         ; preds = %.lr.ph32, %.lr.ph32.preheader.new
  %indvars.iv43 = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %indvars.iv.next44.1, %.lr.ph32 ]
  %niter = phi i64 [ 0, %.lr.ph32.preheader.new ], [ %niter.next.1, %.lr.ph32 ]
  %36 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %indvars.iv43
  %37 = getelementptr inbounds i8, ptr %36, i64 12
  %38 = trunc nuw nsw i64 %indvars.iv43 to i32
  store i32 %38, ptr %37, align 4, !tbaa !13
  %39 = getelementptr inbounds [100010 x %struct.Node], ptr @y, i64 0, i64 %indvars.iv43
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %39, ptr noundef nonnull align 16 dereferenceable(16) %36, i64 16, i1 false), !tbaa.struct !14
  %indvars.iv.next44 = or disjoint i64 %indvars.iv43, 1
  %40 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %indvars.iv.next44
  %41 = getelementptr inbounds i8, ptr %40, i64 12
  %42 = trunc nuw nsw i64 %indvars.iv.next44 to i32
  store i32 %42, ptr %41, align 4, !tbaa !13
  %43 = getelementptr inbounds [100010 x %struct.Node], ptr @y, i64 0, i64 %indvars.iv.next44
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %43, ptr noundef nonnull align 16 dereferenceable(16) %40, i64 16, i1 false), !tbaa.struct !14
  %indvars.iv.next44.1 = add nuw nsw i64 %indvars.iv43, 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 %._crit_edge33.loopexit.unr-lcssa, label %.lr.ph32, !llvm.loop !15

.preheader.loopexit:                              ; preds = %54
  %.pre = load i32, ptr @k, align 4, !tbaa !5
  %.pre49 = sub nsw i32 %55, %.pre
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %._crit_edge33
  %.pre-phi = phi i32 [ %.pre49, %.preheader.loopexit ], [ %33, %._crit_edge33 ]
  %.not38 = icmp slt i32 %.pre-phi, 1
  br i1 %.not38, label %._crit_edge41, label %.lr.ph40

.lr.ph37:                                         ; preds = %.lr.ph37.preheader, %54
  %indvars.iv46 = phi i64 [ %35, %.lr.ph37.preheader ], [ %indvars.iv.next47, %54 ]
  %44 = getelementptr inbounds [100010 x %struct.Node], ptr @x, i64 0, i64 %indvars.iv46
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load i32, ptr %45, align 8, !tbaa !9
  %47 = add nsw i32 %46, 1
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %47)
  %49 = getelementptr inbounds i8, ptr %44, i64 12
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = load i32, ptr @rmx, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %.lr.ph37
  store i32 %50, ptr @rmx, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %.lr.ph37, %53
  %indvars.iv.next47 = add nsw i64 %indvars.iv46, 1
  %55 = load i32, ptr @p, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = icmp slt i64 %indvars.iv.next47, %56
  br i1 %57, label %.lr.ph37, label %.preheader.loopexit, !llvm.loop !16

._crit_edge41:                                    ; preds = %.lr.ph40, %.preheader
  ret i32 0

.lr.ph40:                                         ; preds = %.preheader, %.lr.ph40
  %58 = phi i32 [ %74, %.lr.ph40 ], [ %.pre-phi, %.preheader ]
  %.039 = phi i32 [ %71, %.lr.ph40 ], [ 1, %.preheader ]
  %59 = load i32, ptr @rmx, align 4, !tbaa !5
  %60 = sub nsw i32 %59, %.039
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100010 x %struct.Node], ptr @y, i64 0, i64 %61, i32 2
  %63 = load i32, ptr %62, align 8, !tbaa !9
  %64 = add nsw i32 %63, 1
  %65 = icmp eq i32 %.039, %58
  %66 = zext i1 %65 to i64
  %67 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !17
  %69 = sext i8 %68 to i32
  %70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %64, i32 noundef %69)
  %71 = add nuw nsw i32 %.039, 1
  %72 = load i32, ptr @p, align 4, !tbaa !5
  %73 = load i32, ptr @k, align 4, !tbaa !5
  %74 = sub nsw i32 %72, %73
  %.not.not = icmp slt i32 %.039, %74
  br i1 %.not.not, label %.lr.ph40, label %._crit_edge41, !llvm.loop !18
}

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

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

; 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) #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { 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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }

!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 = !{!10, !6, i64 8}
!10 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 12}
!14 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !12}


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