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

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

%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@a = external dso_local global [30 x i32], align 16
@b = external dso_local global [30 x i32], align 16
@L = external dso_local global [30 x i32], align 16
@R = external dso_local global [30 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z3CRTiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %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 %"struct.std::pair", align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 4
  store i32 0, ptr %1, align 4
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %15

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

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

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds i32, ptr @b, i64 %22
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %23)
  br label %25

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

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

29:                                               ; preds = %43, %28
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr @n, align 4, !tbaa !5
  %32 = icmp sle i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = sub nsw i32 %39, 1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %41
  store i32 %35, ptr %42, align 4, !tbaa !5
  br label %43

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

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

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

51:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %61

52:                                               ; preds = %47
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %52
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %4, align 4, !tbaa !5
  br label %47, !llvm.loop !12

61:                                               ; preds = %51
  %62 = load i32, ptr @n, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %63
  store i32 1, ptr %64, align 4, !tbaa !5
  %65 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %65, ptr getelementptr inbounds ([30 x i32], ptr @L, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %77, %61
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %80

71:                                               ; preds = %66
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %75
  store i32 %73, ptr %76, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %71
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %5, align 4, !tbaa !5
  br label %66, !llvm.loop !13

80:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !5
  %81 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  store i64 %81, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %82, ptr %10, align 4, !tbaa !5
  br label %83

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

87:                                               ; preds = %83
  store i32 14, ptr %11, align 4
  br label %154

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

89:                                               ; preds = %97, %88
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = load i32, ptr %9, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp ne i32 %90, %94
  br i1 %95, label %96, label %104

96:                                               ; preds = %89
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %12, align 4, !tbaa !5
  %100 = load i32, ptr %10, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  store i32 %103, ptr %10, align 4, !tbaa !5
  br label %89, !llvm.loop !14

104:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %105 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %106 = load i32, ptr %105, align 4, !tbaa !15
  %107 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !17
  %109 = load i32, ptr %12, align 4, !tbaa !5
  %110 = load i32, ptr @n, align 4, !tbaa !5
  %111 = load i32, ptr %9, align 4, !tbaa !5
  %112 = sub nsw i32 %110, %111
  %113 = srem i32 %109, %112
  %114 = load i32, ptr @n, align 4, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !5
  %116 = sub nsw i32 %114, %115
  %117 = call i64 @_Z3CRTiiii(i32 noundef %106, i32 noundef %108, i32 noundef %113, i32 noundef %116)
  store i64 %117, ptr %13, align 4
  %118 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %6, ptr noundef nonnull align 4 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %119 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !17
  %121 = icmp eq i32 %120, 0
  br i1 %121, label %122, label %123

122:                                              ; preds = %104
  store i32 14, ptr %11, align 4
  br label %148

123:                                              ; preds = %104
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %10, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %132
  store i32 %127, ptr %133, align 4, !tbaa !5
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %142
  store i32 %137, ptr %143, align 4, !tbaa !5
  %144 = load i32, ptr %10, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  store i32 %147, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %148

148:                                              ; preds = %123, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %149 = load i32, ptr %11, align 4
  switch i32 %149, label %154 [
    i32 0, label %150
  ]

150:                                              ; preds = %148
  br label %151

151:                                              ; preds = %150
  %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 %83, !llvm.loop !18

154:                                              ; preds = %148, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %155

155:                                              ; preds = %154
  %156 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %157 = load i32, ptr %156, align 4, !tbaa !17
  %158 = icmp eq i32 %157, 0
  br i1 %158, label %159, label %161

159:                                              ; preds = %155
  %160 = call i32 @puts(ptr noundef @.str.1)
  br label %175

161:                                              ; preds = %155
  %162 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %163 = load i32, ptr %162, align 4, !tbaa !15
  %164 = icmp sle i32 %163, 0
  br i1 %164, label %165, label %171

165:                                              ; preds = %161
  %166 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %167 = load i32, ptr %166, align 4, !tbaa !17
  %168 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %169 = load i32, ptr %168, align 4, !tbaa !15
  %170 = add nsw i32 %169, %167
  store i32 %170, ptr %168, align 4, !tbaa !15
  br label %171

171:                                              ; preds = %165, %161
  %172 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %173 = load i32, ptr %172, align 4, !tbaa !15
  %174 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %173)
  br label %175

175:                                              ; preds = %171, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  ret i32 0
}

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

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

declare i32 @puts(ptr noundef) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = distinct !{!18, !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"

%"struct.std::pair" = type { i32, i32 }

@n = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [30 x i32], align 16
@b = external dso_local global [30 x i32], align 16
@L = external dso_local local_unnamed_addr global [30 x i32], align 16
@R = external dso_local local_unnamed_addr global [30 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z3CRTiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not47 = icmp slt i32 %6, 1
  br i1 %.not47, label %._crit_edge.thread, label %.lr.ph

.preheader46:                                     ; preds = %.lr.ph
  %.not4049 = icmp slt i32 %13, 1
  br i1 %.not4049, label %._crit_edge.thread, label %.lr.ph51.preheader

.lr.ph51.preheader:                               ; preds = %.preheader46
  %7 = add nuw i32 %13, 1
  %wide.trip.count = zext i32 %7 to i64
  %8 = zext nneg i32 %13 to i64
  %9 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %8, 3
  %10 = icmp ult i64 %9, 3
  br i1 %10, label %.preheader45.unr-lcssa, label %.lr.ph51.preheader.new

.lr.ph51.preheader.new:                           ; preds = %.lr.ph51.preheader
  %unroll_iter = and i64 %8, 2147483644
  br label %.lr.ph51

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

.preheader45.unr-lcssa:                           ; preds = %.lr.ph51, %.lr.ph51.preheader
  %indvars.iv73.unr = phi i64 [ 1, %.lr.ph51.preheader ], [ %indvars.iv.next74.3, %.lr.ph51 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader45, label %.lr.ph51.epil

.lr.ph51.epil:                                    ; preds = %.preheader45.unr-lcssa, %.lr.ph51.epil
  %indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %.lr.ph51.epil ], [ %indvars.iv73.unr, %.preheader45.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph51.epil ], [ 0, %.preheader45.unr-lcssa ]
  %15 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv73.epil
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %18
  %20 = trunc nuw nsw i64 %indvars.iv73.epil to i32
  store i32 %20, ptr %19, align 4, !tbaa !5
  %indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader45, label %.lr.ph51.epil, !llvm.loop !11

.preheader45:                                     ; preds = %.lr.ph51.epil, %.preheader45.unr-lcssa
  %.not = icmp eq i32 %13, 1
  br i1 %.not, label %._crit_edge.thread, label %.lr.ph53.preheader

.lr.ph53.preheader:                               ; preds = %.preheader45
  %wide.trip.count79 = zext nneg i32 %13 to i64
  %21 = add nsw i64 %wide.trip.count79, -1
  %min.iters.check = icmp ult i32 %13, 9
  br i1 %min.iters.check, label %.lr.ph53.preheader123, label %vector.ph

.lr.ph53.preheader123:                            ; preds = %middle.block, %.lr.ph53.preheader
  %indvars.iv76.ph = phi i64 [ 1, %.lr.ph53.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph53

vector.ph:                                        ; preds = %.lr.ph53.preheader
  %n.vec = and i64 %21, -8
  %ind.end = or disjoint i64 %n.vec, 1
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i64> [ <i64 1, i64 2, i64 3, i64 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 1
  %22 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %offset.idx
  %23 = trunc <4 x i64> %vec.ind to <4 x i32>
  %24 = add <4 x i32> %23, <i32 1, i32 1, i32 1, i32 1>
  %25 = trunc <4 x i64> %vec.ind to <4 x i32>
  %26 = add <4 x i32> %25, <i32 5, i32 5, i32 5, i32 5>
  %27 = getelementptr inbounds i8, ptr %22, i64 16
  store <4 x i32> %24, ptr %22, align 4, !tbaa !5
  store <4 x i32> %26, ptr %27, align 4, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
  %28 = icmp eq i64 %index.next, %n.vec
  br i1 %28, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %21, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph53.preheader123

.lr.ph51:                                         ; preds = %.lr.ph51, %.lr.ph51.preheader.new
  %indvars.iv73 = phi i64 [ 1, %.lr.ph51.preheader.new ], [ %indvars.iv.next74.3, %.lr.ph51 ]
  %niter = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %niter.next.3, %.lr.ph51 ]
  %29 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv73
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %32
  %34 = trunc nuw nsw i64 %indvars.iv73 to i32
  store i32 %34, ptr %33, align 4, !tbaa !5
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %35 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv.next74
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, -1
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %38
  %40 = trunc nuw nsw i64 %indvars.iv.next74 to i32
  store i32 %40, ptr %39, align 4, !tbaa !5
  %indvars.iv.next74.1 = add nuw nsw i64 %indvars.iv73, 2
  %41 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv.next74.1
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = add nsw i32 %42, -1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %44
  %46 = trunc nuw nsw i64 %indvars.iv.next74.1 to i32
  store i32 %46, ptr %45, align 4, !tbaa !5
  %indvars.iv.next74.2 = add nuw nsw i64 %indvars.iv73, 3
  %47 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv.next74.2
  %48 = load i32, ptr %47, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %50
  %52 = trunc nuw nsw i64 %indvars.iv.next74.2 to i32
  store i32 %52, ptr %51, align 4, !tbaa !5
  %indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader45.unr-lcssa, label %.lr.ph51, !llvm.loop !16

._crit_edge.thread:                               ; preds = %.preheader45, %.preheader46, %0
  %.lcssa9193.ph = phi i32 [ %13, %.preheader45 ], [ %13, %.preheader46 ], [ %6, %0 ]
  %53 = sext i32 %.lcssa9193.ph to i64
  %54 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %53
  store i32 1, ptr %54, align 4, !tbaa !5
  store i32 %.lcssa9193.ph, ptr getelementptr inbounds (i8, ptr @L, i64 4), align 4, !tbaa !5
  br label %._crit_edge58

._crit_edge:                                      ; preds = %.lr.ph53, %middle.block
  %55 = zext nneg i32 %13 to i64
  %56 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %55
  store i32 1, ptr %56, align 4, !tbaa !5
  store i32 %13, ptr getelementptr inbounds (i8, ptr @L, i64 4), align 4, !tbaa !5
  %57 = add nuw i32 %13, 1
  %wide.trip.count84 = zext i32 %57 to i64
  %58 = add nsw i64 %wide.trip.count, -2
  %min.iters.check106 = icmp ult i64 %58, 8
  br i1 %min.iters.check106, label %.lr.ph57.preheader, label %vector.ph107

.lr.ph57.preheader:                               ; preds = %middle.block104, %._crit_edge
  %indvars.iv81.ph = phi i64 [ 2, %._crit_edge ], [ %ind.end110, %middle.block104 ]
  br label %.lr.ph57

vector.ph107:                                     ; preds = %._crit_edge
  %n.vec109 = and i64 %58, -8
  %ind.end110 = or disjoint i64 %n.vec109, 2
  br label %vector.body112

vector.body112:                                   ; preds = %vector.body112, %vector.ph107
  %index113 = phi i64 [ 0, %vector.ph107 ], [ %index.next119, %vector.body112 ]
  %vec.ind114 = phi <4 x i32> [ <i32 2, i32 3, i32 4, i32 5>, %vector.ph107 ], [ %vec.ind.next117, %vector.body112 ]
  %offset.idx118 = or disjoint i64 %index113, 2
  %59 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %offset.idx118
  %60 = add <4 x i32> %vec.ind114, <i32 -1, i32 -1, i32 -1, i32 -1>
  %61 = add <4 x i32> %vec.ind114, <i32 3, i32 3, i32 3, i32 3>
  %62 = getelementptr inbounds i8, ptr %59, i64 16
  store <4 x i32> %60, ptr %59, align 8, !tbaa !5
  store <4 x i32> %61, ptr %62, align 8, !tbaa !5
  %index.next119 = add nuw i64 %index113, 8
  %vec.ind.next117 = add <4 x i32> %vec.ind114, <i32 8, i32 8, i32 8, i32 8>
  %63 = icmp eq i64 %index.next119, %n.vec109
  br i1 %63, label %middle.block104, label %vector.body112, !llvm.loop !17

middle.block104:                                  ; preds = %vector.body112
  %cmp.n120 = icmp eq i64 %58, %n.vec109
  br i1 %cmp.n120, label %._crit_edge58, label %.lr.ph57.preheader

.lr.ph53:                                         ; preds = %.lr.ph53.preheader123, %.lr.ph53
  %indvars.iv76 = phi i64 [ %indvars.iv.next77, %.lr.ph53 ], [ %indvars.iv76.ph, %.lr.ph53.preheader123 ]
  %indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
  %64 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %indvars.iv76
  %65 = trunc nuw nsw i64 %indvars.iv.next77 to i32
  store i32 %65, ptr %64, align 4, !tbaa !5
  %exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79
  br i1 %exitcond80.not, label %._crit_edge, label %.lr.ph53, !llvm.loop !18

._crit_edge58:                                    ; preds = %.lr.ph57, %middle.block104, %._crit_edge.thread
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 1, ptr %3, align 4, !tbaa !5
  %66 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %66, ptr %1, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %67 = load i32, ptr @n, align 4, !tbaa !5
  %68 = icmp sgt i32 %67, 0
  %69 = lshr i64 %66, 32
  %70 = trunc nuw i64 %69 to i32
  br i1 %68, label %.preheader.lr.ph, label %.thread

.preheader.lr.ph:                                 ; preds = %._crit_edge58
  %71 = getelementptr inbounds i8, ptr %1, i64 4
  br label %.preheader

.lr.ph57:                                         ; preds = %.lr.ph57.preheader, %.lr.ph57
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph57 ], [ %indvars.iv81.ph, %.lr.ph57.preheader ]
  %72 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %indvars.iv81
  %73 = trunc i64 %indvars.iv81 to i32
  %74 = add i32 %73, -1
  store i32 %74, ptr %72, align 4, !tbaa !5
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
  br i1 %exitcond85.not, label %._crit_edge58, label %.lr.ph57, !llvm.loop !19

.preheader:                                       ; preds = %.preheader.lr.ph, %90
  %75 = phi i32 [ %70, %.preheader.lr.ph ], [ %89, %90 ]
  %indvars.iv86 = phi i64 [ 0, %.preheader.lr.ph ], [ %indvars.iv.next87, %90 ]
  %76 = phi i32 [ %67, %.preheader.lr.ph ], [ %100, %90 ]
  %.03167 = phi i32 [ %67, %.preheader.lr.ph ], [ %93, %90 ]
  %77 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %indvars.iv86
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %.not4259 = icmp eq i32 %.03167, %78
  br i1 %.not4259, label %._crit_edge63, label %.lr.ph62

.lr.ph62:                                         ; preds = %.preheader, %.lr.ph62
  %.061 = phi i32 [ %79, %.lr.ph62 ], [ 0, %.preheader ]
  %.160 = phi i32 [ %82, %.lr.ph62 ], [ %.03167, %.preheader ]
  %79 = add nuw nsw i32 %.061, 1
  %80 = sext i32 %.160 to i64
  %81 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %.not42 = icmp eq i32 %82, %78
  br i1 %.not42, label %._crit_edge63, label %.lr.ph62, !llvm.loop !20

._crit_edge63:                                    ; preds = %.lr.ph62, %.preheader
  %.1.lcssa = phi i32 [ %.03167, %.preheader ], [ %78, %.lr.ph62 ]
  %.0.lcssa = phi i32 [ 0, %.preheader ], [ %79, %.lr.ph62 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %83 = load i32, ptr %1, align 8, !tbaa !21
  %84 = trunc nuw nsw i64 %indvars.iv86 to i32
  %85 = sub nsw i32 %76, %84
  %86 = srem i32 %.0.lcssa, %85
  %87 = call i64 @_Z3CRTiiii(i32 noundef %83, i32 noundef %75, i32 noundef %86, i32 noundef %85)
  store i64 %87, ptr %4, align 8
  %88 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %1, ptr noundef nonnull align 4 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %89 = load i32, ptr %71, align 4, !tbaa !23
  %.not43 = icmp eq i32 %89, 0
  br i1 %.not43, label %.thread.thread, label %90

90:                                               ; preds = %._crit_edge63
  %91 = sext i32 %.1.lcssa to i64
  %92 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  %94 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %91
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %96
  store i32 %93, ptr %97, align 4, !tbaa !5
  %98 = sext i32 %93 to i64
  %99 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %98
  store i32 %95, ptr %99, align 4, !tbaa !5
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %100 = load i32, ptr @n, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = icmp slt i64 %indvars.iv.next87, %101
  br i1 %102, label %.preheader, label %.thread.thread96, !llvm.loop !24

.thread:                                          ; preds = %._crit_edge58
  %103 = icmp ult i64 %66, 4294967296
  br i1 %103, label %.thread.thread, label %.thread.thread96

.thread.thread:                                   ; preds = %._crit_edge63, %.thread
  %104 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %113

.thread.thread96:                                 ; preds = %90, %.thread
  %105 = phi i32 [ %70, %.thread ], [ %89, %90 ]
  %106 = load i32, ptr %1, align 8, !tbaa !21
  %107 = icmp slt i32 %106, 1
  br i1 %107, label %108, label %110

108:                                              ; preds = %.thread.thread96
  %109 = add nsw i32 %106, %105
  store i32 %109, ptr %1, align 8, !tbaa !21
  br label %110

110:                                              ; preds = %108, %.thread.thread96
  %111 = phi i32 [ %109, %108 ], [ %106, %.thread.thread96 ]
  %112 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %111)
  br label %113

113:                                              ; preds = %110, %.thread.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret i32 0
}

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !14, !15}
!18 = distinct !{!18, !10, !15, !14}
!19 = distinct !{!19, !10, !15, !14}
!20 = distinct !{!20, !10}
!21 = !{!22, !6, i64 0}
!22 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!23 = !{!22, !6, i64 4}
!24 = distinct !{!24, !10}


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