; LLVM IR from upupming/algorithm :: AdvancedLevel_C++/1068. Find More Coins (30)  (main)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@dp = external dso_local global [10010 x i32], align 16
@w = external dso_local global [10010 x i32], align 16
@choice = external dso_local global [10010 x [110 x i8]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %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 %"class.std::vector", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %25, %0
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = load i32, ptr %2, align 4, !tbaa !5
  %18 = icmp sle i32 %16, %17
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %15
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %22
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %23)
  br label %25

25:                                               ; preds = %20
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %4, align 4, !tbaa !5
  br label %15, !llvm.loop !9

28:                                               ; preds = %19
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds i32, ptr @w, i64 %30
  %32 = getelementptr inbounds i32, ptr %31, i64 1
  call void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef getelementptr inbounds (i32, ptr @w, i64 1), ptr noundef %32, ptr noundef @_Z4cmp1ii)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %33

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

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

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

40:                                               ; preds = %93, %38
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = icmp sge i32 %41, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %40
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %96

48:                                               ; preds = %40
  %49 = load i32, ptr %7, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !5
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sub nsw i32 %53, %57
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = add nsw i32 %61, %65
  %67 = icmp sle i32 %52, %66
  br i1 %67, label %68, label %92

68:                                               ; preds = %48
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [10010 x [110 x i8]], ptr @choice, i64 0, i64 %70
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [110 x i8], ptr %71, i64 0, i64 %73
  store i8 1, ptr %74, align 1, !tbaa !11
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = sub nsw i32 %75, %79
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %83, %87
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %68, %48
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %7, align 4, !tbaa !5
  br label %40, !llvm.loop !13

96:                                               ; preds = %47
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %5, align 4, !tbaa !5
  br label %33, !llvm.loop !14

100:                                              ; preds = %37
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load i32, ptr %3, align 4, !tbaa !5
  %106 = icmp ne i32 %104, %105
  br i1 %106, label %107, label %109

107:                                              ; preds = %100
  %108 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %173

109:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %110 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %110, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %111 = load i32, ptr %2, align 4, !tbaa !5
  store i32 %111, ptr %10, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %141, %109
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = icmp sgt i32 %113, 0
  br i1 %114, label %115, label %144

115:                                              ; preds = %112
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [10010 x [110 x i8]], ptr @choice, i64 0, i64 %117
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [110 x i8], ptr %118, i64 0, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !11, !range !15, !noundef !16
  %123 = trunc i8 %122 to i1
  %124 = zext i1 %123 to i32
  %125 = icmp eq i32 %124, 1
  br i1 %125, label %126, label %141

126:                                              ; preds = %115
  %127 = load i32, ptr %10, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %128
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 4 dereferenceable(4) %129)
          to label %130 unwind label %137

130:                                              ; preds = %126
  %131 = load i32, ptr %10, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %132
  %134 = load i32, ptr %133, align 4, !tbaa !5
  %135 = load i32, ptr %9, align 4, !tbaa !5
  %136 = sub nsw i32 %135, %134
  store i32 %136, ptr %9, align 4, !tbaa !5
  br label %141

137:                                              ; preds = %126
  %138 = landingpad { ptr, i32 }
          cleanup
  %139 = extractvalue { ptr, i32 } %138, 0
  store ptr %139, ptr %11, align 8
  %140 = extractvalue { ptr, i32 } %138, 1
  store i32 %140, ptr %12, align 4
  br label %172

141:                                              ; preds = %130, %115
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = add nsw i32 %142, -1
  store i32 %143, ptr %10, align 4, !tbaa !5
  br label %112, !llvm.loop !17

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

145:                                              ; preds = %168, %144
  %146 = load i32, ptr %13, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  %149 = icmp ult i64 %147, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %145
  store i32 13, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %171

151:                                              ; preds = %145
  %152 = load i32, ptr %13, align 4, !tbaa !5
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %161

154:                                              ; preds = %151
  %155 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3)
          to label %156 unwind label %157

156:                                              ; preds = %154
  br label %161

157:                                              ; preds = %161, %154
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %11, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %172

161:                                              ; preds = %156, %151
  %162 = load i32, ptr %13, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef %163) #6
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %165)
          to label %167 unwind label %157

167:                                              ; preds = %161
  br label %168

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

171:                                              ; preds = %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  br label %173

172:                                              ; preds = %157, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %175

173:                                              ; preds = %171, %107
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %174 = load i32, ptr %1, align 4
  ret i32 %174

175:                                              ; preds = %172
  %176 = load ptr, ptr %11, align 8
  %177 = load i32, ptr %12, align 4
  %178 = insertvalue { ptr, i32 } poison, ptr %176, 0
  %179 = insertvalue { ptr, i32 } %178, i32 %177, 1
  resume { ptr, i32 } %179
}

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@dp = external dso_local local_unnamed_addr global [10010 x i32], align 16
@w = external dso_local global [10010 x i32], align 16
@choice = external dso_local local_unnamed_addr global [10010 x [110 x i8]], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %5 = load i32, ptr %1, align 4, !tbaa !5
  %.not44 = icmp slt i32 %5, 1
  br i1 %.not44, label %.._crit_edge_crit_edge, label %.lr.ph

.._crit_edge_crit_edge:                           ; preds = %0
  %.pre78 = sext i32 %5 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre78, %.._crit_edge_crit_edge ], [ %14, %.lr.ph ]
  %6 = getelementptr inbounds i32, ptr @w, i64 %.pre-phi
  %7 = getelementptr inbounds i8, ptr %6, i64 4
  call void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @w, i64 4), ptr noundef nonnull %7, ptr noundef nonnull @_Z4cmp1ii)
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %.not3951 = icmp slt i32 %8, 1
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %.pre79 = sext i32 %.pre to i64
  br i1 %.not3951, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %._crit_edge
  %9 = add nuw i32 %8, 1
  %wide.trip.count = zext i32 %9 to i64
  %10 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %.pre79
  %indvars.iv.next66.prol = add nsw i64 %.pre79, -1
  br label %17

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %11 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %indvars.iv
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %.not.not = icmp slt i64 %indvars.iv, %14
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge55:                                    ; preds = %._crit_edge50, %._crit_edge
  %15 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %.pre79
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %.not40 = icmp eq i32 %16, %.pre
  br i1 %.not40, label %50, label %48

17:                                               ; preds = %.lr.ph54, %._crit_edge50
  %indvars.iv68 = phi i64 [ 1, %.lr.ph54 ], [ %indvars.iv.next69, %._crit_edge50 ]
  %18 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %indvars.iv68
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %.not4246 = icmp slt i32 %.pre, %19
  br i1 %.not4246, label %._crit_edge50, label %.lr.ph49.preheader

.lr.ph49.preheader:                               ; preds = %17
  %20 = sext i32 %19 to i64
  %21 = add nsw i64 %.pre79, %20
  %22 = and i64 %21, 1
  %lcmp.mod.not.not = icmp eq i64 %22, 0
  br i1 %lcmp.mod.not.not, label %.lr.ph49.prol, label %.lr.ph49.prol.loopexit

.lr.ph49.prol:                                    ; preds = %.lr.ph49.preheader
  %23 = load i32, ptr %10, align 4, !tbaa !5
  %24 = sub nsw i64 %.pre79, %20
  %25 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add nsw i32 %26, %19
  %.not43.prol = icmp sgt i32 %23, %27
  br i1 %.not43.prol, label %.lr.ph49.prol.loopexit, label %28

28:                                               ; preds = %.lr.ph49.prol
  %29 = getelementptr inbounds [10010 x [110 x i8]], ptr @choice, i64 0, i64 %indvars.iv68, i64 %.pre79
  store i8 1, ptr %29, align 1, !tbaa !11
  store i32 %27, ptr %10, align 4, !tbaa !5
  br label %.lr.ph49.prol.loopexit

.lr.ph49.prol.loopexit:                           ; preds = %.lr.ph49.prol, %28, %.lr.ph49.preheader
  %indvars.iv65.unr = phi i64 [ %.pre79, %.lr.ph49.preheader ], [ %indvars.iv.next66.prol, %28 ], [ %indvars.iv.next66.prol, %.lr.ph49.prol ]
  %30 = icmp eq i32 %.pre, %19
  br i1 %30, label %._crit_edge50, label %.lr.ph49

._crit_edge50:                                    ; preds = %.lr.ph49.prol.loopexit, %47, %17
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge55, label %17, !llvm.loop !13

.lr.ph49:                                         ; preds = %.lr.ph49.prol.loopexit, %47
  %indvars.iv65 = phi i64 [ %indvars.iv.next66.1, %47 ], [ %indvars.iv65.unr, %.lr.ph49.prol.loopexit ]
  %31 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %indvars.iv65
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = sub nsw i64 %indvars.iv65, %20
  %34 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %35, %19
  %.not43 = icmp sgt i32 %32, %36
  br i1 %.not43, label %.lr.ph49.1, label %37

37:                                               ; preds = %.lr.ph49
  %38 = getelementptr inbounds [10010 x [110 x i8]], ptr @choice, i64 0, i64 %indvars.iv68, i64 %indvars.iv65
  store i8 1, ptr %38, align 1, !tbaa !11
  store i32 %36, ptr %31, align 4, !tbaa !5
  br label %.lr.ph49.1

.lr.ph49.1:                                       ; preds = %.lr.ph49, %37
  %indvars.iv.next66 = add nsw i64 %indvars.iv65, -1
  %39 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %indvars.iv.next66
  %40 = load i32, ptr %39, align 4, !tbaa !5
  %41 = sub nsw i64 %indvars.iv.next66, %20
  %42 = getelementptr inbounds [10010 x i32], ptr @dp, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, %19
  %.not43.1 = icmp sgt i32 %40, %44
  br i1 %.not43.1, label %47, label %45

45:                                               ; preds = %.lr.ph49.1
  %46 = getelementptr inbounds [10010 x [110 x i8]], ptr @choice, i64 0, i64 %indvars.iv68, i64 %indvars.iv.next66
  store i8 1, ptr %46, align 1, !tbaa !11
  store i32 %44, ptr %39, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %45, %.lr.ph49.1
  %indvars.iv.next66.1 = add nsw i64 %indvars.iv65, -2
  %.not42.not.1 = icmp sgt i64 %indvars.iv.next66, %20
  br i1 %.not42.not.1, label %.lr.ph49, label %._crit_edge50, !llvm.loop !14

48:                                               ; preds = %._crit_edge55
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %80

50:                                               ; preds = %._crit_edge55
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = icmp sgt i32 %51, 0
  br i1 %52, label %.lr.ph59.preheader, label %.preheader

.lr.ph59.preheader:                               ; preds = %50
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  br label %.lr.ph59

.preheader:                                       ; preds = %72, %50
  %55 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %.not = icmp eq i64 %55, 0
  br i1 %.not, label %._crit_edge62, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %.preheader
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #6
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %57)
  %59 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %60 = icmp ugt i64 %59, 1
  br i1 %60, label %.lr.ph61.peel.next, label %._crit_edge62

.lr.ph59:                                         ; preds = %.lr.ph59.preheader, %72
  %indvars.iv71 = phi i64 [ %54, %.lr.ph59.preheader ], [ %indvars.iv.next72, %72 ]
  %.03356 = phi i32 [ %51, %.lr.ph59.preheader ], [ %.1, %72 ]
  %61 = zext nneg i32 %.03356 to i64
  %62 = getelementptr inbounds [10010 x [110 x i8]], ptr @choice, i64 0, i64 %indvars.iv71, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !11, !range !15, !noundef !16
  %64 = trunc nuw i8 %63 to i1
  br i1 %64, label %65, label %72

65:                                               ; preds = %.lr.ph59
  %66 = getelementptr inbounds [10010 x i32], ptr @w, i64 0, i64 %indvars.iv71
  invoke void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 4 dereferenceable(4) %66)
          to label %67 unwind label %70

67:                                               ; preds = %65
  %68 = load i32, ptr %66, align 4, !tbaa !5
  %69 = sub nsw i32 %.03356, %68
  br label %72

70:                                               ; preds = %65
  %71 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %71

72:                                               ; preds = %67, %.lr.ph59
  %.1 = phi i32 [ %69, %67 ], [ %.03356, %.lr.ph59 ]
  %indvars.iv.next72 = add nsw i64 %indvars.iv71, -1
  %73 = icmp sgt i32 %.1, 0
  br i1 %73, label %.lr.ph59, label %.preheader, !llvm.loop !17

._crit_edge62:                                    ; preds = %.lr.ph61.peel.next, %.lr.ph61.preheader, %.preheader
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  br label %80

.lr.ph61.peel.next:                               ; preds = %.lr.ph61.preheader, %.lr.ph61.peel.next
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph61.peel.next ], [ 1, %.lr.ph61.preheader ]
  %74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv74) #6
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %76)
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %78 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %79 = icmp ugt i64 %78, %indvars.iv.next75
  br i1 %79, label %.lr.ph61.peel.next, label %._crit_edge62, !llvm.loop !18

80:                                               ; preds = %._crit_edge62, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFiiiEEvT_S3_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19}
!19 = !{!"llvm.loop.peeled.count", i32 1}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass