; LLVM IR from tangjz/acm-icpc :: TDL_training/2015-10-11 (A - Algorithm of Phil - dby)

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

@s = external dso_local global [100030 x i8], align 16
@out = external dso_local global [100030 x i8], align 16
@l = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 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 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) #4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %10

10:                                               ; preds = %134, %0
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp sle i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %137

15:                                               ; preds = %10
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %17 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %16)
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @s)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %19 = call i64 @strlen(ptr noundef @s) #5
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  %21 = load i32, ptr %5, align 4, !tbaa !5
  %22 = and i32 %21, 1
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %42

24:                                               ; preds = %15
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = ashr i32 %26, 1
  %28 = sub nsw i32 %27, 1
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %6, align 4, !tbaa !5
  %34 = sext i32 %32 to i64
  %35 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %34
  store i8 %31, ptr %35, align 1, !tbaa !9
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = ashr i32 %36, 1
  %38 = sub nsw i32 %37, 1
  store i32 %38, ptr @l, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  %41 = ashr i32 %40, 1
  store i32 %41, ptr @r, align 4, !tbaa !5
  br label %48

42:                                               ; preds = %15
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = ashr i32 %43, 1
  %45 = sub nsw i32 %44, 1
  store i32 %45, ptr @l, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = ashr i32 %46, 1
  store i32 %47, ptr @r, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %42, %24
  br label %49

49:                                               ; preds = %106, %48
  %50 = load i32, ptr @l, align 4, !tbaa !5
  %51 = icmp sge i32 %50, 0
  br i1 %51, label %52, label %56

52:                                               ; preds = %49
  %53 = load i32, ptr @r, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = icmp slt i32 %53, %54
  br label %56

56:                                               ; preds = %52, %49
  %57 = phi i1 [ false, %49 ], [ %55, %52 ]
  br i1 %57, label %58, label %111

58:                                               ; preds = %56
  %59 = load i32, ptr @l, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !9
  %63 = sext i8 %62 to i32
  %64 = sub nsw i32 %63, 48
  %65 = load i32, ptr @r, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !9
  %69 = sext i8 %68 to i32
  %70 = sub nsw i32 %69, 48
  %71 = icmp sgt i32 %64, %70
  br i1 %71, label %72, label %89

72:                                               ; preds = %58
  %73 = load i32, ptr @l, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %6, align 4, !tbaa !5
  %79 = sext i32 %77 to i64
  %80 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %79
  store i8 %76, ptr %80, align 1, !tbaa !9
  %81 = load i32, ptr @r, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %82
  %84 = load i8, ptr %83, align 1, !tbaa !9
  %85 = load i32, ptr %6, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %6, align 4, !tbaa !5
  %87 = sext i32 %85 to i64
  %88 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %87
  store i8 %84, ptr %88, align 1, !tbaa !9
  br label %106

89:                                               ; preds = %58
  %90 = load i32, ptr @r, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !9
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %94 to i64
  %97 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %96
  store i8 %93, ptr %97, align 1, !tbaa !9
  %98 = load i32, ptr @l, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !9
  %102 = load i32, ptr %6, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %6, align 4, !tbaa !5
  %104 = sext i32 %102 to i64
  %105 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %104
  store i8 %101, ptr %105, align 1, !tbaa !9
  br label %106

106:                                              ; preds = %89, %72
  %107 = load i32, ptr @l, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  store i32 %108, ptr @l, align 4, !tbaa !5
  %109 = load i32, ptr @r, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr @r, align 4, !tbaa !5
  br label %49, !llvm.loop !10

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

112:                                              ; preds = %128, %111
  %113 = load i32, ptr %8, align 4, !tbaa !5
  %114 = load i32, ptr %5, align 4, !tbaa !5
  %115 = icmp slt i32 %113, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %112
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %131

117:                                              ; preds = %112
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = shl i32 %118, 1
  %120 = load i32, ptr %8, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !9
  %124 = sext i8 %123 to i32
  %125 = sub nsw i32 %124, 48
  %126 = add nsw i32 %119, %125
  %127 = srem i32 %126, 1000000007
  store i32 %127, ptr %7, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %117
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %8, align 4, !tbaa !5
  br label %112, !llvm.loop !12

131:                                              ; preds = %116
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %132)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %134

134:                                              ; preds = %131
  %135 = load i32, ptr %3, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %3, align 4, !tbaa !5
  br label %10, !llvm.loop !13

137:                                              ; preds = %14
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %138 = load i32, ptr %1, align 4
  ret i32 %138
}

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

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

declare i32 @printf(ptr noundef, ...) #2

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { nounwind }
attributes #5 = { 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}


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

@s = external dso_local global [100030 x i8], align 16
@out = external dso_local local_unnamed_addr global [100030 x i8], align 16
@l = external dso_local local_unnamed_addr global i32, align 4
@r = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nofree norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not36 = icmp slt i32 %3, 1
  br i1 %.not36, label %._crit_edge40, label %.lr.ph39

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

.lr.ph39:                                         ; preds = %0, %._crit_edge
  %.02437 = phi i32 [ %59, %._crit_edge ], [ 1, %0 ]
  %4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.02437)
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @s)
  %6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #6
  %7 = trunc i64 %6 to i32
  %8 = and i32 %7, 1
  %.not27 = icmp eq i32 %8, 0
  br i1 %.not27, label %17, label %9

9:                                                ; preds = %.lr.ph39
  %10 = add nsw i32 %7, 1
  %11 = ashr exact i32 %10, 1
  %12 = add nsw i32 %11, -1
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %13
  %15 = load i8, ptr %14, align 1, !tbaa !9
  store i8 %15, ptr @out, align 16, !tbaa !9
  %16 = ashr i32 %7, 1
  br label %19

17:                                               ; preds = %.lr.ph39
  %18 = ashr exact i32 %7, 1
  br label %19

19:                                               ; preds = %17, %9
  %storemerge28.in = phi i32 [ %18, %17 ], [ %16, %9 ]
  %storemerge = phi i32 [ %18, %17 ], [ %11, %9 ]
  %.023 = phi i64 [ 0, %17 ], [ 1, %9 ]
  %storemerge28 = add nsw i32 %storemerge28.in, -1
  store i32 %storemerge28, ptr @l, align 4, !tbaa !5
  %20 = icmp sgt i32 %storemerge28.in, 0
  %21 = icmp slt i32 %storemerge, %7
  %22 = select i1 %20, i1 %21, i1 false
  br i1 %22, label %.lr.ph.preheader, label %.preheader

.lr.ph.preheader:                                 ; preds = %19
  %23 = sext i32 %storemerge to i64
  %sext = shl i64 %6, 32
  %24 = ashr exact i64 %sext, 32
  %25 = zext i32 %storemerge28 to i64
  %26 = xor i64 %23, -1
  %27 = add nsw i64 %24, %26
  %28 = freeze i64 %27
  %umin = call i64 @llvm.umin.i64(i64 %28, i64 %25)
  %29 = add nuw nsw i64 %umin, 1
  %min.iters.check = icmp ult i64 %umin, 7
  br i1 %min.iters.check, label %.lr.ph.preheader64, label %vector.ph

.lr.ph.preheader64:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv45.ph = phi i64 [ %25, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  %indvars.iv43.ph = phi i64 [ %23, %.lr.ph.preheader ], [ %ind.end57, %middle.block ]
  %indvars.iv.ph = phi i64 [ %.023, %.lr.ph.preheader ], [ %ind.end59, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %29, 8589934584
  %ind.end = sub nsw i64 %25, %n.vec
  %ind.end57 = add nsw i64 %n.vec, %23
  %30 = shl nuw nsw i64 %n.vec, 1
  %ind.end59 = or disjoint i64 %.023, %30
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %25, %index
  %offset.idx61 = add i64 %index, %23
  %31 = shl i64 %index, 1
  %offset.idx62 = or disjoint i64 %.023, %31
  %gep = getelementptr [100030 x i8], ptr getelementptr (i8, ptr @s, i64 -7), i64 0, i64 %offset.idx
  %wide.load = load <8 x i8>, ptr %gep, align 1, !tbaa !9
  %reverse = shufflevector <8 x i8> %wide.load, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
  %32 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %offset.idx61
  %wide.load63 = load <8 x i8>, ptr %32, align 1, !tbaa !9
  %33 = add nuw nsw i64 %offset.idx62, 1
  %34 = call <8 x i8> @llvm.smax.v8i8(<8 x i8> %reverse, <8 x i8> %wide.load63)
  %35 = call <8 x i8> @llvm.smin.v8i8(<8 x i8> %reverse, <8 x i8> %wide.load63)
  %gep71 = getelementptr [100030 x i8], ptr getelementptr (i8, ptr @out, i64 -1), i64 0, i64 %33
  %interleaved.vec = shufflevector <8 x i8> %34, <8 x i8> %35, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
  store <16 x i8> %interleaved.vec, ptr %gep71, align 1, !tbaa !9
  %index.next = add nuw i64 %index, 8
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %middle.block, label %vector.body, !llvm.loop !10

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %29, %n.vec
  br i1 %cmp.n, label %..preheader_crit_edge, label %.lr.ph.preheader64

..preheader_crit_edge:                            ; preds = %.lr.ph, %middle.block
  %indvars.iv.next46.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next46, %.lr.ph ]
  %indvars.iv.next44.lcssa = phi i64 [ %ind.end57, %middle.block ], [ %indvars.iv.next44, %.lr.ph ]
  %37 = trunc nsw i64 %indvars.iv.next46.lcssa to i32
  %38 = trunc nsw i64 %indvars.iv.next44.lcssa to i32
  store i32 %37, ptr @l, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %..preheader_crit_edge, %19
  %storemerge29.lcssa = phi i32 [ %38, %..preheader_crit_edge ], [ %storemerge, %19 ]
  store i32 %storemerge29.lcssa, ptr @r, align 4, !tbaa !5
  %39 = icmp sgt i32 %7, 0
  br i1 %39, label %.lr.ph34.preheader, label %._crit_edge

.lr.ph34.preheader:                               ; preds = %.preheader
  %wide.trip.count = and i64 %6, 2147483647
  %xtraiter = and i64 %6, 1
  %40 = icmp eq i64 %wide.trip.count, 1
  br i1 %40, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph34.preheader.new

.lr.ph34.preheader.new:                           ; preds = %.lr.ph34.preheader
  %unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
  br label %.lr.ph34

.lr.ph:                                           ; preds = %.lr.ph.preheader64, %.lr.ph
  %indvars.iv45 = phi i64 [ %indvars.iv.next46, %.lr.ph ], [ %indvars.iv45.ph, %.lr.ph.preheader64 ]
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %.lr.ph ], [ %indvars.iv43.ph, %.lr.ph.preheader64 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader64 ]
  %41 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %indvars.iv45
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = getelementptr inbounds [100030 x i8], ptr @s, i64 0, i64 %indvars.iv43
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = add nuw nsw i64 %indvars.iv, 1
  %46 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %indvars.iv
  %47 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %45
  %. = call i8 @llvm.smax.i8(i8 %42, i8 %44)
  %.56 = call i8 @llvm.smin.i8(i8 %42, i8 %44)
  store i8 %., ptr %46, align 1, !tbaa !9
  store i8 %.56, ptr %47, align 1, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
  %indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
  %indvars.iv.next44 = add nsw i64 %indvars.iv43, 1
  %48 = icmp sgt i64 %indvars.iv45, 0
  %49 = icmp slt i64 %indvars.iv.next44, %24
  %50 = select i1 %48, i1 %49, i1 false
  br i1 %50, label %.lr.ph, label %..preheader_crit_edge, !llvm.loop !14

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph34, %.lr.ph34.preheader
  %.lcssa.ph = phi i32 [ poison, %.lr.ph34.preheader ], [ %74, %.lr.ph34 ]
  %indvars.iv52.unr = phi i64 [ 0, %.lr.ph34.preheader ], [ %indvars.iv.next53.1, %.lr.ph34 ]
  %.02232.unr = phi i32 [ 0, %.lr.ph34.preheader ], [ %74, %.lr.ph34 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph34.epil

.lr.ph34.epil:                                    ; preds = %._crit_edge.loopexit.unr-lcssa
  %51 = shl nsw i32 %.02232.unr, 1
  %52 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %indvars.iv52.unr
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = sext i8 %53 to i32
  %55 = add i32 %51, -48
  %56 = add i32 %55, %54
  %57 = srem i32 %56, 1000000007
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph34.epil, %._crit_edge.loopexit.unr-lcssa, %.preheader
  %.022.lcssa = phi i32 [ 0, %.preheader ], [ %.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %57, %.lr.ph34.epil ]
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %.022.lcssa)
  %59 = add nuw nsw i32 %.02437, 1
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.02437, %60
  br i1 %.not.not, label %.lr.ph39, label %._crit_edge40, !llvm.loop !15

.lr.ph34:                                         ; preds = %.lr.ph34, %.lr.ph34.preheader.new
  %indvars.iv52 = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %indvars.iv.next53.1, %.lr.ph34 ]
  %.02232 = phi i32 [ 0, %.lr.ph34.preheader.new ], [ %74, %.lr.ph34 ]
  %niter = phi i64 [ 0, %.lr.ph34.preheader.new ], [ %niter.next.1, %.lr.ph34 ]
  %61 = shl nsw i32 %.02232, 1
  %62 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %indvars.iv52
  %63 = load i8, ptr %62, align 2, !tbaa !9
  %64 = sext i8 %63 to i32
  %65 = add i32 %61, -48
  %66 = add i32 %65, %64
  %67 = srem i32 %66, 1000000007
  %indvars.iv.next53 = or disjoint i64 %indvars.iv52, 1
  %68 = shl nsw i32 %67, 1
  %69 = getelementptr inbounds [100030 x i8], ptr @out, i64 0, i64 %indvars.iv.next53
  %70 = load i8, ptr %69, align 1, !tbaa !9
  %71 = sext i8 %70 to i32
  %72 = add i32 %68, -48
  %73 = add i32 %72, %71
  %74 = srem i32 %73, 1000000007
  %indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 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 %._crit_edge.loopexit.unr-lcssa, label %.lr.ph34, !llvm.loop !16
}

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

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.smin.i8(i8, i8) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <8 x i8> @llvm.smax.v8i8(<8 x i8>, <8 x i8>) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <8 x i8> @llvm.smin.v8i8(<8 x i8>, <8 x i8>) #4

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { 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, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}


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