; LLVM IR from tangjz/acm-icpc :: self_training/2016-11-19 (B)

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

@len = external dso_local global i32, align 4
@str = external dso_local global [15 x i8], align 1
@out = external dso_local global [15 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %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
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @str)
  %13 = call i64 @strlen(ptr noundef @str) #4
  %14 = trunc i64 %13 to i32
  store i32 %14, ptr @len, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %154, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @len, align 4, !tbaa !5
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 2, ptr %3, align 4
  br label %157

20:                                               ; preds = %15
  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
  br label %21

21:                                               ; preds = %35, %20
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %38

26:                                               ; preds = %21
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [15 x i8], ptr @str, i64 0, i64 %28
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %4, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %33
  store i8 %30, ptr %34, align 1, !tbaa !9
  br label %35

35:                                               ; preds = %26
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %5, align 4, !tbaa !5
  br label %21, !llvm.loop !10

38:                                               ; preds = %25
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %41
  store i8 -1, ptr %42, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %43 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %43, ptr %6, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %58, %38
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = load i32, ptr @len, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %61

49:                                               ; preds = %44
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [15 x i8], ptr @str, i64 0, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = load i32, ptr %4, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %54 to i64
  %57 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %56
  store i8 %53, ptr %57, align 1, !tbaa !9
  br label %58

58:                                               ; preds = %49
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %6, align 4, !tbaa !5
  br label %44, !llvm.loop !12

61:                                               ; preds = %48
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %63
  store i8 0, ptr %64, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  store i8 1, ptr %7, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  store i32 %66, ptr %9, align 4, !tbaa !5
  br label %67

67:                                               ; preds = %100, %61
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = icmp slt i32 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 11, ptr %3, align 4
  br label %105

72:                                               ; preds = %67
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = sext i8 %76 to i32
  %78 = icmp eq i32 %77, -1
  br i1 %78, label %98, label %79

79:                                               ; preds = %72
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %81
  %83 = load i8, ptr %82, align 1, !tbaa !9
  %84 = sext i8 %83 to i32
  %85 = icmp eq i32 %84, -1
  br i1 %85, label %98, label %86

86:                                               ; preds = %79
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %91 = sext i8 %90 to i32
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !9
  %96 = sext i8 %95 to i32
  %97 = icmp eq i32 %91, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %86, %79, %72
  br label %100

99:                                               ; preds = %86
  store i8 0, ptr %7, align 1, !tbaa !13
  store i32 11, ptr %3, align 4
  br label %105

100:                                              ; preds = %98
  %101 = load i32, ptr %8, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %8, align 4, !tbaa !5
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = add nsw i32 %103, -1
  store i32 %104, ptr %9, align 4, !tbaa !5
  br label %67, !llvm.loop !15

105:                                              ; preds = %99, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %106

106:                                              ; preds = %105
  %107 = load i8, ptr %7, align 1, !tbaa !13, !range !16, !noundef !17
  %108 = trunc i8 %107 to i1
  br i1 %108, label %109, label %150

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

110:                                              ; preds = %144, %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  store i32 14, ptr %3, align 4
  br label %147

115:                                              ; preds = %110
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %117
  %119 = load i8, ptr %118, align 1, !tbaa !9
  %120 = sext i8 %119 to i32
  %121 = icmp eq i32 %120, -1
  br i1 %121, label %122, label %143

122:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = sub nsw i32 %123, 1
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = sub nsw i32 %124, %125
  store i32 %126, ptr %11, align 4, !tbaa !5
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = load i32, ptr %11, align 4, !tbaa !5
  %129 = icmp eq i32 %127, %128
  br i1 %129, label %130, label %134

130:                                              ; preds = %122
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %132
  store i8 97, ptr %133, align 1, !tbaa !9
  br label %142

134:                                              ; preds = %122
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %136
  %138 = load i8, ptr %137, align 1, !tbaa !9
  %139 = load i32, ptr %10, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %140
  store i8 %138, ptr %141, align 1, !tbaa !9
  br label %142

142:                                              ; preds = %134, %130
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %147

143:                                              ; preds = %115
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %10, align 4, !tbaa !5
  br label %110, !llvm.loop !18

147:                                              ; preds = %142, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %148

148:                                              ; preds = %147
  %149 = call i32 @puts(ptr noundef @out)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %151

150:                                              ; preds = %106
  store i32 0, ptr %3, align 4
  br label %151

151:                                              ; preds = %150, %148
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %152 = load i32, ptr %3, align 4
  switch i32 %152, label %157 [
    i32 0, label %153
  ]

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %2, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !19

157:                                              ; preds = %151, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %158 = load i32, ptr %3, align 4
  switch i32 %158, label %163 [
    i32 2, label %159
    i32 1, label %161
  ]

159:                                              ; preds = %157
  %160 = call i32 @puts(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  br label %161

161:                                              ; preds = %159, %157
  %162 = load i32, ptr %1, align 4
  ret i32 %162

163:                                              ; preds = %157
  unreachable
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

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

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

declare i32 @puts(ptr noundef) #1

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !11}
!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"

@len = external dso_local local_unnamed_addr global i32, align 4
@str = external dso_local global [15 x i8], align 1
@out = external dso_local global [15 x i8], align 1
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @str)
  %2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @str) #4
  %3 = trunc i64 %2 to i32
  store i32 %3, ptr @len, align 4, !tbaa !5
  %.not78 = icmp slt i32 %3, 0
  br i1 %.not78, label %.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %0
  %wide.trip.count103 = and i64 %2, 2147483647
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.critedge55
  %indvars.iv = phi i64 [ 1, %.preheader.preheader ], [ %indvars.iv.next, %.critedge55 ]
  %indvars.iv90 = phi i32 [ -1, %.preheader.preheader ], [ %indvars.iv.next91, %.critedge55 ]
  %indvar = phi i64 [ 0, %.preheader.preheader ], [ %4, %.critedge55 ]
  %indvars111 = trunc i64 %indvar to i32
  %4 = add nuw nsw i64 %indvar, 1
  %scevgep = getelementptr i8, ptr @out, i64 %4
  %scevgep95 = getelementptr i8, ptr @str, i64 %indvar
  %5 = xor i64 %indvar, -1
  %.not81 = icmp eq i32 %indvars111, 0
  br i1 %.not81, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %6 = add i32 %indvars.iv90, 1
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 @out, ptr nonnull align 1 @str, i64 %indvar, i1 false), !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %.preheader
  %.044.lcssa = phi i32 [ 0, %.preheader ], [ %6, %.lr.ph.preheader ]
  %7 = zext nneg i32 %.044.lcssa to i64
  %8 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %7
  store i8 -1, ptr %8, align 1, !tbaa !9
  %.14563 = add nuw nsw i32 %.044.lcssa, 1
  %9 = icmp slt i32 %indvars111, %3
  br i1 %9, label %.lr.ph67.preheader, label %._crit_edge68

.lr.ph67.preheader:                               ; preds = %._crit_edge
  %10 = add i64 %2, %5
  %11 = and i64 %10, 4294967295
  %12 = add nuw nsw i64 %11, 1
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, ptr noundef nonnull align 1 dereferenceable(1) %scevgep95, i64 %12, i1 false), !tbaa !9
  br label %.lr.ph67

._crit_edge68.loopexit:                           ; preds = %.lr.ph67
  %13 = trunc nuw i64 %indvars.iv96 to i32
  %14 = trunc nuw i64 %indvars.iv.next97 to i32
  br label %._crit_edge68

._crit_edge68:                                    ; preds = %._crit_edge68.loopexit, %._crit_edge
  %.145.in.lcssa = phi i32 [ %.044.lcssa, %._crit_edge ], [ %13, %._crit_edge68.loopexit ]
  %.145.lcssa = phi i32 [ %.14563, %._crit_edge ], [ %14, %._crit_edge68.loopexit ]
  %15 = zext nneg i32 %.145.lcssa to i64
  %16 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %15
  store i8 0, ptr %16, align 1, !tbaa !9
  %.not5271 = icmp sgt i32 %.145.in.lcssa, 0
  br i1 %.not5271, label %.lr.ph75.preheader, label %.critedge.preheader

.lr.ph75.preheader:                               ; preds = %._crit_edge68
  %17 = zext nneg i32 %.145.in.lcssa to i64
  br label %.lr.ph75

.lr.ph67:                                         ; preds = %.lr.ph67.preheader, %.lr.ph67
  %indvars.iv98 = phi i64 [ %indvar, %.lr.ph67.preheader ], [ %indvars.iv.next99, %.lr.ph67 ]
  %indvars.iv96 = phi i64 [ %indvars.iv, %.lr.ph67.preheader ], [ %indvars.iv.next97, %.lr.ph67 ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count103
  br i1 %exitcond.not, label %._crit_edge68.loopexit, label %.lr.ph67, !llvm.loop !10

.critedge.preheader:                              ; preds = %._crit_edge68, %27
  %18 = add i32 %.145.in.lcssa, 1
  %wide.trip.count = zext i32 %18 to i64
  br label %28

.lr.ph75:                                         ; preds = %.lr.ph75.preheader, %27
  %indvars.iv106 = phi i64 [ 0, %.lr.ph75.preheader ], [ %indvars.iv.next107, %27 ]
  %indvars.iv104 = phi i64 [ %17, %.lr.ph75.preheader ], [ %indvars.iv.next105, %27 ]
  %19 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %indvars.iv106
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = icmp eq i8 %20, -1
  br i1 %21, label %27, label %22

22:                                               ; preds = %.lr.ph75
  %23 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %indvars.iv104
  %24 = load i8, ptr %23, align 1, !tbaa !9
  %25 = icmp eq i8 %24, -1
  %26 = icmp eq i8 %20, %24
  %or.cond = or i1 %25, %26
  br i1 %or.cond, label %27, label %.critedge55

27:                                               ; preds = %.lr.ph75, %22
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %indvars.iv.next105 = add nsw i64 %indvars.iv104, -1
  %.not52 = icmp slt i64 %indvars.iv.next107, %indvars.iv.next105
  br i1 %.not52, label %.lr.ph75, label %.critedge.preheader, !llvm.loop !12

28:                                               ; preds = %.critedge.preheader, %.critedge
  %indvars.iv112 = phi i64 [ 0, %.critedge.preheader ], [ %indvars.iv.next113, %.critedge ]
  %29 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %indvars.iv112
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = icmp eq i8 %30, -1
  br i1 %31, label %32, label %.critedge

32:                                               ; preds = %28
  %33 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %indvars.iv112
  %34 = trunc nuw nsw i64 %indvars.iv112 to i32
  %35 = sub nsw i32 %.145.in.lcssa, %34
  %36 = icmp eq i32 %35, %34
  br i1 %36, label %41, label %37

37:                                               ; preds = %32
  %38 = sext i32 %35 to i64
  %39 = getelementptr inbounds [15 x i8], ptr @out, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !9
  br label %41

41:                                               ; preds = %32, %37
  %storemerge = phi i8 [ %40, %37 ], [ 97, %32 ]
  store i8 %storemerge, ptr %33, align 1, !tbaa !9
  br label %.loopexit

.critedge:                                        ; preds = %28
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %exitcond115.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count
  br i1 %exitcond115.not, label %.loopexit, label %28, !llvm.loop !13

.critedge55:                                      ; preds = %22
  %indvars.iv.next91 = add nsw i32 %indvars.iv90, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %9, label %.preheader, label %.loopexit, !llvm.loop !14

.loopexit:                                        ; preds = %.critedge55, %.critedge, %0, %41
  %out.sink = phi ptr [ @out, %41 ], [ @.str.1, %0 ], [ @out, %.critedge ], [ @.str.1, %.critedge55 ]
  %42 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %out.sink)
  ret i32 0
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

attributes #0 = { mustprogress nofree 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 #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind willreturn memory(read) }

!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}


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