; LLVM IR from tangjz/acm-icpc :: lydsy (4269)

; 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
@a = external dso_local global [100000 x i32], align 16
@r = external dso_local global i32, align 4
@ans = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 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
  store i32 0, ptr %1, align 4
  %7 = 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 %8

8:                                                ; preds = %18, %0
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = load i32, ptr @n, align 4, !tbaa !5
  %11 = icmp slt i32 %9, %10
  br i1 %11, label %13, label %12

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

13:                                               ; preds = %8
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = sext i32 %14 to i64
  %16 = getelementptr inbounds i32, ptr @a, i64 %15
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %16)
  br label %18

18:                                               ; preds = %13
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %2, align 4, !tbaa !5
  br label %8, !llvm.loop !9

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

22:                                               ; preds = %95, %21
  %23 = load i32, ptr %3, align 4, !tbaa !5
  %24 = icmp sge i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %22
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %98

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

28:                                               ; preds = %43, %26
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %32, label %46

32:                                               ; preds = %28
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = shl i32 1, %37
  %39 = and i32 %36, %38
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %32
  br label %46

42:                                               ; preds = %32
  br label %43

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

46:                                               ; preds = %41, %28
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %51

50:                                               ; preds = %46
  store i32 7, ptr %4, align 4
  br label %92

51:                                               ; preds = %46
  %52 = load i32, ptr @r, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %53
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %56
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %54, ptr noundef nonnull align 4 dereferenceable(4) %57) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %86, %51
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr @n, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %62, label %89

62:                                               ; preds = %58
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = load i32, ptr @r, align 4, !tbaa !5
  %65 = icmp ne i32 %63, %64
  br i1 %65, label %66, label %85

66:                                               ; preds = %62
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = shl i32 1, %71
  %73 = and i32 %70, %72
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %85

75:                                               ; preds = %66
  %76 = load i32, ptr @r, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = xor i32 %83, %79
  store i32 %84, ptr %82, align 4, !tbaa !5
  br label %85

85:                                               ; preds = %75, %66, %62
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %5, align 4, !tbaa !5
  br label %58, !llvm.loop !12

89:                                               ; preds = %58
  %90 = load i32, ptr @r, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr @r, align 4, !tbaa !5
  store i32 0, ptr %4, align 4
  br label %92

92:                                               ; preds = %89, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  %93 = load i32, ptr %4, align 4
  switch i32 %93, label %124 [
    i32 0, label %94
    i32 7, label %95
  ]

94:                                               ; preds = %92
  br label %95

95:                                               ; preds = %94, %92
  %96 = load i32, ptr %3, align 4, !tbaa !5
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr %3, align 4, !tbaa !5
  br label %22, !llvm.loop !13

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

99:                                               ; preds = %111, %98
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = load i32, ptr @r, align 4, !tbaa !5
  %102 = icmp slt i32 %100, %101
  br i1 %102, label %104, label %103

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

104:                                              ; preds = %99
  %105 = load i32, ptr %6, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = load i32, ptr @ans, align 4, !tbaa !5
  %110 = xor i32 %109, %108
  store i32 %110, ptr @ans, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %104
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %6, align 4, !tbaa !5
  br label %99, !llvm.loop !14

114:                                              ; preds = %103
  %115 = load i32, ptr @ans, align 4, !tbaa !5
  %116 = load i32, ptr @ans, align 4, !tbaa !5
  %117 = load i32, ptr @r, align 4, !tbaa !5
  %118 = sub nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = xor i32 %116, %121
  %123 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %115, i32 noundef %122)
  ret i32 0

124:                                              ; preds = %92
  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 @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

@n = external dso_local global i32, align 4
@a = external dso_local global [100000 x i32], align 16
@r = external dso_local local_unnamed_addr global i32, align 4
@ans = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

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

.preheader27:                                     ; preds = %.lr.ph, %0
  %4 = phi i32 [ %2, %0 ], [ %7, %.lr.ph ]
  %.pre = load i32, ptr @r, align 4, !tbaa !5
  br label %18

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %5 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %8 = sext i32 %7 to i64
  %9 = icmp slt i64 %indvars.iv.next, %8
  br i1 %9, label %.lr.ph, label %.preheader27, !llvm.loop !9

.preheader:                                       ; preds = %._crit_edge.thread
  %ans.promoted = load i32, ptr @ans, align 4, !tbaa !5
  %10 = icmp sgt i32 %69, 0
  br i1 %10, label %.lr.ph42.preheader, label %71

.lr.ph42.preheader:                               ; preds = %.preheader
  %wide.trip.count57 = zext nneg i32 %69 to i64
  %min.iters.check = icmp ult i32 %69, 8
  br i1 %min.iters.check, label %.lr.ph42.preheader71, label %vector.ph

.lr.ph42.preheader71:                             ; preds = %middle.block, %.lr.ph42.preheader
  %indvars.iv54.ph = phi i64 [ 0, %.lr.ph42.preheader ], [ %n.vec, %middle.block ]
  %.ph = phi i32 [ %ans.promoted, %.lr.ph42.preheader ], [ %17, %middle.block ]
  br label %.lr.ph42

vector.ph:                                        ; preds = %.lr.ph42.preheader
  %n.vec = and i64 %wide.trip.count57, 2147483640
  %11 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %ans.promoted, i64 0
  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> [ %11, %vector.ph ], [ %14, %vector.body ]
  %vec.phi69 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
  %12 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %index
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %wide.load = load <4 x i32>, ptr %12, align 16, !tbaa !5
  %wide.load70 = load <4 x i32>, ptr %13, align 16, !tbaa !5
  %14 = xor <4 x i32> %vec.phi, %wide.load
  %15 = xor <4 x i32> %vec.phi69, %wide.load70
  %index.next = add nuw i64 %index, 8
  %16 = icmp eq i64 %index.next, %n.vec
  br i1 %16, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = xor <4 x i32> %15, %14
  %17 = tail call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count57
  br i1 %cmp.n, label %._crit_edge43, label %.lr.ph42.preheader71

18:                                               ; preds = %.preheader27, %._crit_edge.thread
  %19 = phi i32 [ %4, %.preheader27 ], [ %68, %._crit_edge.thread ]
  %20 = phi i32 [ %.pre, %.preheader27 ], [ %69, %._crit_edge.thread ]
  %.02140 = phi i32 [ 31, %.preheader27 ], [ %70, %._crit_edge.thread ]
  %21 = icmp slt i32 %20, %19
  br i1 %21, label %.lr.ph31, label %._crit_edge

.lr.ph31:                                         ; preds = %18
  %22 = shl nuw i32 1, %.02140
  %23 = sext i32 %20 to i64
  br label %24

24:                                               ; preds = %.lr.ph31, %28
  %indvars.iv47 = phi i64 [ %23, %.lr.ph31 ], [ %indvars.iv.next48, %28 ]
  %25 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv47
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = and i32 %26, %22
  %.not = icmp eq i32 %27, 0
  br i1 %.not, label %28, label %._crit_edge.loopexit

28:                                               ; preds = %24
  %indvars.iv.next48 = add nsw i64 %indvars.iv47, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next48 to i32
  %exitcond.not = icmp eq i32 %19, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge.thread, label %24, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %24
  %29 = trunc nsw i64 %indvars.iv47 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %18
  %.020.lcssa = phi i32 [ %20, %18 ], [ %29, %._crit_edge.loopexit ]
  %30 = icmp eq i32 %.020.lcssa, %19
  br i1 %30, label %._crit_edge.thread, label %31

31:                                               ; preds = %._crit_edge
  %32 = sext i32 %20 to i64
  %33 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %32
  %34 = sext i32 %.020.lcssa to i64
  %35 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %34
  tail call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %33, ptr noundef nonnull align 4 dereferenceable(4) %35) #4
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 0
  %.pre59 = load i32, ptr @r, align 4, !tbaa !5
  br i1 %37, label %.lr.ph38, label %._crit_edge39

.lr.ph38:                                         ; preds = %31
  %38 = shl nuw i32 1, %.02140
  %39 = sext i32 %.pre59 to i64
  %40 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %39
  %41 = zext i32 %.pre59 to i64
  %wide.trip.count = zext nneg i32 %36 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %42 = icmp eq i32 %36, 1
  br i1 %42, label %._crit_edge39.loopexit.unr-lcssa, label %.lr.ph38.new

.lr.ph38.new:                                     ; preds = %.lr.ph38
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %43

43:                                               ; preds = %59, %.lr.ph38.new
  %indvars.iv50 = phi i64 [ 0, %.lr.ph38.new ], [ %indvars.iv.next51.1, %59 ]
  %niter = phi i64 [ 0, %.lr.ph38.new ], [ %niter.next.1, %59 ]
  %.not25 = icmp eq i64 %indvars.iv50, %41
  br i1 %.not25, label %51, label %44

44:                                               ; preds = %43
  %45 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv50
  %46 = load i32, ptr %45, align 8, !tbaa !5
  %47 = and i32 %46, %38
  %.not26 = icmp eq i32 %47, 0
  br i1 %.not26, label %51, label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %40, align 4, !tbaa !5
  %50 = xor i32 %49, %46
  store i32 %50, ptr %45, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %43, %44, %48
  %indvars.iv.next51 = or disjoint i64 %indvars.iv50, 1
  %.not25.1 = icmp eq i64 %indvars.iv.next51, %41
  br i1 %.not25.1, label %59, label %52

52:                                               ; preds = %51
  %53 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next51
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = and i32 %54, %38
  %.not26.1 = icmp eq i32 %55, 0
  br i1 %.not26.1, label %59, label %56

56:                                               ; preds = %52
  %57 = load i32, ptr %40, align 4, !tbaa !5
  %58 = xor i32 %57, %54
  store i32 %58, ptr %53, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %56, %52, %51
  %indvars.iv.next51.1 = add nuw nsw i64 %indvars.iv50, 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_edge39.loopexit.unr-lcssa, label %43, !llvm.loop !15

._crit_edge39.loopexit.unr-lcssa:                 ; preds = %59, %.lr.ph38
  %indvars.iv50.unr = phi i64 [ 0, %.lr.ph38 ], [ %indvars.iv.next51.1, %59 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %.not25.epil = icmp eq i64 %indvars.iv50.unr, %41
  %or.cond = select i1 %lcmp.mod.not, i1 true, i1 %.not25.epil
  br i1 %or.cond, label %._crit_edge39, label %60

60:                                               ; preds = %._crit_edge39.loopexit.unr-lcssa
  %61 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv50.unr
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = and i32 %62, %38
  %.not26.epil = icmp eq i32 %63, 0
  br i1 %.not26.epil, label %._crit_edge39, label %64

64:                                               ; preds = %60
  %65 = load i32, ptr %40, align 4, !tbaa !5
  %66 = xor i32 %65, %62
  store i32 %66, ptr %61, align 4, !tbaa !5
  br label %._crit_edge39

._crit_edge39:                                    ; preds = %._crit_edge39.loopexit.unr-lcssa, %64, %60, %31
  %67 = add nsw i32 %.pre59, 1
  store i32 %67, ptr @r, align 4, !tbaa !5
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %28, %._crit_edge, %._crit_edge39
  %68 = phi i32 [ %19, %._crit_edge ], [ %36, %._crit_edge39 ], [ %19, %28 ]
  %69 = phi i32 [ %20, %._crit_edge ], [ %67, %._crit_edge39 ], [ %20, %28 ]
  %70 = add nsw i32 %.02140, -1
  %.not60 = icmp eq i32 %.02140, 0
  br i1 %.not60, label %.preheader, label %18, !llvm.loop !16

._crit_edge43:                                    ; preds = %.lr.ph42, %middle.block
  %.lcssa = phi i32 [ %17, %middle.block ], [ %82, %.lr.ph42 ]
  store i32 %.lcssa, ptr @ans, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %._crit_edge43, %.preheader
  %72 = phi i32 [ %.lcssa, %._crit_edge43 ], [ %ans.promoted, %.preheader ]
  %73 = add nsw i32 %69, -1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = xor i32 %76, %72
  %78 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %72, i32 noundef %77)
  ret i32 0

.lr.ph42:                                         ; preds = %.lr.ph42.preheader71, %.lr.ph42
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %.lr.ph42 ], [ %indvars.iv54.ph, %.lr.ph42.preheader71 ]
  %79 = phi i32 [ %82, %.lr.ph42 ], [ %.ph, %.lr.ph42.preheader71 ]
  %80 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv54
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = xor i32 %79, %81
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %exitcond58.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count57
  br i1 %exitcond58.not, label %._crit_edge43, label %.lr.ph42, !llvm.loop !17
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !13, !12}


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