; LLVM IR from Tunghohin/Competitive_Coding :: Uva (uva315)

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

@head = external dso_local global [110 x i32], align 16
@tot = external dso_local global i32, align 4
@dfn = external dso_local global [110 x i32], align 16
@low = external dso_local global [110 x i32], align 16
@timestamp = external dso_local global i32, align 4
@root = external dso_local global i32, align 4
@is_cut = external dso_local global [110 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6tarjani(i32 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  br label %9

9:                                                ; preds = %73, %0
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp ne i32 %11, 0
  br i1 %12, label %13, label %77

13:                                               ; preds = %9
  call void @llvm.memset.p0.i64(ptr align 16 @head, i8 0, i64 440, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @dfn, i8 0, i64 440, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @low, i8 0, i64 440, i1 false)
  call void @llvm.memset.p0.i64(ptr align 16 @is_cut, i8 0, i64 110, i1 false)
  store i32 0, ptr @timestamp, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  br label %14

14:                                               ; preds = %36, %13
  %15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3)
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %37

18:                                               ; preds = %14
  br label %19

19:                                               ; preds = %35, %18
  br label %20

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  %21 = call i32 @getchar()
  %22 = trunc i32 %21 to i8
  store i8 %22, ptr %5, align 1, !tbaa !9
  %23 = load i8, ptr %5, align 1, !tbaa !9
  %24 = sext i8 %23 to i32
  %25 = icmp eq i32 %24, 10
  br i1 %25, label %26, label %27

26:                                               ; preds = %20
  store i32 7, ptr %6, align 4
  br label %33

27:                                               ; preds = %20
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4)
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %29, i32 noundef %30)
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %31, i32 noundef %32)
  store i32 0, ptr %6, align 4
  br label %33

33:                                               ; preds = %27, %26
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  %34 = load i32, ptr %6, align 4
  switch i32 %34, label %79 [
    i32 0, label %35
    i32 7, label %36
  ]

35:                                               ; preds = %33
  br label %19, !llvm.loop !10

36:                                               ; preds = %33
  br label %14, !llvm.loop !12

37:                                               ; preds = %14
  store i32 1, ptr @root, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %51, %37
  %39 = load i32, ptr @root, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %42, label %54

42:                                               ; preds = %38
  %43 = load i32, ptr @root, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [110 x i32], ptr @dfn, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %50, label %48

48:                                               ; preds = %42
  %49 = load i32, ptr @root, align 4, !tbaa !5
  call void @_Z6tarjani(i32 noundef %49)
  br label %50

50:                                               ; preds = %48, %42
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr @root, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @root, align 4, !tbaa !5
  br label %38, !llvm.loop !13

54:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %70, %54
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %73

60:                                               ; preds = %55
  %61 = load i32, ptr %8, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [110 x i8], ptr @is_cut, i64 0, i64 %62
  %64 = load i8, ptr %63, align 1, !tbaa !14, !range !16, !noundef !17
  %65 = trunc i8 %64 to i1
  br i1 %65, label %66, label %69

66:                                               ; preds = %60
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %7, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %66, %60
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %8, align 4, !tbaa !5
  br label %55, !llvm.loop !18

73:                                               ; preds = %59
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %74)
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %75, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %9, !llvm.loop !19

77:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %78 = load i32, ptr %1, align 4
  ret i32 %78

79:                                               ; preds = %33
  unreachable
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare i32 @getchar() #6

; 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) #6

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { 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 = !{!15, !15, i64 0}
!15 = !{!"bool", !7, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !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::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" }

@head = external dso_local local_unnamed_addr global [110 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@dfn = external dso_local local_unnamed_addr global [110 x i32], align 16
@low = external dso_local local_unnamed_addr global [110 x i32], align 16
@timestamp = external dso_local local_unnamed_addr global i32, align 4
@root = external dso_local local_unnamed_addr global i32, align 4
@is_cut = external dso_local local_unnamed_addr global [110 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6tarjani(i32 noundef) 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #10
  %4 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %.not29 = icmp eq i32 %5, 0
  br i1 %.not29, label %._crit_edge32, label %.lr.ph31

.lr.ph31:                                         ; preds = %0, %._crit_edge
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) @head, i8 0, i64 440, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) @dfn, i8 0, i64 440, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) @low, i8 0, i64 440, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(110) @is_cut, i8 0, i64 110, i1 false)
  store i32 0, ptr @timestamp, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #10
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %.not1120 = icmp eq i32 %7, 0
  br i1 %.not1120, label %.preheader17, label %.preheader

.critedge.loopexit:                               ; preds = %.lr.ph, %.preheader
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %.not11 = icmp eq i32 %9, 0
  br i1 %.not11, label %.preheader17, label %.preheader

.preheader17:                                     ; preds = %.critedge.loopexit, %.lr.ph31
  store i32 1, ptr @root, align 4, !tbaa !5
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %.not1221 = icmp slt i32 %10, 1
  br i1 %.not1221, label %._crit_edge, label %.lr.ph23

.preheader:                                       ; preds = %.lr.ph31, %.critedge.loopexit
  %11 = call i32 @getchar()
  %sext.mask18 = and i32 %11, 255
  %.not1519 = icmp eq i32 %sext.mask18, 10
  br i1 %.not1519, label %.critedge.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr %3, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %13, i32 noundef %14)
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = load i32, ptr %2, align 4, !tbaa !5
  call void @_Z8add_edgeii(i32 noundef %15, i32 noundef %16)
  %17 = call i32 @getchar()
  %sext.mask = and i32 %17, 255
  %.not15 = icmp eq i32 %sext.mask, 10
  br i1 %.not15, label %.critedge.loopexit, label %.lr.ph, !llvm.loop !9

.preheader16:                                     ; preds = %33
  %.not1324 = icmp slt i32 %34, 1
  br i1 %.not1324, label %._crit_edge, label %.lr.ph27.preheader

.lr.ph27.preheader:                               ; preds = %.preheader16
  %18 = add nuw i32 %34, 1
  %wide.trip.count = zext i32 %18 to i64
  %19 = zext nneg i32 %34 to i64
  %min.iters.check = icmp ult i32 %34, 8
  br i1 %min.iters.check, label %.lr.ph27.preheader40, label %vector.ph

.lr.ph27.preheader40:                             ; preds = %middle.block, %.lr.ph27.preheader
  %indvars.iv.ph = phi i64 [ 1, %.lr.ph27.preheader ], [ %ind.end, %middle.block ]
  %.0825.ph = phi i32 [ 0, %.lr.ph27.preheader ], [ %27, %middle.block ]
  br label %.lr.ph27

vector.ph:                                        ; preds = %.lr.ph27.preheader
  %n.vec = and i64 %19, 2147483640
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
  %vec.phi38 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %20 = getelementptr inbounds [110 x i8], ptr @is_cut, i64 0, i64 %offset.idx
  %21 = getelementptr inbounds i8, ptr %20, i64 4
  %wide.load = load <4 x i8>, ptr %20, align 1, !tbaa !11
  %wide.load39 = load <4 x i8>, ptr %21, align 1, !tbaa !11
  %22 = zext <4 x i8> %wide.load to <4 x i32>
  %23 = zext <4 x i8> %wide.load39 to <4 x i32>
  %24 = add <4 x i32> %vec.phi, %22
  %25 = add <4 x i32> %vec.phi38, %23
  %index.next = add nuw i64 %index, 8
  %26 = icmp eq i64 %index.next, %n.vec
  br i1 %26, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %25, %24
  %27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %19
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph27.preheader40

.lr.ph23:                                         ; preds = %.preheader17, %33
  %28 = phi i32 [ %34, %33 ], [ %10, %.preheader17 ]
  %storemerge22 = phi i32 [ %36, %33 ], [ 1, %.preheader17 ]
  %29 = sext i32 %storemerge22 to i64
  %30 = getelementptr inbounds [110 x i32], ptr @dfn, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %.not14 = icmp eq i32 %31, 0
  br i1 %.not14, label %32, label %33

32:                                               ; preds = %.lr.ph23
  call void @_Z6tarjani(i32 noundef %storemerge22)
  %.pre = load i32, ptr @root, align 4, !tbaa !5
  %.pre35 = load i32, ptr %1, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %.lr.ph23, %32
  %34 = phi i32 [ %28, %.lr.ph23 ], [ %.pre35, %32 ]
  %35 = phi i32 [ %storemerge22, %.lr.ph23 ], [ %.pre, %32 ]
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr @root, align 4, !tbaa !5
  %.not12.not = icmp slt i32 %35, %34
  br i1 %.not12.not, label %.lr.ph23, label %.preheader16, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph27, %middle.block, %.preheader17, %.preheader16
  %.08.lcssa = phi i32 [ 0, %.preheader16 ], [ 0, %.preheader17 ], [ %27, %middle.block ], [ %spec.select, %.lr.ph27 ]
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.08.lcssa)
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %37, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #10
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %40 = load i32, ptr %1, align 4, !tbaa !5
  %.not = icmp eq i32 %40, 0
  br i1 %.not, label %._crit_edge32, label %.lr.ph31, !llvm.loop !17

.lr.ph27:                                         ; preds = %.lr.ph27.preheader40, %.lr.ph27
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph27 ], [ %indvars.iv.ph, %.lr.ph27.preheader40 ]
  %.0825 = phi i32 [ %spec.select, %.lr.ph27 ], [ %.0825.ph, %.lr.ph27.preheader40 ]
  %41 = getelementptr inbounds [110 x i8], ptr @is_cut, i64 0, i64 %indvars.iv
  %42 = load i8, ptr %41, align 1, !tbaa !11, !range !18, !noundef !19
  %43 = zext nneg i8 %42 to i32
  %spec.select = add nuw nsw i32 %.0825, %43
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph27, !llvm.loop !20

._crit_edge32:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #10
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

; 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 #8

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #9

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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { 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 #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !10, !15, !14}


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