; LLVM IR from Tunghohin/Competitive_Coding :: Daimayuan (371)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@f = external dso_local global [8388608 x i64], align 16
@g = external dso_local global [8388608 x i64], align 16
@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@C = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; 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
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @A, ptr noundef @B, ptr noundef @C)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %26, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr @n, align 4, !tbaa !5
  %17 = shl i32 1, %16
  %18 = icmp slt i32 %15, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %29

20:                                               ; preds = %14
  %21 = call noundef i32 @_Z5rng61v()
  %22 = zext i32 %21 to i64
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %24
  store i64 %22, ptr %25, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %20
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !11

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

30:                                               ; preds = %42, %29
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @n, align 4, !tbaa !5
  %33 = shl i32 1, %32
  %34 = icmp slt i32 %31, %33
  br i1 %34, label %36, label %35

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

36:                                               ; preds = %30
  %37 = call noundef i32 @_Z5rng61v()
  %38 = zext i32 %37 to i64
  %39 = load i32, ptr %3, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %40
  store i64 %38, ptr %41, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %36
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %3, align 4, !tbaa !5
  br label %30, !llvm.loop !13

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

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

50:                                               ; preds = %46
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %103

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

52:                                               ; preds = %96, %51
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr @n, align 4, !tbaa !5
  %55 = shl i32 1, %54
  %56 = icmp slt i32 %53, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %52
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %99

58:                                               ; preds = %52
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = shl i32 1, %60
  %62 = and i32 %59, %61
  %63 = icmp eq i32 %62, 0
  br i1 %63, label %64, label %95

64:                                               ; preds = %58
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !9
  %69 = load i32, ptr %6, align 4, !tbaa !5
  %70 = load i32, ptr %4, align 4, !tbaa !5
  %71 = shl i32 1, %70
  %72 = add nsw i32 %69, %71
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %73
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = add nsw i64 %68, %75
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %78
  store i64 %76, ptr %79, align 8, !tbaa !9
  %80 = load i32, ptr %6, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %81
  %83 = load i64, ptr %82, align 8, !tbaa !9
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = shl i32 1, %85
  %87 = add nsw i32 %84, %86
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %88
  %90 = load i64, ptr %89, align 8, !tbaa !9
  %91 = add nsw i64 %83, %90
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %93
  store i64 %91, ptr %94, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %64, %58
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %6, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !5
  br label %52, !llvm.loop !14

99:                                               ; preds = %57
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %4, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %4, align 4, !tbaa !5
  br label %46, !llvm.loop !15

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

104:                                              ; preds = %134, %103
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = load i32, ptr @n, align 4, !tbaa !5
  %107 = shl i32 1, %106
  %108 = icmp slt i32 %105, %107
  br i1 %108, label %110, label %109

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

110:                                              ; preds = %104
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %112
  %114 = load i64, ptr %113, align 8, !tbaa !9
  %115 = srem i64 %114, 1000000007
  store i64 %115, ptr %113, align 8, !tbaa !9
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %117
  %119 = load i64, ptr %118, align 8, !tbaa !9
  %120 = srem i64 %119, 1000000007
  store i64 %120, ptr %118, align 8, !tbaa !9
  %121 = load i32, ptr %7, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %122
  %124 = load i64, ptr %123, align 8, !tbaa !9
  %125 = load i32, ptr %7, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !9
  %129 = mul nsw i64 %124, %128
  %130 = srem i64 %129, 1000000007
  %131 = load i32, ptr %7, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %132
  store i64 %130, ptr %133, align 8, !tbaa !9
  br label %134

134:                                              ; preds = %110
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %7, align 4, !tbaa !5
  br label %104, !llvm.loop !16

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

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

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

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

144:                                              ; preds = %173, %143
  %145 = load i32, ptr %9, align 4, !tbaa !5
  %146 = load i32, ptr @n, align 4, !tbaa !5
  %147 = shl i32 1, %146
  %148 = icmp slt i32 %145, %147
  br i1 %148, label %150, label %149

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

150:                                              ; preds = %144
  %151 = load i32, ptr %9, align 4, !tbaa !5
  %152 = load i32, ptr %8, align 4, !tbaa !5
  %153 = shl i32 1, %152
  %154 = and i32 %151, %153
  %155 = icmp eq i32 %154, 0
  br i1 %155, label %156, label %172

156:                                              ; preds = %150
  %157 = load i32, ptr %9, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !9
  %161 = load i32, ptr %9, align 4, !tbaa !5
  %162 = load i32, ptr %8, align 4, !tbaa !5
  %163 = shl i32 1, %162
  %164 = add nsw i32 %161, %163
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !9
  %168 = sub nsw i64 %160, %167
  %169 = load i32, ptr %9, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %170
  store i64 %168, ptr %171, align 8, !tbaa !9
  br label %172

172:                                              ; preds = %156, %150
  br label %173

173:                                              ; preds = %172
  %174 = load i32, ptr %9, align 4, !tbaa !5
  %175 = add nsw i32 %174, 1
  store i32 %175, ptr %9, align 4, !tbaa !5
  br label %144, !llvm.loop !17

176:                                              ; preds = %149
  br label %177

177:                                              ; preds = %176
  %178 = load i32, ptr %8, align 4, !tbaa !5
  %179 = add nsw i32 %178, 1
  store i32 %179, ptr %8, align 4, !tbaa !5
  br label %138, !llvm.loop !18

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

181:                                              ; preds = %205, %180
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = load i32, ptr @n, align 4, !tbaa !5
  %184 = shl i32 1, %183
  %185 = icmp slt i32 %182, %184
  br i1 %185, label %187, label %186

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

187:                                              ; preds = %181
  %188 = load i32, ptr %10, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %189
  %191 = load i64, ptr %190, align 8, !tbaa !9
  %192 = srem i64 %191, 1000000007
  store i64 %192, ptr %190, align 8, !tbaa !9
  %193 = load i32, ptr %10, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %194
  %196 = load i64, ptr %195, align 8, !tbaa !9
  %197 = icmp slt i64 %196, 0
  br i1 %197, label %198, label %204

198:                                              ; preds = %187
  %199 = load i32, ptr %10, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %200
  %202 = load i64, ptr %201, align 8, !tbaa !9
  %203 = add nsw i64 %202, 1000000007
  store i64 %203, ptr %201, align 8, !tbaa !9
  br label %204

204:                                              ; preds = %198, %187
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %10, align 4, !tbaa !5
  %207 = add nsw i32 %206, 1
  store i32 %207, ptr %10, align 4, !tbaa !5
  br label %181, !llvm.loop !19

208:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %222, %208
  %210 = load i32, ptr %12, align 4, !tbaa !5
  %211 = load i32, ptr @n, align 4, !tbaa !5
  %212 = shl i32 1, %211
  %213 = icmp slt i32 %210, %212
  br i1 %213, label %215, label %214

214:                                              ; preds = %209
  store i32 26, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %225

215:                                              ; preds = %209
  %216 = load i32, ptr %12, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %217
  %219 = load i64, ptr %218, align 8, !tbaa !9
  %220 = load i64, ptr %11, align 8, !tbaa !9
  %221 = xor i64 %220, %219
  store i64 %221, ptr %11, align 8, !tbaa !9
  br label %222

222:                                              ; preds = %215
  %223 = load i32, ptr %12, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %12, align 4, !tbaa !5
  br label %209, !llvm.loop !20

225:                                              ; preds = %214
  %226 = load i64, ptr %11, align 8, !tbaa !9
  %227 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %226)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %228 = load i32, ptr %1, align 4
  ret i32 %228
}

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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5rng61v() #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #4 align 2

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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@n = external dso_local global i32, align 4
@f = external dso_local local_unnamed_addr global [8388608 x i64], align 16
@g = external dso_local local_unnamed_addr global [8388608 x i64], align 16
@A = external dso_local global i32, align 4
@B = external dso_local global i32, align 4
@C = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse 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, ptr noundef nonnull @A, ptr noundef nonnull @B, ptr noundef nonnull @C)
  %2 = load i32, ptr @n, align 4, !tbaa !5
  %.not = icmp eq i32 %2, 31
  br i1 %.not, label %._crit_edge, label %.lr.ph

.preheader64:                                     ; preds = %.lr.ph
  %.not85 = icmp eq i32 %6, 31
  br i1 %.not85, label %._crit_edge, label %.lr.ph68

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %3 = tail call noundef i32 @_Z5rng61v()
  %4 = zext i32 %3 to i64
  %5 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv
  store i64 %4, ptr %5, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %7 = shl nuw i32 1, %6
  %8 = sext i32 %7 to i64
  %9 = icmp slt i64 %indvars.iv.next, %8
  br i1 %9, label %.lr.ph, label %.preheader64, !llvm.loop !11

.preheader63:                                     ; preds = %.lr.ph68
  %10 = icmp sgt i32 %34, 0
  br i1 %10, label %.preheader62.lr.ph, label %.preheader61

.preheader62.lr.ph:                               ; preds = %.preheader63
  %.not150 = icmp eq i32 %34, 31
  br i1 %.not150, label %._crit_edge, label %.preheader62.us.preheader

.preheader62.us.preheader:                        ; preds = %.preheader62.lr.ph
  %wide.trip.count = zext nneg i32 %35 to i64
  br label %.preheader62.us

.preheader62.us:                                  ; preds = %.preheader62.us.preheader, %._crit_edge.us
  %.05472.us = phi i32 [ %30, %._crit_edge.us ], [ 0, %.preheader62.us.preheader ]
  %11 = shl nuw i32 1, %.05472.us
  %12 = sext i32 %11 to i64
  br label %13

13:                                               ; preds = %.preheader62.us, %29
  %indvars.iv95 = phi i64 [ 0, %.preheader62.us ], [ %indvars.iv.next96, %29 ]
  %14 = trunc nuw nsw i64 %indvars.iv95 to i32
  %15 = and i32 %11, %14
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %29

17:                                               ; preds = %13
  %18 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv95
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = add nuw nsw i64 %indvars.iv95, %12
  %21 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %20
  %22 = load i64, ptr %21, align 8, !tbaa !9
  %23 = add nsw i64 %22, %19
  store i64 %23, ptr %18, align 8, !tbaa !9
  %24 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %indvars.iv95
  %25 = load i64, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %20
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = add nsw i64 %27, %25
  store i64 %28, ptr %24, align 8, !tbaa !9
  br label %29

29:                                               ; preds = %17, %13
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %13, !llvm.loop !13

._crit_edge.us:                                   ; preds = %29
  %30 = add nuw nsw i32 %.05472.us, 1
  %exitcond98.not = icmp eq i32 %30, %34
  br i1 %exitcond98.not, label %.preheader61, label %.preheader62.us, !llvm.loop !14

.lr.ph68:                                         ; preds = %.preheader64, %.lr.ph68
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %.lr.ph68 ], [ 0, %.preheader64 ]
  %31 = tail call noundef i32 @_Z5rng61v()
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %indvars.iv92
  store i64 %32, ptr %33, align 8, !tbaa !9
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %35 = shl nuw i32 1, %34
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next93, %36
  br i1 %37, label %.lr.ph68, label %.preheader63, !llvm.loop !15

.preheader61:                                     ; preds = %._crit_edge.us, %.preheader63
  %38 = icmp ne i32 %34, 31
  br i1 %38, label %.lr.ph74.preheader, label %.preheader60

.lr.ph74.preheader:                               ; preds = %.preheader61
  %wide.trip.count102 = zext nneg i32 %35 to i64
  br label %.lr.ph74

.preheader60:                                     ; preds = %.lr.ph74, %.preheader61
  %39 = phi i1 [ false, %.preheader61 ], [ %38, %.lr.ph74 ]
  br i1 %10, label %.preheader59.lr.ph, label %.preheader58

.preheader59.lr.ph:                               ; preds = %.preheader60
  br i1 %39, label %.preheader59.us.preheader, label %._crit_edge

.preheader59.us.preheader:                        ; preds = %.preheader59.lr.ph
  %wide.trip.count107 = zext i32 %35 to i64
  %xtraiter = and i64 %wide.trip.count107, 1
  %unroll_iter = and i64 %wide.trip.count107, 4294967294
  %lcmp.mod.not = icmp ne i64 %xtraiter, 0
  br label %.preheader59.us

.preheader59.us:                                  ; preds = %.preheader59.us.preheader, %._crit_edge.us78
  %.05177.us = phi i32 [ %75, %._crit_edge.us78 ], [ 0, %.preheader59.us.preheader ]
  %40 = shl nuw i32 1, %.05177.us
  %41 = sext i32 %40 to i64
  br label %42

42:                                               ; preds = %64, %.preheader59.us
  %indvars.iv104 = phi i64 [ 0, %.preheader59.us ], [ %indvars.iv.next105.1, %64 ]
  %niter = phi i64 [ 0, %.preheader59.us ], [ %niter.next.1, %64 ]
  %43 = trunc nuw nsw i64 %indvars.iv104 to i32
  %44 = and i32 %40, %43
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %53

46:                                               ; preds = %42
  %47 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv104
  %48 = load i64, ptr %47, align 16, !tbaa !9
  %49 = add nuw nsw i64 %indvars.iv104, %41
  %50 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %49
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = sub nsw i64 %48, %51
  store i64 %52, ptr %47, align 16, !tbaa !9
  br label %53

53:                                               ; preds = %46, %42
  %indvars.iv.next105 = or disjoint i64 %indvars.iv104, 1
  %54 = trunc nuw nsw i64 %indvars.iv.next105 to i32
  %55 = and i32 %40, %54
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %64

57:                                               ; preds = %53
  %58 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv.next105
  %59 = load i64, ptr %58, align 8, !tbaa !9
  %60 = add nuw nsw i64 %indvars.iv.next105, %41
  %61 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !9
  %63 = sub nsw i64 %59, %62
  store i64 %63, ptr %58, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %57, %53
  %indvars.iv.next105.1 = add nuw nsw i64 %indvars.iv104, 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.us78.unr-lcssa, label %42, !llvm.loop !16

._crit_edge.us78.unr-lcssa:                       ; preds = %64
  %65 = trunc nuw nsw i64 %indvars.iv.next105.1 to i32
  %66 = and i32 %40, %65
  %67 = icmp eq i32 %66, 0
  %or.cond = select i1 %lcmp.mod.not, i1 %67, i1 false
  br i1 %or.cond, label %68, label %._crit_edge.us78

68:                                               ; preds = %._crit_edge.us78.unr-lcssa
  %69 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv.next105.1
  %70 = load i64, ptr %69, align 8, !tbaa !9
  %71 = add nuw nsw i64 %indvars.iv.next105.1, %41
  %72 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !9
  %74 = sub nsw i64 %70, %73
  store i64 %74, ptr %69, align 8, !tbaa !9
  br label %._crit_edge.us78

._crit_edge.us78:                                 ; preds = %68, %._crit_edge.us78.unr-lcssa
  %75 = add nuw nsw i32 %.05177.us, 1
  %exitcond109.not = icmp eq i32 %75, %34
  br i1 %exitcond109.not, label %.preheader58, label %.preheader59.us, !llvm.loop !17

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %.lr.ph74
  %indvars.iv99 = phi i64 [ 0, %.lr.ph74.preheader ], [ %indvars.iv.next100, %.lr.ph74 ]
  %76 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv99
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = srem i64 %77, 1000000007
  %79 = getelementptr inbounds [8388608 x i64], ptr @g, i64 0, i64 %indvars.iv99
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = srem i64 %80, 1000000007
  store i64 %81, ptr %79, align 8, !tbaa !9
  %82 = mul nsw i64 %81, %78
  %83 = srem i64 %82, 1000000007
  store i64 %83, ptr %76, align 8, !tbaa !9
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102
  br i1 %exitcond103.not, label %.preheader60, label %.lr.ph74, !llvm.loop !18

.preheader58:                                     ; preds = %._crit_edge.us78, %.preheader60
  br i1 %39, label %.lr.ph80.preheader, label %._crit_edge

.lr.ph80.preheader:                               ; preds = %.preheader58
  %wide.trip.count113 = zext nneg i32 %35 to i64
  %xtraiter162 = and i64 %wide.trip.count113, 1
  %84 = icmp eq i32 %34, 0
  br i1 %84, label %.preheader.unr-lcssa, label %.lr.ph80.preheader.new

.lr.ph80.preheader.new:                           ; preds = %.lr.ph80.preheader
  %unroll_iter164 = and i64 %wide.trip.count113, 2147483646
  br label %.lr.ph80

.preheader.unr-lcssa:                             ; preds = %.lr.ph80, %.lr.ph80.preheader
  %indvars.iv110.unr = phi i64 [ 0, %.lr.ph80.preheader ], [ %indvars.iv.next111.1, %.lr.ph80 ]
  %lcmp.mod163.not = icmp eq i64 %xtraiter162, 0
  br i1 %lcmp.mod163.not, label %.preheader, label %.lr.ph80.epil

.lr.ph80.epil:                                    ; preds = %.preheader.unr-lcssa
  %85 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv110.unr
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = srem i64 %86, 1000000007
  %88 = icmp slt i64 %87, 0
  %89 = add nsw i64 %87, 1000000007
  %spec.select.epil = select i1 %88, i64 %89, i64 %87
  store i64 %spec.select.epil, ptr %85, align 8, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %.preheader.unr-lcssa, %.lr.ph80.epil
  br i1 %39, label %.lr.ph83.preheader, label %._crit_edge

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

vector.ph:                                        ; preds = %.lr.ph83.preheader
  %n.vec = and i64 %wide.trip.count113, 2147483644
  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> [ zeroinitializer, %vector.ph ], [ %92, %vector.body ]
  %vec.phi154 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %93, %vector.body ]
  %90 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %index
  %91 = getelementptr inbounds i8, ptr %90, i64 16
  %wide.load = load <2 x i64>, ptr %90, align 16, !tbaa !9
  %wide.load155 = load <2 x i64>, ptr %91, align 16, !tbaa !9
  %92 = xor <2 x i64> %wide.load, %vec.phi
  %93 = xor <2 x i64> %wide.load155, %vec.phi154
  %index.next = add nuw i64 %index, 4
  %94 = icmp eq i64 %index.next, %n.vec
  br i1 %94, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %bin.rdx = xor <2 x i64> %93, %92
  %95 = tail call i64 @llvm.vector.reduce.xor.v2i64(<2 x i64> %bin.rdx)
  br label %._crit_edge

.lr.ph80:                                         ; preds = %.lr.ph80, %.lr.ph80.preheader.new
  %indvars.iv110 = phi i64 [ 0, %.lr.ph80.preheader.new ], [ %indvars.iv.next111.1, %.lr.ph80 ]
  %niter165 = phi i64 [ 0, %.lr.ph80.preheader.new ], [ %niter165.next.1, %.lr.ph80 ]
  %96 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv110
  %97 = load i64, ptr %96, align 16, !tbaa !9
  %98 = srem i64 %97, 1000000007
  %99 = icmp slt i64 %98, 0
  %100 = add nsw i64 %98, 1000000007
  %spec.select = select i1 %99, i64 %100, i64 %98
  store i64 %spec.select, ptr %96, align 16, !tbaa !9
  %indvars.iv.next111 = or disjoint i64 %indvars.iv110, 1
  %101 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv.next111
  %102 = load i64, ptr %101, align 8, !tbaa !9
  %103 = srem i64 %102, 1000000007
  %104 = icmp slt i64 %103, 0
  %105 = add nsw i64 %103, 1000000007
  %spec.select.1 = select i1 %104, i64 %105, i64 %103
  store i64 %spec.select.1, ptr %101, align 8, !tbaa !9
  %indvars.iv.next111.1 = add nuw nsw i64 %indvars.iv110, 2
  %niter165.next.1 = add i64 %niter165, 2
  %niter165.ncmp.1 = icmp eq i64 %niter165.next.1, %unroll_iter164
  br i1 %niter165.ncmp.1, label %.preheader.unr-lcssa, label %.lr.ph80, !llvm.loop !22

._crit_edge:                                      ; preds = %.lr.ph83, %middle.block, %.preheader62.lr.ph, %0, %.preheader64, %.preheader59.lr.ph, %.preheader58, %.preheader
  %.048.lcssa = phi i64 [ 0, %.preheader ], [ 0, %.preheader58 ], [ 0, %.preheader59.lr.ph ], [ 0, %.preheader64 ], [ 0, %0 ], [ 0, %.preheader62.lr.ph ], [ %95, %middle.block ], [ %109, %.lr.ph83 ]
  %106 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.048.lcssa)
  ret i32 0

.lr.ph83:                                         ; preds = %.lr.ph83.preheader, %.lr.ph83
  %indvars.iv115 = phi i64 [ %indvars.iv.next116, %.lr.ph83 ], [ 0, %.lr.ph83.preheader ]
  %.04881 = phi i64 [ %109, %.lr.ph83 ], [ 0, %.lr.ph83.preheader ]
  %107 = getelementptr inbounds [8388608 x i64], ptr @f, i64 0, i64 %indvars.iv115
  %108 = load i64, ptr %107, align 8, !tbaa !9
  %109 = xor i64 %108, %.04881
  %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
  %exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
  br i1 %exitcond119.not, label %._crit_edge, label %.lr.ph83, !llvm.loop !23
}

; 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 noundef i32 @_Z5rng61v() local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

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

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 = { 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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12, !21, !20}


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