; LLVM IR from tangjz/acm-icpc :: openjudge/c15b.ll (Z5solvev)

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

@_ZZ5solvevE1a = external hidden global [1001 x i32], align 16
@_ZZ5solvevE1b = external hidden global [1001 x i32], align 16
@_ZZ5solvevE3buf = external hidden global [1001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 uwtable
define dso_local void @_Z5solvev() #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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  %8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %1)
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = sext i32 %9 to i64
  %11 = mul i64 %10, 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ5solvevE1a, i8 0, i64 %11, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %46, %0
  %13 = load i32, ptr %3, align 4, !tbaa !5
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

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

17:                                               ; preds = %12
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @_ZZ5solvevE3buf)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %42, %17
  %20 = load i32, ptr %5, align 4, !tbaa !5
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %45

24:                                               ; preds = %19
  %25 = load i32, ptr %5, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [1001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !9
  %29 = sext i8 %28 to i32
  %30 = icmp eq i32 %29, 35
  br i1 %30, label %31, label %41

31:                                               ; preds = %24
  %32 = load i32, ptr %5, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  %37 = and i32 %36, 3
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %39
  store i32 %37, ptr %40, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %31, %24
  br label %42

42:                                               ; preds = %41
  %43 = load i32, ptr %5, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %5, align 4, !tbaa !5
  br label %19, !llvm.loop !10

45:                                               ; preds = %23
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %3, align 4, !tbaa !5
  br label %12, !llvm.loop !12

49:                                               ; preds = %16
  store i32 0, ptr @_ZZ5solvevE1b, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %83, %49
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = sub nsw i32 %52, 3
  %54 = icmp slt i32 %51, %53
  br i1 %54, label %56, label %55

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

56:                                               ; preds = %50
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sub nsw i32 %57, 1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = sub nsw i32 %61, %65
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = icmp sge i32 %67, 4
  br i1 %68, label %69, label %75

69:                                               ; preds = %56
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 4
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1b, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !5
  br label %76

75:                                               ; preds = %56
  br label %76

76:                                               ; preds = %75, %69
  %77 = phi i32 [ %74, %69 ], [ 0, %75 ]
  %78 = add nsw i32 %66, %77
  %79 = and i32 %78, 3
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1b, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %76
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %6, align 4, !tbaa !5
  br label %50, !llvm.loop !13

86:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %87 = load i32, ptr %1, align 4, !tbaa !5
  %88 = sub nsw i32 %87, 3
  store i32 %88, ptr %7, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %120, %86
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr %1, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 11, ptr %4, align 4
  br label %123

94:                                               ; preds = %89
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = and i32 %95, 3
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %119

98:                                               ; preds = %94
  %99 = load i32, ptr %7, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sub nsw i32 %103, %107
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sub nsw i32 %109, 4
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1b, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %108, %113
  %115 = and i32 %114, 3
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %117, label %119

117:                                              ; preds = %98
  %118 = call i32 @puts(ptr noundef @.str.2)
  store i32 1, ptr %4, align 4
  br label %123

119:                                              ; preds = %98, %94
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %7, align 4, !tbaa !5
  br label %89, !llvm.loop !14

123:                                              ; preds = %117, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %124 = load i32, ptr %4, align 4
  switch i32 %124, label %127 [
    i32 11, label %125
  ]

125:                                              ; preds = %123
  %126 = call i32 @puts(ptr noundef @.str.3)
  store i32 0, ptr %4, align 4
  br label %127

127:                                              ; preds = %125, %123
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  %128 = load i32, ptr %4, align 4
  switch i32 %128, label %130 [
    i32 0, label %129
    i32 1, label %129
  ]

129:                                              ; preds = %127, %127
  ret void

130:                                              ; preds = %127
  unreachable
}

; 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

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

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

declare i32 @puts(ptr noundef) #2

attributes #0 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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"

@_ZZ5solvevE1a = external hidden local_unnamed_addr global [1001 x i32], align 16
@_ZZ5solvevE1b = external hidden local_unnamed_addr global [1001 x i32], align 16
@_ZZ5solvevE3buf = external hidden global [1001 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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 nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = sext i32 %4 to i64
  %6 = shl nsw i64 %5, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ5solvevE1a, i8 0, i64 %6, i1 false)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph33, label %._crit_edge34

._crit_edge34:                                    ; preds = %._crit_edge, %0
  %9 = phi i32 [ %4, %0 ], [ %34, %._crit_edge ]
  store i32 0, ptr @_ZZ5solvevE1b, align 16, !tbaa !5
  %10 = add i32 %9, -3
  %11 = icmp sgt i32 %9, 4
  br i1 %11, label %12, label %.lr.ph41.preheader

12:                                               ; preds = %._crit_edge34
  %wide.trip.count46 = zext i32 %10 to i64
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1a, i64 4), align 4, !tbaa !5
  %14 = load i32, ptr @_ZZ5solvevE1a, align 16, !tbaa !5
  %15 = sub i32 %14, %13
  %16 = and i32 %15, 3
  store i32 %16, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1b, i64 4), align 4, !tbaa !5
  %exitcond47.peel.not = icmp eq i32 %10, 2
  br i1 %exitcond47.peel.not, label %.lr.ph41.preheader, label %17

17:                                               ; preds = %12
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1a, i64 8), align 8, !tbaa !5
  %19 = sub i32 %13, %18
  %20 = and i32 %19, 3
  store i32 %20, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1b, i64 8), align 8, !tbaa !5
  %exitcond47.peel51.not = icmp eq i32 %10, 3
  br i1 %exitcond47.peel51.not, label %.lr.ph41.preheader, label %21

21:                                               ; preds = %17
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1a, i64 12), align 4, !tbaa !5
  %23 = sub i32 %18, %22
  %24 = and i32 %23, 3
  store i32 %24, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE1b, i64 12), align 4, !tbaa !5
  %exitcond47.peel55.not = icmp eq i32 %10, 4
  br i1 %exitcond47.peel55.not, label %.lr.ph41.preheader, label %.lr.ph37.peel.next52.preheader

.lr.ph37.peel.next52.preheader:                   ; preds = %21
  %25 = add nsw i64 %wide.trip.count46, -4
  %min.iters.check = icmp ult i64 %25, 4
  br i1 %min.iters.check, label %.lr.ph37.peel.next52.preheader61, label %vector.ph

.lr.ph37.peel.next52.preheader61:                 ; preds = %middle.block, %.lr.ph37.peel.next52.preheader
  %.ph = phi i32 [ %22, %.lr.ph37.peel.next52.preheader ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv43.ph = phi i64 [ 4, %.lr.ph37.peel.next52.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph37.peel.next52

vector.ph:                                        ; preds = %.lr.ph37.peel.next52.preheader
  %n.vec = and i64 %25, -4
  %ind.end = add nsw i64 %n.vec, 4
  %vector.recur.init = insertelement <4 x i32> poison, i32 %22, i64 3
  %load_initial = load <4 x i32>, ptr @_ZZ5solvevE1b, align 16
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %store_forwarded = phi <4 x i32> [ %load_initial, %vector.ph ], [ %30, %vector.body ]
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
  %offset.idx = add i64 %index, 4
  %26 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %offset.idx
  %wide.load = load <4 x i32>, ptr %26, align 16, !tbaa !5
  %27 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %28 = sub <4 x i32> %27, %wide.load
  %29 = add nsw <4 x i32> %28, %store_forwarded
  %30 = and <4 x i32> %29, <i32 3, i32 3, i32 3, i32 3>
  %31 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1b, i64 0, i64 %offset.idx
  store <4 x i32> %30, ptr %31, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 4
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %vector.recur.extract = extractelement <4 x i32> %wide.load, i64 3
  %cmp.n = icmp eq i64 %25, %n.vec
  br i1 %cmp.n, label %.lr.ph41.preheader, label %.lr.ph37.peel.next52.preheader61

.lr.ph33:                                         ; preds = %0, %._crit_edge
  %.02431 = phi i32 [ %45, %._crit_edge ], [ 0, %0 ]
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @_ZZ5solvevE3buf)
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.lr.ph33
  %wide.trip.count = zext nneg i32 %34 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %36 = icmp eq i32 %34, 1
  br i1 %36, label %._crit_edge.loopexit.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

._crit_edge.loopexit.unr-lcssa:                   ; preds = %64, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %64 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %37 = getelementptr inbounds [1001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv.unr
  %38 = load i8, ptr %37, align 1, !tbaa !14
  %39 = icmp eq i8 %38, 35
  br i1 %39, label %40, label %._crit_edge

40:                                               ; preds = %.lr.ph.epil
  %41 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv.unr
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  %44 = and i32 %43, 3
  store i32 %44, ptr %41, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %40, %.lr.ph.epil, %.lr.ph33
  %45 = add nuw nsw i32 %.02431, 1
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %.lr.ph33, label %._crit_edge34, !llvm.loop !15

.lr.ph:                                           ; preds = %64, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %64 ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %64 ]
  %48 = getelementptr inbounds [1001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv
  %49 = load i8, ptr %48, align 2, !tbaa !14
  %50 = icmp eq i8 %49, 35
  br i1 %50, label %51, label %.lr.ph.1

51:                                               ; preds = %.lr.ph
  %52 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv
  %53 = load i32, ptr %52, align 8, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = and i32 %54, 3
  store i32 %55, ptr %52, align 8, !tbaa !5
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %.lr.ph, %51
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %56 = getelementptr inbounds [1001 x i8], ptr @_ZZ5solvevE3buf, i64 0, i64 %indvars.iv.next
  %57 = load i8, ptr %56, align 1, !tbaa !14
  %58 = icmp eq i8 %57, 35
  br i1 %58, label %59, label %64

59:                                               ; preds = %.lr.ph.1
  %60 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv.next
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = add nsw i32 %61, 1
  %63 = and i32 %62, 3
  store i32 %63, ptr %60, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %59, %.lr.ph.1
  %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 %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !16

.lr.ph41.preheader:                               ; preds = %.lr.ph37.peel.next52, %middle.block, %._crit_edge34, %21, %17, %12
  %65 = sext i32 %10 to i64
  %66 = sext i32 %9 to i64
  br label %.lr.ph41

.lr.ph37.peel.next52:                             ; preds = %.lr.ph37.peel.next52.preheader61, %.lr.ph37.peel.next52
  %67 = phi i32 [ %69, %.lr.ph37.peel.next52 ], [ %.ph, %.lr.ph37.peel.next52.preheader61 ]
  %indvars.iv43 = phi i64 [ %indvars.iv.next44, %.lr.ph37.peel.next52 ], [ %indvars.iv43.ph, %.lr.ph37.peel.next52.preheader61 ]
  %68 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv43
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = sub i32 %67, %69
  %71 = add nsw i64 %indvars.iv43, -4
  %72 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1b, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %70, %73
  %75 = and i32 %74, 3
  %76 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1b, i64 0, i64 %indvars.iv43
  store i32 %75, ptr %76, align 4, !tbaa !5
  %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
  %exitcond47.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count46
  br i1 %exitcond47.not, label %.lr.ph41.preheader, label %.lr.ph37.peel.next52, !llvm.loop !17

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %90
  %indvars.iv57 = phi i64 [ %65, %.lr.ph41.preheader ], [ %indvars.iv.next58, %90 ]
  %77 = and i64 %indvars.iv57, 3
  %.not = icmp eq i64 %77, 0
  br i1 %.not, label %90, label %78

78:                                               ; preds = %.lr.ph41
  %79 = add nsw i64 %indvars.iv57, -1
  %80 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1a, i64 0, i64 %indvars.iv57
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = sub i32 %81, %83
  %85 = add nsw i64 %indvars.iv57, -4
  %86 = getelementptr inbounds [1001 x i32], ptr @_ZZ5solvevE1b, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %84, %87
  %89 = and i32 %88, 3
  %.not26 = icmp eq i32 %89, 0
  br i1 %.not26, label %90, label %.critedge

90:                                               ; preds = %.lr.ph41, %78
  %indvars.iv.next58 = add nsw i64 %indvars.iv57, 1
  %.not27 = icmp slt i64 %indvars.iv.next58, %66
  br i1 %.not27, label %.lr.ph41, label %.critedge, !llvm.loop !18

.critedge:                                        ; preds = %90, %78
  %.str.2.sink = phi ptr [ @.str.2, %78 ], [ @.str.3, %90 ]
  %91 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void
}

; 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

attributes #0 = { 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 #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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !11, !12, !13}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 3}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !11, !13, !12}
!18 = distinct !{!18, !10}


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