; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/VK Cup 2016 Round 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::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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@g = external dso_local global [100100 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %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
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @d, ptr noundef @h)
  %14 = load i32, ptr @h, align 4, !tbaa !5
  %15 = load i32, ptr @d, align 4, !tbaa !5
  %16 = load i32, ptr @h, align 4, !tbaa !5
  %17 = sub nsw i32 %15, %16
  %18 = icmp slt i32 %14, %17
  br i1 %18, label %19, label %21

19:                                               ; preds = %0
  %20 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  br label %135

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

22:                                               ; preds = %33, %21
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = load i32, ptr @h, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  %26 = icmp sle i32 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %36

28:                                               ; preds = %22
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sub nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %31
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %32, ptr noundef nonnull align 4 dereferenceable(4) %2)
  br label %33

33:                                               ; preds = %28
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %2, align 4, !tbaa !5
  br label %22, !llvm.loop !9

36:                                               ; preds = %27
  %37 = load i32, ptr @h, align 4, !tbaa !5
  %38 = load i32, ptr @d, align 4, !tbaa !5
  %39 = icmp eq i32 %37, %38
  br i1 %39, label %40, label %69

40:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = load i32, ptr @h, align 4, !tbaa !5
  %43 = sub nsw i32 %41, %42
  %44 = sub nsw i32 %43, 1
  store i32 %44, ptr %3, align 4, !tbaa !5
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = icmp sgt i32 %45, 0
  br i1 %46, label %47, label %65

47:                                               ; preds = %40
  %48 = load i32, ptr @h, align 4, !tbaa !5
  %49 = icmp slt i32 %48, 2
  br i1 %49, label %50, label %52

50:                                               ; preds = %47
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %66

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %53 = load i32, ptr @h, align 4, !tbaa !5
  %54 = add nsw i32 %53, 2
  store i32 %54, ptr %5, align 4, !tbaa !5
  br label %55

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

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

60:                                               ; preds = %55
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([100100 x %"class.std::vector"], ptr @g, i64 0, i64 2), ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %5, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %5, align 4, !tbaa !5
  br label %55, !llvm.loop !11

64:                                               ; preds = %59
  br label %65

65:                                               ; preds = %64, %40
  store i32 0, ptr %4, align 4
  br label %66

66:                                               ; preds = %65, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  %67 = load i32, ptr %4, align 4
  switch i32 %67, label %137 [
    i32 0, label %68
    i32 1, label %135
  ]

68:                                               ; preds = %66
  br label %103

69:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %70 = load i32, ptr @h, align 4, !tbaa !5
  %71 = add nsw i32 %70, 2
  store i32 %71, ptr %7, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %83, %69
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr @d, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = icmp sle i32 %73, %75
  br i1 %76, label %78, label %77

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

78:                                               ; preds = %72
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %80
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %82 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %82, ptr %6, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %78
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %7, align 4, !tbaa !5
  br label %72, !llvm.loop !12

86:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %87 = load i32, ptr @n, align 4, !tbaa !5
  %88 = load i32, ptr @d, align 4, !tbaa !5
  %89 = add nsw i32 %88, 1
  %90 = sub nsw i32 %87, %89
  store i32 %90, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %91 = load i32, ptr @d, align 4, !tbaa !5
  %92 = add nsw i32 %91, 2
  store i32 %92, ptr %9, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %99, %86
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = load i32, ptr @n, align 4, !tbaa !5
  %96 = icmp sle i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %102

98:                                               ; preds = %93
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds ([100100 x %"class.std::vector"], ptr @g, i64 0, i64 1), ptr noundef nonnull align 4 dereferenceable(4) %9)
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %9, align 4, !tbaa !5
  br label %93, !llvm.loop !13

102:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %103

103:                                              ; preds = %102, %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %104

104:                                              ; preds = %131, %103
  %105 = load i32, ptr %10, align 4, !tbaa !5
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = icmp sle i32 %105, %106
  br i1 %107, label %109, label %108

108:                                              ; preds = %104
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %134

109:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %110 = load i32, ptr %10, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %111
  %113 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %112) #6
  %114 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %11, i32 0, i32 0
  store ptr %113, ptr %114, align 8
  br label %115

115:                                              ; preds = %128, %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %117
  %119 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %118) #6
  %120 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %119, ptr %120, align 8
  %121 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br i1 %121, label %123, label %122

122:                                              ; preds = %115
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %130

123:                                              ; preds = %115
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %124, i32 noundef %126)
  br label %128

128:                                              ; preds = %123
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  br label %115, !llvm.loop !14

130:                                              ; preds = %122
  br label %131

131:                                              ; preds = %130
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %10, align 4, !tbaa !5
  br label %104, !llvm.loop !15

134:                                              ; preds = %108
  store i32 0, ptr %1, align 4
  br label %135

135:                                              ; preds = %134, %66, %19
  %136 = load i32, ptr %1, align 4
  ret i32 %136

137:                                              ; preds = %66
  unreachable
}

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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)) #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@n = external dso_local global i32, align 4
@d = external dso_local global i32, align 4
@h = external dso_local global i32, align 4
@g = external dso_local global [100100 x %"class.std::vector"], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @d, ptr noundef nonnull @h)
  %8 = load i32, ptr @h, align 4, !tbaa !5
  %9 = load i32, ptr @d, align 4, !tbaa !5
  %10 = sub nsw i32 %9, %8
  %11 = icmp slt i32 %8, %10
  br i1 %11, label %12, label %14

12:                                               ; preds = %0
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.loopexit

14:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 2, ptr %1, align 4, !tbaa !5
  %.not24 = icmp slt i32 %8, 1
  br i1 %.not24, label %._crit_edge, label %.lr.ph

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre = load i32, ptr @d, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %14
  %15 = phi i32 [ %9, %14 ], [ %.pre, %._crit_edge.loopexit ]
  %.lcssa23 = phi i32 [ %8, %14 ], [ %21, %._crit_edge.loopexit ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %16 = icmp eq i32 %.lcssa23, %15
  br i1 %16, label %22, label %36

.lr.ph:                                           ; preds = %14, %.lr.ph
  %storemerge25 = phi i32 [ %19, %.lr.ph ], [ 1, %14 ]
  %17 = sext i32 %storemerge25 to i64
  %18 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %17
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %18, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %1, align 4, !tbaa !5
  %21 = load i32, ptr @h, align 4, !tbaa !5
  %.not = icmp sgt i32 %19, %21
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !9

22:                                               ; preds = %._crit_edge
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = sub i32 %15, %23
  %25 = icmp slt i32 %24, -1
  br i1 %25, label %26, label %.thread

26:                                               ; preds = %22
  %27 = icmp slt i32 %15, 2
  br i1 %27, label %34, label %28

28:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %29 = add nuw nsw i32 %15, 2
  store i32 %29, ptr %2, align 4, !tbaa !5
  %.not1936 = icmp sgt i32 %29, %23
  br i1 %.not1936, label %._crit_edge39, label %.lr.ph38

._crit_edge39:                                    ; preds = %.lr.ph38, %28
  %30 = phi i32 [ %23, %28 ], [ %33, %.lr.ph38 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %.thread

.lr.ph38:                                         ; preds = %28, %.lr.ph38
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @g, i64 48), ptr noundef nonnull align 4 dereferenceable(4) %2)
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %.not19.not = icmp slt i32 %31, %33
  br i1 %.not19.not, label %.lr.ph38, label %._crit_edge39, !llvm.loop !11

34:                                               ; preds = %26
  %35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %.loopexit

36:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  %37 = add nsw i32 %.lcssa23, 2
  store i32 %37, ptr %3, align 4, !tbaa !5
  %.not1526.not = icmp slt i32 %.lcssa23, %15
  br i1 %.not1526.not, label %.lr.ph29, label %._crit_edge30

._crit_edge30:                                    ; preds = %.lr.ph29, %36
  %.lcssa = phi i32 [ %15, %36 ], [ %44, %.lr.ph29 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %38 = add nsw i32 %.lcssa, 2
  store i32 %38, ptr %4, align 4, !tbaa !5
  %39 = load i32, ptr @n, align 4, !tbaa !5
  %.not1732 = icmp sgt i32 %38, %39
  br i1 %.not1732, label %._crit_edge35, label %.lr.ph34

.lr.ph29:                                         ; preds = %36, %.lr.ph29
  %.01027 = phi i32 [ %42, %.lr.ph29 ], [ 1, %36 ]
  %40 = sext i32 %.01027 to i64
  %41 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %40
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !5
  %44 = load i32, ptr @d, align 4, !tbaa !5
  %.not15 = icmp sgt i32 %42, %44
  br i1 %.not15, label %._crit_edge30, label %.lr.ph29, !llvm.loop !12

._crit_edge35:                                    ; preds = %.lr.ph34, %._crit_edge30
  %45 = phi i32 [ %39, %._crit_edge30 ], [ %48, %.lr.ph34 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %.thread

.lr.ph34:                                         ; preds = %._crit_edge30, %.lr.ph34
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @g, i64 24), ptr noundef nonnull align 4 dereferenceable(4) %4)
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %4, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %.not17.not = icmp slt i32 %46, %48
  br i1 %.not17.not, label %.lr.ph34, label %._crit_edge35, !llvm.loop !13

.thread:                                          ; preds = %22, %._crit_edge39, %._crit_edge35
  %49 = phi i32 [ %23, %22 ], [ %30, %._crit_edge39 ], [ %45, %._crit_edge35 ]
  %.not2043 = icmp slt i32 %49, 1
  br i1 %.not2043, label %.loopexit, label %.lr.ph45

.lr.ph45:                                         ; preds = %.thread, %._crit_edge42
  %indvars.iv = phi i64 [ %indvars.iv.next, %._crit_edge42 ], [ 1, %.thread ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %50 = getelementptr inbounds [100100 x %"class.std::vector"], ptr @g, i64 0, i64 %indvars.iv
  %51 = call ptr @_ZNSt6vectorIiSaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #6
  store ptr %51, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %52 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #6
  store ptr %52, ptr %6, align 8
  %53 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %53, label %.lr.ph41.preheader, label %._crit_edge42

.lr.ph41.preheader:                               ; preds = %.lr.ph45
  %54 = trunc nuw nsw i64 %indvars.iv to i32
  br label %.lr.ph41

._crit_edge42:                                    ; preds = %.lr.ph41, %.lr.ph45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = load i32, ptr @n, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %.not20.not = icmp slt i64 %indvars.iv, %56
  br i1 %.not20.not, label %.lr.ph45, label %.loopexit, !llvm.loop !14

.lr.ph41:                                         ; preds = %.lr.ph41.preheader, %.lr.ph41
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %54, i32 noundef %58)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %61 = call ptr @_ZNSt6vectorIiSaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #6
  store ptr %61, ptr %6, align 8
  %62 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br i1 %62, label %.lr.ph41, label %._crit_edge42, !llvm.loop !15

.loopexit:                                        ; preds = %._crit_edge42, %.thread, %34, %12
  ret i32 0
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPiSt6vectorIiSaIiEEEEbRKNS_17__normal_iteratorIT_T0_EESA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPiSt6vectorIiSaIiEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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