; LLVM IR from tangjz/acm-icpc :: codeforces/complete (662A)

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

@n = external dso_local global i32, align 4
@r = external dso_local global i32, align 4
@a = external dso_local global [500001 x i64], align 16
@s = external dso_local global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 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 i64, align 8
  %4 = alloca i64, align 8
  %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
  store i32 0, ptr %1, align 4
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %12

12:                                               ; preds = %28, %0
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = load i32, ptr @n, 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) #4
  br label %31

17:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %3, ptr noundef %4)
  %19 = load i64, ptr %3, align 8, !tbaa !9
  %20 = load i64, ptr %4, align 8, !tbaa !9
  %21 = xor i64 %19, %20
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %23
  store i64 %21, ptr %24, align 8, !tbaa !9
  %25 = load i64, ptr %3, align 8, !tbaa !9
  %26 = load i64, ptr @s, align 8, !tbaa !9
  %27 = xor i64 %26, %25
  store i64 %27, ptr @s, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %28

28:                                               ; preds = %17
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, 1
  store i32 %30, ptr %2, align 4, !tbaa !5
  br label %12, !llvm.loop !11

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

32:                                               ; preds = %110, %31
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 60
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 -1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %37 = load i32, ptr @r, align 4, !tbaa !5
  store i32 %37, ptr %8, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %56, %36
  %39 = load i32, ptr %8, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 8, ptr %6, align 4
  br label %59

43:                                               ; preds = %38
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !9
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = zext i32 %48 to i64
  %50 = ashr i64 %47, %49
  %51 = and i64 %50, 1
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %43
  %54 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %54, ptr %7, align 4, !tbaa !5
  store i32 8, ptr %6, align 4
  br label %59

55:                                               ; preds = %43
  br label %56

56:                                               ; preds = %55
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %8, align 4, !tbaa !5
  br label %38, !llvm.loop !13

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

60:                                               ; preds = %59
  %61 = load i32, ptr %7, align 4, !tbaa !5
  %62 = icmp eq i32 %61, -1
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  store i32 7, ptr %6, align 4
  br label %107

64:                                               ; preds = %60
  %65 = load i32, ptr @r, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %66
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %69
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %67, ptr noundef nonnull align 8 dereferenceable(8) %70) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %101, %64
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = load i32, ptr @n, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

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

76:                                               ; preds = %71
  %77 = load i32, ptr %9, align 4, !tbaa !5
  %78 = load i32, ptr @r, align 4, !tbaa !5
  %79 = icmp ne i32 %77, %78
  br i1 %79, label %80, label %100

80:                                               ; preds = %76
  %81 = load i32, ptr %9, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %82
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = load i32, ptr %5, align 4, !tbaa !5
  %86 = zext i32 %85 to i64
  %87 = ashr i64 %84, %86
  %88 = and i64 %87, 1
  %89 = icmp ne i64 %88, 0
  br i1 %89, label %90, label %100

90:                                               ; preds = %80
  %91 = load i32, ptr @r, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %92
  %94 = load i64, ptr %93, align 8, !tbaa !9
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !9
  %99 = xor i64 %98, %94
  store i64 %99, ptr %97, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %90, %80, %76
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %9, align 4, !tbaa !5
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %9, align 4, !tbaa !5
  br label %71, !llvm.loop !14

104:                                              ; preds = %75
  %105 = load i32, ptr @r, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr @r, align 4, !tbaa !5
  store i32 0, ptr %6, align 4
  br label %107

107:                                              ; preds = %104, %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %108 = load i32, ptr %6, align 4
  switch i32 %108, label %159 [
    i32 0, label %109
    i32 7, label %110
  ]

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109, %107
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %5, align 4, !tbaa !5
  br label %32, !llvm.loop !15

113:                                              ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %141, %113
  %115 = load i32, ptr %10, align 4, !tbaa !5
  %116 = load i32, ptr @r, align 4, !tbaa !5
  %117 = icmp slt i32 %115, %116
  br i1 %117, label %119, label %118

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

119:                                              ; preds = %114
  %120 = load i64, ptr @s, align 8, !tbaa !9
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !9
  %125 = load i32, ptr %10, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !9
  %129 = sub nsw i64 0, %128
  %130 = and i64 %124, %129
  %131 = and i64 %120, %130
  %132 = icmp ne i64 %131, 0
  br i1 %132, label %133, label %140

133:                                              ; preds = %119
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %135
  %137 = load i64, ptr %136, align 8, !tbaa !9
  %138 = load i64, ptr @s, align 8, !tbaa !9
  %139 = xor i64 %138, %137
  store i64 %139, ptr @s, align 8, !tbaa !9
  br label %140

140:                                              ; preds = %133, %119
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %10, align 4, !tbaa !5
  br label %114, !llvm.loop !16

144:                                              ; preds = %118
  %145 = load i64, ptr @s, align 8, !tbaa !9
  %146 = icmp ne i64 %145, 0
  br i1 %146, label %147, label %149

147:                                              ; preds = %144
  %148 = call i32 @puts(ptr noundef @.str.2)
  br label %158

149:                                              ; preds = %144
  %150 = load i32, ptr @r, align 4, !tbaa !5
  %151 = zext i32 %150 to i64
  %152 = shl i64 1, %151
  %153 = sub nsw i64 %152, 1
  %154 = load i32, ptr @r, align 4, !tbaa !5
  %155 = zext i32 %154 to i64
  %156 = shl i64 1, %155
  %157 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %153, i64 noundef %156)
  br label %158

158:                                              ; preds = %149, %147
  ret i32 0

159:                                              ; preds = %107
  unreachable
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

declare i32 @puts(ptr noundef) #1

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

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 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 #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}


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

@n = external dso_local global i32, align 4
@r = external dso_local local_unnamed_addr global i32, align 4
@a = external dso_local global [500001 x i64], align 16
@s = external dso_local local_unnamed_addr global i64, align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: mustprogress norecurse nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %4 = load i32, ptr @n, align 4, !tbaa !5
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %.preheader35

.preheader35:                                     ; preds = %.lr.ph, %0
  %6 = phi i32 [ %4, %0 ], [ %16, %.lr.ph ]
  %7 = load i32, ptr @r, align 4, !tbaa !5
  %8 = icmp slt i32 %7, %6
  br i1 %8, label %.preheader35.split, label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2)
  %10 = load i64, ptr %1, align 8, !tbaa !9
  %11 = load i64, ptr %2, align 8, !tbaa !9
  %12 = xor i64 %11, %10
  %13 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv
  store i64 %12, ptr %13, align 8, !tbaa !9
  %14 = load i64, ptr @s, align 8, !tbaa !9
  %15 = xor i64 %14, %10
  store i64 %15, ptr @s, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = icmp slt i64 %indvars.iv.next, %17
  br i1 %18, label %.lr.ph, label %.preheader35, !llvm.loop !11

.preheader:                                       ; preds = %.thread, %.preheader35
  %19 = phi i32 [ %7, %.preheader35 ], [ %70, %.thread ]
  %s.promoted = load i64, ptr @s, align 8, !tbaa !9
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph45.preheader, label %._crit_edge46

.lr.ph45.preheader:                               ; preds = %.preheader
  %wide.trip.count65 = zext nneg i32 %19 to i64
  %xtraiter76 = and i64 %wide.trip.count65, 1
  %21 = icmp eq i32 %19, 1
  br i1 %21, label %._crit_edge46.loopexit.unr-lcssa, label %.lr.ph45.preheader.new

.lr.ph45.preheader.new:                           ; preds = %.lr.ph45.preheader
  %unroll_iter79 = and i64 %wide.trip.count65, 2147483646
  br label %.lr.ph45

.preheader35.split:                               ; preds = %.preheader35, %.thread
  %22 = phi i32 [ %69, %.thread ], [ %6, %.preheader35 ]
  %23 = phi i32 [ %70, %.thread ], [ %7, %.preheader35 ]
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %.thread ], [ 0, %.preheader35 ]
  %24 = icmp slt i32 %23, %22
  br i1 %24, label %.lr.ph39, label %.thread

.lr.ph39:                                         ; preds = %.preheader35.split
  %25 = shl nuw i64 1, %indvars.iv58
  %26 = sext i32 %23 to i64
  %wide.trip.count = sext i32 %22 to i64
  br label %27

27:                                               ; preds = %.lr.ph39, %31
  %indvars.iv50 = phi i64 [ %26, %.lr.ph39 ], [ %indvars.iv.next51, %31 ]
  %28 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv50
  %29 = load i64, ptr %28, align 8, !tbaa !9
  %30 = and i64 %29, %25
  %.not31 = icmp eq i64 %30, 0
  br i1 %.not31, label %31, label %32

31:                                               ; preds = %27
  %indvars.iv.next51 = add nsw i64 %indvars.iv50, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count
  br i1 %exitcond.not, label %.thread, label %27, !llvm.loop !13

32:                                               ; preds = %27
  %33 = icmp eq i64 %indvars.iv50, -1
  br i1 %33, label %.thread, label %34

34:                                               ; preds = %32
  %35 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %26
  %sext = shl i64 %indvars.iv50, 32
  %36 = ashr exact i64 %sext, 32
  %37 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %36
  call void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull align 8 dereferenceable(8) %37) #4
  %38 = load i32, ptr @n, align 4, !tbaa !5
  %39 = icmp sgt i32 %38, 0
  %.pre = load i32, ptr @r, align 4, !tbaa !5
  br i1 %39, label %.lr.ph41, label %._crit_edge

.lr.ph41:                                         ; preds = %34
  %40 = sext i32 %.pre to i64
  %41 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %40
  %42 = zext i32 %.pre to i64
  %wide.trip.count56 = zext nneg i32 %38 to i64
  %xtraiter = and i64 %wide.trip.count56, 1
  %43 = icmp eq i32 %38, 1
  br i1 %43, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph41.new

.lr.ph41.new:                                     ; preds = %.lr.ph41
  %unroll_iter = and i64 %wide.trip.count56, 2147483646
  br label %52

._crit_edge.loopexit.unr-lcssa:                   ; preds = %68, %.lr.ph41
  %indvars.iv53.unr = phi i64 [ 0, %.lr.ph41 ], [ %indvars.iv.next54.1, %68 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %.not32.epil = icmp eq i64 %indvars.iv53.unr, %42
  %or.cond = select i1 %lcmp.mod.not, i1 true, i1 %.not32.epil
  br i1 %or.cond, label %._crit_edge, label %44

44:                                               ; preds = %._crit_edge.loopexit.unr-lcssa
  %45 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv53.unr
  %46 = load i64, ptr %45, align 8, !tbaa !9
  %47 = and i64 %46, %25
  %.not33.epil = icmp eq i64 %47, 0
  br i1 %.not33.epil, label %._crit_edge, label %48

48:                                               ; preds = %44
  %49 = load i64, ptr %41, align 8, !tbaa !9
  %50 = xor i64 %49, %46
  store i64 %50, ptr %45, align 8, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %48, %44, %34
  %51 = add nsw i32 %.pre, 1
  store i32 %51, ptr @r, align 4, !tbaa !5
  br label %.thread

52:                                               ; preds = %68, %.lr.ph41.new
  %indvars.iv53 = phi i64 [ 0, %.lr.ph41.new ], [ %indvars.iv.next54.1, %68 ]
  %niter = phi i64 [ 0, %.lr.ph41.new ], [ %niter.next.1, %68 ]
  %.not32 = icmp eq i64 %indvars.iv53, %42
  br i1 %.not32, label %60, label %53

53:                                               ; preds = %52
  %54 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv53
  %55 = load i64, ptr %54, align 16, !tbaa !9
  %56 = and i64 %55, %25
  %.not33 = icmp eq i64 %56, 0
  br i1 %.not33, label %60, label %57

57:                                               ; preds = %53
  %58 = load i64, ptr %41, align 8, !tbaa !9
  %59 = xor i64 %58, %55
  store i64 %59, ptr %54, align 16, !tbaa !9
  br label %60

60:                                               ; preds = %52, %53, %57
  %indvars.iv.next54 = or disjoint i64 %indvars.iv53, 1
  %.not32.1 = icmp eq i64 %indvars.iv.next54, %42
  br i1 %.not32.1, label %68, label %61

61:                                               ; preds = %60
  %62 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv.next54
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = and i64 %63, %25
  %.not33.1 = icmp eq i64 %64, 0
  br i1 %.not33.1, label %68, label %65

65:                                               ; preds = %61
  %66 = load i64, ptr %41, align 8, !tbaa !9
  %67 = xor i64 %66, %63
  store i64 %67, ptr %62, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %65, %61, %60
  %indvars.iv.next54.1 = add nuw nsw i64 %indvars.iv53, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %52, !llvm.loop !14

.thread:                                          ; preds = %31, %.preheader35.split, %32, %._crit_edge
  %69 = phi i32 [ %22, %.preheader35.split ], [ %22, %32 ], [ %38, %._crit_edge ], [ %22, %31 ]
  %70 = phi i32 [ %23, %.preheader35.split ], [ %23, %32 ], [ %51, %._crit_edge ], [ %23, %31 ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next59, 60
  br i1 %exitcond61.not, label %.preheader, label %.preheader35.split, !llvm.loop !15

._crit_edge46.loopexit.unr-lcssa:                 ; preds = %95, %.lr.ph45.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph45.preheader ], [ %96, %95 ]
  %indvars.iv62.unr = phi i64 [ 0, %.lr.ph45.preheader ], [ %indvars.iv.next63.1, %95 ]
  %.unr = phi i64 [ %s.promoted, %.lr.ph45.preheader ], [ %96, %95 ]
  %lcmp.mod77.not = icmp eq i64 %xtraiter76, 0
  br i1 %lcmp.mod77.not, label %._crit_edge46, label %.lr.ph45.epil

.lr.ph45.epil:                                    ; preds = %._crit_edge46.loopexit.unr-lcssa
  %71 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv62.unr
  %72 = load i64, ptr %71, align 8, !tbaa !9
  %73 = sub nsw i64 0, %72
  %74 = and i64 %.unr, %73
  %75 = and i64 %74, %72
  %.not30.epil = icmp eq i64 %75, 0
  br i1 %.not30.epil, label %._crit_edge46, label %76

76:                                               ; preds = %.lr.ph45.epil
  %77 = xor i64 %72, %.unr
  store i64 %77, ptr @s, align 8, !tbaa !9
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge46.loopexit.unr-lcssa, %76, %.lr.ph45.epil, %.preheader
  %78 = phi i64 [ %s.promoted, %.preheader ], [ %.lcssa.ph, %._crit_edge46.loopexit.unr-lcssa ], [ %.unr, %.lr.ph45.epil ], [ %77, %76 ]
  %.not = icmp eq i64 %78, 0
  br i1 %.not, label %99, label %97

.lr.ph45:                                         ; preds = %95, %.lr.ph45.preheader.new
  %indvars.iv62 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %indvars.iv.next63.1, %95 ]
  %79 = phi i64 [ %s.promoted, %.lr.ph45.preheader.new ], [ %96, %95 ]
  %niter80 = phi i64 [ 0, %.lr.ph45.preheader.new ], [ %niter80.next.1, %95 ]
  %80 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv62
  %81 = load i64, ptr %80, align 16, !tbaa !9
  %82 = sub nsw i64 0, %81
  %83 = and i64 %79, %82
  %84 = and i64 %83, %81
  %.not30 = icmp eq i64 %84, 0
  br i1 %.not30, label %.lr.ph45.1, label %85

85:                                               ; preds = %.lr.ph45
  %86 = xor i64 %81, %79
  store i64 %86, ptr @s, align 8, !tbaa !9
  br label %.lr.ph45.1

.lr.ph45.1:                                       ; preds = %.lr.ph45, %85
  %87 = phi i64 [ %79, %.lr.ph45 ], [ %86, %85 ]
  %indvars.iv.next63 = or disjoint i64 %indvars.iv62, 1
  %88 = getelementptr inbounds [500001 x i64], ptr @a, i64 0, i64 %indvars.iv.next63
  %89 = load i64, ptr %88, align 8, !tbaa !9
  %90 = sub nsw i64 0, %89
  %91 = and i64 %87, %90
  %92 = and i64 %91, %89
  %.not30.1 = icmp eq i64 %92, 0
  br i1 %.not30.1, label %95, label %93

93:                                               ; preds = %.lr.ph45.1
  %94 = xor i64 %89, %87
  store i64 %94, ptr @s, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %93, %.lr.ph45.1
  %96 = phi i64 [ %87, %.lr.ph45.1 ], [ %94, %93 ]
  %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
  %niter80.next.1 = add i64 %niter80, 2
  %niter80.ncmp.1 = icmp eq i64 %niter80.next.1, %unroll_iter79
  br i1 %niter80.ncmp.1, label %._crit_edge46.loopexit.unr-lcssa, label %.lr.ph45, !llvm.loop !17

97:                                               ; preds = %._crit_edge46
  %98 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %104

99:                                               ; preds = %._crit_edge46
  %100 = zext nneg i32 %19 to i64
  %101 = shl nuw i64 1, %100
  %102 = add nsw i64 %101, -1
  %103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %102, i64 noundef %101)
  br label %104

104:                                              ; preds = %99, %97
  ret i32 0
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIxENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress norecurse 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !12}


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