; LLVM IR from ACM-VIT/Algos-for-all-Amigos :: Computer_Science/2_Competitive_Programming/Codeforces/800_rating (main)

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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @getUnfinished(ptr noundef, i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local 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 ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %151, %0
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp slt i32 %18, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %5)
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = zext i32 %24 to i64
  %26 = call ptr @llvm.stacksave.p0()
  store ptr %26, ptr %6, align 8
  %27 = alloca i32, i64 %25, align 16
  store i64 %25, ptr %7, align 8
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = zext i32 %28 to i64
  %30 = alloca i32, i64 %29, align 16
  store i64 %29, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %41, %22
  %32 = load i32, ptr %9, align 4, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = icmp slt i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %44

36:                                               ; preds = %31
  %37 = load i32, ptr %9, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr %27, i64 %38
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %39)
  br label %41

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

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

45:                                               ; preds = %55, %44
  %46 = load i32, ptr %10, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

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

50:                                               ; preds = %45
  %51 = load i32, ptr %10, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds i32, ptr %30, i64 %52
  %54 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %53)
  br label %55

55:                                               ; preds = %50
  %56 = load i32, ptr %10, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %10, align 4, !tbaa !5
  br label %45, !llvm.loop !11

58:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = zext i32 %59 to i64
  %61 = alloca i32, i64 %60, align 16
  store i64 %60, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %93, %58
  %63 = load i32, ptr %14, align 4, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %96

67:                                               ; preds = %62
  %68 = load i32, ptr %14, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %27, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = load i32, ptr %14, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr %30, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = sub nsw i32 %71, %75
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %61, i64 %78
  store i32 %76, ptr %79, align 4, !tbaa !5
  %80 = load i32, ptr %14, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %61, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = add nsw i32 %84, %83
  store i32 %85, ptr %11, align 4, !tbaa !5
  %86 = load i32, ptr %14, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds i32, ptr %61, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = call i32 @llvm.abs.i32(i32 %89, i1 true)
  %91 = load i32, ptr %13, align 4, !tbaa !5
  %92 = add nsw i32 %91, %90
  store i32 %92, ptr %13, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %67
  %94 = load i32, ptr %14, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %14, align 4, !tbaa !5
  br label %62, !llvm.loop !12

96:                                               ; preds = %66
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sdiv i32 %97, 2
  store i32 %98, ptr %13, align 4, !tbaa !5
  %99 = load i32, ptr %11, align 4, !tbaa !5
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %103

101:                                              ; preds = %96
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  br label %149

103:                                              ; preds = %96
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %104)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %106 = load i32, ptr %5, align 4, !tbaa !5
  %107 = call ptr @getUnfinished(ptr noundef %61, i32 noundef %106)
  store ptr %107, ptr %15, align 8, !tbaa !13
  br label %108

108:                                              ; preds = %122, %103
  %109 = load ptr, ptr %15, align 8, !tbaa !13
  %110 = getelementptr inbounds i32, ptr %109, i64 0
  %111 = load i32, ptr %110, align 4, !tbaa !5
  %112 = load i32, ptr %5, align 4, !tbaa !5
  %113 = icmp ne i32 %111, %112
  br i1 %113, label %114, label %120

114:                                              ; preds = %108
  %115 = load ptr, ptr %15, align 8, !tbaa !13
  %116 = getelementptr inbounds i32, ptr %115, i64 1
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = load i32, ptr %5, align 4, !tbaa !5
  %119 = icmp ne i32 %117, %118
  br label %120

120:                                              ; preds = %114, %108
  %121 = phi i1 [ false, %108 ], [ %119, %114 ]
  br i1 %121, label %122, label %148

122:                                              ; preds = %120
  %123 = load ptr, ptr %15, align 8, !tbaa !13
  %124 = getelementptr inbounds i32, ptr %123, i64 0
  %125 = load i32, ptr %124, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %61, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = add nsw i32 %128, -1
  store i32 %129, ptr %127, align 4, !tbaa !5
  %130 = load ptr, ptr %15, align 8, !tbaa !13
  %131 = getelementptr inbounds i32, ptr %130, i64 1
  %132 = load i32, ptr %131, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds i32, ptr %61, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %134, align 4, !tbaa !5
  %137 = load ptr, ptr %15, align 8, !tbaa !13
  %138 = getelementptr inbounds i32, ptr %137, i64 0
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  %141 = load ptr, ptr %15, align 8, !tbaa !13
  %142 = getelementptr inbounds i32, ptr %141, i64 1
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %140, i32 noundef %144)
  %146 = load i32, ptr %5, align 4, !tbaa !5
  %147 = call ptr @getUnfinished(ptr noundef %61, i32 noundef %146)
  store ptr %147, ptr %15, align 8, !tbaa !13
  br label %108, !llvm.loop !15

148:                                              ; preds = %120
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %149

149:                                              ; preds = %148, %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %150 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %150)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %151

151:                                              ; preds = %149
  %152 = load i32, ptr %3, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %3, align 4, !tbaa !5
  br label %17, !llvm.loop !16

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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


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

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @getUnfinished(ptr noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() 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) #6
  %3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph56, label %._crit_edge57

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

.lr.ph56:                                         ; preds = %0, %.critedge
  %.03254 = phi i32 [ %89, %.critedge ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %7 = load i32, ptr %2, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  %9 = call ptr @llvm.stacksave.p0()
  %10 = alloca i32, i64 %8, align 16
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = zext i32 %11 to i64
  %13 = alloca i32, i64 %12, align 16
  %14 = icmp sgt i32 %11, 0
  br i1 %14, label %.lr.ph, label %._crit_edge.thread

.preheader:                                       ; preds = %.lr.ph
  %15 = icmp sgt i32 %18, 0
  br i1 %15, label %.lr.ph40, label %._crit_edge.thread

.lr.ph:                                           ; preds = %.lr.ph56, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.lr.ph56 ]
  %16 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge.thread:                               ; preds = %.preheader, %.lr.ph56
  %.lcssa.ph = phi i32 [ %18, %.preheader ], [ %11, %.lr.ph56 ]
  %21 = zext i32 %.lcssa.ph to i64
  %22 = alloca i32, i64 %21, align 16
  br label %._crit_edge46.thread

._crit_edge:                                      ; preds = %.lr.ph40
  %23 = zext i32 %45 to i64
  %24 = alloca i32, i64 %23, align 16
  %25 = icmp sgt i32 %45, 0
  br i1 %25, label %.lr.ph45.preheader, label %._crit_edge46.thread

.lr.ph45.preheader:                               ; preds = %._crit_edge
  %min.iters.check = icmp ult i32 %45, 8
  br i1 %min.iters.check, label %.lr.ph45.preheader87, label %vector.ph

.lr.ph45.preheader87:                             ; preds = %middle.block, %.lr.ph45.preheader
  %indvars.iv65.ph = phi i64 [ 0, %.lr.ph45.preheader ], [ %n.vec, %middle.block ]
  %.02842.ph = phi i32 [ 0, %.lr.ph45.preheader ], [ %41, %middle.block ]
  %.02941.ph = phi i32 [ 0, %.lr.ph45.preheader ], [ %42, %middle.block ]
  br label %.lr.ph45

vector.ph:                                        ; preds = %.lr.ph45.preheader
  %n.vec = and i64 %23, 2147483640
  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 ], [ %38, %vector.body ]
  %vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %39, %vector.body ]
  %vec.phi80 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %34, %vector.body ]
  %vec.phi81 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %35, %vector.body ]
  %26 = getelementptr inbounds i32, ptr %10, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <4 x i32>, ptr %26, align 16, !tbaa !5
  %wide.load82 = load <4 x i32>, ptr %27, align 16, !tbaa !5
  %28 = getelementptr inbounds i32, ptr %13, i64 %index
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %wide.load83 = load <4 x i32>, ptr %28, align 16, !tbaa !5
  %wide.load84 = load <4 x i32>, ptr %29, align 16, !tbaa !5
  %30 = sub nsw <4 x i32> %wide.load, %wide.load83
  %31 = sub nsw <4 x i32> %wide.load82, %wide.load84
  %32 = getelementptr inbounds i32, ptr %24, i64 %index
  %33 = getelementptr inbounds i8, ptr %32, i64 16
  store <4 x i32> %30, ptr %32, align 16, !tbaa !5
  store <4 x i32> %31, ptr %33, align 16, !tbaa !5
  %34 = add <4 x i32> %30, %vec.phi80
  %35 = add <4 x i32> %31, %vec.phi81
  %36 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %30, i1 true)
  %37 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %31, i1 true)
  %38 = add <4 x i32> %36, %vec.phi
  %39 = add <4 x i32> %37, %vec.phi79
  %index.next = add nuw i64 %index, 8
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %39, %38
  %41 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %bin.rdx85 = add <4 x i32> %35, %34
  %42 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx85)
  %cmp.n = icmp eq i64 %n.vec, %23
  br i1 %cmp.n, label %._crit_edge46, label %.lr.ph45.preheader87

.lr.ph40:                                         ; preds = %.preheader, %.lr.ph40
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph40 ], [ 0, %.preheader ]
  %43 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv62
  %44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %43)
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = icmp slt i64 %indvars.iv.next63, %46
  br i1 %47, label %.lr.ph40, label %._crit_edge, !llvm.loop !14

._crit_edge46:                                    ; preds = %.lr.ph45, %middle.block
  %.lcssa78 = phi i32 [ %42, %middle.block ], [ %54, %.lr.ph45 ]
  %.lcssa77 = phi i32 [ %41, %middle.block ], [ %56, %.lr.ph45 ]
  %.not = icmp eq i32 %.lcssa78, 0
  br i1 %.not, label %._crit_edge46.thread, label %57

.lr.ph45:                                         ; preds = %.lr.ph45.preheader87, %.lr.ph45
  %indvars.iv65 = phi i64 [ %indvars.iv.next66, %.lr.ph45 ], [ %indvars.iv65.ph, %.lr.ph45.preheader87 ]
  %.02842 = phi i32 [ %56, %.lr.ph45 ], [ %.02842.ph, %.lr.ph45.preheader87 ]
  %.02941 = phi i32 [ %54, %.lr.ph45 ], [ %.02941.ph, %.lr.ph45.preheader87 ]
  %48 = getelementptr inbounds i32, ptr %10, i64 %indvars.iv65
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv65
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = sub nsw i32 %49, %51
  %53 = getelementptr inbounds i32, ptr %24, i64 %indvars.iv65
  store i32 %52, ptr %53, align 4, !tbaa !5
  %54 = add nsw i32 %52, %.02941
  %55 = call i32 @llvm.abs.i32(i32 %52, i1 true)
  %56 = add nuw nsw i32 %55, %.02842
  %indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next66, %23
  br i1 %exitcond.not, label %._crit_edge46, label %.lr.ph45, !llvm.loop !15

57:                                               ; preds = %._crit_edge46
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.critedge

._crit_edge46.thread:                             ; preds = %._crit_edge.thread, %._crit_edge, %._crit_edge46
  %.028.lcssa72 = phi i32 [ %.lcssa77, %._crit_edge46 ], [ 0, %._crit_edge ], [ 0, %._crit_edge.thread ]
  %59 = phi ptr [ %24, %._crit_edge46 ], [ %24, %._crit_edge ], [ %22, %._crit_edge.thread ]
  %60 = lshr i32 %.028.lcssa72, 1
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %60)
  %62 = load i32, ptr %2, align 4, !tbaa !5
  %63 = call ptr @getUnfinished(ptr noundef nonnull %59, i32 noundef %62)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = load i32, ptr %2, align 4, !tbaa !5
  %.not3649 = icmp eq i32 %64, %65
  br i1 %.not3649, label %.critedge, label %.lr.ph52

.lr.ph52:                                         ; preds = %._crit_edge46.thread, %70
  %66 = phi i32 [ %88, %70 ], [ %65, %._crit_edge46.thread ]
  %67 = phi i32 [ %87, %70 ], [ %64, %._crit_edge46.thread ]
  %.050 = phi ptr [ %86, %70 ], [ %63, %._crit_edge46.thread ]
  %68 = getelementptr inbounds i8, ptr %.050, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %.not37 = icmp eq i32 %69, %66
  br i1 %.not37, label %.critedge, label %70

70:                                               ; preds = %.lr.ph52
  %71 = sext i32 %67 to i64
  %72 = getelementptr inbounds i32, ptr %59, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr %72, align 4, !tbaa !5
  %75 = load i32, ptr %68, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %59, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %77, align 4, !tbaa !5
  %80 = load i32, ptr %.050, align 4, !tbaa !5
  %81 = add nsw i32 %80, 1
  %82 = load i32, ptr %68, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %81, i32 noundef %83)
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = call ptr @getUnfinished(ptr noundef nonnull %59, i32 noundef %85)
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %.not36 = icmp eq i32 %87, %88
  br i1 %.not36, label %.critedge, label %.lr.ph52, !llvm.loop !16

.critedge:                                        ; preds = %70, %.lr.ph52, %._crit_edge46.thread, %57
  call void @llvm.stackrestore.p0(ptr %9)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  %89 = add nuw nsw i32 %.03254, 1
  %90 = load i32, ptr %1, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %.lr.ph56, label %._crit_edge57, !llvm.loop !17
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #5

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

attributes #0 = { 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 nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }

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

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


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