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

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

@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

10:                                               ; preds = %168, %0
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = load i32, ptr @a, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  store i32 2, ptr %3, align 4
  br label %171

15:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %16 = load i32, ptr @a, align 4, !tbaa !5
  %17 = load i32, ptr @a, align 4, !tbaa !5
  %18 = mul nsw i32 %16, %17
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = mul nsw i32 %19, %20
  %22 = sub nsw i32 %18, %21
  store i32 %22, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %23)
  %25 = fptosi double %24 to i32
  store i32 %25, ptr %6, align 4, !tbaa !5
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %28 = mul nsw i32 %26, %27
  %29 = load i32, ptr %4, align 4, !tbaa !5
  %30 = icmp eq i32 %28, %29
  br i1 %30, label %31, label %32

31:                                               ; preds = %15
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %56

32:                                               ; preds = %15
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = add nsw i32 %35, 1
  %37 = mul nsw i32 %34, %36
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = icmp eq i32 %37, %38
  br i1 %39, label %40, label %43

40:                                               ; preds = %32
  store i32 1, ptr %5, align 4, !tbaa !5
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %6, align 4, !tbaa !5
  br label %55

43:                                               ; preds = %32
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sub nsw i32 %44, 1
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = sub nsw i32 %46, 1
  %48 = mul nsw i32 %45, %47
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = icmp eq i32 %48, %49
  br i1 %50, label %51, label %54

51:                                               ; preds = %43
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %6, align 4, !tbaa !5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %51, %43
  br label %55

55:                                               ; preds = %54, %40
  br label %56

56:                                               ; preds = %55, %31
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %59, label %164

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

60:                                               ; preds = %158, %59
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = load i32, ptr @b, align 4, !tbaa !5
  %63 = icmp slt i32 %61, %62
  br i1 %63, label %65, label %64

64:                                               ; preds = %60
  store i32 5, ptr %3, align 4
  br label %161

65:                                               ; preds = %60
  %66 = load i32, ptr @b, align 4, !tbaa !5
  %67 = load i32, ptr @b, align 4, !tbaa !5
  %68 = mul nsw i32 %66, %67
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load i32, ptr %7, align 4, !tbaa !5
  %71 = mul nsw i32 %69, %70
  %72 = sub nsw i32 %68, %71
  store i32 %72, ptr %4, align 4, !tbaa !5
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %73)
  %75 = fptosi double %74 to i32
  store i32 %75, ptr %8, align 4, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !5
  %77 = load i32, ptr %8, align 4, !tbaa !5
  %78 = mul nsw i32 %76, %77
  %79 = load i32, ptr %4, align 4, !tbaa !5
  %80 = icmp eq i32 %78, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %65
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %106

82:                                               ; preds = %65
  %83 = load i32, ptr %8, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  %85 = load i32, ptr %8, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  %87 = mul nsw i32 %84, %86
  %88 = load i32, ptr %4, align 4, !tbaa !5
  %89 = icmp eq i32 %87, %88
  br i1 %89, label %90, label %93

90:                                               ; preds = %82
  store i32 1, ptr %5, align 4, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %8, align 4, !tbaa !5
  br label %105

93:                                               ; preds = %82
  %94 = load i32, ptr %8, align 4, !tbaa !5
  %95 = sub nsw i32 %94, 1
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = sub nsw i32 %96, 1
  %98 = mul nsw i32 %95, %97
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = icmp eq i32 %98, %99
  br i1 %100, label %101, label %104

101:                                              ; preds = %93
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = add nsw i32 %102, -1
  store i32 %103, ptr %8, align 4, !tbaa !5
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %101, %93
  br label %105

105:                                              ; preds = %104, %90
  br label %106

106:                                              ; preds = %105, %81
  %107 = load i32, ptr %5, align 4, !tbaa !5
  %108 = icmp eq i32 %107, 1
  br i1 %108, label %109, label %154

109:                                              ; preds = %106
  %110 = load i32, ptr %6, align 4, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = icmp ne i32 %110, %111
  br i1 %112, label %113, label %154

113:                                              ; preds = %109
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = sub nsw i32 0, %114
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = mul nsw i32 %115, %116
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = mul nsw i32 %118, %119
  %121 = add nsw i32 %117, %120
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %154

123:                                              ; preds = %113
  %124 = load i32, ptr %6, align 4, !tbaa !5
  %125 = load i32, ptr %8, align 4, !tbaa !5
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = load i32, ptr %7, align 4, !tbaa !5
  %128 = sub nsw i32 0, %127
  %129 = call noundef i32 @_Z4distiiii(i32 noundef %124, i32 noundef %125, i32 noundef %126, i32 noundef %128)
  %130 = load i32, ptr @a, align 4, !tbaa !5
  %131 = load i32, ptr @a, align 4, !tbaa !5
  %132 = mul nsw i32 %130, %131
  %133 = load i32, ptr @b, align 4, !tbaa !5
  %134 = load i32, ptr @b, align 4, !tbaa !5
  %135 = mul nsw i32 %133, %134
  %136 = add nsw i32 %132, %135
  %137 = icmp eq i32 %129, %136
  br i1 %137, label %138, label %154

138:                                              ; preds = %123
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.2)
  %141 = load i32, ptr %6, align 4, !tbaa !5
  %142 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %141)
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef @.str.3)
  %144 = load i32, ptr %2, align 4, !tbaa !5
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %143, i32 noundef %144)
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %145, ptr noundef @.str.4)
  %147 = load i32, ptr %8, align 4, !tbaa !5
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %147)
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %148, ptr noundef @.str.3)
  %150 = load i32, ptr %7, align 4, !tbaa !5
  %151 = sub nsw i32 0, %150
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %149, i32 noundef %151)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @.str.4)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %155

154:                                              ; preds = %123, %113, %109, %106
  store i32 0, ptr %3, align 4
  br label %155

155:                                              ; preds = %154, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %156 = load i32, ptr %3, align 4
  switch i32 %156, label %161 [
    i32 0, label %157
  ]

157:                                              ; preds = %155
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %7, align 4, !tbaa !5
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %7, align 4, !tbaa !5
  br label %60, !llvm.loop !9

161:                                              ; preds = %155, %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  %162 = load i32, ptr %3, align 4
  switch i32 %162, label %165 [
    i32 5, label %163
  ]

163:                                              ; preds = %161
  br label %164

164:                                              ; preds = %163, %56
  store i32 0, ptr %3, align 4
  br label %165

165:                                              ; preds = %164, %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %166 = load i32, ptr %3, align 4
  switch i32 %166, label %171 [
    i32 0, label %167
  ]

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167
  %169 = load i32, ptr %2, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %2, align 4, !tbaa !5
  br label %10, !llvm.loop !11

171:                                              ; preds = %165, %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %172 = load i32, ptr %3, align 4
  switch i32 %172, label %177 [
    i32 2, label %173
    i32 1, label %175
  ]

173:                                              ; preds = %171
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.5)
  store i32 0, ptr %1, align 4
  br label %175

175:                                              ; preds = %173, %171
  %176 = load i32, ptr %1, align 4
  ret i32 %176

177:                                              ; preds = %171
  unreachable
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #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}


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

@a = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b)
  %2 = load i32, ptr @a, align 4, !tbaa !5
  %3 = icmp sgt i32 %2, 1
  br i1 %3, label %.lr.ph90, label %._crit_edge

.lr.ph90:                                         ; preds = %0, %.loopexit
  %4 = phi i32 [ %52, %.loopexit ], [ %2, %0 ]
  %.06088 = phi i32 [ %51, %.loopexit ], [ 1, %0 ]
  %add = add nsw i32 %4, %.06088
  %sub = sub nsw i32 %4, %.06088
  %5 = mul nsw i32 %add, %sub
  %6 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %5)
  %7 = fptosi double %6 to i32
  %8 = mul nsw i32 %7, %7
  %9 = icmp eq i32 %8, %5
  br i1 %9, label %.preheader, label %10

10:                                               ; preds = %.lr.ph90
  %11 = add nsw i32 %7, 1
  %12 = mul nsw i32 %11, %11
  %13 = icmp eq i32 %12, %5
  br i1 %13, label %.preheader, label %14

14:                                               ; preds = %10
  %15 = add nsw i32 %7, -1
  %16 = mul nsw i32 %15, %15
  %17 = icmp eq i32 %16, %5
  br i1 %17, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.lr.ph90, %10, %14
  %.05676.ph = phi i32 [ %15, %14 ], [ %7, %.lr.ph90 ], [ %11, %10 ]
  %18 = load i32, ptr @b, align 4, !tbaa !5
  %.not7186 = icmp sgt i32 %18, 1
  br i1 %.not7186, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %48
  %19 = phi i32 [ %50, %48 ], [ %18, %.preheader ]
  %.05587 = phi i32 [ %49, %48 ], [ 1, %.preheader ]
  %add69 = add nsw i32 %19, %.05587
  %sub70 = sub nsw i32 %19, %.05587
  %20 = mul nsw i32 %add69, %sub70
  %21 = tail call noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef %20)
  %22 = fptosi double %21 to i32
  %23 = mul nsw i32 %22, %22
  %24 = icmp eq i32 %23, %20
  br i1 %24, label %33, label %25

25:                                               ; preds = %.lr.ph
  %26 = add nsw i32 %22, 1
  %27 = mul nsw i32 %26, %26
  %28 = icmp eq i32 %27, %20
  br i1 %28, label %33, label %29

29:                                               ; preds = %25
  %30 = add nsw i32 %22, -1
  %31 = mul nsw i32 %30, %30
  %32 = icmp eq i32 %31, %20
  %spec.select74 = select i1 %32, i32 %30, i32 %22
  br label %33

33:                                               ; preds = %29, %25, %.lr.ph
  %34 = phi i1 [ true, %.lr.ph ], [ true, %25 ], [ %32, %29 ]
  %.0 = phi i32 [ %22, %.lr.ph ], [ %26, %25 ], [ %spec.select74, %29 ]
  %.not = icmp ne i32 %.05676.ph, %.0
  %or.cond.not = select i1 %34, i1 %.not, i1 false
  br i1 %or.cond.not, label %35, label %48

35:                                               ; preds = %33
  %36 = mul i32 %.05587, %.06088
  %37 = mul nsw i32 %.0, %.05676.ph
  %38 = icmp eq i32 %37, %36
  br i1 %38, label %39, label %48

39:                                               ; preds = %35
  %40 = sub nsw i32 0, %.05587
  %41 = tail call noundef i32 @_Z4distiiii(i32 noundef %.05676.ph, i32 noundef %.0, i32 noundef %.06088, i32 noundef %40)
  %42 = load i32, ptr @a, align 4, !tbaa !5
  %43 = mul nsw i32 %42, %42
  %44 = load i32, ptr @b, align 4, !tbaa !5
  %45 = mul nsw i32 %44, %44
  %46 = add nuw nsw i32 %45, %43
  %47 = icmp eq i32 %41, %46
  br i1 %47, label %54, label %48

48:                                               ; preds = %39, %35, %33
  %49 = add nuw nsw i32 %.05587, 1
  %50 = load i32, ptr @b, align 4, !tbaa !5
  %.not71 = icmp slt i32 %49, %50
  br i1 %.not71, label %.lr.ph, label %.loopexit, !llvm.loop !9

.loopexit:                                        ; preds = %48, %.preheader, %14
  %51 = add nuw nsw i32 %.06088, 1
  %52 = load i32, ptr @a, align 4, !tbaa !5
  %53 = icmp slt i32 %51, %52
  br i1 %53, label %.lr.ph90, label %._crit_edge, !llvm.loop !11

54:                                               ; preds = %39
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.1)
  %56 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.2)
  %57 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.05676.ph)
  %58 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef nonnull @.str.3)
  %59 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %58, i32 noundef %.06088)
  %60 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef nonnull @.str.4)
  %61 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.0)
  %62 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull @.str.3)
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %62, i32 noundef %40)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str.4)
  br label %66

._crit_edge:                                      ; preds = %.loopexit, %0
  %65 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.5)
  br label %66

66:                                               ; preds = %54, %._crit_edge
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIiEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) 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 #5

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #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 = { 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 #5 = { "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" }

!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: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass