; LLVM IR from DionysiosB/CodeForces :: 0900-0999 (903A-HungryStudentProblem)

; 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::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.0" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::allocator.0", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::_Bit_reference", align 8
  %11 = alloca %"struct.std::_Bit_reference", align 8
  %12 = alloca %"struct.std::_Bit_reference", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"struct.std::_Bit_reference", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store i64 107, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 3, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  store i64 7, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef 107, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %16 unwind label %21

16:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !5
  br label %17

17:                                               ; preds = %71, %16
  %18 = load i64, ptr %9, align 8, !tbaa !5
  %19 = icmp slt i64 %18, 107
  br i1 %19, label %25, label %20

20:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %88

21:                                               ; preds = %0
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %7, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %8, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  br label %127

25:                                               ; preds = %17
  %26 = load i64, ptr %9, align 8, !tbaa !5
  %27 = srem i64 %26, 3
  %28 = icmp eq i64 %27, 0
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  br i1 %28, label %61, label %29

29:                                               ; preds = %25
  %30 = load i64, ptr %9, align 8, !tbaa !5
  %31 = srem i64 %30, 7
  %32 = icmp eq i64 %31, 0
  br i1 %32, label %61, label %33

33:                                               ; preds = %29
  %34 = load i64, ptr %9, align 8, !tbaa !5
  %35 = icmp sge i64 %34, 3
  br i1 %35, label %36, label %46

36:                                               ; preds = %33
  %37 = load i64, ptr %9, align 8, !tbaa !5
  %38 = sub nsw i64 %37, 3
  %39 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %38)
          to label %40 unwind label %74

40:                                               ; preds = %36
  %41 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 0
  %42 = extractvalue { ptr, i64 } %39, 0
  store ptr %42, ptr %41, align 8
  %43 = getelementptr inbounds { ptr, i64 }, ptr %10, i32 0, i32 1
  %44 = extractvalue { ptr, i64 } %39, 1
  store i64 %44, ptr %43, align 8
  %45 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  br i1 %45, label %61, label %46

46:                                               ; preds = %40, %33
  %47 = load i64, ptr %9, align 8, !tbaa !5
  %48 = icmp sge i64 %47, 7
  br i1 %48, label %49, label %59

49:                                               ; preds = %46
  %50 = load i64, ptr %9, align 8, !tbaa !5
  %51 = sub nsw i64 %50, 7
  %52 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %51)
          to label %53 unwind label %78

53:                                               ; preds = %49
  %54 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 0
  %55 = extractvalue { ptr, i64 } %52, 0
  store ptr %55, ptr %54, align 8
  %56 = getelementptr inbounds { ptr, i64 }, ptr %11, i32 0, i32 1
  %57 = extractvalue { ptr, i64 } %52, 1
  store i64 %57, ptr %56, align 8
  %58 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %11) #5
  br label %59

59:                                               ; preds = %53, %46
  %60 = phi i1 [ false, %46 ], [ %58, %53 ]
  br label %61

61:                                               ; preds = %59, %40, %29, %25
  %62 = phi i1 [ true, %40 ], [ true, %29 ], [ true, %25 ], [ %60, %59 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %63 = load i64, ptr %9, align 8, !tbaa !5
  %64 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %63)
          to label %65 unwind label %82

65:                                               ; preds = %61
  %66 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 0
  %67 = extractvalue { ptr, i64 } %64, 0
  store ptr %67, ptr %66, align 8
  %68 = getelementptr inbounds { ptr, i64 }, ptr %12, i32 0, i32 1
  %69 = extractvalue { ptr, i64 } %64, 1
  store i64 %69, ptr %68, align 8
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %12, i1 noundef zeroext %62) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %71

71:                                               ; preds = %65
  %72 = load i64, ptr %9, align 8, !tbaa !5
  %73 = add nsw i64 %72, 1
  store i64 %73, ptr %9, align 8, !tbaa !5
  br label %17, !llvm.loop !9

74:                                               ; preds = %36
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %7, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %8, align 4
  br label %87

78:                                               ; preds = %49
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %7, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %8, align 4
  br label %86

82:                                               ; preds = %61
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %7, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  br label %86

86:                                               ; preds = %82, %78
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  br label %87

87:                                               ; preds = %86, %74
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %126

88:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %89 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %13)
          to label %90 unwind label %110

90:                                               ; preds = %88
  br label %91

91:                                               ; preds = %109, %90
  %92 = load i64, ptr %13, align 8, !tbaa !5
  %93 = add nsw i64 %92, -1
  store i64 %93, ptr %13, align 8, !tbaa !5
  %94 = icmp ne i64 %92, 0
  br i1 %94, label %95, label %123

95:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %96 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %14)
          to label %97 unwind label %114

97:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %98 = load i64, ptr %14, align 8, !tbaa !5
  %99 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %5, i64 noundef %98)
          to label %100 unwind label %118

100:                                              ; preds = %97
  %101 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 0
  %102 = extractvalue { ptr, i64 } %99, 0
  store ptr %102, ptr %101, align 8
  %103 = getelementptr inbounds { ptr, i64 }, ptr %15, i32 0, i32 1
  %104 = extractvalue { ptr, i64 } %99, 1
  store i64 %104, ptr %103, align 8
  %105 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %15) #5
  %106 = zext i1 %105 to i64
  %107 = select i1 %105, ptr @.str.1, ptr @.str.2
  %108 = invoke i32 @puts(ptr noundef %107)
          to label %109 unwind label %118

109:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %91, !llvm.loop !11

110:                                              ; preds = %88
  %111 = landingpad { ptr, i32 }
          cleanup
  %112 = extractvalue { ptr, i32 } %111, 0
  store ptr %112, ptr %7, align 8
  %113 = extractvalue { ptr, i32 } %111, 1
  store i32 %113, ptr %8, align 4
  br label %125

114:                                              ; preds = %95
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %7, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %8, align 4
  br label %122

118:                                              ; preds = %100, %97
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %7, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %122

122:                                              ; preds = %118, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %125

123:                                              ; preds = %91
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  %124 = load i32, ptr %1, align 4
  ret i32 %124

125:                                              ; preds = %122, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %126

126:                                              ; preds = %125, %87
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #5
  br label %127

127:                                              ; preds = %126, %21
  call void @llvm.lifetime.end.p0(i64 40, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  br label %128

128:                                              ; preds = %127
  %129 = load ptr, ptr %7, align 8
  %130 = load i32, ptr %8, align 4
  %131 = insertvalue { ptr, i32 } poison, ptr %129, 0
  %132 = insertvalue { ptr, i32 } %131, i32 %130, 1
  resume { ptr, i32 } %132
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #3 align 2

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

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

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

declare i32 @puts(ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

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

%"class.std::vector" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.0" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::vector", align 8
  %2 = alloca %"class.std::allocator.0", align 1
  %3 = alloca %"struct.std::_Bit_reference", align 8
  %4 = alloca %"struct.std::_Bit_reference", align 8
  %5 = alloca %"struct.std::_Bit_reference", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::_Bit_reference", align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #5
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 107, ptr noundef nonnull align 1 dereferenceable(1) %2)
          to label %.thread.peel unwind label %52

.thread.peel:                                     ; preds = %0
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  %10 = getelementptr inbounds i8, ptr %4, i64 8
  %11 = getelementptr inbounds i8, ptr %5, i64 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %12 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 0)
          to label %.thread.peel29 unwind label %.loopexit.split-lp44

.thread.peel29:                                   ; preds = %.thread.peel
  %13 = extractvalue { ptr, i64 } %12, 0
  store ptr %13, ptr %5, align 8
  %14 = extractvalue { ptr, i64 } %12, 1
  store i64 %14, ptr %11, align 8
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext true) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %16 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 1)
          to label %.thread.peel35 unwind label %.loopexit.split-lp44

.thread.peel35:                                   ; preds = %.thread.peel29
  %17 = extractvalue { ptr, i64 } %16, 0
  store ptr %17, ptr %5, align 8
  %18 = extractvalue { ptr, i64 } %16, 1
  store i64 %18, ptr %11, align 8
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext false) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %20 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 2)
          to label %.peel.next31 unwind label %.loopexit.split-lp44

.peel.next31:                                     ; preds = %.thread.peel35
  %21 = extractvalue { ptr, i64 } %20, 0
  store ptr %21, ptr %5, align 8
  %22 = extractvalue { ptr, i64 } %20, 1
  store i64 %22, ptr %11, align 8
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext false) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %24 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 3)
          to label %.peel.next unwind label %.loopexit43.loopexit.split-lp

.peel.next:                                       ; preds = %.peel.next31
  %25 = extractvalue { ptr, i64 } %24, 0
  store ptr %25, ptr %5, align 8
  %26 = extractvalue { ptr, i64 } %24, 1
  store i64 %26, ptr %11, align 8
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext true) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %28 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 1)
          to label %.thread.peel60 unwind label %.loopexit.split-lp

.thread.peel60:                                   ; preds = %.peel.next
  %29 = extractvalue { ptr, i64 } %28, 0
  store ptr %29, ptr %3, align 8
  %30 = extractvalue { ptr, i64 } %28, 1
  store i64 %30, ptr %9, align 8
  %31 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  %spec.select = select i1 %31, i1 true, i1 false
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %32 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 4)
          to label %.peel.next57 unwind label %.loopexit43.loopexit.split-lp

.peel.next57:                                     ; preds = %.thread.peel60
  %33 = extractvalue { ptr, i64 } %32, 0
  store ptr %33, ptr %5, align 8
  %34 = extractvalue { ptr, i64 } %32, 1
  store i64 %34, ptr %11, align 8
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext %spec.select) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %36 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 2)
          to label %.thread.peel65 unwind label %.loopexit.split-lp

.thread.peel65:                                   ; preds = %.peel.next57
  %37 = extractvalue { ptr, i64 } %36, 0
  store ptr %37, ptr %3, align 8
  %38 = extractvalue { ptr, i64 } %36, 1
  store i64 %38, ptr %9, align 8
  %39 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  %spec.select81 = select i1 %39, i1 true, i1 false
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %40 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 5)
          to label %.peel.next62 unwind label %.loopexit43.loopexit.split-lp

.peel.next62:                                     ; preds = %.thread.peel65
  %41 = extractvalue { ptr, i64 } %40, 0
  store ptr %41, ptr %5, align 8
  %42 = extractvalue { ptr, i64 } %40, 1
  store i64 %42, ptr %11, align 8
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext %spec.select81) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %44 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef 6)
          to label %.peel.next67 unwind label %.loopexit43.loopexit.split-lp

.peel.next67:                                     ; preds = %.peel.next62
  %45 = extractvalue { ptr, i64 } %44, 0
  store ptr %45, ptr %5, align 8
  %46 = extractvalue { ptr, i64 } %44, 1
  store i64 %46, ptr %11, align 8
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext true) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  br label %54

.loopexit48:                                      ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %6)
  %49 = load i64, ptr %6, align 8, !tbaa !5
  %50 = add nsw i64 %49, -1
  store i64 %50, ptr %6, align 8, !tbaa !5
  %.not24 = icmp eq i64 %49, 0
  br i1 %.not24, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.loopexit48
  %51 = getelementptr inbounds i8, ptr %8, i64 8
  br label %82

52:                                               ; preds = %0
  %53 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %2) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #5
  br label %97

54:                                               ; preds = %.peel.next67, %75
  %.023 = phi i64 [ 7, %.peel.next67 ], [ %79, %75 ]
  %.lhs.trunc = trunc nuw i64 %.023 to i8
  %55 = urem i8 %.lhs.trunc, 3
  %56 = icmp eq i8 %55, 0
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  %57 = urem i8 %.lhs.trunc, 7
  %58 = icmp eq i8 %57, 0
  %or.cond = or i1 %56, %58
  br i1 %or.cond, label %.thread, label %59

59:                                               ; preds = %54
  %60 = add nsw i64 %.023, -3
  %61 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef %60)
          to label %62 unwind label %.loopexit

62:                                               ; preds = %59
  %63 = extractvalue { ptr, i64 } %61, 0
  store ptr %63, ptr %3, align 8
  %64 = extractvalue { ptr, i64 } %61, 1
  store i64 %64, ptr %9, align 8
  %65 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  br i1 %65, label %.thread, label %66

66:                                               ; preds = %62
  %67 = add nsw i64 %.023, -7
  %68 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef %67)
          to label %69 unwind label %.loopexit74

69:                                               ; preds = %66
  %70 = extractvalue { ptr, i64 } %68, 0
  store ptr %70, ptr %4, align 8
  %71 = extractvalue { ptr, i64 } %68, 1
  store i64 %71, ptr %10, align 8
  %72 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %4) #5
  br label %.thread

.thread:                                          ; preds = %69, %62, %54
  %73 = phi i1 [ true, %62 ], [ true, %54 ], [ %72, %69 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %74 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef %.023)
          to label %75 unwind label %.loopexit43.loopexit

75:                                               ; preds = %.thread
  %76 = extractvalue { ptr, i64 } %74, 0
  store ptr %76, ptr %5, align 8
  %77 = extractvalue { ptr, i64 } %74, 1
  store i64 %77, ptr %11, align 8
  %78 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %5, i1 noundef zeroext %73) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  %79 = add nuw nsw i64 %.023, 1
  %exitcond.not = icmp eq i64 %79, 107
  br i1 %exitcond.not, label %.loopexit48, label %54, !llvm.loop !9

.loopexit:                                        ; preds = %59
  %lpad.loopexit73 = landingpad { ptr, i32 }
          cleanup
  br label %81

.loopexit.split-lp:                               ; preds = %.peel.next, %.peel.next57
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %81

.loopexit74:                                      ; preds = %66
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %80

.loopexit43.loopexit:                             ; preds = %.thread
  %lpad.loopexit78 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit43

.loopexit43.loopexit.split-lp:                    ; preds = %.peel.next31, %.thread.peel60, %.thread.peel65, %.peel.next62
  %lpad.loopexit.split-lp79 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit43

.loopexit.split-lp44:                             ; preds = %.thread.peel, %.thread.peel29, %.thread.peel35
  %lpad.loopexit.split-lp46 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit43

.loopexit43:                                      ; preds = %.loopexit43.loopexit, %.loopexit43.loopexit.split-lp, %.loopexit.split-lp44
  %lpad.phi47 = phi { ptr, i32 } [ %lpad.loopexit.split-lp46, %.loopexit.split-lp44 ], [ %lpad.loopexit78, %.loopexit43.loopexit ], [ %lpad.loopexit.split-lp79, %.loopexit43.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  br label %80

80:                                               ; preds = %.loopexit43, %.loopexit74
  %.pn = phi { ptr, i32 } [ %lpad.phi47, %.loopexit43 ], [ %lpad.loopexit, %.loopexit74 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %81

81:                                               ; preds = %.loopexit, %.loopexit.split-lp, %80
  %.pn.pn = phi { ptr, i32 } [ %.pn, %80 ], [ %lpad.loopexit73, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  br label %96

82:                                               ; preds = %.lr.ph, %86
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  %84 = load i64, ptr %7, align 8, !tbaa !5
  %85 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %1, i64 noundef %84)
          to label %86 unwind label %94

86:                                               ; preds = %82
  %87 = extractvalue { ptr, i64 } %85, 0
  store ptr %87, ptr %8, align 8
  %88 = extractvalue { ptr, i64 } %85, 1
  store i64 %88, ptr %51, align 8
  %89 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %8) #5
  %90 = select i1 %89, ptr @.str.1, ptr @.str.2
  %91 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %90)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  %92 = load i64, ptr %6, align 8, !tbaa !5
  %93 = add nsw i64 %92, -1
  store i64 %93, ptr %6, align 8, !tbaa !5
  %.not = icmp eq i64 %92, 0
  br i1 %.not, label %._crit_edge, label %82, !llvm.loop !12

94:                                               ; preds = %82
  %95 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %96

._crit_edge:                                      ; preds = %86, %.loopexit48
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %1) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %1) #5
  ret i32 0

96:                                               ; preds = %94, %81
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %81 ], [ %95, %94 ]
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %1) #5
  br label %97

97:                                               ; preds = %96, %52
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %96 ], [ %53, %52 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %1) #5
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; 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 nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 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
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) local_unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass