; LLVM IR from kazunetakahashi/atcoder :: 201411_201509/0320_indeednow_quala/B.ll (Z2XYv)

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

@X = external dso_local global [30 x i32], align 16
@Y = external dso_local global [30 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_Z2XYv() #0 {
  %1 = alloca i1, align 1
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #2
  store ptr @X, ptr %2, align 8, !tbaa !5
  store ptr @Y, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %6

6:                                                ; preds = %22, %0
  %7 = load i32, ptr %4, align 4, !tbaa !9
  %8 = icmp slt i32 %7, 30
  br i1 %8, label %10, label %9

9:                                                ; preds = %6
  store i32 2, ptr %5, align 4
  br label %25

10:                                               ; preds = %6
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = load i32, ptr %11, align 4, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = icmp ne i32 %12, %14
  br i1 %15, label %16, label %17

16:                                               ; preds = %10
  store i1 false, ptr %1, align 1
  store i32 1, ptr %5, align 4
  br label %25

17:                                               ; preds = %10
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds i32, ptr %18, i32 1
  store ptr %19, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds i32, ptr %20, i32 1
  store ptr %21, ptr %3, align 8, !tbaa !5
  br label %22

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

25:                                               ; preds = %16, %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  %26 = load i32, ptr %5, align 4
  switch i32 %26, label %28 [
    i32 2, label %27
  ]

27:                                               ; preds = %25
  store i1 true, ptr %1, align 1
  store i32 1, ptr %5, align 4
  br label %28

28:                                               ; preds = %27, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #2
  %29 = load i1, ptr %1, align 1
  ret i1 %29
}

; 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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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

@X = external dso_local local_unnamed_addr global [30 x i32], align 16
@Y = external dso_local local_unnamed_addr global [30 x i32], align 16

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local noundef zeroext i1 @_Z2XYv() local_unnamed_addr #0 {
  %1 = load i32, ptr @X, align 16, !tbaa !5
  %2 = load i32, ptr @Y, align 16, !tbaa !5
  %.not = icmp eq i32 %1, %2
  br i1 %.not, label %3, label %.critedge

3:                                                ; preds = %0
  %4 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 4), align 4, !tbaa !5
  %5 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 4), align 4, !tbaa !5
  %.not.1 = icmp eq i32 %4, %5
  br i1 %.not.1, label %6, label %.critedge

6:                                                ; preds = %3
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 8), align 8, !tbaa !5
  %8 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 8), align 8, !tbaa !5
  %.not.2 = icmp eq i32 %7, %8
  br i1 %.not.2, label %9, label %.critedge

9:                                                ; preds = %6
  %10 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 12), align 4, !tbaa !5
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 12), align 4, !tbaa !5
  %.not.3 = icmp eq i32 %10, %11
  br i1 %.not.3, label %12, label %.critedge

12:                                               ; preds = %9
  %13 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 16), align 16, !tbaa !5
  %14 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 16), align 16, !tbaa !5
  %.not.4 = icmp eq i32 %13, %14
  br i1 %.not.4, label %15, label %.critedge

15:                                               ; preds = %12
  %16 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 20), align 4, !tbaa !5
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 20), align 4, !tbaa !5
  %.not.5 = icmp eq i32 %16, %17
  br i1 %.not.5, label %18, label %.critedge

18:                                               ; preds = %15
  %19 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 24), align 8, !tbaa !5
  %20 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 24), align 8, !tbaa !5
  %.not.6 = icmp eq i32 %19, %20
  br i1 %.not.6, label %21, label %.critedge

21:                                               ; preds = %18
  %22 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 28), align 4, !tbaa !5
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 28), align 4, !tbaa !5
  %.not.7 = icmp eq i32 %22, %23
  br i1 %.not.7, label %24, label %.critedge

24:                                               ; preds = %21
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 32), align 16, !tbaa !5
  %26 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 32), align 16, !tbaa !5
  %.not.8 = icmp eq i32 %25, %26
  br i1 %.not.8, label %27, label %.critedge

27:                                               ; preds = %24
  %28 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 36), align 4, !tbaa !5
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 36), align 4, !tbaa !5
  %.not.9 = icmp eq i32 %28, %29
  br i1 %.not.9, label %30, label %.critedge

30:                                               ; preds = %27
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 40), align 8, !tbaa !5
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 40), align 8, !tbaa !5
  %.not.10 = icmp eq i32 %31, %32
  br i1 %.not.10, label %33, label %.critedge

33:                                               ; preds = %30
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 44), align 4, !tbaa !5
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 44), align 4, !tbaa !5
  %.not.11 = icmp eq i32 %34, %35
  br i1 %.not.11, label %36, label %.critedge

36:                                               ; preds = %33
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 48), align 16, !tbaa !5
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 48), align 16, !tbaa !5
  %.not.12 = icmp eq i32 %37, %38
  br i1 %.not.12, label %39, label %.critedge

39:                                               ; preds = %36
  %40 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 52), align 4, !tbaa !5
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 52), align 4, !tbaa !5
  %.not.13 = icmp eq i32 %40, %41
  br i1 %.not.13, label %42, label %.critedge

42:                                               ; preds = %39
  %43 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 56), align 8, !tbaa !5
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 56), align 8, !tbaa !5
  %.not.14 = icmp eq i32 %43, %44
  br i1 %.not.14, label %45, label %.critedge

45:                                               ; preds = %42
  %46 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 60), align 4, !tbaa !5
  %47 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 60), align 4, !tbaa !5
  %.not.15 = icmp eq i32 %46, %47
  br i1 %.not.15, label %48, label %.critedge

48:                                               ; preds = %45
  %49 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 64), align 16, !tbaa !5
  %50 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 64), align 16, !tbaa !5
  %.not.16 = icmp eq i32 %49, %50
  br i1 %.not.16, label %51, label %.critedge

51:                                               ; preds = %48
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 68), align 4, !tbaa !5
  %53 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 68), align 4, !tbaa !5
  %.not.17 = icmp eq i32 %52, %53
  br i1 %.not.17, label %54, label %.critedge

54:                                               ; preds = %51
  %55 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 72), align 8, !tbaa !5
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 72), align 8, !tbaa !5
  %.not.18 = icmp eq i32 %55, %56
  br i1 %.not.18, label %57, label %.critedge

57:                                               ; preds = %54
  %58 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 76), align 4, !tbaa !5
  %59 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 76), align 4, !tbaa !5
  %.not.19 = icmp eq i32 %58, %59
  br i1 %.not.19, label %60, label %.critedge

60:                                               ; preds = %57
  %61 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 80), align 16, !tbaa !5
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 80), align 16, !tbaa !5
  %.not.20 = icmp eq i32 %61, %62
  br i1 %.not.20, label %63, label %.critedge

63:                                               ; preds = %60
  %64 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 84), align 4, !tbaa !5
  %65 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 84), align 4, !tbaa !5
  %.not.21 = icmp eq i32 %64, %65
  br i1 %.not.21, label %66, label %.critedge

66:                                               ; preds = %63
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 88), align 8, !tbaa !5
  %68 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 88), align 8, !tbaa !5
  %.not.22 = icmp eq i32 %67, %68
  br i1 %.not.22, label %69, label %.critedge

69:                                               ; preds = %66
  %70 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 92), align 4, !tbaa !5
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 92), align 4, !tbaa !5
  %.not.23 = icmp eq i32 %70, %71
  br i1 %.not.23, label %72, label %.critedge

72:                                               ; preds = %69
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 96), align 16, !tbaa !5
  %74 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 96), align 16, !tbaa !5
  %.not.24 = icmp eq i32 %73, %74
  br i1 %.not.24, label %75, label %.critedge

75:                                               ; preds = %72
  %76 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 100), align 4, !tbaa !5
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 100), align 4, !tbaa !5
  %.not.25 = icmp eq i32 %76, %77
  br i1 %.not.25, label %78, label %.critedge

78:                                               ; preds = %75
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 104), align 8, !tbaa !5
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 104), align 8, !tbaa !5
  %.not.26 = icmp eq i32 %79, %80
  br i1 %.not.26, label %81, label %.critedge

81:                                               ; preds = %78
  %82 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 108), align 4, !tbaa !5
  %83 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 108), align 4, !tbaa !5
  %.not.27 = icmp eq i32 %82, %83
  br i1 %.not.27, label %84, label %.critedge

84:                                               ; preds = %81
  %85 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 112), align 16, !tbaa !5
  %86 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 112), align 16, !tbaa !5
  %.not.28 = icmp eq i32 %85, %86
  br i1 %.not.28, label %87, label %.critedge

87:                                               ; preds = %84
  %88 = load i32, ptr getelementptr inbounds (i8, ptr @X, i64 116), align 4, !tbaa !5
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @Y, i64 116), align 4, !tbaa !5
  %.not.29 = icmp eq i32 %88, %89
  br label %.critedge

.critedge:                                        ; preds = %87, %84, %81, %78, %75, %72, %69, %66, %63, %60, %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %15, %12, %9, %6, %3, %0
  %.lcssa = phi i1 [ false, %0 ], [ false, %3 ], [ false, %6 ], [ false, %9 ], [ false, %12 ], [ false, %15 ], [ false, %18 ], [ false, %21 ], [ false, %24 ], [ false, %27 ], [ false, %30 ], [ false, %33 ], [ false, %36 ], [ false, %39 ], [ false, %42 ], [ false, %45 ], [ false, %48 ], [ false, %51 ], [ false, %54 ], [ false, %57 ], [ false, %60 ], [ false, %63 ], [ false, %66 ], [ false, %69 ], [ false, %72 ], [ false, %75 ], [ false, %78 ], [ false, %81 ], [ false, %84 ], [ %.not.29, %87 ]
  ret i1 %.lcssa
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) 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" }

!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"}


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass