; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/Codesprints 2016/Codesprint April/Problem E (E)

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

@n = external dso_local global i32, align 4
@c = external dso_local global [50100 x i32], align 16
@d = external dso_local global [50100 x i32], align 16
@g = external dso_local global [50100 x %"class.std::vector"], align 16
@xsum = external dso_local global [50100 x [2 x i32]], align 16
@l = external dso_local global [50100 x i32], align 16
@r = external dso_local global [50100 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

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

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

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [50100 x i32], ptr @c, i64 0, i64 %21
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %41, %27
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %44

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %4, ptr noundef %5)
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [50100 x %"class.std::vector"], ptr @g, i64 0, i64 %36
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %37, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [50100 x %"class.std::vector"], ptr @g, i64 0, i64 %39
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %41

41:                                               ; preds = %33
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !5
  br label %28, !llvm.loop !11

44:                                               ; preds = %32
  call void @_Z3dfsii(i32 noundef 1, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6)
  br label %46

46:                                               ; preds = %132, %130, %44
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  store i32 %48, ptr %6, align 4, !tbaa !5
  %49 = icmp ne i32 %47, 0
  br i1 %49, label %50, label %133

50:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef %7, ptr noundef %8)
  %52 = load i32, ptr %7, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [50100 x i32], ptr @l, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = load i32, ptr %8, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [50100 x i32], ptr @l, i64 0, i64 %57
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = icmp slt i32 %55, %59
  br i1 %60, label %61, label %73

61:                                               ; preds = %50
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [50100 x i32], ptr @l, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [50100 x i32], ptr @r, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp slt i32 %65, %69
  br i1 %70, label %71, label %73

71:                                               ; preds = %61
  %72 = call i32 @puts(ptr noundef @.str.3)
  store i32 8, ptr %9, align 4
  br label %130, !llvm.loop !12

73:                                               ; preds = %61, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %74 = load i32, ptr getelementptr inbounds ([2 x i32], ptr getelementptr inbounds ([50100 x [2 x i32]], ptr @xsum, i64 0, i64 1), i64 0, i64 1), align 4, !tbaa !5
  store i32 %74, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %75 = load i32, ptr %7, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [50100 x i32], ptr @d, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !5
  store i32 %78, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %79 = load i32, ptr %8, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [50100 x i32], ptr @d, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  store i32 %82, ptr %12, align 4, !tbaa !5
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = srem i32 %83, 2
  %85 = icmp eq i32 %84, 1
  br i1 %85, label %86, label %94

86:                                               ; preds = %73
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [50100 x [2 x i32]], ptr @xsum, i64 0, i64 %88
  %90 = getelementptr inbounds [2 x i32], ptr %89, i64 0, i64 0
  %91 = load i32, ptr %90, align 8, !tbaa !5
  %92 = load i32, ptr %10, align 4, !tbaa !5
  %93 = xor i32 %92, %91
  store i32 %93, ptr %10, align 4, !tbaa !5
  br label %102

94:                                               ; preds = %73
  %95 = load i32, ptr %7, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [50100 x [2 x i32]], ptr @xsum, i64 0, i64 %96
  %98 = getelementptr inbounds [2 x i32], ptr %97, i64 0, i64 1
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = xor i32 %100, %99
  store i32 %101, ptr %10, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %94, %86
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = srem i32 %103, 2
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %114

106:                                              ; preds = %102
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [50100 x [2 x i32]], ptr @xsum, i64 0, i64 %108
  %110 = getelementptr inbounds [2 x i32], ptr %109, i64 0, i64 0
  %111 = load i32, ptr %110, align 8, !tbaa !5
  %112 = load i32, ptr %10, align 4, !tbaa !5
  %113 = xor i32 %112, %111
  store i32 %113, ptr %10, align 4, !tbaa !5
  br label %122

114:                                              ; preds = %102
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [50100 x [2 x i32]], ptr @xsum, i64 0, i64 %116
  %118 = getelementptr inbounds [2 x i32], ptr %117, i64 0, i64 1
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %10, align 4, !tbaa !5
  %121 = xor i32 %120, %119
  store i32 %121, ptr %10, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %114, %106
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %127, label %125

125:                                              ; preds = %122
  %126 = call i32 @puts(ptr noundef @.str.4)
  br label %129

127:                                              ; preds = %122
  %128 = call i32 @puts(ptr noundef @.str.5)
  br label %129

129:                                              ; preds = %127, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  store i32 0, ptr %9, align 4
  br label %130

130:                                              ; preds = %129, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %131 = load i32, ptr %9, align 4
  switch i32 %131, label %135 [
    i32 0, label %132
    i32 8, label %46
  ]

132:                                              ; preds = %130
  br label %46, !llvm.loop !12

133:                                              ; preds = %46
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %134 = load i32, ptr %1, align 4
  ret i32 %134

135:                                              ; preds = %130
  unreachable
}

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

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

declare i32 @puts(ptr noundef) #3

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


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

@n = external dso_local global i32, align 4
@c = external dso_local global [50100 x i32], align 16
@d = external dso_local local_unnamed_addr global [50100 x i32], align 16
@g = external dso_local global [50100 x %"class.std::vector"], align 16
@xsum = external dso_local local_unnamed_addr global [50100 x [2 x i32]], align 16
@l = external dso_local local_unnamed_addr global [50100 x i32], align 16
@r = external dso_local local_unnamed_addr global [50100 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %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 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not19 = icmp slt i32 %7, 1
  br i1 %.not19, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph
  %8 = icmp sgt i32 %11, 1
  br i1 %8, label %.lr.ph22, label %._crit_edge

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

._crit_edge:                                      ; preds = %.lr.ph22, %0, %.preheader
  call void @_Z3dfsii(i32 noundef 1, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %3)
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = add nsw i32 %14, -1
  store i32 %15, ptr %3, align 4, !tbaa !5
  %.not1623 = icmp eq i32 %14, 0
  br i1 %.not1623, label %._crit_edge26, label %.lr.ph25

.lr.ph22:                                         ; preds = %.preheader, %.lr.ph22
  %.01421 = phi i32 [ %23, %.lr.ph22 ], [ 1, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %17 = load i32, ptr %1, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [50100 x %"class.std::vector"], ptr @g, i64 0, i64 %18
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %19, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [50100 x %"class.std::vector"], ptr @g, i64 0, i64 %21
  call void @_ZNSt6vectorIiSaIiEE9push_backERKi(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  %23 = add nuw nsw i32 %.01421, 1
  %24 = load i32, ptr @n, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %.lr.ph22, label %._crit_edge, !llvm.loop !11

.lr.ph25:                                         ; preds = %._crit_edge, %52
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %4, ptr noundef nonnull %5)
  %27 = load i32, ptr %4, align 4
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [50100 x i32], ptr @l, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = load i32, ptr %5, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [50100 x i32], ptr @l, i64 0, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !5
  %35 = icmp slt i32 %30, %34
  br i1 %35, label %36, label %40

36:                                               ; preds = %.lr.ph25
  %37 = getelementptr inbounds [50100 x i32], ptr @r, i64 0, i64 %28
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = icmp slt i32 %34, %38
  br i1 %39, label %52, label %40, !llvm.loop !12

40:                                               ; preds = %36, %.lr.ph25
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @xsum, i64 12), align 4, !tbaa !5
  %42 = getelementptr inbounds [50100 x i32], ptr @d, i64 0, i64 %28
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = getelementptr inbounds [50100 x i32], ptr @d, i64 0, i64 %32
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = and i32 %43, -2147483647
  %47 = icmp eq i32 %46, 1
  %48 = getelementptr inbounds [50100 x [2 x i32]], ptr @xsum, i64 0, i64 %28
  %49 = getelementptr inbounds [50100 x [2 x i32]], ptr @xsum, i64 0, i64 %28, i64 1
  %.pn.in = select i1 %47, ptr %48, ptr %49
  %.pn = load i32, ptr %.pn.in, align 4, !tbaa !5
  %.013 = xor i32 %.pn, %41
  %50 = and i32 %45, 1
  %51 = icmp eq i32 %50, 0
  %.pn17.in = select i1 %51, ptr %48, ptr %49
  %.pn17 = load i32, ptr %.pn17.in, align 4, !tbaa !5
  %.not18 = icmp eq i32 %.013, %.pn17
  %.str.4..str.5 = select i1 %.not18, ptr @.str.4, ptr @.str.5
  br label %52

52:                                               ; preds = %40, %36
  %.str.4.sink = phi ptr [ @.str.3, %36 ], [ %.str.4..str.5, %40 ]
  %53 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.4.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %54 = load i32, ptr %3, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  store i32 %55, ptr %3, align 4, !tbaa !5
  %.not16 = icmp eq i32 %54, 0
  br i1 %.not16, label %._crit_edge26, label %.lr.ph25

._crit_edge26:                                    ; preds = %52, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  ret i32 0
}

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

; 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 #0 align 2

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

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


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