; LLVM IR from tangjz/acm-icpc :: luogu (2405)

; 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, [2550 x i32] }

@ch = external dso_local global [10050 x i8], align 16
@n = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@res = external dso_local global [33220 x i32], align 16
@f = external dso_local global [33220 x [2 x i32]], align 16
@A = external dso_local global %struct.Big_int, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.Big_int, 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
  store i32 0, ptr %1, align 4
  call void @_ZN7Big_int9getstringEv(ptr noundef nonnull align 4 dereferenceable(10204) @A)
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp eq i32 %10, 1
  br i1 %11, label %12, label %14

12:                                               ; preds = %0
  %13 = call i32 @puts(ptr noundef @ch)
  store i32 0, ptr %1, align 4
  br label %126

14:                                               ; preds = %0
  br label %15

15:                                               ; preds = %25, %14
  %16 = load i32, ptr @A, align 4, !tbaa !9
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %22

18:                                               ; preds = %15
  %19 = load i32, ptr getelementptr inbounds (%struct.Big_int, ptr @A, i32 0, i32 1), align 4, !tbaa !5
  %20 = icmp ne i32 %19, 0
  %21 = xor i1 %20, true
  br label %22

22:                                               ; preds = %18, %15
  %23 = phi i1 [ false, %15 ], [ %21, %18 ]
  %24 = xor i1 %23, true
  br i1 %24, label %25, label %31

25:                                               ; preds = %22
  %26 = call noundef i32 @_ZNK7Big_intrmERKi(ptr noundef nonnull align 4 dereferenceable(10204) @A, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %27 = load i32, ptr @d, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @d, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %29
  store i32 %26, ptr %30, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 10204, ptr %2) #6
  call void @_ZN7Big_intdVERKi(ptr dead_on_unwind writable sret(%struct.Big_int) align 4 %2, ptr noundef nonnull align 4 dereferenceable(10204) @A, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.end.p0(i64 10204, ptr %2) #6
  br label %15, !llvm.loop !11

31:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %32 = load i32, ptr @d, align 4, !tbaa !5
  store i32 %32, ptr %4, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %45, %31
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = icmp sle i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %50

38:                                               ; preds = %33
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %40
  %42 = load i32, ptr %4, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %43
  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) %41, ptr noundef nonnull align 4 dereferenceable(4) %44) #6
  br label %45

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

50:                                               ; preds = %37
  %51 = load i32, ptr getelementptr inbounds ([33220 x i32], ptr @res, i64 0, i64 1), align 4, !tbaa !5
  store i32 %51, ptr getelementptr inbounds ([33220 x [2 x i32]], ptr @f, i64 0, i64 1), align 8, !tbaa !5
  %52 = load i32, ptr @n, align 4, !tbaa !5
  %53 = load i32, ptr getelementptr inbounds ([33220 x i32], ptr @res, i64 0, i64 1), align 4, !tbaa !5
  %54 = sub nsw i32 %52, %53
  store i32 %54, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([33220 x [2 x i32]], ptr @f, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %109, %50
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = load i32, ptr @d, align 4, !tbaa !5
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %112

60:                                               ; preds = %55
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %63
  %65 = getelementptr inbounds [2 x i32], ptr %64, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = sub nsw i32 %66, 1
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %68
  %70 = getelementptr inbounds [2 x i32], ptr %69, i64 0, i64 1
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %6, align 4, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %65, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = add nsw i32 %74, %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %81
  %83 = getelementptr inbounds [2 x i32], ptr %82, i64 0, i64 0
  store i32 %79, ptr %83, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %86
  %88 = getelementptr inbounds [2 x i32], ptr %87, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %89 = load i32, ptr %5, align 4, !tbaa !5
  %90 = sub nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %91
  %93 = getelementptr inbounds [2 x i32], ptr %92, i64 0, i64 1
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  store i32 %95, ptr %7, align 4, !tbaa !5
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %88, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = add nsw i32 %97, %98
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = sub nsw i32 %99, %103
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %106
  %108 = getelementptr inbounds [2 x i32], ptr %107, i64 0, i64 1
  store i32 %104, ptr %108, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %109

109:                                              ; preds = %60
  %110 = load i32, ptr %5, align 4, !tbaa !5
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %5, align 4, !tbaa !5
  br label %55, !llvm.loop !14

112:                                              ; preds = %59
  %113 = load i32, ptr @d, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %114
  %116 = getelementptr inbounds [2 x i32], ptr %115, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %117 = load i32, ptr @d, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %118
  %120 = getelementptr inbounds [2 x i32], ptr %119, i64 0, i64 1
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %8, align 4, !tbaa !5
  %123 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %116, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %124)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  store i32 0, ptr %1, align 4
  br label %126

126:                                              ; preds = %112, %12
  %127 = load i32, ptr %1, align 4
  ret i32 %127
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Big_int9getstringEv(ptr noundef nonnull align 4 dereferenceable(10204)) #1 align 2

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

declare i32 @puts(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Big_intrmERKi(ptr noundef nonnull align 4 dereferenceable(10204), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; 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(10204), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

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

; 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)) #5

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

declare i32 @printf(ptr noundef, ...) #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 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 #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS7Big_int", !6, i64 0, !7, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


; 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, [2550 x i32] }

@ch = external dso_local global [10050 x i8], align 16
@n = external dso_local global i32, align 4
@d = external dso_local local_unnamed_addr global i32, align 4
@res = external dso_local global [33220 x i32], align 16
@f = external dso_local global [33220 x [2 x i32]], align 16
@A = external dso_local global %struct.Big_int, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.Big_int, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  tail call void @_ZN7Big_int9getstringEv(ptr noundef nonnull align 4 dereferenceable(10204) @A)
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %11, label %.preheader

.preheader:                                       ; preds = %0
  %8 = load i32, ptr @A, align 4, !tbaa !9
  %9 = icmp ne i32 %8, 1
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4
  %.not25 = icmp ne i32 %10, 0
  %.not2226 = select i1 %9, i1 true, i1 %.not25
  br i1 %.not2226, label %.lr.ph, label %._crit_edge

11:                                               ; preds = %0
  %12 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @ch)
  br label %61

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %13 = call noundef i32 @_ZNK7Big_intrmERKi(ptr noundef nonnull align 4 dereferenceable(10204) @A, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %14 = load i32, ptr @d, align 4, !tbaa !5
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @d, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %16
  store i32 %13, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 10204, ptr nonnull %1) #6
  call void @_ZN7Big_intdVERKi(ptr dead_on_unwind nonnull writable sret(%struct.Big_int) align 4 %1, ptr noundef nonnull align 4 dereferenceable(10204) @A, ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @llvm.lifetime.end.p0(i64 10204, ptr nonnull %1) #6
  %18 = load i32, ptr @A, align 4, !tbaa !9
  %19 = icmp ne i32 %18, 1
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @A, i64 4), align 4
  %.not = icmp ne i32 %20, 0
  %.not22 = select i1 %19, i1 true, i1 %.not
  br i1 %.not22, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %21 = load i32, ptr @d, align 4, !tbaa !5
  %.not2327 = icmp slt i32 %21, 1
  br i1 %.not2327, label %._crit_edge32.thread, label %.lr.ph31.preheader

._crit_edge32.thread:                             ; preds = %._crit_edge
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @res, i64 4), align 4, !tbaa !5
  store i32 %22, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = sub nsw i32 %23, %22
  store i32 %24, ptr getelementptr inbounds (i8, ptr @f, i64 12), align 4, !tbaa !5
  br label %._crit_edge32.._crit_edge37_crit_edge

.lr.ph31.preheader:                               ; preds = %._crit_edge
  %25 = zext nneg i32 %21 to i64
  br label %.lr.ph31

._crit_edge32:                                    ; preds = %.lr.ph31
  %.pre = load i32, ptr @d, align 4, !tbaa !5
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @res, i64 4), align 4, !tbaa !5
  store i32 %26, ptr getelementptr inbounds (i8, ptr @f, i64 8), align 8, !tbaa !5
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = sub nsw i32 %27, %26
  store i32 %28, ptr getelementptr inbounds (i8, ptr @f, i64 12), align 4, !tbaa !5
  %.not2433 = icmp slt i32 %.pre, 2
  br i1 %.not2433, label %._crit_edge32.._crit_edge37_crit_edge, label %.lr.ph36

._crit_edge32.._crit_edge37_crit_edge:            ; preds = %._crit_edge32.thread, %._crit_edge32
  %29 = phi i32 [ %21, %._crit_edge32.thread ], [ %.pre, %._crit_edge32 ]
  %.pre47 = sext i32 %29 to i64
  br label %._crit_edge37

.lr.ph31:                                         ; preds = %.lr.ph31.preheader, %.lr.ph31
  %indvars.iv39 = phi i64 [ 1, %.lr.ph31.preheader ], [ %indvars.iv.next40, %.lr.ph31 ]
  %indvars.iv = phi i64 [ %25, %.lr.ph31.preheader ], [ %indvars.iv.next, %.lr.ph31 ]
  %30 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %indvars.iv39
  %31 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %indvars.iv
  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) %30, ptr noundef nonnull align 4 dereferenceable(4) %31) #6
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not23.not = icmp slt i64 %indvars.iv39, %indvars.iv.next
  br i1 %.not23.not, label %.lr.ph31, label %._crit_edge32, !llvm.loop !13

._crit_edge37:                                    ; preds = %.lr.ph36, %._crit_edge32.._crit_edge37_crit_edge
  %.pre-phi = phi i64 [ %.pre47, %._crit_edge32.._crit_edge37_crit_edge ], [ %60, %.lr.ph36 ]
  %32 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %.pre-phi
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %33 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %.pre-phi, i64 1
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %4, align 4, !tbaa !5
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %37)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %61

.lr.ph36:                                         ; preds = %._crit_edge32, %.lr.ph36
  %39 = phi i32 [ %57, %.lr.ph36 ], [ %28, %._crit_edge32 ]
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.lr.ph36 ], [ 2, %._crit_edge32 ]
  %40 = add nsw i64 %indvars.iv44, -1
  %41 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %42 = getelementptr inbounds i8, ptr %41, i64 4
  %43 = add nsw i32 %39, 1
  store i32 %43, ptr %2, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = getelementptr inbounds [33220 x i32], ptr @res, i64 0, i64 %indvars.iv44
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, %45
  %49 = getelementptr inbounds [33220 x [2 x i32]], ptr @f, i64 0, i64 %indvars.iv44
  store i32 %48, ptr %49, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %50 = load i32, ptr %42, align 4, !tbaa !5
  %51 = add nsw i32 %50, -1
  store i32 %51, ptr %3, align 4, !tbaa !5
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = add nsw i32 %54, %53
  %56 = load i32, ptr %46, align 4, !tbaa !5
  %57 = sub i32 %55, %56
  %58 = getelementptr inbounds i8, ptr %49, i64 4
  store i32 %57, ptr %58, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %59 = load i32, ptr @d, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %.not24.not = icmp slt i64 %indvars.iv44, %60
  br i1 %.not24.not, label %.lr.ph36, label %._crit_edge37, !llvm.loop !14

61:                                               ; preds = %._crit_edge37, %11
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7Big_int9getstringEv(ptr noundef nonnull align 4 dereferenceable(10204)) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK7Big_intrmERKi(ptr noundef nonnull align 4 dereferenceable(10204), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; 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(10204), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

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

; 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 #5

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 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 #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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!10, !6, i64 0}
!10 = !{!"_ZTS7Big_int", !6, i64 0, !7, i64 4}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}


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