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

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

@n = external dso_local global i32, align 4
@lnk = external dso_local global [100001 x i32], align 16
@deg = external dso_local global [100001 x i32], align 16
@lim = external dso_local global i32, align 4
@e = external dso_local global [200003 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [3 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z4dfs1ii(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 noundef zeroext i1 @_Z4dfs2ii(i32 noundef, 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 %struct.Edge, align 4
  %6 = alloca %struct.Edge, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %12

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

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %66

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %19 = getelementptr inbounds %struct.Edge, ptr %5, i32 0, i32 0
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  store i32 %23, ptr %19, align 4, !tbaa !9
  %24 = getelementptr inbounds %struct.Edge, ptr %5, i32 0, i32 1
  %25 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %25, ptr %24, align 4, !tbaa !11
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = shl i32 %26, 1
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [200003 x %struct.Edge], ptr @e, i64 0, i64 %28
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 4 %5, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = shl i32 %30, 1
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %33
  store i32 %31, ptr %34, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %37, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %40 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 0
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  store i32 %44, ptr %40, align 4, !tbaa !9
  %45 = getelementptr inbounds %struct.Edge, ptr %6, i32 0, i32 1
  %46 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %46, ptr %45, align 4, !tbaa !11
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = shl i32 %47, 1
  %49 = or i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [200003 x %struct.Edge], ptr @e, i64 0, i64 %50
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %51, ptr align 4 %6, i64 8, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = shl i32 %52, 1
  %54 = or i32 %53, 1
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %60, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %63

63:                                               ; preds = %17
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !13

66:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %80, %66
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = icmp sle i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %83

72:                                               ; preds = %67
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = and i32 %76, 1
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = add nsw i32 %78, %77
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %72
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %10, align 4, !tbaa !5
  br label %67, !llvm.loop !15

83:                                               ; preds = %71
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = sdiv i32 %84, 2
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %85)
  store i32 0, ptr %8, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 1
  store i32 %88, ptr %9, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %104, %83
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %93, label %105

93:                                               ; preds = %89
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = add nsw i32 %94, %95
  %97 = ashr i32 %96, 1
  store i32 %97, ptr @lim, align 4, !tbaa !5
  %98 = call noundef zeroext i1 @_Z4dfs1ii(i32 noundef 1, i32 noundef -1)
  br i1 %98, label %99, label %101

99:                                               ; preds = %93
  %100 = load i32, ptr @lim, align 4, !tbaa !5
  store i32 %100, ptr %9, align 4, !tbaa !5
  br label %104

101:                                              ; preds = %93
  %102 = load i32, ptr @lim, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %8, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %101, %99
  br label %89, !llvm.loop !16

105:                                              ; preds = %89
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %106)
  store i32 1, ptr %8, align 4, !tbaa !5
  %108 = load i32, ptr @n, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  store i32 %109, ptr %9, align 4, !tbaa !5
  br label %110

110:                                              ; preds = %125, %105
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %114, label %126

114:                                              ; preds = %110
  %115 = load i32, ptr %8, align 4, !tbaa !5
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = add nsw i32 %115, %116
  %118 = ashr i32 %117, 1
  store i32 %118, ptr @lim, align 4, !tbaa !5
  %119 = call noundef zeroext i1 @_Z4dfs2ii(i32 noundef 1, i32 noundef -1)
  br i1 %119, label %120, label %122

120:                                              ; preds = %114
  %121 = load i32, ptr @lim, align 4, !tbaa !5
  store i32 %121, ptr %9, align 4, !tbaa !5
  br label %125

122:                                              ; preds = %114
  %123 = load i32, ptr @lim, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %8, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %122, %120
  br label %110, !llvm.loop !17

126:                                              ; preds = %110
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = add nsw i32 %127, 1
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %128)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret i32 0
}

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

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

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: readwrite) }
attributes #5 = { 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 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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

@n = external dso_local global i32, align 4
@lnk = external dso_local local_unnamed_addr global [100001 x i32], align 16
@deg = external dso_local local_unnamed_addr global [100001 x i32], align 16
@lim = external dso_local local_unnamed_addr global i32, align 4
@e = external dso_local local_unnamed_addr global [200003 x %struct.Edge], align 16
@.str = external hidden unnamed_addr constant [3 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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z4dfs1ii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress 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 noundef zeroext i1 @_Z4dfs2ii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

.preheader:                                       ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %4, %0 ], [ %39, %.lr.ph ]
  %.not31 = icmp slt i32 %.lcssa, 1
  br i1 %.not31, label %._crit_edge, label %.lr.ph34.preheader

.lr.ph34.preheader:                               ; preds = %.preheader
  %6 = add nuw i32 %.lcssa, 1
  %wide.trip.count = zext i32 %6 to i64
  %7 = zext nneg i32 %.lcssa to i64
  %min.iters.check = icmp ult i32 %.lcssa, 8
  br i1 %min.iters.check, label %.lr.ph34.preheader60, label %vector.ph

.lr.ph34.preheader60:                             ; preds = %middle.block, %.lr.ph34.preheader
  %indvars.iv51.ph = phi i64 [ 1, %.lr.ph34.preheader ], [ %ind.end, %middle.block ]
  %.02832.ph = phi i32 [ 0, %.lr.ph34.preheader ], [ %15, %middle.block ]
  br label %.lr.ph34

vector.ph:                                        ; preds = %.lr.ph34.preheader
  %n.vec = and i64 %7, 2147483640
  %ind.end = or disjoint 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 ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
  %vec.phi58 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %8 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %offset.idx
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %wide.load = load <4 x i32>, ptr %8, align 4, !tbaa !5
  %wide.load59 = load <4 x i32>, ptr %9, align 4, !tbaa !5
  %10 = and <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %11 = and <4 x i32> %wide.load59, <i32 1, i32 1, i32 1, i32 1>
  %12 = add <4 x i32> %10, %vec.phi
  %13 = add <4 x i32> %11, %vec.phi58
  %index.next = add nuw i64 %index, 8
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %13, %12
  %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %7
  br i1 %cmp.n, label %._crit_edge.loopexit, label %.lr.ph34.preheader60

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = shl nuw i64 %indvars.iv, 1
  %23 = trunc nuw i64 %22 to i32
  %sext = shl i64 %indvars.iv, 33
  %24 = ashr exact i64 %sext, 32
  %25 = getelementptr inbounds [200003 x %struct.Edge], ptr @e, i64 0, i64 %24
  store i32 %20, ptr %25, align 16, !tbaa !5
  %.sroa.416.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 4
  store i32 %21, ptr %.sroa.416.0..sroa_idx, align 4, !tbaa !5
  store i32 %23, ptr %19, align 4, !tbaa !5
  %26 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %18
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %26, align 4, !tbaa !5
  %29 = sext i32 %21 to i64
  %30 = getelementptr inbounds [100001 x i32], ptr @lnk, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %32 = trunc i64 %22 to i32
  %33 = or disjoint i32 %32, 1
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [200003 x %struct.Edge], ptr @e, i64 0, i64 %34
  store i32 %31, ptr %35, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 4
  store i32 %17, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  store i32 %33, ptr %30, align 4, !tbaa !5
  %36 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %29
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = icmp slt i64 %indvars.iv.next, %40
  br i1 %41, label %.lr.ph, label %.preheader, !llvm.loop !13

._crit_edge.loopexit:                             ; preds = %.lr.ph34, %middle.block
  %.lcssa56 = phi i32 [ %15, %middle.block ], [ %50, %.lr.ph34 ]
  %42 = lshr i32 %.lcssa56, 1
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.028.lcssa = phi i32 [ 0, %.preheader ], [ %42, %._crit_edge.loopexit ]
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.028.lcssa)
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 1
  br i1 %45, label %.lr.ph39.preheader, label %._crit_edge40

.lr.ph39.preheader:                               ; preds = %._crit_edge
  %46 = add nsw i32 %44, -1
  br label %.lr.ph39

.lr.ph34:                                         ; preds = %.lr.ph34.preheader60, %.lr.ph34
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %.lr.ph34 ], [ %indvars.iv51.ph, %.lr.ph34.preheader60 ]
  %.02832 = phi i32 [ %50, %.lr.ph34 ], [ %.02832.ph, %.lr.ph34.preheader60 ]
  %47 = getelementptr inbounds [100001 x i32], ptr @deg, i64 0, i64 %indvars.iv51
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = and i32 %48, 1
  %50 = add nuw nsw i32 %49, %.02832
  %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_edge.loopexit, label %.lr.ph34, !llvm.loop !14

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %.lr.ph39
  %.02337 = phi i32 [ %.1, %.lr.ph39 ], [ %46, %.lr.ph39.preheader ]
  %.02436 = phi i32 [ %.125, %.lr.ph39 ], [ 0, %.lr.ph39.preheader ]
  %51 = add nsw i32 %.02337, %.02436
  %52 = ashr i32 %51, 1
  store i32 %52, ptr @lim, align 4, !tbaa !5
  %53 = call noundef zeroext i1 @_Z4dfs1ii(i32 noundef 1, i32 noundef -1)
  %54 = load i32, ptr @lim, align 4
  %55 = add nsw i32 %54, 1
  %.125 = select i1 %53, i32 %.02436, i32 %55
  %.1 = select i1 %53, i32 %54, i32 %.02337
  %56 = icmp slt i32 %.125, %.1
  br i1 %56, label %.lr.ph39, label %._crit_edge40, !llvm.loop !15

._crit_edge40:                                    ; preds = %.lr.ph39, %._crit_edge
  %.024.lcssa = phi i32 [ 0, %._crit_edge ], [ %.125, %.lr.ph39 ]
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.024.lcssa)
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %59 = icmp sgt i32 %58, 2
  br i1 %59, label %.lr.ph45.preheader, label %._crit_edge46

.lr.ph45.preheader:                               ; preds = %._crit_edge40
  %60 = add nsw i32 %58, -1
  br label %.lr.ph45

.lr.ph45:                                         ; preds = %.lr.ph45.preheader, %.lr.ph45
  %.243 = phi i32 [ %.3, %.lr.ph45 ], [ %60, %.lr.ph45.preheader ]
  %.22642 = phi i32 [ %.327, %.lr.ph45 ], [ 1, %.lr.ph45.preheader ]
  %61 = add nsw i32 %.243, %.22642
  %62 = ashr i32 %61, 1
  store i32 %62, ptr @lim, align 4, !tbaa !5
  %63 = call noundef zeroext i1 @_Z4dfs2ii(i32 noundef 1, i32 noundef -1)
  %64 = load i32, ptr @lim, align 4
  %65 = add nsw i32 %64, 1
  %.327 = select i1 %63, i32 %.22642, i32 %65
  %.3 = select i1 %63, i32 %64, i32 %.243
  %66 = icmp slt i32 %.327, %.3
  br i1 %66, label %.lr.ph45, label %._crit_edge46.loopexit, !llvm.loop !16

._crit_edge46.loopexit:                           ; preds = %.lr.ph45
  %67 = add nsw i32 %.327, 1
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge46.loopexit, %._crit_edge40
  %.226.lcssa = phi i32 [ 2, %._crit_edge40 ], [ %67, %._crit_edge46.loopexit ]
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.226.lcssa)
  ret i32 0
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

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 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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