; LLVM IR from tangjz/acm-icpc :: 51nod (1312)

; 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 [51 x i64], align 16
@ans = 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 [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %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 = %22, %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 %25

17:                                               ; preds = %12
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i64, ptr @a, i64 %19
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %20)
  br label %22

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

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

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

30:                                               ; preds = %26
  store i32 5, ptr %5, align 4
  br label %121

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %32 = load i32, ptr %3, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %6, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %57, %31
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %60

39:                                               ; preds = %34
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = icmp slt i64 %43, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %39
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %54
  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) %52, ptr noundef nonnull align 8 dereferenceable(8) %55) #4
  br label %56

56:                                               ; preds = %49, %39
  br label %57

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

60:                                               ; preds = %38
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !11
  %65 = icmp ne i64 %64, 0
  br i1 %65, label %67, label %66

66:                                               ; preds = %60
  store i32 5, ptr %5, align 4
  br label %121

67:                                               ; preds = %60
  store i32 60, ptr %4, align 4, !tbaa !5
  br label %68

68:                                               ; preds = %80, %67
  %69 = load i32, ptr %3, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %70
  %72 = load i64, ptr %71, align 8, !tbaa !11
  %73 = load i32, ptr %4, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  %75 = ashr i64 %72, %74
  %76 = xor i64 %75, -1
  %77 = and i64 %76, 1
  %78 = icmp ne i64 %77, 0
  br i1 %78, label %79, label %83

79:                                               ; preds = %68
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %4, align 4, !tbaa !5
  %82 = add nsw i32 %81, -1
  store i32 %82, ptr %4, align 4, !tbaa !5
  br label %68, !llvm.loop !14

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

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

88:                                               ; preds = %84
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %117

89:                                               ; preds = %84
  %90 = load i32, ptr %3, align 4, !tbaa !5
  %91 = load i32, ptr %7, align 4, !tbaa !5
  %92 = icmp ne i32 %90, %91
  br i1 %92, label %93, label %113

93:                                               ; preds = %89
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %95
  %97 = load i64, ptr %96, align 8, !tbaa !11
  %98 = load i32, ptr %4, align 4, !tbaa !5
  %99 = zext i32 %98 to i64
  %100 = ashr i64 %97, %99
  %101 = and i64 %100, 1
  %102 = icmp ne i64 %101, 0
  br i1 %102, label %103, label %113

103:                                              ; preds = %93
  %104 = load i32, ptr %3, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !11
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !11
  %112 = xor i64 %111, %107
  store i64 %112, ptr %110, align 8, !tbaa !11
  br label %113

113:                                              ; preds = %103, %93, %89
  br label %114

114:                                              ; preds = %113
  %115 = load i32, ptr %7, align 4, !tbaa !5
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %7, align 4, !tbaa !5
  br label %84, !llvm.loop !15

117:                                              ; preds = %88
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %3, align 4, !tbaa !5
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %3, align 4, !tbaa !5
  br label %26, !llvm.loop !16

121:                                              ; preds = %66, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %122

122:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %135, %122
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = load i32, ptr @n, align 4, !tbaa !5
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %138

128:                                              ; preds = %123
  %129 = load i32, ptr %8, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !11
  %133 = load i64, ptr @a, align 16, !tbaa !11
  %134 = xor i64 %133, %132
  store i64 %134, ptr @a, align 16, !tbaa !11
  br label %135

135:                                              ; preds = %128
  %136 = load i32, ptr %8, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %8, align 4, !tbaa !5
  br label %123, !llvm.loop !17

138:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %151, %138
  %140 = load i32, ptr %9, align 4, !tbaa !5
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  store i32 20, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %154

144:                                              ; preds = %139
  %145 = load i64, ptr @a, align 16, !tbaa !11
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %147
  %149 = load i64, ptr %148, align 8, !tbaa !11
  %150 = xor i64 %149, %145
  store i64 %150, ptr %148, align 8, !tbaa !11
  br label %151

151:                                              ; preds = %144
  %152 = load i32, ptr %9, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %9, align 4, !tbaa !5
  br label %139, !llvm.loop !18

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

155:                                              ; preds = %167, %154
  %156 = load i32, ptr %10, align 4, !tbaa !5
  %157 = load i32, ptr @n, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %155
  store i32 23, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %170

160:                                              ; preds = %155
  %161 = load i32, ptr %10, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %162
  %164 = load i64, ptr %163, align 8, !tbaa !11
  %165 = load i64, ptr @ans, align 8, !tbaa !11
  %166 = add nsw i64 %165, %164
  store i64 %166, ptr @ans, align 8, !tbaa !11
  br label %167

167:                                              ; preds = %160
  %168 = load i32, ptr %10, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %10, align 4, !tbaa !5
  br label %155, !llvm.loop !19

170:                                              ; preds = %159
  %171 = load i64, ptr @ans, align 8, !tbaa !11
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %171)
  ret i32 0
}

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 @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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !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 [51 x i64], align 16
@ans = 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 [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 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 %.preheader.thread

.preheader46:                                     ; preds = %.lr.ph
  %4 = icmp sgt i32 %7, 0
  br i1 %4, label %.lr.ph55, label %.preheader.thread

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %5 = getelementptr inbounds i64, ptr @a, i64 %indvars.iv
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, 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 %.preheader46, !llvm.loop !9

.loopexit.loopexit.unr-lcssa:                     ; preds = %59, %.lr.ph53.preheader
  %indvars.iv78.unr = phi i64 [ 0, %.lr.ph53.preheader ], [ %indvars.iv.next79.1, %59 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %.not41.epil = icmp eq i64 %indvars.iv81, %indvars.iv78.unr
  %or.cond = select i1 %lcmp.mod.not, i1 true, i1 %.not41.epil
  br i1 %or.cond, label %.loopexit, label %10

10:                                               ; preds = %.loopexit.loopexit.unr-lcssa
  %11 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv78.unr
  %12 = load i64, ptr %11, align 8, !tbaa !11
  %13 = and i64 %12, %40
  %.not42.epil = icmp eq i64 %13, 0
  br i1 %.not42.epil, label %.loopexit, label %14

14:                                               ; preds = %10
  %15 = load i64, ptr %24, align 8, !tbaa !11
  %16 = xor i64 %15, %12
  store i64 %16, ptr %11, align 8, !tbaa !11
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %14, %10, %.preheader44
  %17 = sext i32 %23 to i64
  %18 = icmp slt i64 %indvars.iv.next82, %17
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  br i1 %18, label %.lr.ph55, label %._crit_edge56, !llvm.loop !13

.lr.ph55:                                         ; preds = %.preheader46, %.loopexit
  %19 = phi i32 [ %23, %.loopexit ], [ %7, %.preheader46 ]
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.loopexit ], [ 0, %.preheader46 ]
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %.loopexit ], [ 1, %.preheader46 ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %20 = sext i32 %19 to i64
  %21 = icmp slt i64 %indvars.iv.next82, %20
  br i1 %21, label %.lr.ph51, label %._crit_edge

.lr.ph51:                                         ; preds = %.lr.ph55
  %22 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv81
  br label %26

._crit_edge:                                      ; preds = %34, %.lr.ph55
  %23 = phi i32 [ %19, %.lr.ph55 ], [ %35, %34 ]
  %.lcssa47 = phi i32 [ %19, %.lr.ph55 ], [ %36, %34 ]
  %24 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv81
  %25 = load i64, ptr %24, align 8, !tbaa !11
  %.not = icmp eq i64 %25, 0
  br i1 %.not, label %._crit_edge56, label %.preheader45

26:                                               ; preds = %.lr.ph51, %34
  %27 = phi i32 [ %19, %.lr.ph51 ], [ %35, %34 ]
  %28 = phi i32 [ %19, %.lr.ph51 ], [ %36, %34 ]
  %indvars.iv75 = phi i64 [ %indvars.iv73, %.lr.ph51 ], [ %indvars.iv.next76, %34 ]
  %29 = load i64, ptr %22, align 8, !tbaa !11
  %30 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv75
  %31 = load i64, ptr %30, align 8, !tbaa !11
  %32 = icmp slt i64 %29, %31
  br i1 %32, label %33, label %34

33:                                               ; preds = %26
  tail 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) %22, ptr noundef nonnull align 8 dereferenceable(8) %30) #4
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %26, %33
  %35 = phi i32 [ %27, %26 ], [ %.pre, %33 ]
  %36 = phi i32 [ %28, %26 ], [ %.pre, %33 ]
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %37 = trunc nuw i64 %indvars.iv.next76 to i32
  %38 = icmp sgt i32 %36, %37
  br i1 %38, label %26, label %._crit_edge, !llvm.loop !14

.preheader45:                                     ; preds = %._crit_edge, %.preheader45
  %.037 = phi i32 [ %42, %.preheader45 ], [ 60, %._crit_edge ]
  %39 = zext nneg i32 %.037 to i64
  %40 = shl nuw i64 1, %39
  %41 = and i64 %40, %25
  %.not40.not = icmp eq i64 %41, 0
  %42 = add nsw i32 %.037, -1
  br i1 %.not40.not, label %.preheader45, label %.preheader44, !llvm.loop !15

.preheader44:                                     ; preds = %.preheader45
  %43 = icmp sgt i32 %.lcssa47, 0
  br i1 %43, label %.lr.ph53.preheader, label %.loopexit

.lr.ph53.preheader:                               ; preds = %.preheader44
  %wide.trip.count = zext nneg i32 %.lcssa47 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %44 = icmp eq i32 %.lcssa47, 1
  br i1 %44, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph53.preheader.new

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

.lr.ph53:                                         ; preds = %59, %.lr.ph53.preheader.new
  %indvars.iv78 = phi i64 [ 0, %.lr.ph53.preheader.new ], [ %indvars.iv.next79.1, %59 ]
  %niter = phi i64 [ 0, %.lr.ph53.preheader.new ], [ %niter.next.1, %59 ]
  %.not41 = icmp eq i64 %indvars.iv81, %indvars.iv78
  br i1 %.not41, label %.lr.ph53.1, label %45

45:                                               ; preds = %.lr.ph53
  %46 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv78
  %47 = load i64, ptr %46, align 16, !tbaa !11
  %48 = and i64 %47, %40
  %.not42 = icmp eq i64 %48, 0
  br i1 %.not42, label %.lr.ph53.1, label %49

49:                                               ; preds = %45
  %50 = load i64, ptr %24, align 8, !tbaa !11
  %51 = xor i64 %50, %47
  store i64 %51, ptr %46, align 16, !tbaa !11
  br label %.lr.ph53.1

.lr.ph53.1:                                       ; preds = %.lr.ph53, %45, %49
  %indvars.iv.next79 = or disjoint i64 %indvars.iv78, 1
  %.not41.1 = icmp eq i64 %indvars.iv81, %indvars.iv.next79
  br i1 %.not41.1, label %59, label %52

52:                                               ; preds = %.lr.ph53.1
  %53 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv.next79
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %55 = and i64 %54, %40
  %.not42.1 = icmp eq i64 %55, 0
  br i1 %.not42.1, label %59, label %56

56:                                               ; preds = %52
  %57 = load i64, ptr %24, align 8, !tbaa !11
  %58 = xor i64 %57, %54
  store i64 %58, ptr %53, align 8, !tbaa !11
  br label %59

59:                                               ; preds = %56, %52, %.lr.ph53.1
  %indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 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 %.loopexit.loopexit.unr-lcssa, label %.lr.ph53, !llvm.loop !16

._crit_edge56:                                    ; preds = %.loopexit, %._crit_edge
  %60 = icmp sgt i32 %23, 1
  br i1 %60, label %.lr.ph60.preheader, label %.preheader

.lr.ph60.preheader:                               ; preds = %._crit_edge56
  %a.promoted = load i64, ptr @a, align 16, !tbaa !11
  %wide.trip.count87 = zext nneg i32 %23 to i64
  %61 = add nsw i64 %wide.trip.count87, -1
  %min.iters.check = icmp ult i32 %23, 5
  br i1 %min.iters.check, label %.lr.ph60.preheader151, label %vector.ph

.lr.ph60.preheader151:                            ; preds = %middle.block, %.lr.ph60.preheader
  %indvars.iv84.ph = phi i64 [ 1, %.lr.ph60.preheader ], [ %ind.end, %middle.block ]
  %.ph152 = phi i64 [ %a.promoted, %.lr.ph60.preheader ], [ %68, %middle.block ]
  br label %.lr.ph60

vector.ph:                                        ; preds = %.lr.ph60.preheader
  %n.vec = and i64 %61, -4
  %ind.end = or disjoint i64 %n.vec, 1
  %62 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %a.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 <2 x i64> [ %62, %vector.ph ], [ %65, %vector.body ]
  %vec.phi113 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %66, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %63 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %offset.idx
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  %wide.load = load <2 x i64>, ptr %63, align 8, !tbaa !11
  %wide.load114 = load <2 x i64>, ptr %64, align 8, !tbaa !11
  %65 = xor <2 x i64> %vec.phi, %wide.load
  %66 = xor <2 x i64> %vec.phi113, %wide.load114
  %index.next = add nuw i64 %index, 4
  %67 = icmp eq i64 %index.next, %n.vec
  br i1 %67, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = xor <2 x i64> %66, %65
  %68 = tail call i64 @llvm.vector.reduce.xor.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %61, %n.vec
  br i1 %cmp.n, label %..preheader43_crit_edge, label %.lr.ph60.preheader151

..preheader43_crit_edge:                          ; preds = %.lr.ph60, %middle.block
  %.lcssa107 = phi i64 [ %68, %middle.block ], [ %78, %.lr.ph60 ]
  store i64 %.lcssa107, ptr @a, align 16, !tbaa !11
  br i1 %60, label %.lr.ph64, label %.preheader

.preheader.thread:                                ; preds = %.preheader46, %0
  %ans.promoted100 = load i64, ptr @ans, align 8, !tbaa !11
  br label %90

.lr.ph64:                                         ; preds = %..preheader43_crit_edge
  %wide.trip.count92 = zext nneg i32 %23 to i64
  %69 = add nsw i64 %wide.trip.count87, -1
  %min.iters.check117 = icmp ult i32 %23, 5
  br i1 %min.iters.check117, label %scalar.ph116.preheader, label %vector.ph118

scalar.ph116.preheader:                           ; preds = %middle.block115, %.lr.ph64
  %indvars.iv89.ph = phi i64 [ 1, %.lr.ph64 ], [ %ind.end121, %middle.block115 ]
  br label %scalar.ph116

vector.ph118:                                     ; preds = %.lr.ph64
  %n.vec120 = and i64 %69, -4
  %ind.end121 = or disjoint i64 %n.vec120, 1
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %.lcssa107, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body123

vector.body123:                                   ; preds = %vector.body123, %vector.ph118
  %index124 = phi i64 [ 0, %vector.ph118 ], [ %index.next128, %vector.body123 ]
  %offset.idx125 = or disjoint i64 %index124, 1
  %70 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %offset.idx125
  %71 = getelementptr inbounds i8, ptr %70, i64 16
  %wide.load126 = load <2 x i64>, ptr %70, align 8, !tbaa !11
  %wide.load127 = load <2 x i64>, ptr %71, align 8, !tbaa !11
  %72 = xor <2 x i64> %wide.load126, %broadcast.splat
  %73 = xor <2 x i64> %wide.load127, %broadcast.splat
  store <2 x i64> %72, ptr %70, align 8, !tbaa !11
  store <2 x i64> %73, ptr %71, align 8, !tbaa !11
  %index.next128 = add nuw i64 %index124, 4
  %74 = icmp eq i64 %index.next128, %n.vec120
  br i1 %74, label %middle.block115, label %vector.body123, !llvm.loop !20

middle.block115:                                  ; preds = %vector.body123
  %cmp.n129 = icmp eq i64 %69, %n.vec120
  br i1 %cmp.n129, label %.preheader, label %scalar.ph116.preheader

.lr.ph60:                                         ; preds = %.lr.ph60.preheader151, %.lr.ph60
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %.lr.ph60 ], [ %indvars.iv84.ph, %.lr.ph60.preheader151 ]
  %75 = phi i64 [ %78, %.lr.ph60 ], [ %.ph152, %.lr.ph60.preheader151 ]
  %76 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv84
  %77 = load i64, ptr %76, align 8, !tbaa !11
  %78 = xor i64 %75, %77
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
  br i1 %exitcond88.not, label %..preheader43_crit_edge, label %.lr.ph60, !llvm.loop !21

.preheader:                                       ; preds = %scalar.ph116, %middle.block115, %._crit_edge56, %..preheader43_crit_edge
  %ans.promoted = load i64, ptr @ans, align 8, !tbaa !11
  %79 = icmp sgt i32 %23, 0
  br i1 %79, label %.lr.ph66.preheader, label %90

.lr.ph66.preheader:                               ; preds = %.preheader
  %wide.trip.count97 = zext nneg i32 %23 to i64
  %min.iters.check132 = icmp ult i32 %23, 4
  br i1 %min.iters.check132, label %.lr.ph66.preheader147, label %vector.ph133

.lr.ph66.preheader147:                            ; preds = %middle.block130, %.lr.ph66.preheader
  %indvars.iv94.ph = phi i64 [ 0, %.lr.ph66.preheader ], [ %n.vec135, %middle.block130 ]
  %.ph = phi i64 [ %ans.promoted, %.lr.ph66.preheader ], [ %86, %middle.block130 ]
  br label %.lr.ph66

vector.ph133:                                     ; preds = %.lr.ph66.preheader
  %n.vec135 = and i64 %wide.trip.count97, 2147483644
  %80 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %ans.promoted, i64 0
  br label %vector.body137

vector.body137:                                   ; preds = %vector.body137, %vector.ph133
  %index138 = phi i64 [ 0, %vector.ph133 ], [ %index.next143, %vector.body137 ]
  %vec.phi139 = phi <2 x i64> [ %80, %vector.ph133 ], [ %83, %vector.body137 ]
  %vec.phi140 = phi <2 x i64> [ zeroinitializer, %vector.ph133 ], [ %84, %vector.body137 ]
  %81 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %index138
  %82 = getelementptr inbounds i8, ptr %81, i64 16
  %wide.load141 = load <2 x i64>, ptr %81, align 16, !tbaa !11
  %wide.load142 = load <2 x i64>, ptr %82, align 16, !tbaa !11
  %83 = add <2 x i64> %vec.phi139, %wide.load141
  %84 = add <2 x i64> %vec.phi140, %wide.load142
  %index.next143 = add nuw i64 %index138, 4
  %85 = icmp eq i64 %index.next143, %n.vec135
  br i1 %85, label %middle.block130, label %vector.body137, !llvm.loop !22

middle.block130:                                  ; preds = %vector.body137
  %bin.rdx144 = add <2 x i64> %84, %83
  %86 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx144)
  %cmp.n145 = icmp eq i64 %n.vec135, %wide.trip.count97
  br i1 %cmp.n145, label %._crit_edge67, label %.lr.ph66.preheader147

scalar.ph116:                                     ; preds = %scalar.ph116.preheader, %scalar.ph116
  %indvars.iv89 = phi i64 [ %indvars.iv.next90, %scalar.ph116 ], [ %indvars.iv89.ph, %scalar.ph116.preheader ]
  %87 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv89
  %88 = load i64, ptr %87, align 8, !tbaa !11
  %89 = xor i64 %88, %.lcssa107
  store i64 %89, ptr %87, align 8, !tbaa !11
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92
  br i1 %exitcond93.not, label %.preheader, label %scalar.ph116, !llvm.loop !23

._crit_edge67:                                    ; preds = %.lr.ph66, %middle.block130
  %.lcssa = phi i64 [ %86, %middle.block130 ], [ %96, %.lr.ph66 ]
  store i64 %.lcssa, ptr @ans, align 8, !tbaa !11
  br label %90

90:                                               ; preds = %.preheader.thread, %._crit_edge67, %.preheader
  %91 = phi i64 [ %.lcssa, %._crit_edge67 ], [ %ans.promoted, %.preheader ], [ %ans.promoted100, %.preheader.thread ]
  %92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %91)
  ret i32 0

.lr.ph66:                                         ; preds = %.lr.ph66.preheader147, %.lr.ph66
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %.lr.ph66 ], [ %indvars.iv94.ph, %.lr.ph66.preheader147 ]
  %93 = phi i64 [ %96, %.lr.ph66 ], [ %.ph, %.lr.ph66.preheader147 ]
  %94 = getelementptr inbounds [51 x i64], ptr @a, i64 0, i64 %indvars.iv94
  %95 = load i64, ptr %94, align 8, !tbaa !11
  %96 = add nsw i64 %93, %95
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond98.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count97
  br i1 %exitcond98.not, label %._crit_edge67, label %.lr.ph66, !llvm.loop !24
}

; 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 @_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 #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 i64 @llvm.vector.reduce.xor.v2i64(<2 x i64>) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10, !18, !19}
!21 = distinct !{!21, !10, !19, !18}
!22 = distinct !{!22, !10, !18, !19}
!23 = distinct !{!23, !10, !19, !18}
!24 = distinct !{!24, !10, !19, !18}


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