; LLVM IR from tangjz/acm-icpc :: hdu/4769.ll (Z3dfsib)

; 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.Bitset = type { i32, [10 x i64] }

@m = external dso_local global i32, align 4
@rcnt = external dso_local global i32, align 4
@bits = external dso_local global [201 x i32], align 16
@tim = external dso_local global [601 x i32], align 16
@per = external dso_local global [601 x i32], align 16
@con = external dso_local global [61 x i32], align 16
@lim = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@curC = external dso_local global [61 x %struct.Bitset], align 16
@row = external dso_local global [601 x %struct.Bitset], align 16
@col = external dso_local global [201 x %struct.Bitset], align 16
@_ZL3upp = external hidden constant i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4calci(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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6BitsetmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.Bitset) align 8, ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88)) #0 align 2

; 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
define dso_local void @_Z3dfsib(i32 noundef %0, i1 noundef zeroext %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.Bitset, align 8
  store i32 %0, ptr %3, align 4, !tbaa !5
  %12 = zext i1 %1 to i8
  store i8 %12, ptr %4, align 1, !tbaa !9
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = call noundef i32 @_Z4calci(i32 noundef %13)
  %15 = load i32, ptr @ans, align 4, !tbaa !5
  %16 = icmp sge i32 %14, %15
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  br label %157

18:                                               ; preds = %2
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %20
  %22 = call noundef zeroext i1 @_ZNK6Bitset4noneEv(ptr noundef nonnull align 8 dereferenceable(88) %21)
  br i1 %22, label %23, label %25

23:                                               ; preds = %18
  %24 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %24, ptr @ans, align 4, !tbaa !5
  br label %157

25:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %27
  %29 = call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %28, i32 noundef 0)
  store i32 %29, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %31
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  %35 = call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %32, i32 noundef %34)
  store i32 %35, ptr %6, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %54, %25
  %37 = load i32, ptr %6, align 4, !tbaa !5
  %38 = load i32, ptr @m, align 4, !tbaa !5
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

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

41:                                               ; preds = %36
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [201 x i32], ptr @bits, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [201 x i32], ptr @bits, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp slt i32 %45, %49
  br i1 %50, label %51, label %53

51:                                               ; preds = %41
  %52 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %52, ptr %5, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %51, %41
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %56
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  %60 = call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %57, i32 noundef %59)
  store i32 %60, ptr %6, align 4, !tbaa !5
  br label %36, !llvm.loop !11

61:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [201 x %struct.Bitset], ptr @col, i64 0, i64 %63
  %65 = call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %64, i32 noundef 0)
  store i32 %65, ptr %7, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %145, %61
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = load i32, ptr @rcnt, align 4, !tbaa !5
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 5, ptr %8, align 4
  br label %152

71:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [601 x i32], ptr @tim, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  store i32 %75, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %76 = load i32, ptr %7, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [601 x i32], ptr @per, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  store i32 %79, ptr %10, align 4, !tbaa !5
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = icmp ne i32 %83, -1
  br i1 %84, label %85, label %86

85:                                               ; preds = %71
  store i32 7, ptr %8, align 4
  br label %142

86:                                               ; preds = %71
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = icmp sgt i32 %87, 1
  br i1 %88, label %89, label %98

89:                                               ; preds = %86
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = sub nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = icmp eq i32 %94, %95
  br i1 %96, label %97, label %98

97:                                               ; preds = %89
  store i32 7, ptr %8, align 4
  br label %142

98:                                               ; preds = %89, %86
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = load i32, ptr @lim, align 4, !tbaa !5
  %101 = icmp slt i32 %99, %100
  br i1 %101, label %102, label %111

102:                                              ; preds = %98
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = icmp eq i32 %107, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %102
  store i32 7, ptr %8, align 4
  br label %142

111:                                              ; preds = %102, %98
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %114
  store i32 %112, ptr %115, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr %11) #5
  %116 = load i32, ptr %3, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %117
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [601 x %struct.Bitset], ptr @row, i64 0, i64 %120
  call void @_ZNK6BitsetmiERKS_(ptr dead_on_unwind writable sret(%struct.Bitset) align 8 %11, ptr noundef nonnull align 8 dereferenceable(88) %118, ptr noundef nonnull align 8 dereferenceable(88) %121)
  %122 = load i32, ptr %3, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %124
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %125, ptr align 8 %11, i64 88, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 88, ptr %11) #5
  %126 = load i32, ptr %3, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  %128 = load i8, ptr %4, align 1, !tbaa !9, !range !15, !noundef !16
  %129 = trunc i8 %128 to i1
  call void @_Z3dfsib(i32 noundef %127, i1 noundef zeroext %129)
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %131
  store i32 -1, ptr %132, align 4, !tbaa !5
  %133 = load i8, ptr %4, align 1, !tbaa !9, !range !15, !noundef !16
  %134 = trunc i8 %133 to i1
  br i1 %134, label %141, label %135

135:                                              ; preds = %111
  %136 = load i32, ptr @ans, align 4, !tbaa !5
  %137 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @lim, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3upp)
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = icmp sle i32 %136, %138
  br i1 %139, label %140, label %141

140:                                              ; preds = %135
  store i32 1, ptr %8, align 4
  br label %142

141:                                              ; preds = %135, %111
  store i32 0, ptr %8, align 4
  br label %142

142:                                              ; preds = %141, %140, %110, %97, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %143 = load i32, ptr %8, align 4
  switch i32 %143, label %152 [
    i32 0, label %144
    i32 7, label %145
  ]

144:                                              ; preds = %142
  br label %145

145:                                              ; preds = %144, %142
  %146 = load i32, ptr %5, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [201 x %struct.Bitset], ptr @col, i64 0, i64 %147
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  %151 = call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %148, i32 noundef %150)
  store i32 %151, ptr %7, align 4, !tbaa !5
  br label %66, !llvm.loop !17

152:                                              ; preds = %142, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %153 = load i32, ptr %8, align 4
  switch i32 %153, label %155 [
    i32 5, label %154
  ]

154:                                              ; preds = %152
  store i32 0, ptr %8, align 4
  br label %155

155:                                              ; preds = %154, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %156 = load i32, ptr %8, align 4
  switch i32 %156, label %158 [
    i32 0, label %157
    i32 1, label %157
  ]

157:                                              ; preds = %155, %155, %23, %17
  ret void

158:                                              ; preds = %155
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6Bitset4noneEv(ptr noundef nonnull align 8 dereferenceable(88)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint 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 #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, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{i64 0, i64 4, !5, i64 8, i64 80, !14}
!14 = !{!7, !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!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.Bitset = type { i32, [10 x i64] }

@m = external dso_local local_unnamed_addr global i32, align 4
@rcnt = external dso_local local_unnamed_addr global i32, align 4
@bits = external dso_local local_unnamed_addr global [201 x i32], align 16
@tim = external dso_local local_unnamed_addr global [601 x i32], align 16
@per = external dso_local local_unnamed_addr global [601 x i32], align 16
@con = external dso_local local_unnamed_addr global [61 x i32], align 16
@lim = external dso_local global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@curC = external dso_local global [61 x %struct.Bitset], align 16
@row = external dso_local global [601 x %struct.Bitset], align 16
@col = external dso_local global [201 x %struct.Bitset], align 16
@_ZL3upp = external hidden constant i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z4calci(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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6BitsetmiERKS_(ptr dead_on_unwind noalias writable sret(%struct.Bitset) align 8, ptr noundef nonnull align 8 dereferenceable(88), ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #0 align 2

; 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
define dso_local void @_Z3dfsib(i32 noundef %0, i1 noundef zeroext %1) local_unnamed_addr #0 {
  %3 = alloca %struct.Bitset, align 8
  %4 = tail call noundef i32 @_Z4calci(i32 noundef %0)
  %5 = load i32, ptr @ans, align 4, !tbaa !5
  %.not = icmp slt i32 %4, %5
  br i1 %.not, label %6, label %.loopexit

6:                                                ; preds = %2
  %7 = sext i32 %0 to i64
  %8 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %7
  %9 = tail call noundef zeroext i1 @_ZNK6Bitset4noneEv(ptr noundef nonnull align 8 dereferenceable(88) %8)
  br i1 %9, label %10, label %11

10:                                               ; preds = %6
  store i32 %0, ptr @ans, align 4, !tbaa !5
  br label %.loopexit

11:                                               ; preds = %6
  %12 = tail call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %8, i32 noundef 0)
  %13 = add nsw i32 %12, 1
  %14 = tail call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %8, i32 noundef %13)
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %11
  %.0.lcssa = phi i32 [ %12, %11 ], [ %spec.select, %.lr.ph ]
  %17 = sext i32 %.0.lcssa to i64
  %18 = getelementptr inbounds [201 x %struct.Bitset], ptr @col, i64 0, i64 %17
  %19 = tail call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %18, i32 noundef 0)
  %20 = load i32, ptr @rcnt, align 4, !tbaa !5
  %21 = icmp slt i32 %19, %20
  br i1 %21, label %.lr.ph49, label %.loopexit

.lr.ph49:                                         ; preds = %._crit_edge
  %22 = add nsw i32 %0, 1
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [61 x %struct.Bitset], ptr @curC, i64 0, i64 %23
  br i1 %1, label %.lr.ph49.split.us, label %.lr.ph49.split

.lr.ph49.split.us:                                ; preds = %.lr.ph49, %52
  %.03947.us = phi i32 [ %54, %52 ], [ %19, %.lr.ph49 ]
  %25 = sext i32 %.03947.us to i64
  %26 = getelementptr inbounds [601 x i32], ptr @tim, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = getelementptr inbounds [601 x i32], ptr @per, i64 0, i64 %25
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = sext i32 %27 to i64
  %31 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %.not42.us = icmp eq i32 %32, -1
  br i1 %.not42.us, label %33, label %52

33:                                               ; preds = %.lr.ph49.split.us
  %34 = icmp sgt i32 %27, 1
  br i1 %34, label %35, label %41

35:                                               ; preds = %33
  %36 = add nsw i32 %27, -1
  %37 = zext nneg i32 %36 to i64
  %38 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp eq i32 %39, %29
  br i1 %40, label %52, label %41

41:                                               ; preds = %35, %33
  %42 = load i32, ptr @lim, align 4, !tbaa !5
  %43 = icmp slt i32 %27, %42
  br i1 %43, label %44, label %50

44:                                               ; preds = %41
  %45 = add nsw i32 %27, 1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = icmp eq i32 %48, %29
  br i1 %49, label %52, label %50

50:                                               ; preds = %44, %41
  store i32 %29, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #5
  %51 = getelementptr inbounds [601 x %struct.Bitset], ptr @row, i64 0, i64 %25
  call void @_ZNK6BitsetmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Bitset) align 8 %3, ptr noundef nonnull align 8 dereferenceable(88) %8, ptr noundef nonnull align 8 dereferenceable(88) %51)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %24, ptr noundef nonnull align 8 dereferenceable(88) %3, i64 88, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #5
  call void @_Z3dfsib(i32 noundef %22, i1 noundef zeroext true)
  store i32 -1, ptr %31, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %50, %44, %35, %.lr.ph49.split.us
  %53 = add nsw i32 %.03947.us, 1
  %54 = call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %18, i32 noundef %53)
  %55 = load i32, ptr @rcnt, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %.lr.ph49.split.us, label %.loopexit, !llvm.loop !11

.lr.ph:                                           ; preds = %11, %.lr.ph
  %.046 = phi i32 [ %spec.select, %.lr.ph ], [ %12, %11 ]
  %.03645 = phi i32 [ %65, %.lr.ph ], [ %14, %11 ]
  %57 = sext i32 %.03645 to i64
  %58 = getelementptr inbounds [201 x i32], ptr @bits, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = sext i32 %.046 to i64
  %61 = getelementptr inbounds [201 x i32], ptr @bits, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp slt i32 %59, %62
  %spec.select = select i1 %63, i32 %.03645, i32 %.046
  %64 = add nsw i32 %.03645, 1
  %65 = tail call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %8, i32 noundef %64)
  %66 = load i32, ptr @m, align 4, !tbaa !5
  %67 = icmp slt i32 %65, %66
  br i1 %67, label %.lr.ph, label %._crit_edge, !llvm.loop !13

.lr.ph49.split:                                   ; preds = %.lr.ph49, %98
  %.03947 = phi i32 [ %100, %98 ], [ %19, %.lr.ph49 ]
  %68 = sext i32 %.03947 to i64
  %69 = getelementptr inbounds [601 x i32], ptr @tim, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = getelementptr inbounds [601 x i32], ptr @per, i64 0, i64 %68
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = sext i32 %70 to i64
  %74 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %.not42 = icmp eq i32 %75, -1
  br i1 %.not42, label %76, label %98

76:                                               ; preds = %.lr.ph49.split
  %77 = icmp sgt i32 %70, 1
  br i1 %77, label %78, label %84

78:                                               ; preds = %76
  %79 = add nsw i32 %70, -1
  %80 = zext nneg i32 %79 to i64
  %81 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = icmp eq i32 %82, %72
  br i1 %83, label %98, label %84

84:                                               ; preds = %78, %76
  %85 = load i32, ptr @lim, align 4, !tbaa !5
  %86 = icmp slt i32 %70, %85
  br i1 %86, label %87, label %93

87:                                               ; preds = %84
  %88 = add nsw i32 %70, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [61 x i32], ptr @con, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp eq i32 %91, %72
  br i1 %92, label %98, label %93

93:                                               ; preds = %87, %84
  store i32 %72, ptr %74, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %3) #5
  %94 = getelementptr inbounds [601 x %struct.Bitset], ptr @row, i64 0, i64 %68
  call void @_ZNK6BitsetmiERKS_(ptr dead_on_unwind nonnull writable sret(%struct.Bitset) align 8 %3, ptr noundef nonnull align 8 dereferenceable(88) %8, ptr noundef nonnull align 8 dereferenceable(88) %94)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(88) %24, ptr noundef nonnull align 8 dereferenceable(88) %3, i64 88, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %3) #5
  call void @_Z3dfsib(i32 noundef %22, i1 noundef zeroext false)
  store i32 -1, ptr %74, align 4, !tbaa !5
  %95 = load i32, ptr @ans, align 4, !tbaa !5
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) @lim, ptr noundef nonnull align 4 dereferenceable(4) @_ZL3upp)
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %.not43 = icmp sgt i32 %95, %97
  br i1 %.not43, label %98, label %.loopexit

98:                                               ; preds = %93, %.lr.ph49.split, %78, %87
  %99 = add nsw i32 %.03947, 1
  %100 = call noundef i32 @_ZNK6Bitset6lowbitEi(ptr noundef nonnull align 8 dereferenceable(88) %18, i32 noundef %99)
  %101 = load i32, ptr @rcnt, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %.lr.ph49.split, label %.loopexit, !llvm.loop !11

.loopexit:                                        ; preds = %98, %93, %52, %._crit_edge, %2, %10
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK6Bitset4noneEv(ptr noundef nonnull align 8 dereferenceable(88)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { inlinehint 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 #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 = !{i64 0, i64 4, !5, i64 8, i64 80, !10}
!10 = !{!7, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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