; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/292 Division 2/Problem B (B)

; 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 i32, align 4
@m = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@g = external dso_local global i32, align 4
@boy = external dso_local global [101 x i32], align 16
@girl = external dso_local global [101 x i32], align 16
@temp = external dso_local global i32, align 4
@x = external dso_local global i32, align 4
@y = external dso_local global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 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
  store i32 0, ptr %1, align 4
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) @m)
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @b)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %22, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @b, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %25

17:                                               ; preds = %12
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @temp)
  %19 = load i32, ptr @temp, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %20
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %17
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !9

25:                                               ; preds = %16
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @g)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %27

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

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %40

32:                                               ; preds = %27
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @temp)
  %34 = load i32, ptr @temp, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %35
  store i32 1, ptr %36, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %32
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %3, align 4, !tbaa !5
  br label %27, !llvm.loop !11

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %41 = load i32, ptr @n, align 4, !tbaa !5
  %42 = load i32, ptr @m, align 4, !tbaa !5
  %43 = mul nsw i32 %41, %42
  %44 = mul nsw i32 %43, 10
  store i32 %44, ptr %4, align 4, !tbaa !5
  store i32 0, ptr @x, align 4, !tbaa !5
  store i32 0, ptr @y, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %78, %40
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %81

50:                                               ; preds = %45
  %51 = load i32, ptr @x, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %62, label %56

56:                                               ; preds = %50
  %57 = load i32, ptr @y, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %69

62:                                               ; preds = %56, %50
  %63 = load i32, ptr @y, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %64
  store i32 1, ptr %65, align 4, !tbaa !5
  %66 = load i32, ptr @x, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %67
  store i32 1, ptr %68, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %62, %56
  %70 = load i32, ptr @x, align 4, !tbaa !5
  %71 = add nsw i32 %70, 1
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = srem i32 %71, %72
  store i32 %73, ptr @x, align 4, !tbaa !5
  %74 = load i32, ptr @y, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  %76 = load i32, ptr @m, align 4, !tbaa !5
  %77 = srem i32 %75, %76
  store i32 %77, ptr @y, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %69
  %79 = load i32, ptr %5, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr %5, align 4, !tbaa !5
  br label %45, !llvm.loop !12

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

82:                                               ; preds = %97, %81
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %100

87:                                               ; preds = %82
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = icmp eq i32 %91, 1
  br i1 %92, label %93, label %96

93:                                               ; preds = %87
  %94 = load i32, ptr %6, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %6, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %93, %87
  br label %97

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

100:                                              ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %116, %100
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = load i32, ptr @m, align 4, !tbaa !5
  %104 = icmp slt i32 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %119

106:                                              ; preds = %101
  %107 = load i32, ptr %8, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = icmp eq i32 %110, 1
  br i1 %111, label %112, label %115

112:                                              ; preds = %106
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %6, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %112, %106
  br label %116

116:                                              ; preds = %115
  %117 = load i32, ptr %8, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %8, align 4, !tbaa !5
  br label %101, !llvm.loop !14

119:                                              ; preds = %105
  %120 = load i32, ptr %6, align 4, !tbaa !5
  %121 = load i32, ptr @n, align 4, !tbaa !5
  %122 = load i32, ptr @m, align 4, !tbaa !5
  %123 = add nsw i32 %121, %122
  %124 = icmp eq i32 %120, %123
  br i1 %124, label %125, label %128

125:                                              ; preds = %119
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %127 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %131

128:                                              ; preds = %119
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %131

131:                                              ; preds = %128, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #1

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

; 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

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 = { 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 #4 = { 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 = { 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}


; 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 i32, align 4
@m = external dso_local global i32, align 4
@b = external dso_local global i32, align 4
@g = external dso_local global i32, align 4
@boy = external dso_local local_unnamed_addr global [101 x i32], align 16
@girl = external dso_local local_unnamed_addr global [101 x i32], align 16
@temp = external dso_local global i32, align 4
@x = external dso_local local_unnamed_addr global i32, align 4
@y = external dso_local local_unnamed_addr global i32, align 4
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @g)
  %7 = load i32, ptr @g, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph27, label %._crit_edge28

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.01924 = phi i32 [ %13, %.lr.ph ], [ 0, %0 ]
  %9 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @temp)
  %10 = load i32, ptr @temp, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %11
  store i32 1, ptr %12, align 4, !tbaa !5
  %13 = add nuw nsw i32 %.01924, 1
  %14 = load i32, ptr @b, align 4, !tbaa !5
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge28:                                    ; preds = %.lr.ph27, %._crit_edge
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = load i32, ptr @m, align 4, !tbaa !5
  %18 = mul i32 %16, 10
  %19 = mul i32 %18, %17
  store i32 0, ptr @x, align 4, !tbaa !5
  store i32 0, ptr @y, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph31, label %.preheader23

.lr.ph27:                                         ; preds = %._crit_edge, %.lr.ph27
  %.02025 = phi i32 [ %25, %.lr.ph27 ], [ 0, %._crit_edge ]
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @temp)
  %22 = load i32, ptr @temp, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %23
  store i32 1, ptr %24, align 4, !tbaa !5
  %25 = add nuw nsw i32 %.02025, 1
  %26 = load i32, ptr @g, align 4, !tbaa !5
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph27, label %._crit_edge28, !llvm.loop !11

..preheader23_crit_edge:                          ; preds = %50
  store i32 %52, ptr @x, align 4, !tbaa !5
  store i32 %54, ptr @y, align 4, !tbaa !5
  br label %.preheader23

.preheader23:                                     ; preds = %..preheader23_crit_edge, %._crit_edge28
  %28 = icmp sgt i32 %16, 0
  br i1 %28, label %.lr.ph35.preheader, label %.preheader

.lr.ph35.preheader:                               ; preds = %.preheader23
  %wide.trip.count = zext nneg i32 %16 to i64
  %min.iters.check = icmp ult i32 %16, 8
  br i1 %min.iters.check, label %.lr.ph35.preheader72, label %vector.ph

.lr.ph35.preheader72:                             ; preds = %middle.block, %.lr.ph35.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph35.preheader ], [ %n.vec, %middle.block ]
  %.01733.ph = phi i32 [ 0, %.lr.ph35.preheader ], [ %38, %middle.block ]
  br label %.lr.ph35

vector.ph:                                        ; preds = %.lr.ph35.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %35, %vector.body ]
  %vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %36, %vector.body ]
  %29 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %wide.load = load <4 x i32>, ptr %29, align 16, !tbaa !5
  %wide.load52 = load <4 x i32>, ptr %30, align 16, !tbaa !5
  %31 = icmp eq <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
  %32 = icmp eq <4 x i32> %wide.load52, <i32 1, i32 1, i32 1, i32 1>
  %33 = zext <4 x i1> %31 to <4 x i32>
  %34 = zext <4 x i1> %32 to <4 x i32>
  %35 = add <4 x i32> %vec.phi, %33
  %36 = add <4 x i32> %vec.phi51, %34
  %index.next = add nuw i64 %index, 8
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %36, %35
  %38 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader, label %.lr.ph35.preheader72

.lr.ph31:                                         ; preds = %._crit_edge28, %50
  %.01829 = phi i32 [ %55, %50 ], [ 0, %._crit_edge28 ]
  %39 = phi i32 [ %52, %50 ], [ 0, %._crit_edge28 ]
  %40 = phi i32 [ %54, %50 ], [ 0, %._crit_edge28 ]
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = icmp eq i32 %43, 1
  %.pre = sext i32 %40 to i64
  br i1 %44, label %.lr.ph31._crit_edge, label %45

45:                                               ; preds = %.lr.ph31
  %46 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %.pre
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %.lr.ph31._crit_edge, label %50

.lr.ph31._crit_edge:                              ; preds = %.lr.ph31, %45
  %49 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %.pre
  store i32 1, ptr %49, align 4, !tbaa !5
  store i32 1, ptr %42, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %.lr.ph31._crit_edge, %45
  %51 = add nsw i32 %39, 1
  %52 = srem i32 %51, %16
  %53 = add nsw i32 %40, 1
  %54 = srem i32 %53, %17
  %55 = add nuw nsw i32 %.01829, 1
  %exitcond.not = icmp eq i32 %55, %19
  br i1 %exitcond.not, label %..preheader23_crit_edge, label %.lr.ph31, !llvm.loop !15

.preheader:                                       ; preds = %.lr.ph35, %middle.block, %.preheader23
  %.017.lcssa = phi i32 [ 0, %.preheader23 ], [ %38, %middle.block ], [ %spec.select, %.lr.ph35 ]
  %56 = icmp sgt i32 %17, 0
  br i1 %56, label %.lr.ph38.preheader, label %._crit_edge39

.lr.ph38.preheader:                               ; preds = %.preheader
  %wide.trip.count47 = zext nneg i32 %17 to i64
  %min.iters.check55 = icmp ult i32 %17, 8
  br i1 %min.iters.check55, label %.lr.ph38.preheader70, label %vector.ph56

.lr.ph38.preheader70:                             ; preds = %middle.block53, %.lr.ph38.preheader
  %indvars.iv44.ph = phi i64 [ 0, %.lr.ph38.preheader ], [ %n.vec58, %middle.block53 ]
  %.236.ph = phi i32 [ %.017.lcssa, %.lr.ph38.preheader ], [ %67, %middle.block53 ]
  br label %.lr.ph38

vector.ph56:                                      ; preds = %.lr.ph38.preheader
  %n.vec58 = and i64 %wide.trip.count47, 2147483640
  %57 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.017.lcssa, i64 0
  br label %vector.body60

vector.body60:                                    ; preds = %vector.body60, %vector.ph56
  %index61 = phi i64 [ 0, %vector.ph56 ], [ %index.next66, %vector.body60 ]
  %vec.phi62 = phi <4 x i32> [ %57, %vector.ph56 ], [ %64, %vector.body60 ]
  %vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %65, %vector.body60 ]
  %58 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %index61
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %wide.load64 = load <4 x i32>, ptr %58, align 16, !tbaa !5
  %wide.load65 = load <4 x i32>, ptr %59, align 16, !tbaa !5
  %60 = icmp eq <4 x i32> %wide.load64, <i32 1, i32 1, i32 1, i32 1>
  %61 = icmp eq <4 x i32> %wide.load65, <i32 1, i32 1, i32 1, i32 1>
  %62 = zext <4 x i1> %60 to <4 x i32>
  %63 = zext <4 x i1> %61 to <4 x i32>
  %64 = add <4 x i32> %vec.phi62, %62
  %65 = add <4 x i32> %vec.phi63, %63
  %index.next66 = add nuw i64 %index61, 8
  %66 = icmp eq i64 %index.next66, %n.vec58
  br i1 %66, label %middle.block53, label %vector.body60, !llvm.loop !16

middle.block53:                                   ; preds = %vector.body60
  %bin.rdx67 = add <4 x i32> %65, %64
  %67 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx67)
  %cmp.n68 = icmp eq i64 %n.vec58, %wide.trip.count47
  br i1 %cmp.n68, label %._crit_edge39, label %.lr.ph38.preheader70

.lr.ph35:                                         ; preds = %.lr.ph35.preheader72, %.lr.ph35
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph35 ], [ %indvars.iv.ph, %.lr.ph35.preheader72 ]
  %.01733 = phi i32 [ %spec.select, %.lr.ph35 ], [ %.01733.ph, %.lr.ph35.preheader72 ]
  %68 = getelementptr inbounds [101 x i32], ptr @boy, i64 0, i64 %indvars.iv
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = icmp eq i32 %69, 1
  %71 = zext i1 %70 to i32
  %spec.select = add nuw nsw i32 %.01733, %71
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond43.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond43.not, label %.preheader, label %.lr.ph35, !llvm.loop !17

._crit_edge39:                                    ; preds = %.lr.ph38, %middle.block53, %.preheader
  %.2.lcssa = phi i32 [ %.017.lcssa, %.preheader ], [ %67, %middle.block53 ], [ %spec.select22, %.lr.ph38 ]
  %72 = add nsw i32 %17, %16
  %73 = icmp eq i32 %.2.lcssa, %72
  %.str..str.1 = select i1 %73, ptr @.str, ptr @.str.1
  %74 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str..str.1)
  %75 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %74, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph38:                                         ; preds = %.lr.ph38.preheader70, %.lr.ph38
  %indvars.iv44 = phi i64 [ %indvars.iv.next45, %.lr.ph38 ], [ %indvars.iv44.ph, %.lr.ph38.preheader70 ]
  %.236 = phi i32 [ %spec.select22, %.lr.ph38 ], [ %.236.ph, %.lr.ph38.preheader70 ]
  %76 = getelementptr inbounds [101 x i32], ptr @girl, i64 0, i64 %indvars.iv44
  %77 = load i32, ptr %76, align 4, !tbaa !5
  %78 = icmp eq i32 %77, 1
  %79 = zext i1 %78 to i32
  %spec.select22 = add nsw i32 %.236, %79
  %indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
  %exitcond48.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count47
  br i1 %exitcond48.not, label %._crit_edge39, label %.lr.ph38, !llvm.loop !18
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

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

; 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 #3 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)) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4

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 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !13, !14}
!17 = distinct !{!17, !10, !14, !13}
!18 = distinct !{!18, !10, !14, !13}


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