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

@_ZZ5solvevE3deg = external hidden global [100001 x i32], align 16
@_ZZ5solvevE3dsu = external hidden global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

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

; 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
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %10 = 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 0, ptr %3, align 4, !tbaa !5
  br label %11

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

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %26

16:                                               ; preds = %11
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %18
  store i32 1, ptr %19, align 4, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %21
  store i32 -1, ptr %22, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %16
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !5
  br label %11, !llvm.loop !9

26:                                               ; preds = %15
  br label %27

27:                                               ; preds = %90, %88, %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %2, align 4, !tbaa !5
  %30 = icmp ne i32 %28, 0
  br i1 %30, label %31, label %91

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %4, ptr noundef %5)
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr %4, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr %5, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !5
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = call noundef i32 @_Z7dsuFindPii(ptr noundef @_ZZ5solvevE3dsu, i32 noundef %45)
  store i32 %46, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = call noundef i32 @_Z7dsuFindPii(ptr noundef @_ZZ5solvevE3dsu, i32 noundef %47)
  store i32 %48, ptr %5, align 4, !tbaa !5
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %51, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %56, align 4, !tbaa !5
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = icmp eq i32 %59, %60
  br i1 %61, label %62, label %63

62:                                               ; preds = %31
  store i32 5, ptr %6, align 4
  br label %88, !llvm.loop !11

63:                                               ; preds = %31
  %64 = load i32, ptr %4, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp slt i32 %67, %71
  br i1 %72, label %73, label %74

73:                                               ; preds = %63
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5) #5
  br label %74

74:                                               ; preds = %73, %63
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = add nsw i32 %82, %78
  store i32 %83, ptr %81, align 4, !tbaa !5
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %86
  store i32 %84, ptr %87, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  br label %88

88:                                               ; preds = %74, %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  %89 = load i32, ptr %6, align 4
  switch i32 %89, label %128 [
    i32 0, label %90
    i32 5, label %27
  ]

90:                                               ; preds = %88
  br label %27, !llvm.loop !11

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

92:                                               ; preds = %124, %91
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = load i32, ptr %1, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

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

97:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = call noundef i32 @_Z7dsuFindPii(ptr noundef @_ZZ5solvevE3dsu, i32 noundef %98)
  store i32 %99, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %105
  %107 = load i32, ptr %106, align 4, !tbaa !5
  %108 = sub nsw i32 0, %107
  %109 = call noundef i32 @_ZSt3gcdIiiENSt11common_typeIJT_T0_EE4typeES1_S2_(i32 noundef %103, i32 noundef %108) #5
  store i32 %109, ptr %9, align 4, !tbaa !5
  %110 = load i32, ptr %8, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = sub nsw i32 0, %113
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = sdiv i32 %114, %115
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sdiv i32 %120, %121
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %116, i32 noundef %122)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %124

124:                                              ; preds = %97
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %7, align 4, !tbaa !5
  br label %92, !llvm.loop !12

127:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void

128:                                              ; preds = %88
  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 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 void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt3gcdIiiENSt11common_typeIJT_T0_EE4typeES1_S2_(i32 noundef, i32 noundef) #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 = { 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 #4 = { 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}


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

@_ZZ5solvevE3deg = external hidden local_unnamed_addr global [100001 x i32], align 16
@_ZZ5solvevE3dsu = external hidden global [100001 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph.preheader, label %.preheader16

.lr.ph.preheader:                                 ; preds = %0
  %8 = zext nneg i32 %6 to i64
  %9 = shl nuw nsw i64 %8, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ5solvevE3dsu, i8 -1, i64 %9, i1 false), !tbaa !5
  %min.iters.check = icmp ult i32 %6, 8
  br i1 %min.iters.check, label %.lr.ph.preheader34, label %vector.ph

.lr.ph.preheader34:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %8, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %10 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %index
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %10, align 16, !tbaa !5
  store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %11, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %12 = icmp eq i64 %index.next, %n.vec
  br i1 %12, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %8
  br i1 %cmp.n, label %.preheader16, label %.lr.ph.preheader34

.preheader16:                                     ; preds = %.lr.ph, %middle.block, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = add nsw i32 %13, -1
  store i32 %14, ptr %2, align 4, !tbaa !5
  %.not18 = icmp eq i32 %13, 0
  br i1 %.not18, label %.preheader, label %.lr.ph19

.lr.ph:                                           ; preds = %.lr.ph.preheader34, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ %indvars.iv.ph, %.lr.ph.preheader34 ]
  %15 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv
  store i32 1, ptr %15, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %8
  br i1 %exitcond.not, label %.preheader16, label %.lr.ph, !llvm.loop !13

.preheader.loopexit:                              ; preds = %55
  %.pre32 = load i32, ptr %1, align 4, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader16
  %16 = phi i32 [ %.pre32, %.preheader.loopexit ], [ %6, %.preheader16 ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph21, label %._crit_edge

.lr.ph19:                                         ; preds = %.preheader16, %55
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  store i32 %20, ptr %3, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %22, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = add nsw i32 %25, -1
  store i32 %26, ptr %4, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %28, align 4, !tbaa !5
  %31 = call noundef i32 @_Z7dsuFindPii(ptr noundef nonnull @_ZZ5solvevE3dsu, i32 noundef %20)
  store i32 %31, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = call noundef i32 @_Z7dsuFindPii(ptr noundef nonnull @_ZZ5solvevE3dsu, i32 noundef %32)
  store i32 %33, ptr %4, align 4, !tbaa !5
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %36, align 4, !tbaa !5
  %39 = sext i32 %33 to i64
  %40 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr %40, align 4, !tbaa !5
  %43 = icmp eq i32 %34, %33
  br i1 %43, label %55, label %44, !llvm.loop !14

44:                                               ; preds = %.lr.ph19
  %45 = load i32, ptr %36, align 4, !tbaa !5
  %46 = icmp slt i32 %45, %42
  br i1 %46, label %47, label %48

47:                                               ; preds = %44
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4) #6
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  %.phi.trans.insert = sext i32 %.pre to i64
  %.phi.trans.insert26 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %.phi.trans.insert
  %.pre27 = load i32, ptr %.phi.trans.insert26, align 4, !tbaa !5
  %.pre28 = load i32, ptr %4, align 4, !tbaa !5
  %.phi.trans.insert29 = sext i32 %.pre28 to i64
  %.phi.trans.insert30 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %.phi.trans.insert29
  %.pre31 = load i32, ptr %.phi.trans.insert30, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %47, %44
  %.pre-phi33 = phi i64 [ %.phi.trans.insert29, %47 ], [ %39, %44 ]
  %.pre-phi = phi i64 [ %.phi.trans.insert, %47 ], [ %35, %44 ]
  %49 = phi i32 [ %.pre31, %47 ], [ %42, %44 ]
  %50 = phi i32 [ %.pre28, %47 ], [ %33, %44 ]
  %51 = phi i32 [ %.pre27, %47 ], [ %45, %44 ]
  %52 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %.pre-phi
  %53 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %.pre-phi33
  %54 = add nsw i32 %49, %51
  store i32 %54, ptr %53, align 4, !tbaa !5
  store i32 %50, ptr %52, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %.lr.ph19, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = add nsw i32 %56, -1
  store i32 %57, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %56, 0
  br i1 %.not, label %.preheader.loopexit, label %.lr.ph19

._crit_edge:                                      ; preds = %.lr.ph21, %.preheader
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void

.lr.ph21:                                         ; preds = %.preheader, %.lr.ph21
  %indvars.iv23 = phi i64 [ %indvars.iv.next24, %.lr.ph21 ], [ 0, %.preheader ]
  %58 = trunc nuw nsw i64 %indvars.iv23 to i32
  %59 = call noundef i32 @_Z7dsuFindPii(ptr noundef nonnull @_ZZ5solvevE3dsu, i32 noundef %58)
  %60 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3deg, i64 0, i64 %indvars.iv23
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = sext i32 %59 to i64
  %63 = getelementptr inbounds [100001 x i32], ptr @_ZZ5solvevE3dsu, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = sub nsw i32 0, %64
  %66 = call noundef i32 @_ZSt3gcdIiiENSt11common_typeIJT_T0_EE4typeES1_S2_(i32 noundef %61, i32 noundef %65) #6
  %67 = load i32, ptr %63, align 4, !tbaa !5
  %68 = sdiv i32 %67, %66
  %69 = sub nsw i32 0, %68
  %70 = load i32, ptr %60, align 4, !tbaa !5
  %71 = sdiv i32 %70, %66
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %69, i32 noundef %71)
  %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
  %73 = load i32, ptr %1, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv.next24, %74
  br i1 %75, label %.lr.ph21, label %._crit_edge, !llvm.loop !15
}

; 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 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 void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZSt3gcdIiiENSt11common_typeIJT_T0_EE4typeES1_S2_(i32 noundef, i32 noundef) local_unnamed_addr #4

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

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

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 = { 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 = { 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 #4 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass