; LLVM IR from tangjz/acm-icpc :: hdu (4760)

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

@sz = external dso_local global [1025 x i32], align 16
@len = external dso_local global [1025 x [17 x i32]], align 16
@msk = external dso_local global [1025 x [17 x i32]], align 16
@buf = external dso_local global [17 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7read_ipv() #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z11read_subnetRi(ptr noundef nonnull align 4 dereferenceable(4)) #0

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

17:                                               ; preds = %180, %0
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.2, ptr noundef @buf)
  %19 = icmp eq i32 %18, 1
  br i1 %19, label %20, label %181

20:                                               ; preds = %17
  %21 = load i8, ptr @buf, align 16, !tbaa !5
  %22 = sext i8 %21 to i32
  %23 = icmp eq i32 %22, 69
  br i1 %23, label %24, label %57

24:                                               ; preds = %20
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.3, ptr noundef %2, ptr noundef %3)
  %26 = load i32, ptr %3, align 4, !tbaa !8
  %27 = load i32, ptr %2, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [1025 x i32], ptr @sz, i64 0, i64 %28
  store i32 %26, ptr %29, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [1025 x [17 x i32]], ptr @len, i64 0, i64 %31
  %33 = getelementptr inbounds [17 x i32], ptr %32, i64 0, i64 0
  store ptr %33, ptr %4, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %34 = load i32, ptr %2, align 4, !tbaa !8
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [1025 x [17 x i32]], ptr @msk, i64 0, i64 %35
  %37 = getelementptr inbounds [17 x i32], ptr %36, i64 0, i64 0
  store ptr %37, ptr %5, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %38

38:                                               ; preds = %53, %24
  %39 = load i32, ptr %6, align 4, !tbaa !8
  %40 = load i32, ptr %3, align 4, !tbaa !8
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %56

43:                                               ; preds = %38
  %44 = load ptr, ptr %4, align 8, !tbaa !10
  %45 = load i32, ptr %6, align 4, !tbaa !8
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = call noundef i32 @_Z11read_subnetRi(ptr noundef nonnull align 4 dereferenceable(4) %47)
  %49 = load ptr, ptr %5, align 8, !tbaa !10
  %50 = load i32, ptr %6, align 4, !tbaa !8
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  store i32 %48, ptr %52, align 4, !tbaa !8
  br label %53

53:                                               ; preds = %43
  %54 = load i32, ptr %6, align 4, !tbaa !8
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %6, align 4, !tbaa !8
  br label %38, !llvm.loop !12

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

57:                                               ; preds = %20
  %58 = load i8, ptr @buf, align 16, !tbaa !5
  %59 = sext i8 %58 to i32
  %60 = icmp eq i32 %59, 68
  br i1 %60, label %61, label %66

61:                                               ; preds = %57
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.4, ptr noundef %2)
  %63 = load i32, ptr %2, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [1025 x i32], ptr @sz, i64 0, i64 %64
  store i32 0, ptr %65, align 4, !tbaa !8
  br label %179

66:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %67 = call noundef i32 @_Z7read_ipv()
  store i32 %67, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %68 = call noundef i32 @_Z7read_ipv()
  store i32 %68, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #4
  store i8 0, ptr %9, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !8
  br label %69

69:                                               ; preds = %167, %66
  %70 = load i32, ptr %10, align 4, !tbaa !8
  %71 = icmp slt i32 %70, 1025
  br i1 %71, label %72, label %76

72:                                               ; preds = %69
  %73 = load i8, ptr %9, align 1, !tbaa !14, !range !16, !noundef !17
  %74 = trunc i8 %73 to i1
  %75 = xor i1 %74, true
  br label %76

76:                                               ; preds = %72, %69
  %77 = phi i1 [ false, %69 ], [ %75, %72 ]
  br i1 %77, label %79, label %78

78:                                               ; preds = %76
  store i32 7, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %170

79:                                               ; preds = %76
  %80 = load i32, ptr %10, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [1025 x i32], ptr @sz, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %86, label %85

85:                                               ; preds = %79
  br label %167

86:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #4
  store i8 0, ptr %12, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  store i8 0, ptr %13, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %87 = load i32, ptr %10, align 4, !tbaa !8
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [1025 x [17 x i32]], ptr @len, i64 0, i64 %88
  %90 = getelementptr inbounds [17 x i32], ptr %89, i64 0, i64 0
  store ptr %90, ptr %14, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %91 = load i32, ptr %10, align 4, !tbaa !8
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [1025 x [17 x i32]], ptr @msk, i64 0, i64 %92
  %94 = getelementptr inbounds [17 x i32], ptr %93, i64 0, i64 0
  store ptr %94, ptr %15, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !8
  br label %95

95:                                               ; preds = %150, %86
  %96 = load i32, ptr %16, align 4, !tbaa !8
  %97 = load i32, ptr %10, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [1025 x i32], ptr @sz, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !8
  %101 = icmp slt i32 %96, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %95
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %153

103:                                              ; preds = %95
  %104 = load i32, ptr %7, align 4, !tbaa !8
  %105 = load ptr, ptr %15, align 8, !tbaa !10
  %106 = load i32, ptr %16, align 4, !tbaa !8
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %105, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !8
  %110 = xor i32 %104, %109
  %111 = load ptr, ptr %14, align 8, !tbaa !10
  %112 = load i32, ptr %16, align 4, !tbaa !8
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds i32, ptr %111, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !8
  %116 = sub nsw i32 32, %115
  %117 = lshr i32 %110, %116
  %118 = icmp ne i32 %117, 0
  %119 = xor i1 %118, true
  %120 = zext i1 %119 to i32
  %121 = load i8, ptr %12, align 1, !tbaa !14, !range !16, !noundef !17
  %122 = trunc i8 %121 to i1
  %123 = zext i1 %122 to i32
  %124 = or i32 %123, %120
  %125 = icmp ne i32 %124, 0
  %126 = zext i1 %125 to i8
  store i8 %126, ptr %12, align 1, !tbaa !14
  %127 = load i32, ptr %8, align 4, !tbaa !8
  %128 = load ptr, ptr %15, align 8, !tbaa !10
  %129 = load i32, ptr %16, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i32, ptr %128, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !8
  %133 = xor i32 %127, %132
  %134 = load ptr, ptr %14, align 8, !tbaa !10
  %135 = load i32, ptr %16, align 4, !tbaa !8
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !8
  %139 = sub nsw i32 32, %138
  %140 = lshr i32 %133, %139
  %141 = icmp ne i32 %140, 0
  %142 = xor i1 %141, true
  %143 = zext i1 %142 to i32
  %144 = load i8, ptr %13, align 1, !tbaa !14, !range !16, !noundef !17
  %145 = trunc i8 %144 to i1
  %146 = zext i1 %145 to i32
  %147 = or i32 %146, %143
  %148 = icmp ne i32 %147, 0
  %149 = zext i1 %148 to i8
  store i8 %149, ptr %13, align 1, !tbaa !14
  br label %150

150:                                              ; preds = %103
  %151 = load i32, ptr %16, align 4, !tbaa !8
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %16, align 4, !tbaa !8
  br label %95, !llvm.loop !18

153:                                              ; preds = %102
  %154 = load i8, ptr %12, align 1, !tbaa !14, !range !16, !noundef !17
  %155 = trunc i8 %154 to i1
  %156 = zext i1 %155 to i32
  %157 = load i8, ptr %13, align 1, !tbaa !14, !range !16, !noundef !17
  %158 = trunc i8 %157 to i1
  %159 = zext i1 %158 to i32
  %160 = and i32 %156, %159
  %161 = load i8, ptr %9, align 1, !tbaa !14, !range !16, !noundef !17
  %162 = trunc i8 %161 to i1
  %163 = zext i1 %162 to i32
  %164 = or i32 %163, %160
  %165 = icmp ne i32 %164, 0
  %166 = zext i1 %165 to i8
  store i8 %166, ptr %9, align 1, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #4
  br label %167

167:                                              ; preds = %153, %85
  %168 = load i32, ptr %10, align 4, !tbaa !8
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %10, align 4, !tbaa !8
  br label %69, !llvm.loop !19

170:                                              ; preds = %78
  %171 = load i8, ptr %9, align 1, !tbaa !14, !range !16, !noundef !17
  %172 = trunc i8 %171 to i1
  br i1 %172, label %173, label %174

173:                                              ; preds = %170
  br label %175

174:                                              ; preds = %170
  br label %175

175:                                              ; preds = %174, %173
  %176 = phi ptr [ @.str.5, %173 ], [ @.str.6, %174 ]
  %177 = getelementptr inbounds [2 x i8], ptr %176, i64 0, i64 0
  %178 = call i32 @puts(ptr noundef %177)
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %179

179:                                              ; preds = %175, %61
  br label %180

180:                                              ; preds = %179, %56
  br label %17, !llvm.loop !20

181:                                              ; preds = %17
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %182 = load i32, ptr %1, align 4
  ret i32 %182
}

declare i32 @puts(ptr noundef) #2

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 = { "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 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !6, i64 0}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}


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

@sz = external dso_local local_unnamed_addr global [1025 x i32], align 16
@len = external dso_local global [1025 x [17 x i32]], align 16
@msk = external dso_local local_unnamed_addr global [1025 x [17 x i32]], align 16
@buf = external dso_local global [17 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7read_ipv() 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; 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 uwtable
declare dso_local noundef i32 @_Z11read_subnetRi(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @buf)
  %4 = icmp eq i32 %3, 1
  br i1 %4, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %0, %.loopexit
  %5 = load i8, ptr @buf, align 16, !tbaa !5
  switch i8 %5, label %26 [
    i8 69, label %6
    i8 68, label %21
  ]

6:                                                ; preds = %.lr.ph49
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %8 = load i32, ptr %2, align 4, !tbaa !8
  %9 = load i32, ptr %1, align 4, !tbaa !8
  %10 = sext i32 %9 to i64
  %11 = getelementptr inbounds [1025 x i32], ptr @sz, i64 0, i64 %10
  store i32 %8, ptr %11, align 4, !tbaa !8
  %12 = getelementptr inbounds [1025 x [17 x i32]], ptr @len, i64 0, i64 %10
  %13 = getelementptr inbounds [1025 x [17 x i32]], ptr @msk, i64 0, i64 %10
  %14 = icmp sgt i32 %8, 0
  br i1 %14, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %6, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %6 ]
  %15 = getelementptr inbounds i32, ptr %12, i64 %indvars.iv
  %16 = call noundef i32 @_Z11read_subnetRi(ptr noundef nonnull align 4 dereferenceable(4) %15)
  %17 = getelementptr inbounds i32, ptr %13, i64 %indvars.iv
  store i32 %16, ptr %17, align 4, !tbaa !8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr %2, align 4, !tbaa !8
  %19 = sext i32 %18 to i64
  %20 = icmp slt i64 %indvars.iv.next, %19
  br i1 %20, label %.lr.ph, label %.loopexit, !llvm.loop !10

21:                                               ; preds = %.lr.ph49
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %1)
  %23 = load i32, ptr %1, align 4, !tbaa !8
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [1025 x i32], ptr @sz, i64 0, i64 %24
  store i32 0, ptr %25, align 4, !tbaa !8
  br label %.loopexit

26:                                               ; preds = %.lr.ph49
  %27 = call noundef i32 @_Z7read_ipv()
  %28 = call noundef i32 @_Z7read_ipv()
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %27, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert65 = insertelement <4 x i32> poison, i32 %28, i64 0
  %broadcast.splat66 = shufflevector <4 x i32> %broadcast.splatinsert65, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %32

29:                                               ; preds = %._crit_edge
  %30 = select i1 %.1, ptr @.str.5, ptr @.str.6
  %31 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %30)
  br label %.loopexit

32:                                               ; preds = %26, %._crit_edge
  %indvars.iv55 = phi i64 [ 1, %26 ], [ %indvars.iv.next56, %._crit_edge ]
  %33 = getelementptr inbounds [1025 x i32], ptr @sz, i64 0, i64 %indvars.iv55
  %34 = load i32, ptr %33, align 4, !tbaa !8
  %.not = icmp eq i32 %34, 0
  br i1 %.not, label %._crit_edge, label %35

35:                                               ; preds = %32
  %36 = getelementptr inbounds [1025 x [17 x i32]], ptr @len, i64 0, i64 %indvars.iv55
  %37 = getelementptr inbounds [1025 x [17 x i32]], ptr @msk, i64 0, i64 %indvars.iv55
  %38 = icmp sgt i32 %34, 0
  br i1 %38, label %.lr.ph44.preheader, label %._crit_edge

.lr.ph44.preheader:                               ; preds = %35
  %wide.trip.count = zext nneg i32 %34 to i64
  %min.iters.check = icmp ult i32 %34, 8
  br i1 %min.iters.check, label %.lr.ph44.preheader69, label %vector.ph

.lr.ph44.preheader69:                             ; preds = %middle.block, %.lr.ph44.preheader
  %indvars.iv53.ph = phi i64 [ 0, %.lr.ph44.preheader ], [ %n.vec, %middle.block ]
  %.03242.ph = phi i1 [ false, %.lr.ph44.preheader ], [ %63, %middle.block ]
  %.03341.ph = phi i1 [ false, %.lr.ph44.preheader ], [ %65, %middle.block ]
  br label %.lr.ph44

vector.ph:                                        ; preds = %.lr.ph44.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 i1> [ zeroinitializer, %vector.ph ], [ %59, %vector.body ]
  %vec.phi59 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %60, %vector.body ]
  %vec.phi60 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %51, %vector.body ]
  %vec.phi61 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %52, %vector.body ]
  %39 = getelementptr inbounds i32, ptr %37, i64 %index
  %40 = getelementptr inbounds i8, ptr %39, i64 16
  %wide.load = load <4 x i32>, ptr %39, align 4, !tbaa !8
  %wide.load62 = load <4 x i32>, ptr %40, align 4, !tbaa !8
  %41 = xor <4 x i32> %wide.load, %broadcast.splat
  %42 = xor <4 x i32> %wide.load62, %broadcast.splat
  %43 = getelementptr inbounds i32, ptr %36, i64 %index
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %wide.load63 = load <4 x i32>, ptr %43, align 4, !tbaa !8
  %wide.load64 = load <4 x i32>, ptr %44, align 4, !tbaa !8
  %45 = sub nsw <4 x i32> <i32 32, i32 32, i32 32, i32 32>, %wide.load63
  %46 = sub nsw <4 x i32> <i32 32, i32 32, i32 32, i32 32>, %wide.load64
  %47 = lshr <4 x i32> %41, %45
  %48 = lshr <4 x i32> %42, %46
  %49 = icmp eq <4 x i32> %47, zeroinitializer
  %50 = icmp eq <4 x i32> %48, zeroinitializer
  %51 = or <4 x i1> %vec.phi60, %49
  %52 = or <4 x i1> %vec.phi61, %50
  %53 = xor <4 x i32> %wide.load, %broadcast.splat66
  %54 = xor <4 x i32> %wide.load62, %broadcast.splat66
  %55 = lshr <4 x i32> %53, %45
  %56 = lshr <4 x i32> %54, %46
  %57 = icmp eq <4 x i32> %55, zeroinitializer
  %58 = icmp eq <4 x i32> %56, zeroinitializer
  %59 = or <4 x i1> %vec.phi, %57
  %60 = or <4 x i1> %vec.phi59, %58
  %index.next = add nuw i64 %index, 8
  %61 = icmp eq i64 %index.next, %n.vec
  br i1 %61, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i1> %60, %59
  %62 = bitcast <4 x i1> %bin.rdx to i4
  %63 = icmp ne i4 %62, 0
  %bin.rdx67 = or <4 x i1> %52, %51
  %64 = bitcast <4 x i1> %bin.rdx67 to i4
  %65 = icmp ne i4 %64, 0
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge.loopexit, label %.lr.ph44.preheader69

._crit_edge.loopexit:                             ; preds = %.lr.ph44, %middle.block
  %.lcssa58 = phi i1 [ %65, %middle.block ], [ %74, %.lr.ph44 ]
  %.lcssa = phi i1 [ %63, %middle.block ], [ %77, %.lr.ph44 ]
  %66 = and i1 %.lcssa58, %.lcssa
  br label %._crit_edge

.lr.ph44:                                         ; preds = %.lr.ph44.preheader69, %.lr.ph44
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %.lr.ph44 ], [ %indvars.iv53.ph, %.lr.ph44.preheader69 ]
  %.03242 = phi i1 [ %77, %.lr.ph44 ], [ %.03242.ph, %.lr.ph44.preheader69 ]
  %.03341 = phi i1 [ %74, %.lr.ph44 ], [ %.03341.ph, %.lr.ph44.preheader69 ]
  %67 = getelementptr inbounds i32, ptr %37, i64 %indvars.iv53
  %68 = load i32, ptr %67, align 4, !tbaa !8
  %69 = xor i32 %68, %27
  %70 = getelementptr inbounds i32, ptr %36, i64 %indvars.iv53
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = sub nsw i32 32, %71
  %73 = lshr i32 %69, %72
  %.not38 = icmp eq i32 %73, 0
  %74 = or i1 %.03341, %.not38
  %75 = xor i32 %68, %28
  %76 = lshr i32 %75, %72
  %.not39 = icmp eq i32 %76, 0
  %77 = or i1 %.03242, %.not39
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph44, !llvm.loop !15

._crit_edge:                                      ; preds = %35, %._crit_edge.loopexit, %32
  %.1 = phi i1 [ false, %32 ], [ false, %35 ], [ %66, %._crit_edge.loopexit ]
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %78 = icmp ugt i64 %indvars.iv55, 1023
  %.not37 = select i1 %78, i1 true, i1 %.1
  br i1 %.not37, label %29, label %32, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph, %6, %21, %29
  %79 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @buf)
  %80 = icmp eq i32 %79, 1
  br i1 %80, label %.lr.ph49, label %._crit_edge50, !llvm.loop !17

._crit_edge50:                                    ; preds = %.loopexit, %0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret i32 0
}

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

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 = { 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 #3 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !11, !14, !13}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}


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