; LLVM IR from DionysiosB/CodeForces :: 0700-0799 (770D-DrawBrackets)

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

@ans = external dso_local global [333 x [555 x i8]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [111 x i8], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 111, ptr %3) #5
  %12 = getelementptr inbounds [111 x i8], ptr %3, i64 0, i64 0
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  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
  br label %14

14:                                               ; preds = %39, %0
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %42

19:                                               ; preds = %14
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [111 x i8], ptr %3, i64 0, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = sext i8 %23 to i32
  %25 = icmp eq i32 %24, 91
  %26 = zext i1 %25 to i64
  %27 = select i1 %25, i32 1, i32 -1
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = add nsw i32 %28, %27
  store i32 %29, ptr %6, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = load i32, ptr %6, align 4, !tbaa !5
  %32 = icmp sgt i32 %30, %31
  br i1 %32, label %33, label %35

33:                                               ; preds = %19
  %34 = load i32, ptr %4, align 4, !tbaa !5
  br label %37

35:                                               ; preds = %19
  %36 = load i32, ptr %6, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %35, %33
  %38 = phi i32 [ %34, %33 ], [ %36, %35 ]
  store i32 %38, ptr %4, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %37
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %7, align 4, !tbaa !5
  br label %14, !llvm.loop !10

42:                                               ; preds = %18
  store i32 0, ptr %5, align 4, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %107, %42
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %110

48:                                               ; preds = %43
  %49 = load i32, ptr %8, align 4, !tbaa !5
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %72

51:                                               ; preds = %48
  %52 = load i32, ptr %8, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 1
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [111 x i8], ptr %3, i64 0, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !9
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %57, 91
  br i1 %58, label %59, label %66

59:                                               ; preds = %51
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [111 x i8], ptr %3, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !9
  %64 = sext i8 %63 to i32
  %65 = icmp eq i32 %64, 93
  br label %66

66:                                               ; preds = %59, %51
  %67 = phi i1 [ false, %51 ], [ %65, %59 ]
  %68 = zext i1 %67 to i64
  %69 = select i1 %67, i32 4, i32 1
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = add nsw i32 %70, %69
  store i32 %71, ptr %5, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %66, %48
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [111 x i8], ptr %3, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = sext i8 %76 to i32
  %78 = icmp eq i32 %77, 91
  br i1 %78, label %79, label %82

79:                                               ; preds = %72
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %6, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %79, %72
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = sub nsw i32 %84, %85
  %87 = add nsw i32 %86, 1
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [111 x i8], ptr %3, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !9
  %92 = sext i8 %91 to i32
  %93 = icmp eq i32 %92, 91
  %94 = zext i1 %93 to i64
  %95 = select i1 %93, i32 1, i32 -1
  %96 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3prtiiii(i32 noundef %83, i32 noundef %87, i32 noundef %95, i32 noundef %96)
  %97 = load i32, ptr %8, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [111 x i8], ptr %3, i64 0, i64 %98
  %100 = load i8, ptr %99, align 1, !tbaa !9
  %101 = sext i8 %100 to i32
  %102 = icmp eq i32 %101, 93
  br i1 %102, label %103, label %106

103:                                              ; preds = %82
  %104 = load i32, ptr %6, align 4, !tbaa !5
  %105 = add nsw i32 %104, -1
  store i32 %105, ptr %6, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %103, %82
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %8, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %8, align 4, !tbaa !5
  br label %43, !llvm.loop !12

110:                                              ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %143, %110
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = mul nsw i32 2, %113
  %115 = icmp sle i32 %112, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %111
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %146

117:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %138, %117
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = load i32, ptr %5, align 4, !tbaa !5
  %121 = icmp sle i32 %119, %120
  br i1 %121, label %123, label %122

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

123:                                              ; preds = %118
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [333 x [555 x i8]], ptr @ans, i64 0, i64 %125
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [555 x i8], ptr %126, i64 0, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !9
  %131 = sext i8 %130 to i32
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %134

133:                                              ; preds = %123
  br label %135

134:                                              ; preds = %123
  br label %135

135:                                              ; preds = %134, %133
  %136 = phi i32 [ %131, %133 ], [ 32, %134 ]
  %137 = call i32 @putchar(i32 noundef %136)
  br label %138

138:                                              ; preds = %135
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %11, align 4, !tbaa !5
  br label %118, !llvm.loop !13

141:                                              ; preds = %122
  %142 = call i32 @puts(ptr noundef @.str.1)
  br label %143

143:                                              ; preds = %141
  %144 = load i32, ptr %9, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr %9, align 4, !tbaa !5
  br label %111, !llvm.loop !14

146:                                              ; preds = %116
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 111, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %147 = load i32, ptr %1, align 4
  ret i32 %147
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @putchar(i32 noundef) #4

declare i32 @puts(ptr noundef) #3

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

@ans = external dso_local local_unnamed_addr global [333 x [555 x i8]], align 16
@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca [111 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 111, ptr nonnull %2) #6
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph.preheader, label %.preheader.preheader

.lr.ph.preheader:                                 ; preds = %0
  %wide.trip.count = zext nneg i32 %4 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %6 = icmp eq i32 %4, 1
  br i1 %6, label %.preheader45.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.preheader45.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa87.ph = phi i32 [ poison, %.lr.ph.preheader ], [ %36, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %.03547.unr = phi i32 [ 0, %.lr.ph.preheader ], [ %35, %.lr.ph ]
  %.03846.unr = phi i32 [ 0, %.lr.ph.preheader ], [ %36, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader45, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader45.unr-lcssa
  %7 = getelementptr inbounds [111 x i8], ptr %2, i64 0, i64 %indvars.iv.unr
  %8 = load i8, ptr %7, align 1, !tbaa !9
  %9 = icmp eq i8 %8, 91
  %10 = select i1 %9, i32 1, i32 -1
  %11 = add nsw i32 %10, %.03547.unr
  %12 = call i32 @llvm.smax.i32(i32 %.03846.unr, i32 %11)
  br label %.preheader45

.preheader45:                                     ; preds = %.preheader45.unr-lcssa, %.lr.ph.epil
  %.lcssa87 = phi i32 [ %.lcssa87.ph, %.preheader45.unr-lcssa ], [ %12, %.lr.ph.epil ]
  br i1 %5, label %13, label %.preheader44

13:                                               ; preds = %.preheader45
  %14 = add i32 %.lcssa87, 1
  %15 = load i8, ptr %2, align 16, !tbaa !9
  %16 = icmp eq i8 %15, 91
  %17 = zext i1 %16 to i32
  %18 = sub i32 %14, %17
  %19 = select i1 %16, i32 1, i32 -1
  call void @_Z3prtiiii(i32 noundef %.lcssa87, i32 noundef %18, i32 noundef %19, i32 noundef 0)
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = icmp sgt i32 %20, 1
  br i1 %21, label %.peel.next, label %.preheader44

.peel.next:                                       ; preds = %13
  %22 = load i8, ptr %2, align 16, !tbaa !9
  %23 = icmp eq i8 %22, 93
  %24 = sext i1 %23 to i32
  %.3.peel = add nsw i32 %17, %24
  br label %42

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %.03547 = phi i32 [ 0, %.lr.ph.preheader.new ], [ %35, %.lr.ph ]
  %.03846 = phi i32 [ 0, %.lr.ph.preheader.new ], [ %36, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %25 = getelementptr inbounds [111 x i8], ptr %2, i64 0, i64 %indvars.iv
  %26 = load i8, ptr %25, align 2, !tbaa !9
  %27 = icmp eq i8 %26, 91
  %28 = select i1 %27, i32 1, i32 -1
  %29 = add nsw i32 %28, %.03547
  %30 = call i32 @llvm.smax.i32(i32 %.03846, i32 %29)
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %31 = getelementptr inbounds [111 x i8], ptr %2, i64 0, i64 %indvars.iv.next
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = icmp eq i8 %32, 91
  %34 = select i1 %33, i32 1, i32 -1
  %35 = add nsw i32 %34, %29
  %36 = call i32 @llvm.smax.i32(i32 %30, i32 %35)
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 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 %.preheader45.unr-lcssa, label %.lr.ph, !llvm.loop !10

.preheader44.loopexit.loopexit:                   ; preds = %49
  %37 = add nuw i32 %51, 1
  %38 = zext i32 %37 to i64
  br label %.preheader44

.preheader44:                                     ; preds = %13, %.preheader44.loopexit.loopexit, %.preheader45
  %.036.lcssa = phi i64 [ 1, %.preheader45 ], [ 1, %13 ], [ %38, %.preheader44.loopexit.loopexit ]
  %39 = shl nuw i32 %.lcssa87, 1
  %.not57 = icmp slt i32 %.lcssa87, 0
  br i1 %.not57, label %._crit_edge59, label %.preheader.preheader

.preheader.preheader:                             ; preds = %0, %.preheader44
  %40 = phi i32 [ %39, %.preheader44 ], [ 0, %0 ]
  %.036.lcssa84 = phi i64 [ %.036.lcssa, %.preheader44 ], [ 1, %0 ]
  %smax = call i32 @llvm.smax.i32(i32 %40, i32 0)
  %41 = or disjoint i32 %smax, 1
  %wide.trip.count74 = zext nneg i32 %41 to i64
  br label %.preheader

42:                                               ; preds = %49, %.peel.next
  %43 = phi i8 [ %22, %.peel.next ], [ %58, %49 ]
  %indvars.iv62 = phi i64 [ 1, %.peel.next ], [ %indvars.iv.next63, %49 ]
  %.150 = phi i32 [ %.3.peel, %.peel.next ], [ %.3, %49 ]
  %.03649 = phi i32 [ 0, %.peel.next ], [ %51, %49 ]
  %44 = icmp eq i8 %43, 91
  br i1 %44, label %45, label %49

45:                                               ; preds = %42
  %46 = getelementptr inbounds [111 x i8], ptr %2, i64 0, i64 %indvars.iv62
  %47 = load i8, ptr %46, align 1, !tbaa !9
  %.fr = freeze i8 %47
  %48 = icmp eq i8 %.fr, 93
  %spec.select43 = select i1 %48, i32 4, i32 1
  br label %49

49:                                               ; preds = %42, %45
  %50 = phi i32 [ 1, %42 ], [ %spec.select43, %45 ]
  %51 = add nuw nsw i32 %50, %.03649
  %52 = getelementptr inbounds [111 x i8], ptr %2, i64 0, i64 %indvars.iv62
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = icmp eq i8 %53, 91
  %55 = zext i1 %54 to i32
  %spec.select = add nsw i32 %.150, %55
  %56 = sub i32 %14, %spec.select
  %57 = select i1 %54, i32 1, i32 -1
  call void @_Z3prtiiii(i32 noundef %.lcssa87, i32 noundef %56, i32 noundef %57, i32 noundef %51)
  %58 = load i8, ptr %52, align 1, !tbaa !9
  %59 = icmp eq i8 %58, 93
  %60 = sext i1 %59 to i32
  %.3 = add nsw i32 %spec.select, %60
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = icmp slt i64 %indvars.iv.next63, %62
  br i1 %63, label %42, label %.preheader44.loopexit.loopexit, !llvm.loop !12

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %indvars.iv71 = phi i64 [ 0, %.preheader.preheader ], [ %indvars.iv.next72, %._crit_edge ]
  br label %65

._crit_edge59:                                    ; preds = %._crit_edge, %.preheader44
  call void @llvm.lifetime.end.p0(i64 111, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

._crit_edge:                                      ; preds = %65
  %64 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
  br i1 %exitcond75.not, label %._crit_edge59, label %.preheader, !llvm.loop !14

65:                                               ; preds = %.preheader, %65
  %indvars.iv66 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next67, %65 ]
  %66 = getelementptr inbounds [333 x [555 x i8]], ptr @ans, i64 0, i64 %indvars.iv71, i64 %indvars.iv66
  %67 = load i8, ptr %66, align 1, !tbaa !9
  %.not40 = icmp eq i8 %67, 0
  %narrow = select i1 %.not40, i8 32, i8 %67
  %. = sext i8 %narrow to i32
  %68 = call i32 @putchar(i32 noundef %.)
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %exitcond70.not = icmp eq i64 %indvars.iv.next67, %.036.lcssa84
  br i1 %exitcond70.not, label %._crit_edge, label %65, !llvm.loop !15
}

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

; Function Attrs: inlinehint mustprogress nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

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


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