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

; 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
@m = external dso_local global i32, align 4
@f = external dso_local global [100001 x i32], align 16
@g = external dso_local global [100001 x i32], align 16
@a = external dso_local global [100001 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

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

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

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

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %18
  %20 = getelementptr inbounds %struct.Node, ptr %19, i32 0, i32 0
  store i32 %16, ptr %20, align 16, !tbaa !9
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %22
  %24 = getelementptr inbounds %struct.Node, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %26
  %28 = getelementptr inbounds %struct.Node, ptr %27, i32 0, i32 2
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.Node, ptr %31, i32 0, i32 3
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %24, ptr noundef %28, ptr noundef %32)
  br label %34

34:                                               ; preds = %15
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !11

37:                                               ; preds = %14
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %struct.Node, ptr @a, i64 %39
  call void @_ZSt4sortIP4NodePFbRKS0_S3_EEvT_S6_T0_(ptr noundef @a, ptr noundef %40, ptr noundef @_Z3cmpRK4NodeS1_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  br label %41

41:                                               ; preds = %93, %37
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = load i32, ptr @n, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %95

46:                                               ; preds = %41
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %4, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %65, %46
  %50 = load i32, ptr %4, align 4, !tbaa !5
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %53, label %62

53:                                               ; preds = %49
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %55
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %58
  %60 = call noundef zeroext i1 @_Z3cmpRK4NodeS1_(ptr noundef nonnull align 4 dereferenceable(16) %56, ptr noundef nonnull align 4 dereferenceable(16) %59)
  %61 = xor i1 %60, true
  br label %62

62:                                               ; preds = %53, %49
  %63 = phi i1 [ false, %49 ], [ %61, %53 ]
  br i1 %63, label %64, label %68

64:                                               ; preds = %62
  br label %65

65:                                               ; preds = %64
  %66 = load i32, ptr %4, align 4, !tbaa !5
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %4, align 4, !tbaa !5
  br label %49, !llvm.loop !13

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %69 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %69, ptr %6, align 4, !tbaa !5
  br label %70

70:                                               ; preds = %89, %68
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = icmp slt i32 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %92

75:                                               ; preds = %70
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sub nsw i32 %76, %77
  %79 = sub nsw i32 %78, 1
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %81
  %83 = getelementptr inbounds %struct.Node, ptr %82, i32 0, i32 0
  %84 = load i32, ptr %83, align 16, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %87, %79
  store i32 %88, ptr %86, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %75
  %90 = load i32, ptr %6, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %6, align 4, !tbaa !5
  br label %70, !llvm.loop !14

92:                                               ; preds = %74
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %94, ptr %3, align 4, !tbaa !5
  br label %41, !llvm.loop !15

95:                                               ; preds = %45
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = sub nsw i32 %96, 1
  call void @_Z5solveii(i32 noundef 0, i32 noundef %97)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %112, %95
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %115

103:                                              ; preds = %98
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %109, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %103
  %113 = load i32, ptr %7, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %98, !llvm.loop !16

115:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %127, %115
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = load i32, ptr @n, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %130

121:                                              ; preds = %116
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %123
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %125)
  br label %127

127:                                              ; preds = %121
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %8, align 4, !tbaa !5
  br label %116, !llvm.loop !17

130:                                              ; preds = %120
  ret i32 0
}

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { "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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS4Node", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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
@m = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [100001 x i32], align 16
@g = external dso_local local_unnamed_addr global [100001 x i32], align 16
@a = external dso_local global [100001 x %struct.Node], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %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
  %.pre = sext i32 %2 to i64
  br label %._crit_edge

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

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

.loopexit:                                        ; preds = %.lr.ph39.prol.loopexit, %.lr.ph39, %.critedge
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, %31
  br i1 %17, label %.preheader34, label %._crit_edge41, !llvm.loop !13

.preheader34:                                     ; preds = %._crit_edge, %.loopexit
  %.03040 = phi i32 [ %31, %.loopexit ], [ 0, %._crit_edge ]
  %18 = sext i32 %.03040 to i64
  %19 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %18
  br label %24

._crit_edge41:                                    ; preds = %.loopexit, %._crit_edge
  %.lcssa = phi i32 [ %5, %._crit_edge ], [ %16, %.loopexit ]
  %20 = add nsw i32 %.lcssa, -1
  tail call void @_Z5solveii(i32 noundef 0, i32 noundef %20)
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph45.preheader, label %._crit_edge48

.lr.ph45.preheader:                               ; preds = %._crit_edge41
  %wide.trip.count = zext nneg i32 %21 to i64
  %xtraiter75 = and i64 %wide.trip.count, 3
  %23 = icmp ult i32 %21, 4
  br i1 %23, label %.preheader.unr-lcssa, label %.lr.ph45.preheader.new

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

24:                                               ; preds = %.preheader34, %28
  %indvar = phi i32 [ 0, %.preheader34 ], [ %indvar.next, %28 ]
  %indvars.iv58.in = phi i32 [ %.03040, %.preheader34 ], [ %indvars.iv58, %28 ]
  %indvars.iv52 = phi i64 [ %18, %.preheader34 ], [ %indvars.iv.next53, %28 ]
  %indvars.iv58 = add i32 %indvars.iv58.in, 1
  %indvars.iv.next53 = add nsw i64 %indvars.iv52, 1
  %25 = load i32, ptr @n, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = icmp slt i64 %indvars.iv.next53, %26
  br i1 %27, label %28, label %.critedge

28:                                               ; preds = %24
  %29 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv.next53
  %30 = tail call noundef zeroext i1 @_Z3cmpRK4NodeS1_(ptr noundef nonnull align 4 dereferenceable(16) %19, ptr noundef nonnull align 4 dereferenceable(16) %29)
  %indvar.next = add i32 %indvar, 1
  br i1 %30, label %.critedge, label %24, !llvm.loop !14

.critedge:                                        ; preds = %24, %28
  %31 = trunc nsw i64 %indvars.iv.next53 to i32
  %32 = trunc nsw i64 %indvars.iv52 to i32
  %.not37 = icmp sgt i32 %.03040, %32
  br i1 %.not37, label %.loopexit, label %.lr.ph39.preheader

.lr.ph39.preheader:                               ; preds = %.critedge
  %33 = and i32 %indvar, 1
  %lcmp.mod.not.not = icmp eq i32 %33, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph39.prol, label %.lr.ph39.prol.loopexit

.lr.ph39.prol:                                    ; preds = %.lr.ph39.preheader
  %34 = sub i32 %32, %.03040
  %35 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %18
  %36 = load i32, ptr %35, align 16, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = add nsw i32 %34, %39
  store i32 %40, ptr %38, align 4, !tbaa !5
  %indvars.iv.next56.prol = add nsw i64 %18, 1
  br label %.lr.ph39.prol.loopexit

.lr.ph39.prol.loopexit:                           ; preds = %.lr.ph39.prol, %.lr.ph39.preheader
  %indvars.iv55.unr = phi i64 [ %18, %.lr.ph39.preheader ], [ %indvars.iv.next56.prol, %.lr.ph39.prol ]
  %41 = icmp eq i32 %indvar, 0
  br i1 %41, label %.loopexit, label %.lr.ph39

.lr.ph39:                                         ; preds = %.lr.ph39.prol.loopexit, %.lr.ph39
  %indvars.iv55 = phi i64 [ %indvars.iv.next56.1, %.lr.ph39 ], [ %indvars.iv55.unr, %.lr.ph39.prol.loopexit ]
  %42 = trunc nsw i64 %indvars.iv55 to i32
  %43 = sub i32 %32, %42
  %44 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv55
  %45 = load i32, ptr %44, align 16, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = add nsw i32 %43, %48
  store i32 %49, ptr %47, align 4, !tbaa !5
  %indvars.iv.next56 = add nsw i64 %indvars.iv55, 1
  %50 = trunc nsw i64 %indvars.iv.next56 to i32
  %51 = sub i32 %32, %50
  %52 = getelementptr inbounds [100001 x %struct.Node], ptr @a, i64 0, i64 %indvars.iv.next56
  %53 = load i32, ptr %52, align 16, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = add nsw i32 %51, %56
  store i32 %57, ptr %55, align 4, !tbaa !5
  %indvars.iv.next56.1 = add nsw i64 %indvars.iv55, 2
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next56.1 to i32
  %exitcond.not.1 = icmp eq i32 %indvars.iv58, %lftr.wideiv.1
  br i1 %exitcond.not.1, label %.loopexit, label %.lr.ph39, !llvm.loop !15

.preheader.unr-lcssa:                             ; preds = %.lr.ph45, %.lr.ph45.preheader
  %indvars.iv60.unr = phi i64 [ 0, %.lr.ph45.preheader ], [ %indvars.iv.next61.3, %.lr.ph45 ]
  %lcmp.mod76.not = icmp eq i64 %xtraiter75, 0
  br i1 %lcmp.mod76.not, label %.preheader, label %.lr.ph45.epil

.lr.ph45.epil:                                    ; preds = %.preheader.unr-lcssa, %.lr.ph45.epil
  %indvars.iv60.epil = phi i64 [ %indvars.iv.next61.epil, %.lr.ph45.epil ], [ %indvars.iv60.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph45.epil ], [ 0, %.preheader.unr-lcssa ]
  %58 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv60.epil
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %61, align 4, !tbaa !5
  %indvars.iv.next61.epil = add nuw nsw i64 %indvars.iv60.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter75
  br i1 %epil.iter.cmp.not, label %.preheader, label %.lr.ph45.epil, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph45.epil, %.preheader.unr-lcssa
  br i1 %22, label %.lr.ph47, label %._crit_edge48

.lr.ph45:                                         ; preds = %.lr.ph45, %.lr.ph45.preheader.new
  %indvars.iv60 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %indvars.iv.next61.3, %.lr.ph45 ]
  %niter = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %niter.next.3, %.lr.ph45 ]
  %64 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv60
  %65 = load i32, ptr %64, align 16, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %67, align 4, !tbaa !5
  %indvars.iv.next61 = or disjoint i64 %indvars.iv60, 1
  %70 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv.next61
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %73, align 4, !tbaa !5
  %indvars.iv.next61.1 = or disjoint i64 %indvars.iv60, 2
  %76 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv.next61.1
  %77 = load i32, ptr %76, align 8, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %79, align 4, !tbaa !5
  %indvars.iv.next61.2 = or disjoint i64 %indvars.iv60, 3
  %82 = getelementptr inbounds [100001 x i32], ptr @f, i64 0, i64 %indvars.iv.next61.2
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %85, align 4, !tbaa !5
  %indvars.iv.next61.3 = add nuw nsw i64 %indvars.iv60, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph45, !llvm.loop !18

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

.lr.ph47:                                         ; preds = %.preheader, %.lr.ph47
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph47 ], [ 0, %.preheader ]
  %88 = getelementptr inbounds [100001 x i32], ptr @g, i64 0, i64 %indvars.iv64
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %89)
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = icmp slt i64 %indvars.iv.next65, %92
  br i1 %93, label %.lr.ph47, label %._crit_edge48, !llvm.loop !19
}

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

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

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

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


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