; LLVM IR from tangjz/acm-icpc :: codeforces/complete/1554B.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"

%class.anon = type { i8 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ5solvevE3pos = external hidden global [200009 x [2 x i32]], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 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 %class.anon, align 1
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %1, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds ([2 x i32], ptr @_ZZ5solvevE3pos, i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr @_ZZ5solvevE3pos, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %41, %0
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %44

19:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %6)
  br label %21

21:                                               ; preds = %32, %19
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = load i32, ptr %6, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %25, label %35

25:                                               ; preds = %21
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [2 x i32], ptr @_ZZ5solvevE3pos, i64 %27
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = mul i64 %30, 8
  call void @llvm.memset.p0.i64(ptr align 4 %28, i8 0, i64 %31, i1 false)
  br label %32

32:                                               ; preds = %25
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = shl i32 %33, 1
  store i32 %34, ptr %3, align 4, !tbaa !5
  br label %21, !llvm.loop !9

35:                                               ; preds = %21
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %37
  %39 = getelementptr inbounds [2 x i32], ptr %38, i64 0, i64 0
  %40 = load i32, ptr %5, align 4, !tbaa !5
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef %39, i32 noundef %40)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %41

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

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

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

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

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

51:                                               ; preds = %85, %50
  %52 = load i32, ptr %9, align 4, !tbaa !5
  %53 = load i32, ptr %3, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  store i32 11, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %88

56:                                               ; preds = %51
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = and i32 %57, %58
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %56
  br label %85

62:                                               ; preds = %56
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = or i32 %63, %64
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %66
  %68 = getelementptr inbounds [2 x i32], ptr %67, i64 0, i64 0
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %70
  %72 = getelementptr inbounds [2 x i32], ptr %71, i64 0, i64 0
  %73 = load i32, ptr %72, align 8, !tbaa !5
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef %68, i32 noundef %73)
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = load i32, ptr %9, align 4, !tbaa !5
  %76 = or i32 %74, %75
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %77
  %79 = getelementptr inbounds [2 x i32], ptr %78, i64 0, i64 0
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %81
  %83 = getelementptr inbounds [2 x i32], ptr %82, i64 0, i64 1
  %84 = load i32, ptr %83, align 4, !tbaa !5
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1) %4, ptr noundef %79, i32 noundef %84)
  br label %85

85:                                               ; preds = %62, %61
  %86 = load i32, ptr %9, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %9, align 4, !tbaa !5
  br label %51, !llvm.loop !12

88:                                               ; preds = %55
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = shl i32 %90, 1
  store i32 %91, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !13

92:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %93 = load i32, ptr %2, align 4, !tbaa !5
  %94 = sub nsw i32 0, %93
  %95 = sext i32 %94 to i64
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = mul nsw i64 %95, %97
  store i64 %98, ptr %10, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %134, %92
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

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

104:                                              ; preds = %99
  %105 = load i32, ptr %11, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %106
  %108 = getelementptr inbounds [2 x i32], ptr %107, i64 0, i64 1
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %111, label %133

111:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %113
  %115 = getelementptr inbounds [2 x i32], ptr %114, i64 0, i64 0
  %116 = load i32, ptr %115, align 8, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = load i32, ptr %11, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %119
  %121 = getelementptr inbounds [2 x i32], ptr %120, i64 0, i64 1
  %122 = load i32, ptr %121, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = mul nsw i64 %117, %123
  %125 = load i32, ptr %2, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = mul nsw i64 %126, %128
  %130 = sub nsw i64 %124, %129
  store i64 %130, ptr %12, align 8, !tbaa !14
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %132 = load i64, ptr %131, align 8, !tbaa !14
  store i64 %132, ptr %10, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %133

133:                                              ; preds = %111, %104
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %11, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %11, align 4, !tbaa !5
  br label %99, !llvm.loop !16

137:                                              ; preds = %103
  %138 = load i64, ptr %10, align 8, !tbaa !14
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %138)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

; 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: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, i32 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

declare i32 @printf(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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!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"

%class.anon = type { i8 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZZ5solvevE3pos = external hidden global [200009 x [2 x i32]], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %class.anon, align 1
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  store i32 0, ptr getelementptr inbounds (i8, ptr @_ZZ5solvevE3pos, i64 4), align 4, !tbaa !5
  store i32 0, ptr @_ZZ5solvevE3pos, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %.not40 = icmp slt i32 %8, 1
  br i1 %.not40, label %._crit_edge50, label %.lr.ph44

.preheader36:                                     ; preds = %._crit_edge
  %9 = icmp sgt i32 %.1.lcssa, 1
  br i1 %9, label %.preheader.us.preheader, label %._crit_edge50

.preheader.us.preheader:                          ; preds = %.preheader36
  %wide.trip.count = zext nneg i32 %.1.lcssa to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge48.us
  %.03049.us = phi i32 [ %22, %._crit_edge48.us ], [ 1, %.preheader.us.preheader ]
  br label %10

10:                                               ; preds = %.preheader.us, %21
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %21 ]
  %11 = trunc nuw nsw i64 %indvars.iv to i32
  %12 = and i32 %.03049.us, %11
  %.not34.us = icmp eq i32 %12, 0
  br i1 %.not34.us, label %13, label %21

13:                                               ; preds = %10
  %14 = or i32 %.03049.us, %11
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %15
  %17 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %indvars.iv
  %18 = load i32, ptr %17, align 8, !tbaa !5
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull %16, i32 noundef %18)
  %19 = getelementptr inbounds i8, ptr %17, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !5
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull %16, i32 noundef %20)
  br label %21

21:                                               ; preds = %13, %10
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge48.us, label %10, !llvm.loop !9

._crit_edge48.us:                                 ; preds = %21
  %22 = shl i32 %.03049.us, 1
  %23 = icmp slt i32 %22, %.1.lcssa
  br i1 %23, label %.preheader.us, label %._crit_edge50, !llvm.loop !11

.lr.ph44:                                         ; preds = %0, %._crit_edge
  %.03142 = phi i32 [ %32, %._crit_edge ], [ 1, %0 ]
  %.03241 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 1, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %4)
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %.not3537 = icmp sgt i32 %.03241, %25
  br i1 %.not3537, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph44, %.lr.ph
  %.138 = phi i32 [ %29, %.lr.ph ], [ %.03241, %.lr.ph44 ]
  %26 = sext i32 %.138 to i64
  %27 = getelementptr inbounds [2 x i32], ptr @_ZZ5solvevE3pos, i64 %26
  %28 = shl nsw i64 %26, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 8 %27, i8 0, i64 %28, i1 false)
  %29 = shl i32 %.138, 1
  %.not35 = icmp sgt i32 %29, %25
  br i1 %.not35, label %._crit_edge, label %.lr.ph, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph44
  %.1.lcssa = phi i32 [ %.03241, %.lr.ph44 ], [ %29, %.lr.ph ]
  %30 = sext i32 %25 to i64
  %31 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %30
  call void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1) %3, ptr noundef nonnull %31, i32 noundef %.03142)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  %32 = add nuw nsw i32 %.03142, 1
  %33 = load i32, ptr %1, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.03142, %33
  br i1 %.not.not, label %.lr.ph44, label %.preheader36, !llvm.loop !13

._crit_edge50:                                    ; preds = %._crit_edge48.us, %0, %.preheader36
  %.032.lcssa62 = phi i32 [ %.1.lcssa, %.preheader36 ], [ 1, %0 ], [ %.1.lcssa, %._crit_edge48.us ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sub nsw i32 0, %34
  %36 = sext i32 %35 to i64
  %37 = sext i32 %.032.lcssa62 to i64
  %38 = mul nsw i64 %36, %37
  store i64 %38, ptr %5, align 8, !tbaa !14
  %39 = icmp sgt i32 %.032.lcssa62, 0
  br i1 %39, label %.lr.ph53.preheader, label %._crit_edge54

.lr.ph53.preheader:                               ; preds = %._crit_edge50
  %wide.trip.count59 = zext nneg i32 %.032.lcssa62 to i64
  br label %.lr.ph53

._crit_edge54:                                    ; preds = %58, %._crit_edge50
  %40 = phi i64 [ %38, %._crit_edge50 ], [ %59, %58 ]
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %40)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret void

.lr.ph53:                                         ; preds = %.lr.ph53.preheader, %58
  %42 = phi i64 [ %38, %.lr.ph53.preheader ], [ %59, %58 ]
  %indvars.iv56 = phi i64 [ 0, %.lr.ph53.preheader ], [ %indvars.iv.next57, %58 ]
  %43 = getelementptr inbounds [200009 x [2 x i32]], ptr @_ZZ5solvevE3pos, i64 0, i64 %indvars.iv56
  %44 = getelementptr inbounds i8, ptr %43, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %58

47:                                               ; preds = %.lr.ph53
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %48 = load i32, ptr %43, align 8, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = zext nneg i32 %45 to i64
  %51 = mul nsw i64 %49, %50
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 %indvars.iv56, %53
  %55 = sub nsw i64 %51, %54
  store i64 %55, ptr %6, align 8, !tbaa !14
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %57 = load i64, ptr %56, align 8, !tbaa !14
  store i64 %57, ptr %5, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %58

58:                                               ; preds = %.lr.ph53, %47
  %59 = phi i64 [ %42, %.lr.ph53 ], [ %57, %47 ]
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond60.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count59
  br i1 %exitcond60.not, label %._crit_edge54, label %.lr.ph53, !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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @"_ZZ5solvevENK3$_0clEPii"(ptr noundef nonnull align 1 dereferenceable(1), ptr noundef, i32 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !10}


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