; LLVM IR from eyangch/competitive-programming :: BOI/2006 (countries)

; 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_istream" = type { ptr, i64, %"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::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@x = external dso_local global [1000 x i64], align 16
@y = external dso_local global [1000 x i64], align 16
@s = external dso_local global [1000 x i64], align 16
@graph = external dso_local global [1000 x i64], align 16
@c = external dso_local global [1000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3lgfxxxx(i64 noundef, i64 noundef, i64 noundef, i64 noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3dfsx(i64 noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store i64 0, ptr %2, align 8, !tbaa !5
  br label %14

14:                                               ; preds = %29, %0
  %15 = load i64, ptr %2, align 8, !tbaa !5
  %16 = load i64, ptr @N, align 8, !tbaa !5
  %17 = icmp slt i64 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  br label %32

19:                                               ; preds = %14
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds [1000 x i64], ptr @x, i64 0, i64 %20
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %23 = load i64, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds [1000 x i64], ptr @y, i64 0, i64 %23
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) %24)
  %26 = load i64, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %26
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %27)
  br label %29

29:                                               ; preds = %19
  %30 = load i64, ptr %2, align 8, !tbaa !5
  %31 = add nsw i64 %30, 1
  store i64 %31, ptr %2, align 8, !tbaa !5
  br label %14, !llvm.loop !9

32:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  store i64 0, ptr %3, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %128, %32
  %34 = load i64, ptr %3, align 8, !tbaa !5
  %35 = load i64, ptr @N, align 8, !tbaa !5
  %36 = icmp slt i64 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %131

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 1, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store i64 0, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store i64 1, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !5
  br label %39

39:                                               ; preds = %98, %38
  %40 = load i64, ptr %10, align 8, !tbaa !5
  %41 = load i64, ptr @N, align 8, !tbaa !5
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %39
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %101

44:                                               ; preds = %39
  %45 = load i64, ptr %3, align 8, !tbaa !5
  %46 = load i64, ptr %10, align 8, !tbaa !5
  %47 = icmp eq i64 %45, %46
  br i1 %47, label %48, label %49

48:                                               ; preds = %44
  br label %98

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %50 = load i64, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds [1000 x i64], ptr @x, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = load i64, ptr %10, align 8, !tbaa !5
  %54 = getelementptr inbounds [1000 x i64], ptr @x, i64 0, i64 %53
  %55 = load i64, ptr %54, align 8, !tbaa !5
  %56 = sub nsw i64 %52, %55
  %57 = call noundef double @_ZSt3powIxiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i64 noundef %56, i32 noundef 2)
  %58 = load i64, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds [1000 x i64], ptr @y, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !5
  %61 = load i64, ptr %10, align 8, !tbaa !5
  %62 = getelementptr inbounds [1000 x i64], ptr @y, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !5
  %64 = sub nsw i64 %60, %63
  %65 = call noundef double @_ZSt3powIxiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i64 noundef %64, i32 noundef 2)
  %66 = fadd double %57, %65
  %67 = fptosi double %66 to i64
  store i64 %67, ptr %11, align 8, !tbaa !5
  %68 = load i64, ptr %10, align 8, !tbaa !5
  %69 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !5
  %71 = load i64, ptr %11, align 8, !tbaa !5
  %72 = load i64, ptr %5, align 8, !tbaa !5
  %73 = load i64, ptr %6, align 8, !tbaa !5
  %74 = call noundef zeroext i1 @_Z3lgfxxxx(i64 noundef %70, i64 noundef %71, i64 noundef %72, i64 noundef %73)
  br i1 %74, label %75, label %83

75:                                               ; preds = %49
  %76 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %76, ptr %8, align 8, !tbaa !5
  %77 = load i64, ptr %6, align 8, !tbaa !5
  store i64 %77, ptr %9, align 8, !tbaa !5
  %78 = load i64, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !5
  store i64 %80, ptr %5, align 8, !tbaa !5
  %81 = load i64, ptr %11, align 8, !tbaa !5
  store i64 %81, ptr %6, align 8, !tbaa !5
  %82 = load i64, ptr %10, align 8, !tbaa !5
  store i64 %82, ptr %7, align 8, !tbaa !5
  br label %97

83:                                               ; preds = %49
  %84 = load i64, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = load i64, ptr %11, align 8, !tbaa !5
  %88 = load i64, ptr %8, align 8, !tbaa !5
  %89 = load i64, ptr %9, align 8, !tbaa !5
  %90 = call noundef zeroext i1 @_Z3lgfxxxx(i64 noundef %86, i64 noundef %87, i64 noundef %88, i64 noundef %89)
  br i1 %90, label %91, label %96

91:                                               ; preds = %83
  %92 = load i64, ptr %10, align 8, !tbaa !5
  %93 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !5
  store i64 %94, ptr %8, align 8, !tbaa !5
  %95 = load i64, ptr %11, align 8, !tbaa !5
  store i64 %95, ptr %9, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %91, %83
  br label %97

97:                                               ; preds = %96, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %98

98:                                               ; preds = %97, %48
  %99 = load i64, ptr %10, align 8, !tbaa !5
  %100 = add nsw i64 %99, 1
  store i64 %100, ptr %10, align 8, !tbaa !5
  br label %39, !llvm.loop !11

101:                                              ; preds = %43
  %102 = load i64, ptr %5, align 8, !tbaa !5
  %103 = load i64, ptr %6, align 8, !tbaa !5
  %104 = load i64, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %104
  %106 = load i64, ptr %105, align 8, !tbaa !5
  %107 = call noundef zeroext i1 @_Z3lgfxxxx(i64 noundef %102, i64 noundef %103, i64 noundef %106, i64 noundef 1)
  br i1 %107, label %108, label %124

108:                                              ; preds = %101
  %109 = load i64, ptr %5, align 8, !tbaa !5
  %110 = load i64, ptr %9, align 8, !tbaa !5
  %111 = mul nsw i64 %109, %110
  %112 = load i64, ptr %8, align 8, !tbaa !5
  %113 = load i64, ptr %6, align 8, !tbaa !5
  %114 = mul nsw i64 %112, %113
  %115 = icmp eq i64 %111, %114
  br i1 %115, label %116, label %119

116:                                              ; preds = %108
  %117 = load i64, ptr %3, align 8, !tbaa !5
  %118 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %117
  store i8 68, ptr %118, align 1, !tbaa !12
  br label %123

119:                                              ; preds = %108
  %120 = load i64, ptr %7, align 8, !tbaa !5
  %121 = load i64, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds [1000 x i64], ptr @graph, i64 0, i64 %121
  store i64 %120, ptr %122, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %119, %116
  br label %127

124:                                              ; preds = %101
  %125 = load i64, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %125
  store i8 75, ptr %126, align 1, !tbaa !12
  br label %127

127:                                              ; preds = %124, %123
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %128

128:                                              ; preds = %127
  %129 = load i64, ptr %3, align 8, !tbaa !5
  %130 = add nsw i64 %129, 1
  store i64 %130, ptr %3, align 8, !tbaa !5
  br label %33, !llvm.loop !13

131:                                              ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !5
  br label %132

132:                                              ; preds = %155, %131
  %133 = load i64, ptr %12, align 8, !tbaa !5
  %134 = load i64, ptr @N, align 8, !tbaa !5
  %135 = icmp slt i64 %133, %134
  br i1 %135, label %137, label %136

136:                                              ; preds = %132
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %158

137:                                              ; preds = %132
  %138 = load i64, ptr %12, align 8, !tbaa !5
  %139 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %138
  %140 = load i8, ptr %139, align 1, !tbaa !12
  %141 = icmp ne i8 %140, 0
  br i1 %141, label %142, label %148

142:                                              ; preds = %137
  %143 = load i64, ptr %12, align 8, !tbaa !5
  %144 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %143
  %145 = load i8, ptr %144, align 1, !tbaa !12
  %146 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %145)
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %146, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %154

148:                                              ; preds = %137
  %149 = load i64, ptr %12, align 8, !tbaa !5
  %150 = call noundef i64 @_Z3dfsx(i64 noundef %149)
  %151 = add nsw i64 %150, 1
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %151)
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %152, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %154

154:                                              ; preds = %148, %142
  br label %155

155:                                              ; preds = %154
  %156 = load i64, ptr %12, align 8, !tbaa !5
  %157 = add nsw i64 %156, 1
  store i64 %157, ptr %12, align 8, !tbaa !5
  br label %132, !llvm.loop !14

158:                                              ; preds = %136
  %159 = load i32, ptr %1, align 4
  ret i32 %159
}

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #1 align 2

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 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 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 #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 = !{!"long long", !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 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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_istream" = type { ptr, i64, %"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::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@N = external dso_local global i64, align 8
@x = external dso_local global [1000 x i64], align 16
@y = external dso_local global [1000 x i64], align 16
@s = external dso_local global [1000 x i64], align 16
@graph = external dso_local local_unnamed_addr global [1000 x i64], align 16
@c = external dso_local local_unnamed_addr global [1000 x i8], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3lgfxxxx(i64 noundef, i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3dfsx(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %2 = load i64, ptr @N, align 8, !tbaa !5
  %3 = icmp sgt i64 %2, 0
  br i1 %3, label %.lr.ph, label %._crit_edge81

.preheader65:                                     ; preds = %.lr.ph
  %4 = icmp sgt i64 %12, 0
  br i1 %4, label %.preheader64, label %._crit_edge81

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.04766 = phi i64 [ %11, %.lr.ph ], [ 0, %0 ]
  %5 = getelementptr inbounds [1000 x i64], ptr @x, i64 0, i64 %.04766
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %7 = getelementptr inbounds [1000 x i64], ptr @y, i64 0, i64 %.04766
  %8 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %9 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %.04766
  %10 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %11 = add nuw nsw i64 %.04766, 1
  %12 = load i64, ptr @N, align 8, !tbaa !5
  %13 = icmp slt i64 %11, %12
  br i1 %13, label %.lr.ph, label %.preheader65, !llvm.loop !9

.preheader64:                                     ; preds = %.preheader65, %59
  %14 = phi i64 [ %61, %59 ], [ %12, %.preheader65 ]
  %.06278 = phi i64 [ %60, %59 ], [ 0, %.preheader65 ]
  %15 = icmp sgt i64 %14, 0
  br i1 %15, label %.lr.ph73, label %._crit_edge

.lr.ph73:                                         ; preds = %.preheader64
  %16 = getelementptr inbounds [1000 x i64], ptr @x, i64 0, i64 %.06278
  %17 = getelementptr inbounds [1000 x i64], ptr @y, i64 0, i64 %.06278
  br label %22

.preheader:                                       ; preds = %59
  %18 = icmp sgt i64 %61, 0
  br i1 %18, label %.lr.ph80, label %._crit_edge81

._crit_edge:                                      ; preds = %45, %.preheader64
  %.059.lcssa = phi i64 [ 0, %.preheader64 ], [ %.261, %45 ]
  %.056.lcssa = phi i64 [ 1, %.preheader64 ], [ %.258, %45 ]
  %.053.lcssa = phi i64 [ 0, %.preheader64 ], [ %.255, %45 ]
  %.050.lcssa = phi i64 [ 0, %.preheader64 ], [ %.252, %45 ]
  %.049.lcssa = phi i64 [ 1, %.preheader64 ], [ %.2, %45 ]
  %19 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %.06278
  %20 = load i64, ptr %19, align 8, !tbaa !5
  %21 = tail call noundef zeroext i1 @_Z3lgfxxxx(i64 noundef %.059.lcssa, i64 noundef %.056.lcssa, i64 noundef %20, i64 noundef 1)
  br i1 %21, label %49, label %57

22:                                               ; preds = %.lr.ph73, %45
  %.04872 = phi i64 [ 0, %.lr.ph73 ], [ %46, %45 ]
  %.04971 = phi i64 [ 1, %.lr.ph73 ], [ %.2, %45 ]
  %.05070 = phi i64 [ 0, %.lr.ph73 ], [ %.252, %45 ]
  %.05369 = phi i64 [ 0, %.lr.ph73 ], [ %.255, %45 ]
  %.05668 = phi i64 [ 1, %.lr.ph73 ], [ %.258, %45 ]
  %.05967 = phi i64 [ 0, %.lr.ph73 ], [ %.261, %45 ]
  %23 = icmp eq i64 %.06278, %.04872
  br i1 %23, label %45, label %24

24:                                               ; preds = %22
  %25 = load i64, ptr %16, align 8, !tbaa !5
  %26 = getelementptr inbounds [1000 x i64], ptr @x, i64 0, i64 %.04872
  %27 = load i64, ptr %26, align 8, !tbaa !5
  %28 = sub nsw i64 %25, %27
  %29 = tail call noundef double @_ZSt3powIxiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i64 noundef %28, i32 noundef 2)
  %30 = load i64, ptr %17, align 8, !tbaa !5
  %31 = getelementptr inbounds [1000 x i64], ptr @y, i64 0, i64 %.04872
  %32 = load i64, ptr %31, align 8, !tbaa !5
  %33 = sub nsw i64 %30, %32
  %34 = tail call noundef double @_ZSt3powIxiEN9__gnu_cxx9__promoteIDTplcvNS1_IT_Xsr3std12__is_integerIS2_EE7__valueEE6__typeELi0EcvNS1_IT0_Xsr3std12__is_integerIS5_EE7__valueEE6__typeELi0EEXsr3std12__is_integerIS8_EE7__valueEE6__typeES2_S5_(i64 noundef %33, i32 noundef 2)
  %35 = fadd double %29, %34
  %36 = fptosi double %35 to i64
  %37 = getelementptr inbounds [1000 x i64], ptr @s, i64 0, i64 %.04872
  %38 = load i64, ptr %37, align 8, !tbaa !5
  %39 = tail call noundef zeroext i1 @_Z3lgfxxxx(i64 noundef %38, i64 noundef %36, i64 noundef %.05967, i64 noundef %.05668)
  %40 = load i64, ptr %37, align 8, !tbaa !5
  br i1 %39, label %45, label %41

41:                                               ; preds = %24
  %42 = tail call noundef zeroext i1 @_Z3lgfxxxx(i64 noundef %40, i64 noundef %36, i64 noundef %.05070, i64 noundef %.04971)
  br i1 %42, label %43, label %45

43:                                               ; preds = %41
  %44 = load i64, ptr %37, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %24, %43, %41, %22
  %.261 = phi i64 [ %.05967, %22 ], [ %.05967, %43 ], [ %.05967, %41 ], [ %40, %24 ]
  %.258 = phi i64 [ %.05668, %22 ], [ %.05668, %43 ], [ %.05668, %41 ], [ %36, %24 ]
  %.255 = phi i64 [ %.05369, %22 ], [ %.05369, %43 ], [ %.05369, %41 ], [ %.04872, %24 ]
  %.252 = phi i64 [ %.05070, %22 ], [ %44, %43 ], [ %.05070, %41 ], [ %.05967, %24 ]
  %.2 = phi i64 [ %.04971, %22 ], [ %36, %43 ], [ %.04971, %41 ], [ %.05668, %24 ]
  %46 = add nuw nsw i64 %.04872, 1
  %47 = load i64, ptr @N, align 8, !tbaa !5
  %48 = icmp slt i64 %46, %47
  br i1 %48, label %22, label %._crit_edge, !llvm.loop !11

49:                                               ; preds = %._crit_edge
  %50 = mul nsw i64 %.049.lcssa, %.059.lcssa
  %51 = mul nsw i64 %.050.lcssa, %.056.lcssa
  %52 = icmp eq i64 %50, %51
  br i1 %52, label %53, label %55

53:                                               ; preds = %49
  %54 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %.06278
  store i8 68, ptr %54, align 1, !tbaa !12
  br label %59

55:                                               ; preds = %49
  %56 = getelementptr inbounds [1000 x i64], ptr @graph, i64 0, i64 %.06278
  store i64 %.053.lcssa, ptr %56, align 8, !tbaa !5
  br label %59

57:                                               ; preds = %._crit_edge
  %58 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %.06278
  store i8 75, ptr %58, align 1, !tbaa !12
  br label %59

59:                                               ; preds = %53, %55, %57
  %60 = add nuw nsw i64 %.06278, 1
  %61 = load i64, ptr @N, align 8, !tbaa !5
  %62 = icmp slt i64 %60, %61
  br i1 %62, label %.preheader64, label %.preheader, !llvm.loop !13

._crit_edge81:                                    ; preds = %71, %0, %.preheader65, %.preheader
  ret i32 0

.lr.ph80:                                         ; preds = %.preheader, %71
  %.079 = phi i64 [ %73, %71 ], [ 0, %.preheader ]
  %63 = getelementptr inbounds [1000 x i8], ptr @c, i64 0, i64 %.079
  %64 = load i8, ptr %63, align 1, !tbaa !12
  %.not = icmp eq i8 %64, 0
  br i1 %.not, label %67, label %65

65:                                               ; preds = %.lr.ph80
  %66 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i8 noundef signext %64)
  br label %71

67:                                               ; preds = %.lr.ph80
  %68 = tail call noundef i64 @_Z3dfsx(i64 noundef %.079)
  %69 = add nsw i64 %68, 1
  %70 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %69)
  br label %71

71:                                               ; preds = %65, %67
  %.sink = phi ptr [ %66, %65 ], [ %70, %67 ]
  %72 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %73 = add nuw nsw i64 %.079, 1
  %74 = load i64, ptr @N, align 8, !tbaa !5
  %75 = icmp slt i64 %73, %74
  br i1 %75, label %.lr.ph80, label %._crit_edge81, !llvm.loop !14
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #4

; 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 #1 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)) #4

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

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 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 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 #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" }

!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 = !{!"long long", !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 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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