; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/122 Division 1/Problem C (C)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@h = external dso_local global [6 x i32], align 16
@ans = external dso_local global [7 x i32], align 16
@res = external dso_local global i32, align 4
@_Z2s1B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2s2B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2s3B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2s4B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addi(i32 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %6

6:                                                ; preds = %20, %0
  %7 = load i32, ptr %3, align 4, !tbaa !5
  %8 = icmp slt i32 %7, 6
  br i1 %8, label %10, label %9

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

10:                                               ; preds = %6
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [6 x i32], ptr @h, i64 0, i64 %12
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %13)
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds [6 x i32], ptr @h, i64 0, i64 %16
  %18 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %19 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %19, ptr %2, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %10
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = add nsw i32 %21, 1
  store i32 %22, ptr %3, align 4, !tbaa !5
  br label %6, !llvm.loop !9

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

24:                                               ; preds = %31, %23
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = icmp sle i32 %25, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %34

29:                                               ; preds = %24
  %30 = load i32, ptr %4, align 4, !tbaa !5
  call void @_Z5solvei(i32 noundef %30)
  br label %31

31:                                               ; preds = %29
  %32 = load i32, ptr %4, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %4, align 4, !tbaa !5
  br label %24, !llvm.loop !11

34:                                               ; preds = %28
  %35 = load i32, ptr @res, align 4, !tbaa !5
  %36 = icmp eq i32 %35, 1000000000
  br i1 %36, label %37, label %39

37:                                               ; preds = %34
  %38 = call i32 @puts(ptr noundef @.str.5)
  br label %70

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %55, %39
  %41 = load i32, ptr %5, align 4, !tbaa !5
  %42 = icmp slt i32 %41, 7
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %40
  br label %45

45:                                               ; preds = %52, %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [7 x i32], ptr @ans, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr %48, align 4, !tbaa !5
  %51 = icmp ne i32 %49, 0
  br i1 %51, label %52, label %54

52:                                               ; preds = %45
  %53 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z3addi(i32 noundef %53)
  br label %45, !llvm.loop !12

54:                                               ; preds = %45
  br label %55

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

58:                                               ; preds = %43
  %59 = load i32, ptr @res, align 4, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %59)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s1B5cxx11)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s2B5cxx11)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s3B5cxx11)
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s4B5cxx11)
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %68, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %70

70:                                               ; preds = %58, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  ret i32 0
}

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

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

declare i32 @puts(ptr noundef) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) #1

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 = { inlinehint 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { "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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@h = external dso_local global [6 x i32], align 16
@ans = external dso_local local_unnamed_addr global [7 x i32], align 16
@res = external dso_local local_unnamed_addr global i32, align 4
@_Z2s1B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2s2B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2s3B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@_Z2s4B5cxx11 = external dso_local global %"class.std::__cxx11::basic_string", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addi(i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5solvei(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
.preheader15:
  %0 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %0) #7
  store i32 0, ptr %0, align 4, !tbaa !5
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @h)
  %2 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) @h)
  %3 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %3, ptr %0, align 4, !tbaa !5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @h, i64 4))
  %5 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @h, i64 4))
  %6 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %6, ptr %0, align 4, !tbaa !5
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @h, i64 8))
  %8 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @h, i64 8))
  %9 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %9, ptr %0, align 4, !tbaa !5
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @h, i64 12))
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @h, i64 12))
  %12 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %12, ptr %0, align 4, !tbaa !5
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @h, i64 16))
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @h, i64 16))
  %15 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %15, ptr %0, align 4, !tbaa !5
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (i8, ptr @h, i64 20))
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %0, ptr noundef nonnull align 4 dereferenceable(4) getelementptr inbounds (i8, ptr @h, i64 20))
  %18 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %18, ptr %0, align 4, !tbaa !5
  %.not17 = icmp slt i32 %18, 0
  br i1 %.not17, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %.preheader15
  %19 = load i32, ptr @res, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 1000000000
  br i1 %20, label %25, label %.preheader.preheader

.preheader.preheader:                             ; preds = %._crit_edge
  %21 = load i32, ptr @ans, align 16, !tbaa !5
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr @ans, align 16, !tbaa !5
  %.not1319 = icmp eq i32 %21, 0
  br i1 %.not1319, label %._crit_edge21, label %.lr.ph20

.lr.ph:                                           ; preds = %.preheader15, %.lr.ph
  %.01118 = phi i32 [ %23, %.lr.ph ], [ 0, %.preheader15 ]
  call void @_Z5solvei(i32 noundef %.01118)
  %23 = add nuw nsw i32 %.01118, 1
  %24 = load i32, ptr %0, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.01118, %24
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

25:                                               ; preds = %._crit_edge
  %26 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.5)
  br label %64

.lr.ph20:                                         ; preds = %.preheader.preheader, %.lr.ph20
  call void @_Z3addi(i32 noundef 0)
  %27 = load i32, ptr @ans, align 16, !tbaa !5
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr @ans, align 16, !tbaa !5
  %.not13 = icmp eq i32 %27, 0
  br i1 %.not13, label %._crit_edge21, label %.lr.ph20, !llvm.loop !11

._crit_edge21:                                    ; preds = %.lr.ph20, %.preheader.preheader
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  %.not1319.1 = icmp eq i32 %29, 0
  br i1 %.not1319.1, label %._crit_edge21.1, label %.lr.ph20.1

.lr.ph20.1:                                       ; preds = %._crit_edge21, %.lr.ph20.1
  call void @_Z3addi(i32 noundef 1)
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  %32 = add nsw i32 %31, -1
  store i32 %32, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  %.not13.1 = icmp eq i32 %31, 0
  br i1 %.not13.1, label %._crit_edge21.1, label %.lr.ph20.1, !llvm.loop !11

._crit_edge21.1:                                  ; preds = %.lr.ph20.1, %._crit_edge21
  %33 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 8), align 8, !tbaa !5
  %34 = add nsw i32 %33, -1
  store i32 %34, ptr getelementptr inbounds (i8, ptr @ans, i64 8), align 8, !tbaa !5
  %.not1319.2 = icmp eq i32 %33, 0
  br i1 %.not1319.2, label %._crit_edge21.2, label %.lr.ph20.2

.lr.ph20.2:                                       ; preds = %._crit_edge21.1, %.lr.ph20.2
  call void @_Z3addi(i32 noundef 2)
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 8), align 8, !tbaa !5
  %36 = add nsw i32 %35, -1
  store i32 %36, ptr getelementptr inbounds (i8, ptr @ans, i64 8), align 8, !tbaa !5
  %.not13.2 = icmp eq i32 %35, 0
  br i1 %.not13.2, label %._crit_edge21.2, label %.lr.ph20.2, !llvm.loop !11

._crit_edge21.2:                                  ; preds = %.lr.ph20.2, %._crit_edge21.1
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 12), align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr getelementptr inbounds (i8, ptr @ans, i64 12), align 4, !tbaa !5
  %.not1319.3 = icmp eq i32 %37, 0
  br i1 %.not1319.3, label %._crit_edge21.3, label %.lr.ph20.3

.lr.ph20.3:                                       ; preds = %._crit_edge21.2, %.lr.ph20.3
  call void @_Z3addi(i32 noundef 3)
  %39 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 12), align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  store i32 %40, ptr getelementptr inbounds (i8, ptr @ans, i64 12), align 4, !tbaa !5
  %.not13.3 = icmp eq i32 %39, 0
  br i1 %.not13.3, label %._crit_edge21.3, label %.lr.ph20.3, !llvm.loop !11

._crit_edge21.3:                                  ; preds = %.lr.ph20.3, %._crit_edge21.2
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 16), align 16, !tbaa !5
  %42 = add nsw i32 %41, -1
  store i32 %42, ptr getelementptr inbounds (i8, ptr @ans, i64 16), align 16, !tbaa !5
  %.not1319.4 = icmp eq i32 %41, 0
  br i1 %.not1319.4, label %._crit_edge21.4, label %.lr.ph20.4

.lr.ph20.4:                                       ; preds = %._crit_edge21.3, %.lr.ph20.4
  call void @_Z3addi(i32 noundef 4)
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 16), align 16, !tbaa !5
  %44 = add nsw i32 %43, -1
  store i32 %44, ptr getelementptr inbounds (i8, ptr @ans, i64 16), align 16, !tbaa !5
  %.not13.4 = icmp eq i32 %43, 0
  br i1 %.not13.4, label %._crit_edge21.4, label %.lr.ph20.4, !llvm.loop !11

._crit_edge21.4:                                  ; preds = %.lr.ph20.4, %._crit_edge21.3
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 20), align 4, !tbaa !5
  %46 = add nsw i32 %45, -1
  store i32 %46, ptr getelementptr inbounds (i8, ptr @ans, i64 20), align 4, !tbaa !5
  %.not1319.5 = icmp eq i32 %45, 0
  br i1 %.not1319.5, label %._crit_edge21.5, label %.lr.ph20.5

.lr.ph20.5:                                       ; preds = %._crit_edge21.4, %.lr.ph20.5
  call void @_Z3addi(i32 noundef 5)
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 20), align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr getelementptr inbounds (i8, ptr @ans, i64 20), align 4, !tbaa !5
  %.not13.5 = icmp eq i32 %47, 0
  br i1 %.not13.5, label %._crit_edge21.5, label %.lr.ph20.5, !llvm.loop !11

._crit_edge21.5:                                  ; preds = %.lr.ph20.5, %._crit_edge21.4
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 24), align 8, !tbaa !5
  %50 = add nsw i32 %49, -1
  store i32 %50, ptr getelementptr inbounds (i8, ptr @ans, i64 24), align 8, !tbaa !5
  %.not1319.6 = icmp eq i32 %49, 0
  br i1 %.not1319.6, label %._crit_edge21.6, label %.lr.ph20.6

.lr.ph20.6:                                       ; preds = %._crit_edge21.5, %.lr.ph20.6
  call void @_Z3addi(i32 noundef 6)
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 24), align 8, !tbaa !5
  %52 = add nsw i32 %51, -1
  store i32 %52, ptr getelementptr inbounds (i8, ptr @ans, i64 24), align 8, !tbaa !5
  %.not13.6 = icmp eq i32 %51, 0
  br i1 %.not13.6, label %._crit_edge21.6, label %.lr.ph20.6, !llvm.loop !11

._crit_edge21.6:                                  ; preds = %.lr.ph20.6, %._crit_edge21.5
  %53 = load i32, ptr @res, align 4, !tbaa !5
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %53)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s1B5cxx11)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s2B5cxx11)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %58, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s3B5cxx11)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull align 8 dereferenceable(32) @_Z2s4B5cxx11)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %64

64:                                               ; preds = %._crit_edge21.6, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %0) #7
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1

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 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #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 = { "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 #7 = { 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}


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