; LLVM IR from tangjz/acm-icpc :: codeforces/sgu (325)

; 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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@buf = external dso_local global [1000001 x i8], align 16
@n = external dso_local global i32, align 4
@bits = external dso_local global [1000001 x i32], align 16
@ctr = external dso_local global [27 x i32], align 16
@rem = external dso_local global [27 x i32], align 16
@cand = external dso_local global [27 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @buf)
  store i32 0, ptr @n, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %32, %0
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %17
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %21, label %35

21:                                               ; preds = %15
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %23
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = sub nsw i32 %26, 65
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [27 x i32], ptr @ctr, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %29, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %21
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @n, align 4, !tbaa !5
  br label %15, !llvm.loop !10

35:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %64, %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = icmp slt i32 %37, 26
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %36
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [27 x i32], ptr @ctr, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = and i32 %44, 1
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = add nsw i32 %46, %45
  store i32 %47, ptr %2, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [27 x i32], ptr @ctr, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = ashr i32 %51, 1
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [27 x i32], ptr @rem, i64 0, i64 %54
  store i32 %52, ptr %55, align 4, !tbaa !5
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [27 x %"class.std::vector"], ptr @cand, i64 0, i64 %57
  %59 = load i32, ptr %3, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [27 x i32], ptr @rem, i64 0, i64 %60
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %63)
  br label %64

64:                                               ; preds = %40
  %65 = load i32, ptr %3, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !5
  br label %36, !llvm.loop !12

67:                                               ; preds = %39
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = and i32 %68, 1
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = icmp ne i32 %69, %70
  br i1 %71, label %72, label %74

72:                                               ; preds = %67
  %73 = call i32 @puts(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %183

74:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  store i64 0, ptr %5, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !5
  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
  %75 = load i32, ptr @n, align 4, !tbaa !5
  %76 = and i32 %75, 1
  store i32 %76, ptr %8, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %177, %74
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %180

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !9
  %87 = sext i8 %86 to i32
  %88 = sub nsw i32 %87, 65
  store i32 %88, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [27 x i32], ptr @rem, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %109

94:                                               ; preds = %82
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [27 x i32], ptr @rem, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = add nsw i32 %98, -1
  store i32 %99, ptr %97, align 4, !tbaa !5
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [27 x %"class.std::vector"], ptr @cand, i64 0, i64 %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %103 = load i32, ptr @n, align 4, !tbaa !5
  %104 = sub nsw i32 %103, 1
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sub nsw i32 %104, %105
  store i32 %106, ptr %11, align 4, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %7, align 4, !tbaa !5
  store i32 %107, ptr %10, align 4, !tbaa !5
  br label %134

109:                                              ; preds = %82
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %124

112:                                              ; preds = %109
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [27 x i32], ptr @ctr, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = and i32 %116, 1
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %124

119:                                              ; preds = %112
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = add nsw i32 %120, -1
  store i32 %121, ptr %8, align 4, !tbaa !5
  %122 = load i32, ptr @n, align 4, !tbaa !5
  %123 = ashr i32 %122, 1
  store i32 %123, ptr %10, align 4, !tbaa !5
  br label %133

124:                                              ; preds = %112, %109
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [27 x %"class.std::vector"], ptr @cand, i64 0, i64 %126
  %128 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %127) #5
  %129 = load i32, ptr %128, align 4, !tbaa !5
  store i32 %129, ptr %10, align 4, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [27 x %"class.std::vector"], ptr @cand, i64 0, i64 %131
  call void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %132) #5
  br label %133

133:                                              ; preds = %124, %119
  br label %134

134:                                              ; preds = %133, %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %135 = load i32, ptr %10, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %12, align 4, !tbaa !5
  br label %137

137:                                              ; preds = %150, %134
  %138 = load i32, ptr %12, align 4, !tbaa !5
  %139 = load i32, ptr @n, align 4, !tbaa !5
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %157

142:                                              ; preds = %137
  %143 = load i32, ptr %12, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [1000001 x i32], ptr @bits, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = load i64, ptr %5, align 8, !tbaa !13
  %149 = add nsw i64 %148, %147
  store i64 %149, ptr %5, align 8, !tbaa !13
  br label %150

150:                                              ; preds = %142
  %151 = load i32, ptr %12, align 4, !tbaa !5
  %152 = load i32, ptr %12, align 4, !tbaa !5
  %153 = sub nsw i32 0, %152
  %154 = and i32 %151, %153
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = add nsw i32 %155, %154
  store i32 %156, ptr %12, align 4, !tbaa !5
  br label %137, !llvm.loop !15

157:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %158 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %158, ptr %13, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %169, %157
  %160 = load i32, ptr %13, align 4, !tbaa !5
  %161 = icmp sgt i32 %160, 0
  br i1 %161, label %163, label %162

162:                                              ; preds = %159
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %176

163:                                              ; preds = %159
  %164 = load i32, ptr %13, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [1000001 x i32], ptr @bits, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = add nsw i32 %167, 1
  store i32 %168, ptr %166, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %163
  %170 = load i32, ptr %13, align 4, !tbaa !5
  %171 = load i32, ptr %13, align 4, !tbaa !5
  %172 = sub nsw i32 0, %171
  %173 = and i32 %170, %172
  %174 = load i32, ptr %13, align 4, !tbaa !5
  %175 = sub nsw i32 %174, %173
  store i32 %175, ptr %13, align 4, !tbaa !5
  br label %159, !llvm.loop !16

176:                                              ; preds = %162
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %6, align 4, !tbaa !5
  br label %77, !llvm.loop !17

180:                                              ; preds = %81
  %181 = load i64, ptr %5, align 8, !tbaa !13
  %182 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %181)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %183

183:                                              ; preds = %180, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %184 = load i32, ptr %1, align 4
  ret i32 %184
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

declare i32 @puts(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) #4 align 2

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

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}


; 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"

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@buf = external dso_local global [1000001 x i8], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@bits = external dso_local local_unnamed_addr global [1000001 x i32], align 16
@ctr = external dso_local local_unnamed_addr global [27 x i32], align 16
@rem = external dso_local local_unnamed_addr global [27 x i32], align 16
@cand = external dso_local global [27 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

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

.preheader58.loopexit:                            ; preds = %.lr.ph
  %4 = trunc nuw nsw i64 %indvars.iv.next to i32
  br label %.preheader58

.preheader58:                                     ; preds = %.preheader58.loopexit, %0
  %storemerge.lcssa = phi i32 [ 0, %0 ], [ %4, %.preheader58.loopexit ]
  store i32 %storemerge.lcssa, ptr @n, align 4, !tbaa !8
  br label %17

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %5 = phi i8 [ %12, %.lr.ph ], [ %3, %0 ]
  %6 = sext i8 %5 to i64
  %7 = add nsw i64 %6, -65
  %8 = getelementptr inbounds [27 x i32], ptr @ctr, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !8
  %10 = add nsw i32 %9, 1
  store i32 %10, ptr %8, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %indvars.iv.next
  %12 = load i8, ptr %11, align 1, !tbaa !5
  %.not = icmp eq i8 %12, 0
  br i1 %.not, label %.preheader58.loopexit, label %.lr.ph, !llvm.loop !10

13:                                               ; preds = %17
  %14 = load i32, ptr @n, align 4, !tbaa !8
  %15 = and i32 %14, 1
  %.not52 = icmp eq i32 %15, %21
  br i1 %.not52, label %.preheader57, label %26

.preheader57:                                     ; preds = %13
  %16 = icmp sgt i32 %14, 0
  br i1 %16, label %.lr.ph73, label %._crit_edge74

17:                                               ; preds = %.preheader58, %17
  %indvars.iv78 = phi i64 [ 0, %.preheader58 ], [ %indvars.iv.next79, %17 ]
  %.04761 = phi i32 [ 0, %.preheader58 ], [ %21, %17 ]
  %18 = getelementptr inbounds [27 x i32], ptr @ctr, i64 0, i64 %indvars.iv78
  %19 = load i32, ptr %18, align 4, !tbaa !8
  %20 = and i32 %19, 1
  %21 = add nuw nsw i32 %20, %.04761
  %22 = ashr i32 %19, 1
  %23 = getelementptr inbounds [27 x i32], ptr @rem, i64 0, i64 %indvars.iv78
  store i32 %22, ptr %23, align 4, !tbaa !8
  %24 = getelementptr inbounds [27 x %"class.std::vector"], ptr @cand, i64 0, i64 %indvars.iv78
  %25 = sext i32 %22 to i64
  tail call void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %25)
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next79, 26
  br i1 %exitcond.not, label %13, label %17, !llvm.loop !12

26:                                               ; preds = %13
  %27 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %74

._crit_edge74:                                    ; preds = %._crit_edge, %.preheader57
  %.044.lcssa = phi i64 [ 0, %.preheader57 ], [ %.145.lcssa, %._crit_edge ]
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %.044.lcssa)
  br label %74

.lr.ph73:                                         ; preds = %.preheader57, %._crit_edge
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %._crit_edge ], [ 0, %.preheader57 ]
  %29 = phi i32 [ %55, %._crit_edge ], [ %14, %.preheader57 ]
  %.04072 = phi i32 [ %.1, %._crit_edge ], [ %21, %.preheader57 ]
  %.04171 = phi i32 [ %.142, %._crit_edge ], [ 0, %.preheader57 ]
  %.04469 = phi i64 [ %.145.lcssa, %._crit_edge ], [ 0, %.preheader57 ]
  %30 = getelementptr inbounds [1000001 x i8], ptr @buf, i64 0, i64 %indvars.iv81
  %31 = load i8, ptr %30, align 1, !tbaa !5
  %32 = sext i8 %31 to i64
  %33 = add nsw i64 %32, -65
  %34 = getelementptr inbounds [27 x i32], ptr @rem, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !8
  %.not53 = icmp eq i32 %35, 0
  br i1 %.not53, label %42, label %36

36:                                               ; preds = %.lr.ph73
  %37 = add nsw i32 %35, -1
  store i32 %37, ptr %34, align 4, !tbaa !8
  %38 = getelementptr inbounds [27 x %"class.std::vector"], ptr @cand, i64 0, i64 %33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %39 = xor i32 %.04171, -1
  %40 = add i32 %29, %39
  store i32 %40, ptr %1, align 4, !tbaa !8
  call void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  %41 = add nsw i32 %.04171, 1
  br label %53

42:                                               ; preds = %.lr.ph73
  %.not54 = icmp eq i32 %.04072, 0
  br i1 %.not54, label %49, label %43

43:                                               ; preds = %42
  %44 = getelementptr inbounds [27 x i32], ptr @ctr, i64 0, i64 %33
  %45 = load i32, ptr %44, align 4, !tbaa !8
  %46 = and i32 %45, 1
  %.not55 = icmp eq i32 %46, 0
  br i1 %.not55, label %49, label %47

47:                                               ; preds = %43
  %48 = ashr i32 %29, 1
  br label %53

49:                                               ; preds = %43, %42
  %50 = getelementptr inbounds [27 x %"class.std::vector"], ptr @cand, i64 0, i64 %33
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #5
  %52 = load i32, ptr %51, align 4, !tbaa !8
  call void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #5
  br label %53

53:                                               ; preds = %47, %49, %36
  %.142 = phi i32 [ %41, %36 ], [ %.04171, %47 ], [ %.04171, %49 ]
  %.1 = phi i32 [ %.04072, %36 ], [ 0, %47 ], [ %.04072, %49 ]
  %.038 = phi i32 [ %.04171, %36 ], [ %48, %47 ], [ %52, %49 ]
  %54 = add nsw i32 %.038, 1
  %55 = load i32, ptr @n, align 4, !tbaa !8
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %.lr.ph65, label %.preheader

.preheader:                                       ; preds = %.lr.ph65, %53
  %.145.lcssa = phi i64 [ %.04469, %53 ], [ %62, %.lr.ph65 ]
  %57 = icmp sgt i32 %.038, 0
  br i1 %57, label %.lr.ph68, label %._crit_edge

.lr.ph65:                                         ; preds = %53, %.lr.ph65
  %.03764 = phi i32 [ %65, %.lr.ph65 ], [ %54, %53 ]
  %.14563 = phi i64 [ %62, %.lr.ph65 ], [ %.04469, %53 ]
  %58 = sext i32 %.03764 to i64
  %59 = getelementptr inbounds [1000001 x i32], ptr @bits, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = add nsw i64 %.14563, %61
  %63 = sub nsw i32 0, %.03764
  %64 = and i32 %.03764, %63
  %65 = add nsw i32 %64, %.03764
  %66 = icmp slt i32 %65, %55
  br i1 %66, label %.lr.ph65, label %.preheader, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph68, %.preheader
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %67 = sext i32 %55 to i64
  %68 = icmp slt i64 %indvars.iv.next82, %67
  br i1 %68, label %.lr.ph73, label %._crit_edge74, !llvm.loop !14

.lr.ph68:                                         ; preds = %.preheader, %.lr.ph68
  %.067 = phi i32 [ %73, %.lr.ph68 ], [ %.038, %.preheader ]
  %69 = zext nneg i32 %.067 to i64
  %70 = getelementptr inbounds [1000001 x i32], ptr @bits, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %70, align 4, !tbaa !8
  %.not56 = add nsw i32 %.067, -1
  %73 = and i32 %.not56, %.067
  %.not85 = icmp eq i32 %73, 0
  br i1 %.not85, label %._crit_edge, label %.lr.ph68, !llvm.loop !15

74:                                               ; preds = %._crit_edge74, %26
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE7reserveEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backEOi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE4backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #4 align 2

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

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}


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