; LLVM IR from eyangch/competitive-programming :: Codeforces/1707 (a)

; 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::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@ans = external dso_local global [100000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %8 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %9 = getelementptr i8, ptr %8, i64 -24
  %10 = load i64, ptr %9, align 8
  %11 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %10
  %12 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %11, ptr noundef null)
  %13 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  br label %15

15:                                               ; preds = %108, %0
  %16 = load i64, ptr @T, align 8, !tbaa !8
  %17 = add nsw i64 %16, -1
  store i64 %17, ptr @T, align 8, !tbaa !8
  %18 = icmp ne i64 %16, 0
  br i1 %18, label %19, label %110

19:                                               ; preds = %15
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %20, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %22 = load i64, ptr @N, align 8, !tbaa !8
  %23 = getelementptr inbounds i8, ptr @ans, i64 %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef @ans, ptr noundef %23, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %24

24:                                               ; preds = %33, %19
  %25 = load i64, ptr %3, align 8, !tbaa !8
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %36

29:                                               ; preds = %24
  %30 = load i64, ptr %3, align 8, !tbaa !8
  %31 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %30
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %31)
  br label %33

33:                                               ; preds = %29
  %34 = load i64, ptr %3, align 8, !tbaa !8
  %35 = add nsw i64 %34, 1
  store i64 %35, ptr %3, align 8, !tbaa !8
  br label %24, !llvm.loop !13

36:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %37 = load i64, ptr @N, align 8, !tbaa !8
  %38 = sub nsw i64 %37, 1
  store i64 %38, ptr %4, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %39

39:                                               ; preds = %71, %36
  %40 = load i64, ptr %5, align 8, !tbaa !8
  %41 = load i64, ptr @Q, align 8, !tbaa !8
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %43, label %46

43:                                               ; preds = %39
  %44 = load i64, ptr %4, align 8, !tbaa !8
  %45 = icmp sge i64 %44, 0
  br label %46

46:                                               ; preds = %43, %39
  %47 = phi i1 [ false, %39 ], [ %45, %43 ]
  br i1 %47, label %49, label %48

48:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %74

49:                                               ; preds = %46
  br label %50

50:                                               ; preds = %61, %49
  %51 = load i64, ptr %4, align 8, !tbaa !8
  %52 = icmp sgt i64 %51, 0
  br i1 %52, label %53, label %59

53:                                               ; preds = %50
  %54 = load i64, ptr %4, align 8, !tbaa !8
  %55 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %54
  %56 = load i64, ptr %55, align 8, !tbaa !8
  %57 = load i64, ptr %5, align 8, !tbaa !8
  %58 = icmp sle i64 %56, %57
  br label %59

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

61:                                               ; preds = %59
  %62 = load i64, ptr %4, align 8, !tbaa !8
  %63 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %62
  store i8 1, ptr %63, align 1, !tbaa !15
  %64 = load i64, ptr %4, align 8, !tbaa !8
  %65 = add nsw i64 %64, -1
  store i64 %65, ptr %4, align 8, !tbaa !8
  br label %50, !llvm.loop !17

66:                                               ; preds = %59
  %67 = load i64, ptr %4, align 8, !tbaa !8
  %68 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %67
  store i8 1, ptr %68, align 1, !tbaa !15
  %69 = load i64, ptr %4, align 8, !tbaa !8
  %70 = add nsw i64 %69, -1
  store i64 %70, ptr %4, align 8, !tbaa !8
  br label %71

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

74:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %75

75:                                               ; preds = %90, %74
  %76 = load i64, ptr %6, align 8, !tbaa !8
  %77 = load i64, ptr %4, align 8, !tbaa !8
  %78 = icmp sle i64 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %93

80:                                               ; preds = %75
  %81 = load i64, ptr %6, align 8, !tbaa !8
  %82 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !8
  %84 = load i64, ptr @Q, align 8, !tbaa !8
  %85 = icmp sle i64 %83, %84
  br i1 %85, label %86, label %89

86:                                               ; preds = %80
  %87 = load i64, ptr %6, align 8, !tbaa !8
  %88 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %87
  store i8 1, ptr %88, align 1, !tbaa !15
  br label %89

89:                                               ; preds = %86, %80
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %6, align 8, !tbaa !8
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %6, align 8, !tbaa !8
  br label %75, !llvm.loop !19

93:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %94

94:                                               ; preds = %105, %93
  %95 = load i64, ptr %7, align 8, !tbaa !8
  %96 = load i64, ptr @N, align 8, !tbaa !8
  %97 = icmp slt i64 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %108

99:                                               ; preds = %94
  %100 = load i64, ptr %7, align 8, !tbaa !8
  %101 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %100
  %102 = load i8, ptr %101, align 1, !tbaa !15, !range !20, !noundef !21
  %103 = trunc i8 %102 to i1
  %104 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i1 noundef zeroext %103)
  br label %105

105:                                              ; preds = %99
  %106 = load i64, ptr %7, align 8, !tbaa !8
  %107 = add nsw i64 %106, 1
  store i64 %107, ptr %7, align 8, !tbaa !8
  br label %94, !llvm.loop !22

108:                                              ; preds = %98
  %109 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %15, !llvm.loop !23

110:                                              ; preds = %15
  %111 = load i32, ptr %1, align 4
  ret i32 %111
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #4

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 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 #2 = { "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 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@T = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@Q = external dso_local global i64, align 8
@A = external dso_local global [100000 x i64], align 16
@ans = external dso_local global [100000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @T)
  %9 = load i64, ptr @T, align 8, !tbaa !8
  %10 = add nsw i64 %9, -1
  store i64 %10, ptr @T, align 8, !tbaa !8
  %.not50 = icmp eq i64 %9, 0
  br i1 %.not50, label %._crit_edge53, label %.lr.ph52

.lr.ph52:                                         ; preds = %0, %._crit_edge
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %13 = load i64, ptr @N, align 8, !tbaa !8
  %14 = getelementptr inbounds i8, ptr @ans, i64 %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 0, ptr %1, align 4, !tbaa !11
  call void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef nonnull @ans, ptr noundef nonnull %14, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %15 = load i64, ptr @N, align 8, !tbaa !8
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.preheader32:                                     ; preds = %.lr.ph
  %17 = load i64, ptr @Q, align 8, !tbaa !8
  %18 = icmp sgt i64 %17, 0
  %19 = icmp sgt i64 %24, 0
  %20 = and i1 %19, %18
  br i1 %20, label %.preheader, label %.preheader31

.lr.ph:                                           ; preds = %.lr.ph52, %.lr.ph
  %.02534 = phi i64 [ %23, %.lr.ph ], [ 0, %.lr.ph52 ]
  %21 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.02534
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = add nuw nsw i64 %.02534, 1
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %.preheader32, !llvm.loop !13

.preheader31:                                     ; preds = %.critedge, %.preheader32
  %.024.in.lcssa = phi i64 [ %24, %.preheader32 ], [ %.136, %.critedge ]
  %.not27.not45 = icmp sgt i64 %.024.in.lcssa, 0
  br i1 %.not27.not45, label %.lr.ph47.preheader, label %.preheader30

.lr.ph47.preheader:                               ; preds = %.preheader31
  %xtraiter = and i64 %.024.in.lcssa, 1
  %26 = icmp eq i64 %.024.in.lcssa, 1
  br i1 %26, label %.preheader30.loopexit.unr-lcssa, label %.lr.ph47.preheader.new

.lr.ph47.preheader.new:                           ; preds = %.lr.ph47.preheader
  %unroll_iter = and i64 %.024.in.lcssa, 9223372036854775806
  br label %.lr.ph47

.preheader:                                       ; preds = %.preheader32, %.critedge
  %.02342 = phi i64 [ %33, %.critedge ], [ 0, %.preheader32 ]
  %.024.in41 = phi i64 [ %.136, %.critedge ], [ %24, %.preheader32 ]
  %27 = icmp ugt i64 %.024.in41, 1
  br i1 %27, label %.lr.ph37, label %.preheader31.thread58

.lr.ph37:                                         ; preds = %.preheader, %31
  %.136.in = phi i64 [ %.136, %31 ], [ %.024.in41, %.preheader ]
  %.136 = add nsw i64 %.136.in, -1
  %28 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.136
  %29 = load i64, ptr %28, align 8, !tbaa !8
  %.not29 = icmp sgt i64 %29, %.02342
  %30 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %.136
  store i8 1, ptr %30, align 1, !tbaa !15
  br i1 %.not29, label %.critedge, label %31

31:                                               ; preds = %.lr.ph37
  %32 = icmp ugt i64 %.136, 1
  br i1 %32, label %.lr.ph37, label %.preheader31.thread58, !llvm.loop !17

.preheader31.thread58:                            ; preds = %.preheader, %31
  store i8 1, ptr @ans, align 16, !tbaa !15
  br i1 %19, label %.lr.ph49.preheader, label %._crit_edge

.critedge:                                        ; preds = %.lr.ph37
  %33 = add nuw nsw i64 %.02342, 1
  %34 = icmp slt i64 %33, %17
  %35 = icmp sgt i64 %.136.in, 1
  %36 = and i1 %35, %34
  br i1 %36, label %.preheader, label %.preheader31, !llvm.loop !18

.preheader30.loopexit.unr-lcssa:                  ; preds = %50, %.lr.ph47.preheader
  %.02246.unr = phi i64 [ 0, %.lr.ph47.preheader ], [ %51, %50 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader30, label %.lr.ph47.epil

.lr.ph47.epil:                                    ; preds = %.preheader30.loopexit.unr-lcssa
  %37 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.02246.unr
  %38 = load i64, ptr %37, align 8, !tbaa !8
  %.not28.epil = icmp sgt i64 %38, %17
  br i1 %.not28.epil, label %.preheader30, label %39

39:                                               ; preds = %.lr.ph47.epil
  %40 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %.02246.unr
  store i8 1, ptr %40, align 1, !tbaa !15
  br label %.preheader30

.preheader30:                                     ; preds = %.preheader30.loopexit.unr-lcssa, %39, %.lr.ph47.epil, %.preheader31
  br i1 %19, label %.lr.ph49.preheader, label %._crit_edge

.lr.ph49.preheader:                               ; preds = %.preheader31.thread58, %.preheader30
  br label %.lr.ph49

.lr.ph47:                                         ; preds = %50, %.lr.ph47.preheader.new
  %.02246 = phi i64 [ 0, %.lr.ph47.preheader.new ], [ %51, %50 ]
  %niter = phi i64 [ 0, %.lr.ph47.preheader.new ], [ %niter.next.1, %50 ]
  %41 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %.02246
  %42 = load i64, ptr %41, align 16, !tbaa !8
  %.not28 = icmp sgt i64 %42, %17
  br i1 %.not28, label %.lr.ph47.1, label %43

43:                                               ; preds = %.lr.ph47
  %44 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %.02246
  store i8 1, ptr %44, align 2, !tbaa !15
  br label %.lr.ph47.1

.lr.ph47.1:                                       ; preds = %.lr.ph47, %43
  %45 = or disjoint i64 %.02246, 1
  %46 = getelementptr inbounds [100000 x i64], ptr @A, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %.not28.1 = icmp sgt i64 %47, %17
  br i1 %.not28.1, label %50, label %48

48:                                               ; preds = %.lr.ph47.1
  %49 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %45
  store i8 1, ptr %49, align 1, !tbaa !15
  br label %50

50:                                               ; preds = %48, %.lr.ph47.1
  %51 = add nuw nsw i64 %.02246, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader30.loopexit.unr-lcssa, label %.lr.ph47, !llvm.loop !19

._crit_edge:                                      ; preds = %.lr.ph49, %.preheader31.thread58, %.lr.ph52, %.preheader30
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext 10)
  %53 = load i64, ptr @T, align 8, !tbaa !8
  %54 = add nsw i64 %53, -1
  store i64 %54, ptr @T, align 8, !tbaa !8
  %.not = icmp eq i64 %53, 0
  br i1 %.not, label %._crit_edge53, label %.lr.ph52, !llvm.loop !20

.lr.ph49:                                         ; preds = %.lr.ph49.preheader, %.lr.ph49
  %.048 = phi i64 [ %59, %.lr.ph49 ], [ 0, %.lr.ph49.preheader ]
  %55 = getelementptr inbounds [100000 x i8], ptr @ans, i64 0, i64 %.048
  %56 = load i8, ptr %55, align 1, !tbaa !15, !range !21, !noundef !22
  %57 = trunc nuw i8 %56 to i1
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i1 noundef zeroext %57)
  %59 = add nuw nsw i64 %.048, 1
  %60 = load i64, ptr @N, align 8, !tbaa !8
  %61 = icmp slt i64 %59, %60
  br i1 %61, label %.lr.ph49, label %._crit_edge, !llvm.loop !23

._crit_edge53:                                    ; preds = %._crit_edge, %0
  ret i32 0
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #1 align 2

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4fillIPbiEvT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEb(ptr noundef nonnull align 8 dereferenceable(8), i1 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

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 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 #2 = { "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 = { inlinehint 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !14}


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