; LLVM IR from tangjz/acm-icpc :: self_training/2015-02-22/O.ll (Z5checki)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@n = external dso_local global i32, align 4
@a = external dso_local global [10001 x i32], align 16
@b = external dso_local global [10001 x i32], align 16
@c = external dso_local global [10001 x i32], align 16
@tot = external dso_local global i32, align 4
@pre = external dso_local global [402 x [2 x i32]], align 16
@cnt = external dso_local global i32, align 4
@seq = external dso_local global [402 x i32], align 16
@sum = external dso_local global i32, align 4
@scc = external dso_local global [402 x i32], align 16
@vis = external dso_local global [402 x i8], align 16

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs1i(i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4dfs2i(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checki(i32 noundef %0) #2 {
  %2 = alloca i1, align 1
  %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 %3, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @pre, i8 0, i64 3216, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %103, %1
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %106

14:                                               ; preds = %9
  %15 = load i32, ptr %4, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [10001 x i32], ptr @c, i64 0, i64 %16
  %18 = load i32, ptr %17, align 4, !tbaa !5
  switch i32 %18, label %102 [
    i32 0, label %19
    i32 1, label %40
    i32 2, label %81
  ]

19:                                               ; preds = %14
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %22
  %24 = load i32, ptr %23, align 4, !tbaa !5
  %25 = add nsw i32 %20, %24
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  call void @_Z7addedgeii(i32 noundef %25, i32 noundef %29)
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %30, %34
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  call void @_Z7addedgeii(i32 noundef %35, i32 noundef %39)
  br label %102

40:                                               ; preds = %14
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  call void @_Z7addedgeii(i32 noundef %44, i32 noundef %48)
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  call void @_Z7addedgeii(i32 noundef %52, i32 noundef %56)
  %57 = load i32, ptr @n, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %57, %61
  %63 = load i32, ptr @n, align 4, !tbaa !5
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = add nsw i32 %63, %67
  call void @_Z7addedgeii(i32 noundef %62, i32 noundef %68)
  %69 = load i32, ptr @n, align 4, !tbaa !5
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %69, %73
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %75, %79
  call void @_Z7addedgeii(i32 noundef %74, i32 noundef %80)
  br label %102

81:                                               ; preds = %14
  %82 = load i32, ptr %4, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %83
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = load i32, ptr @n, align 4, !tbaa !5
  %87 = load i32, ptr %4, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = add nsw i32 %86, %90
  call void @_Z7addedgeii(i32 noundef %85, i32 noundef %91)
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = load i32, ptr %4, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = add nsw i32 %96, %100
  call void @_Z7addedgeii(i32 noundef %95, i32 noundef %101)
  br label %102

102:                                              ; preds = %81, %40, %19, %14
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %4, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %4, align 4, !tbaa !5
  br label %9, !llvm.loop !9

106:                                              ; preds = %13
  store i32 0, ptr @cnt, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 402, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %122, %106
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = load i32, ptr @n, align 4, !tbaa !5
  %110 = shl i32 %109, 1
  %111 = icmp slt i32 %108, %110
  br i1 %111, label %113, label %112

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

113:                                              ; preds = %107
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [402 x i8], ptr @vis, i64 0, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !11, !range !13, !noundef !14
  %118 = trunc i8 %117 to i1
  br i1 %118, label %121, label %119

119:                                              ; preds = %113
  %120 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z4dfs1i(i32 noundef %120)
  br label %121

121:                                              ; preds = %119, %113
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %5, align 4, !tbaa !5
  br label %107, !llvm.loop !15

125:                                              ; preds = %112
  store i32 0, ptr @sum, align 4, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 402, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %126 = load i32, ptr @n, align 4, !tbaa !5
  %127 = shl i32 %126, 1
  %128 = sub nsw i32 %127, 1
  store i32 %128, ptr %6, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %150, %125
  %130 = load i32, ptr %6, align 4, !tbaa !5
  %131 = icmp sge i32 %130, 0
  br i1 %131, label %133, label %132

132:                                              ; preds = %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %153

133:                                              ; preds = %129
  %134 = load i32, ptr %6, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [402 x i32], ptr @seq, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [402 x i8], ptr @vis, i64 0, i64 %138
  %140 = load i8, ptr %139, align 1, !tbaa !11, !range !13, !noundef !14
  %141 = trunc i8 %140 to i1
  br i1 %141, label %149, label %142

142:                                              ; preds = %133
  %143 = load i32, ptr @sum, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr @sum, align 4, !tbaa !5
  %145 = load i32, ptr %6, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [402 x i32], ptr @seq, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  call void @_Z4dfs2i(i32 noundef %148)
  br label %149

149:                                              ; preds = %142, %133
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %6, align 4, !tbaa !5
  %152 = add nsw i32 %151, -1
  store i32 %152, ptr %6, align 4, !tbaa !5
  br label %129, !llvm.loop !16

153:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %173, %153
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = load i32, ptr @n, align 4, !tbaa !5
  %157 = icmp slt i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  store i32 12, ptr %8, align 4
  br label %176

159:                                              ; preds = %154
  %160 = load i32, ptr %7, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [402 x i32], ptr @scc, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = load i32, ptr @n, align 4, !tbaa !5
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = add nsw i32 %164, %165
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [402 x i32], ptr @scc, i64 0, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = icmp eq i32 %163, %169
  br i1 %170, label %171, label %172

171:                                              ; preds = %159
  store i1 false, ptr %2, align 1
  store i32 1, ptr %8, align 4
  br label %176

172:                                              ; preds = %159
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %7, align 4, !tbaa !5
  br label %154, !llvm.loop !17

176:                                              ; preds = %171, %158
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %177 = load i32, ptr %8, align 4
  switch i32 %177, label %181 [
    i32 12, label %178
    i32 1, label %179
  ]

178:                                              ; preds = %176
  store i1 true, ptr %2, align 1
  br label %179

179:                                              ; preds = %178, %176
  %180 = load i1, ptr %2, align 1
  ret i1 %180

181:                                              ; preds = %176
  unreachable
}

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!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"

@n = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local local_unnamed_addr global [10001 x i32], align 16
@b = external dso_local local_unnamed_addr global [10001 x i32], align 16
@c = external dso_local local_unnamed_addr global [10001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pre = external dso_local local_unnamed_addr global [402 x [2 x i32]], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@seq = external dso_local local_unnamed_addr global [402 x i32], align 16
@sum = external dso_local local_unnamed_addr global i32, align 4
@scc = external dso_local local_unnamed_addr global [402 x i32], align 16
@vis = external dso_local local_unnamed_addr global [402 x i8], align 16

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z5checki(i32 noundef %0) local_unnamed_addr #1 {
  store i32 0, ptr @tot, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3216) @pre, i8 0, i64 3216, i1 false)
  %2 = icmp sgt i32 %0, 0
  br i1 %2, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %1
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %47, %1
  store i32 0, ptr @cnt, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(402) @vis, i8 0, i64 402, i1 false)
  %3 = load i32, ptr @n, align 4, !tbaa !5
  %4 = shl i32 %3, 1
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph43, label %._crit_edge44.thread

._crit_edge44.thread:                             ; preds = %._crit_edge
  store i32 0, ptr @sum, align 4, !tbaa !5
  br label %.preheader

.lr.ph:                                           ; preds = %.lr.ph.preheader, %47
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %47 ]
  %6 = getelementptr inbounds [10001 x i32], ptr @c, i64 0, i64 %indvars.iv
  %7 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %7, label %47 [
    i32 0, label %8
    i32 1, label %19
    i32 2, label %36
  ]

8:                                                ; preds = %.lr.ph
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %10 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %indvars.iv
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = add nsw i32 %11, %9
  %13 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %indvars.iv
  %14 = load i32, ptr %13, align 4, !tbaa !5
  tail call void @_Z7addedgeii(i32 noundef %12, i32 noundef %14)
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = load i32, ptr %13, align 4, !tbaa !5
  %17 = add nsw i32 %16, %15
  %18 = load i32, ptr %10, align 4, !tbaa !5
  tail call void @_Z7addedgeii(i32 noundef %17, i32 noundef %18)
  br label %47

19:                                               ; preds = %.lr.ph
  %20 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %indvars.iv
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %indvars.iv
  %23 = load i32, ptr %22, align 4, !tbaa !5
  tail call void @_Z7addedgeii(i32 noundef %21, i32 noundef %23)
  %24 = load i32, ptr %22, align 4, !tbaa !5
  %25 = load i32, ptr %20, align 4, !tbaa !5
  tail call void @_Z7addedgeii(i32 noundef %24, i32 noundef %25)
  %26 = load i32, ptr @n, align 4, !tbaa !5
  %27 = load i32, ptr %20, align 4, !tbaa !5
  %28 = add nsw i32 %27, %26
  %29 = load i32, ptr %22, align 4, !tbaa !5
  %30 = add nsw i32 %29, %26
  tail call void @_Z7addedgeii(i32 noundef %28, i32 noundef %30)
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = load i32, ptr %22, align 4, !tbaa !5
  %33 = add nsw i32 %32, %31
  %34 = load i32, ptr %20, align 4, !tbaa !5
  %35 = add nsw i32 %34, %31
  tail call void @_Z7addedgeii(i32 noundef %33, i32 noundef %35)
  br label %47

36:                                               ; preds = %.lr.ph
  %37 = getelementptr inbounds [10001 x i32], ptr @a, i64 0, i64 %indvars.iv
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %40 = getelementptr inbounds [10001 x i32], ptr @b, i64 0, i64 %indvars.iv
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add nsw i32 %41, %39
  tail call void @_Z7addedgeii(i32 noundef %38, i32 noundef %42)
  %43 = load i32, ptr %40, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = load i32, ptr %37, align 4, !tbaa !5
  %46 = add nsw i32 %45, %44
  tail call void @_Z7addedgeii(i32 noundef %43, i32 noundef %46)
  br label %47

47:                                               ; preds = %.lr.ph, %8, %19, %36
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge44:                                    ; preds = %56
  store i32 0, ptr @sum, align 4, !tbaa !5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(402) @vis, i8 0, i64 402, i1 false)
  %48 = icmp sgt i32 %58, 0
  br i1 %48, label %.lr.ph48.preheader, label %.preheader

.lr.ph48.preheader:                               ; preds = %._crit_edge44
  %49 = zext nneg i32 %58 to i64
  br label %.lr.ph48

.lr.ph43:                                         ; preds = %._crit_edge, %56
  %50 = phi i32 [ %57, %56 ], [ %3, %._crit_edge ]
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %56 ], [ 0, %._crit_edge ]
  %51 = getelementptr inbounds [402 x i8], ptr @vis, i64 0, i64 %indvars.iv57
  %52 = load i8, ptr %51, align 1, !tbaa !11, !range !13, !noundef !14
  %53 = trunc nuw i8 %52 to i1
  br i1 %53, label %56, label %54

54:                                               ; preds = %.lr.ph43
  %55 = trunc nuw nsw i64 %indvars.iv57 to i32
  tail call void @_Z4dfs1i(i32 noundef %55)
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %.lr.ph43, %54
  %57 = phi i32 [ %50, %.lr.ph43 ], [ %.pre, %54 ]
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %58 = shl i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = icmp slt i64 %indvars.iv.next58, %59
  br i1 %60, label %.lr.ph43, label %._crit_edge44, !llvm.loop !15

.preheader.loopexit:                              ; preds = %77
  %.pre67 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %._crit_edge44.thread, %.preheader.loopexit, %._crit_edge44
  %61 = phi i32 [ %.pre67, %.preheader.loopexit ], [ %57, %._crit_edge44 ], [ %3, %._crit_edge44.thread ]
  %62 = icmp slt i32 %61, 1
  br i1 %62, label %._crit_edge51, label %.lr.ph50.preheader

.lr.ph50.preheader:                               ; preds = %.preheader
  %63 = zext nneg i32 %61 to i64
  %wide.trip.count65 = zext nneg i32 %61 to i64
  %64 = load i32, ptr @scc, align 16, !tbaa !5
  %65 = getelementptr inbounds [402 x i32], ptr @scc, i64 0, i64 %63
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp eq i32 %64, %66
  br i1 %67, label %._crit_edge51, label %.lr.ph74

.lr.ph48:                                         ; preds = %.lr.ph48.preheader, %77
  %indvars.iv60 = phi i64 [ %49, %.lr.ph48.preheader ], [ %indvars.iv.next61, %77 ]
  %indvars.iv.next61 = add nsw i64 %indvars.iv60, -1
  %68 = getelementptr inbounds [402 x i32], ptr @seq, i64 0, i64 %indvars.iv.next61
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [402 x i8], ptr @vis, i64 0, i64 %70
  %72 = load i8, ptr %71, align 1, !tbaa !11, !range !13, !noundef !14
  %73 = trunc nuw i8 %72 to i1
  br i1 %73, label %77, label %74

74:                                               ; preds = %.lr.ph48
  %75 = load i32, ptr @sum, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @sum, align 4, !tbaa !5
  tail call void @_Z4dfs2i(i32 noundef %69)
  br label %77

77:                                               ; preds = %.lr.ph48, %74
  %78 = icmp ugt i64 %indvars.iv60, 1
  br i1 %78, label %.lr.ph48, label %.preheader.loopexit, !llvm.loop !16

.lr.ph74:                                         ; preds = %.lr.ph50.preheader, %.lr.ph50
  %indvars.iv6373 = phi i64 [ %indvars.iv.next64, %.lr.ph50 ], [ 0, %.lr.ph50.preheader ]
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv6373, 1
  %exitcond66 = icmp eq i64 %indvars.iv.next64, %wide.trip.count65
  br i1 %exitcond66, label %._crit_edge51.loopexit, label %.lr.ph50, !llvm.loop !17

.lr.ph50:                                         ; preds = %.lr.ph74
  %79 = getelementptr inbounds [402 x i32], ptr @scc, i64 0, i64 %indvars.iv.next64
  %80 = load i32, ptr %79, align 4, !tbaa !5
  %81 = add nuw nsw i64 %indvars.iv.next64, %63
  %82 = getelementptr inbounds [402 x i32], ptr @scc, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp eq i32 %80, %83
  br i1 %84, label %._crit_edge51.loopexit, label %.lr.ph74, !llvm.loop !17

._crit_edge51.loopexit:                           ; preds = %.lr.ph74, %.lr.ph50
  %85 = icmp uge i64 %indvars.iv.next64, %63
  br label %._crit_edge51

._crit_edge51:                                    ; preds = %._crit_edge51.loopexit, %.lr.ph50.preheader, %.preheader
  %.lcssa = phi i1 [ true, %.preheader ], [ false, %.lr.ph50.preheader ], [ %85, %._crit_edge51.loopexit ]
  ret i1 %.lcssa
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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