; LLVM IR from tangjz/acm-icpc :: lydsy (1005)

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

%struct.Big_int = type { i32, [3000 x i32] }

@ans = external dso_local global %struct.Big_int, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@degree = external dso_local global [1001 x i32], align 16
@sum = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.Big_int, align 4
  %6 = alloca %struct.Big_int, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.Big_int, align 4
  %9 = alloca %struct.Big_int, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %37, %0
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = load i32, ptr @n, align 4, !tbaa !5
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %15, label %40

15:                                               ; preds = %11
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %17
  %19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %18)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !5
  %24 = icmp eq i32 %23, -1
  br i1 %24, label %25, label %28

25:                                               ; preds = %15
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr @m, align 4, !tbaa !5
  br label %36

28:                                               ; preds = %15
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sub nsw i32 %32, 1
  %34 = load i32, ptr @sum, align 4, !tbaa !5
  %35 = add nsw i32 %34, %33
  store i32 %35, ptr @sum, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %28, %25
  br label %37

37:                                               ; preds = %36
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !9

40:                                               ; preds = %11
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = sub nsw i32 %41, 2
  %43 = load i32, ptr @sum, align 4, !tbaa !5
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %40
  %46 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %114

47:                                               ; preds = %40
  store i32 1, ptr getelementptr inbounds (%struct.Big_int, ptr @ans, i32 0, i32 1), align 4, !tbaa !5
  store i32 1, ptr @ans, align 4, !tbaa !11
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %56, %47
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = load i32, ptr @n, align 4, !tbaa !5
  %51 = sub nsw i32 %50, 2
  %52 = load i32, ptr @sum, align 4, !tbaa !5
  %53 = sub nsw i32 %51, %52
  %54 = icmp sle i32 %49, %53
  br i1 %54, label %55, label %59

55:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 12004, ptr %5) #4
  call void @_ZN7Big_intmLERKi(ptr dead_on_unwind writable sret(%struct.Big_int) align 4 %5, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.end.p0(i64 12004, ptr %5) #4
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %2, align 4, !tbaa !5
  br label %48, !llvm.loop !13

59:                                               ; preds = %48
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %66, %59
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sub nsw i32 %62, 2
  %64 = icmp sle i32 %61, %63
  br i1 %64, label %65, label %69

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 12004, ptr %6) #4
  call void @_ZN7Big_intmLERKi(ptr dead_on_unwind writable sret(%struct.Big_int) align 4 %6, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 12004, ptr %6) #4
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %2, align 4, !tbaa !5
  br label %60, !llvm.loop !14

69:                                               ; preds = %60
  %70 = load i32, ptr @n, align 4, !tbaa !5
  %71 = sub nsw i32 %70, 2
  store i32 %71, ptr %2, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %81, %69
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = load i32, ptr @sum, align 4, !tbaa !5
  %75 = icmp sgt i32 %73, %74
  br i1 %75, label %76, label %84

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = sub nsw i32 %77, %78
  %80 = sub nsw i32 %79, 1
  store i32 %80, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12004, ptr %8) #4
  call void @_ZN7Big_intdVERKi(ptr dead_on_unwind writable sret(%struct.Big_int) align 4 %8, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 12004, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %81

81:                                               ; preds = %76
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = add nsw i32 %82, -1
  store i32 %83, ptr %2, align 4, !tbaa !5
  br label %72, !llvm.loop !15

84:                                               ; preds = %72
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %110, %84
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = icmp sle i32 %86, %87
  br i1 %88, label %89, label %113

89:                                               ; preds = %85
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = icmp ne i32 %93, -1
  br i1 %94, label %95, label %109

95:                                               ; preds = %89
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %105, %95
  %97 = load i32, ptr %3, align 4, !tbaa !5
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = sub nsw i32 %101, 1
  %103 = icmp sle i32 %97, %102
  br i1 %103, label %104, label %108

104:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 12004, ptr %9) #4
  call void @_ZN7Big_intdVERKi(ptr dead_on_unwind writable sret(%struct.Big_int) align 4 %9, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 12004, ptr %9) #4
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %3, align 4, !tbaa !5
  br label %96, !llvm.loop !16

108:                                              ; preds = %96
  br label %109

109:                                              ; preds = %108, %89
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %2, align 4, !tbaa !5
  br label %85, !llvm.loop !17

113:                                              ; preds = %85
  call void @_ZNK7Big_int5PrintEv(ptr noundef nonnull align 4 dereferenceable(12004) @ans)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %114

114:                                              ; preds = %113, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %115 = load i32, ptr %1, align 4
  ret i32 %115
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Big_intmLERKi(ptr dead_on_unwind noalias writable sret(%struct.Big_int) align 4, ptr noundef nonnull align 4 dereferenceable(12004), ptr noundef nonnull align 4 dereferenceable(4)) #3 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: mustprogress uwtable
declare dso_local void @_ZN7Big_intdVERKi(ptr dead_on_unwind noalias writable sret(%struct.Big_int) align 4, ptr noundef nonnull align 4 dereferenceable(12004), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Big_int5PrintEv(ptr noundef nonnull align 4 dereferenceable(12004)) #3 align 2

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

%struct.Big_int = type { i32, [3000 x i32] }

@ans = external dso_local global %struct.Big_int, align 4
@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@degree = external dso_local global [1001 x i32], align 16
@sum = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %struct.Big_int, align 4
  %4 = alloca %struct.Big_int, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.Big_int, align 4
  %7 = alloca %struct.Big_int, 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
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %9 = load i32, ptr @n, align 4, !tbaa !5
  %.not19 = icmp slt i32 %9, 1
  br i1 %.not19, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %21
  %indvars.iv = phi i64 [ %indvars.iv.next, %21 ], [ 1, %0 ]
  %10 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %indvars.iv
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %10)
  %12 = load i32, ptr %10, align 4, !tbaa !5
  %13 = icmp eq i32 %12, -1
  br i1 %13, label %14, label %17

14:                                               ; preds = %.lr.ph
  %15 = load i32, ptr @m, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr @m, align 4, !tbaa !5
  br label %21

17:                                               ; preds = %.lr.ph
  %18 = add nsw i32 %12, -1
  %19 = load i32, ptr @sum, align 4, !tbaa !5
  %20 = add nsw i32 %18, %19
  store i32 %20, ptr @sum, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %14, %17
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @n, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %.not.not = icmp slt i64 %indvars.iv, %23
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %21, %0
  %24 = phi i32 [ %9, %0 ], [ %22, %21 ]
  %25 = add nsw i32 %24, -2
  %26 = load i32, ptr @sum, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %28, label %30

28:                                               ; preds = %._crit_edge
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %69

30:                                               ; preds = %._crit_edge
  store i32 1, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  store i32 1, ptr @ans, align 4, !tbaa !11
  %31 = sub i32 %25, %26
  %.not623 = icmp slt i32 %31, 1
  br i1 %.not623, label %.preheader17, label %.lr.ph25

.preheader17:                                     ; preds = %.lr.ph25, %30
  %.pre-phi = phi i32 [ %25, %30 ], [ %37, %.lr.ph25 ]
  %32 = phi i32 [ %26, %30 ], [ %38, %.lr.ph25 ]
  %33 = phi i32 [ %24, %30 ], [ %36, %.lr.ph25 ]
  store i32 1, ptr %1, align 4, !tbaa !5
  %.not826 = icmp slt i32 %33, 3
  br i1 %.not826, label %.preheader16, label %.lr.ph27

.lr.ph25:                                         ; preds = %30, %.lr.ph25
  %34 = phi i32 [ %35, %.lr.ph25 ], [ 1, %30 ]
  call void @llvm.lifetime.start.p0(i64 12004, ptr nonnull %3) #4
  call void @_ZN7Big_intmLERKi(ptr dead_on_unwind nonnull writable sret(%struct.Big_int) align 4 %3, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) @m)
  call void @llvm.lifetime.end.p0(i64 12004, ptr nonnull %3) #4
  %35 = add nuw nsw i32 %34, 1
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = add nsw i32 %36, -2
  %38 = load i32, ptr @sum, align 4, !tbaa !5
  %39 = sub i32 %37, %38
  %.not6.not = icmp slt i32 %34, %39
  br i1 %.not6.not, label %.lr.ph25, label %.preheader17, !llvm.loop !13

.preheader16.loopexit:                            ; preds = %.lr.ph27
  %.pre = load i32, ptr @sum, align 4, !tbaa !5
  br label %.preheader16

.preheader16:                                     ; preds = %.preheader16.loopexit, %.preheader17
  %40 = phi i32 [ %33, %.preheader17 ], [ %45, %.preheader16.loopexit ]
  %41 = phi i32 [ %32, %.preheader17 ], [ %.pre, %.preheader16.loopexit ]
  %.lcssa = phi i32 [ %.pre-phi, %.preheader17 ], [ %46, %.preheader16.loopexit ]
  store i32 %.lcssa, ptr %1, align 4, !tbaa !5
  %42 = icmp sgt i32 %.lcssa, %41
  br i1 %42, label %.lr.ph30, label %.preheader15

.lr.ph27:                                         ; preds = %.preheader17, %.lr.ph27
  call void @llvm.lifetime.start.p0(i64 12004, ptr nonnull %4) #4
  call void @_ZN7Big_intmLERKi(ptr dead_on_unwind nonnull writable sret(%struct.Big_int) align 4 %4, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 12004, ptr nonnull %4) #4
  %43 = load i32, ptr %1, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %1, align 4, !tbaa !5
  %45 = load i32, ptr @n, align 4, !tbaa !5
  %46 = add nsw i32 %45, -2
  %.not8.not = icmp slt i32 %43, %46
  br i1 %.not8.not, label %.lr.ph27, label %.preheader16.loopexit, !llvm.loop !14

.preheader15.loopexit:                            ; preds = %.lr.ph30
  %.pre41 = load i32, ptr @n, align 4, !tbaa !5
  br label %.preheader15

.preheader15:                                     ; preds = %.preheader15.loopexit, %.preheader16
  %47 = phi i32 [ %.pre41, %.preheader15.loopexit ], [ %40, %.preheader16 ]
  store i32 1, ptr %1, align 4, !tbaa !5
  %.not1133 = icmp slt i32 %47, 1
  br i1 %.not1133, label %._crit_edge36, label %.lr.ph35

.lr.ph30:                                         ; preds = %.preheader16, %.lr.ph30
  %storemerge929 = phi i32 [ %52, %.lr.ph30 ], [ %.lcssa, %.preheader16 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = xor i32 %storemerge929, -1
  %50 = add i32 %48, %49
  store i32 %50, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12004, ptr nonnull %6) #4
  call void @_ZN7Big_intdVERKi(ptr dead_on_unwind nonnull writable sret(%struct.Big_int) align 4 %6, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) %5)
  call void @llvm.lifetime.end.p0(i64 12004, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  %51 = load i32, ptr %1, align 4, !tbaa !5
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr %1, align 4, !tbaa !5
  %53 = load i32, ptr @sum, align 4, !tbaa !5
  %54 = icmp sgt i32 %52, %53
  br i1 %54, label %.lr.ph30, label %.preheader15.loopexit, !llvm.loop !15

.lr.ph35:                                         ; preds = %.preheader15, %.loopexit
  %55 = phi i32 [ %66, %.loopexit ], [ %47, %.preheader15 ]
  %56 = phi i32 [ %68, %.loopexit ], [ 1, %.preheader15 ]
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %.not12 = icmp eq i32 %59, -1
  br i1 %.not12, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.lr.ph35
  store i32 1, ptr %2, align 4, !tbaa !5
  %.not14.not31 = icmp sgt i32 %59, 1
  br i1 %.not14.not31, label %.lr.ph32, label %.loopexit

.lr.ph32:                                         ; preds = %.preheader, %.lr.ph32
  call void @llvm.lifetime.start.p0(i64 12004, ptr nonnull %7) #4
  call void @_ZN7Big_intdVERKi(ptr dead_on_unwind nonnull writable sret(%struct.Big_int) align 4 %7, ptr noundef nonnull align 4 dereferenceable(12004) @ans, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.end.p0(i64 12004, ptr nonnull %7) #4
  %60 = load i32, ptr %2, align 4, !tbaa !5
  %61 = add nsw i32 %60, 1
  store i32 %61, ptr %2, align 4, !tbaa !5
  %62 = load i32, ptr %1, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [1001 x i32], ptr @degree, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %.not14.not = icmp slt i32 %61, %65
  br i1 %.not14.not, label %.lr.ph32, label %.loopexit.loopexit, !llvm.loop !16

.loopexit.loopexit:                               ; preds = %.lr.ph32
  %.pre42 = load i32, ptr @n, align 4, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.preheader, %.lr.ph35
  %66 = phi i32 [ %.pre42, %.loopexit.loopexit ], [ %55, %.preheader ], [ %55, %.lr.ph35 ]
  %67 = phi i32 [ %62, %.loopexit.loopexit ], [ %56, %.preheader ], [ %56, %.lr.ph35 ]
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %1, align 4, !tbaa !5
  %.not11.not = icmp slt i32 %67, %66
  br i1 %.not11.not, label %.lr.ph35, label %._crit_edge36, !llvm.loop !17

._crit_edge36:                                    ; preds = %.loopexit, %.preheader15
  call void @_ZNK7Big_int5PrintEv(ptr noundef nonnull align 4 dereferenceable(12004) @ans)
  br label %69

69:                                               ; preds = %._crit_edge36, %28
  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 i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Big_intmLERKi(ptr dead_on_unwind noalias writable sret(%struct.Big_int) align 4, ptr noundef nonnull align 4 dereferenceable(12004), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 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: mustprogress uwtable
declare dso_local void @_ZN7Big_intdVERKi(ptr dead_on_unwind noalias writable sret(%struct.Big_int) align 4, ptr noundef nonnull align 4 dereferenceable(12004), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK7Big_int5PrintEv(ptr noundef nonnull align 4 dereferenceable(12004)) local_unnamed_addr #3 align 2

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass