; LLVM IR from tangjz/acm-icpc :: hdu (5668)

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

@t = external dso_local global i32, align 4
@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 [25 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 @t)
  br label %15

15:                                               ; preds = %181, %0
  %16 = load i32, ptr @t, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr @t, align 4, !tbaa !5
  %18 = icmp ne i32 %16, 0
  br i1 %18, label %19, label %182

19:                                               ; preds = %15
  %20 = 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 %21

21:                                               ; preds = %31, %19
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = load i32, ptr @n, align 4, !tbaa !5
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

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

26:                                               ; preds = %21
  %27 = load i32, ptr %2, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr @b, i64 %28
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %29)
  br label %31

31:                                               ; preds = %26
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !9

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

35:                                               ; preds = %49, %34
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr @n, align 4, !tbaa !5
  %38 = icmp sle i32 %36, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i32, ptr %3, align 4, !tbaa !5
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %43
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %47
  store i32 %41, ptr %48, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %40
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %3, align 4, !tbaa !5
  br label %35, !llvm.loop !11

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

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

57:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %67

58:                                               ; preds = %53
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %58
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %4, align 4, !tbaa !5
  br label %53, !llvm.loop !12

67:                                               ; preds = %57
  %68 = load i32, ptr @n, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %69
  store i32 1, ptr %70, align 4, !tbaa !5
  %71 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %71, 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 %72

72:                                               ; preds = %83, %67
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = load i32, ptr @n, align 4, !tbaa !5
  %75 = icmp sle i32 %73, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %86

77:                                               ; preds = %72
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sub nsw i32 %78, 1
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %77
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %5, align 4, !tbaa !5
  br label %72, !llvm.loop !13

86:                                               ; preds = %76
  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
  %87 = 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 %87, 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
  %88 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %88, ptr %10, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %157, %86
  %90 = load i32, ptr %9, align 4, !tbaa !5
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 16, ptr %11, align 4
  br label %160

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

95:                                               ; preds = %103, %94
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp ne i32 %96, %100
  br i1 %101, label %102, label %110

102:                                              ; preds = %95
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %12, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %12, align 4, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  store i32 %109, ptr %10, align 4, !tbaa !5
  br label %95, !llvm.loop !14

110:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %111 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %112 = load i32, ptr %111, align 4, !tbaa !15
  %113 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !17
  %115 = load i32, ptr %12, align 4, !tbaa !5
  %116 = load i32, ptr @n, align 4, !tbaa !5
  %117 = load i32, ptr %9, align 4, !tbaa !5
  %118 = sub nsw i32 %116, %117
  %119 = srem i32 %115, %118
  %120 = load i32, ptr @n, align 4, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sub nsw i32 %120, %121
  %123 = call i64 @_Z3CRTiiii(i32 noundef %112, i32 noundef %114, i32 noundef %119, i32 noundef %122)
  store i64 %123, ptr %13, align 4
  %124 = 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
  %125 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %126 = load i32, ptr %125, align 4, !tbaa !17
  %127 = icmp eq i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %110
  store i32 16, ptr %11, align 4
  br label %154

129:                                              ; preds = %110
  %130 = load i32, ptr %10, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %131
  %133 = load i32, ptr %132, 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 = sext i32 %137 to i64
  %139 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %138
  store i32 %133, ptr %139, align 4, !tbaa !5
  %140 = load i32, ptr %10, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %141
  %143 = load i32, ptr %142, 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
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %148
  store i32 %143, ptr %149, align 4, !tbaa !5
  %150 = load i32, ptr %10, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  store i32 %153, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %11, align 4
  br label %154

154:                                              ; preds = %129, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %155 = load i32, ptr %11, align 4
  switch i32 %155, label %160 [
    i32 0, label %156
  ]

156:                                              ; preds = %154
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %9, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %9, align 4, !tbaa !5
  br label %89, !llvm.loop !18

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

161:                                              ; preds = %160
  %162 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !17
  %164 = icmp eq i32 %163, 0
  br i1 %164, label %165, label %167

165:                                              ; preds = %161
  %166 = call i32 @puts(ptr noundef @.str.1)
  br label %181

167:                                              ; preds = %161
  %168 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %169 = load i32, ptr %168, align 4, !tbaa !15
  %170 = icmp sle i32 %169, 0
  br i1 %170, label %171, label %177

171:                                              ; preds = %167
  %172 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  %173 = load i32, ptr %172, align 4, !tbaa !17
  %174 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %175 = load i32, ptr %174, align 4, !tbaa !15
  %176 = add nsw i32 %175, %173
  store i32 %176, ptr %174, align 4, !tbaa !15
  br label %177

177:                                              ; preds = %171, %167
  %178 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %179 = load i32, ptr %178, align 4, !tbaa !15
  %180 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %179)
  br label %181

181:                                              ; preds = %177, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %15, !llvm.loop !19

182:                                              ; preds = %15
  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}
!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"

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

@t = external dso_local global i32, align 4
@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 [25 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 @t)
  %6 = load i32, ptr @t, align 4, !tbaa !5
  %7 = add nsw i32 %6, -1
  store i32 %7, ptr @t, align 4, !tbaa !5
  %.not70 = icmp eq i32 %6, 0
  br i1 %.not70, label %._crit_edge73, label %.lr.ph72

.lr.ph72:                                         ; preds = %0
  %8 = getelementptr inbounds i8, ptr %1, i64 4
  br label %9

9:                                                ; preds = %.lr.ph72, %117
  %10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %.not4048 = icmp slt i32 %11, 1
  br i1 %.not4048, label %._crit_edge.thread, label %.lr.ph

.preheader47:                                     ; preds = %.lr.ph
  %.not4150 = icmp slt i32 %18, 1
  br i1 %.not4150, label %._crit_edge.thread, label %.lr.ph52.preheader

.lr.ph52.preheader:                               ; preds = %.preheader47
  %12 = add nuw i32 %18, 1
  %wide.trip.count = zext i32 %12 to i64
  %13 = zext nneg i32 %18 to i64
  %14 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %13, 3
  %15 = icmp ult i64 %14, 3
  br i1 %15, label %.preheader46.unr-lcssa, label %.lr.ph52.preheader.new

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

.lr.ph:                                           ; preds = %9, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %9 ]
  %16 = getelementptr inbounds i32, ptr @b, i64 %indvars.iv
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %16)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %.not40.not = icmp slt i64 %indvars.iv, %19
  br i1 %.not40.not, label %.lr.ph, label %.preheader47, !llvm.loop !9

.preheader46.unr-lcssa:                           ; preds = %.lr.ph52, %.lr.ph52.preheader
  %indvars.iv78.unr = phi i64 [ 1, %.lr.ph52.preheader ], [ %indvars.iv.next79.3, %.lr.ph52 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader46, label %.lr.ph52.epil

.lr.ph52.epil:                                    ; preds = %.preheader46.unr-lcssa, %.lr.ph52.epil
  %indvars.iv78.epil = phi i64 [ %indvars.iv.next79.epil, %.lr.ph52.epil ], [ %indvars.iv78.unr, %.preheader46.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph52.epil ], [ 0, %.preheader46.unr-lcssa ]
  %20 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv78.epil
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = add nsw i32 %21, -1
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %23
  %25 = trunc nuw nsw i64 %indvars.iv78.epil to i32
  store i32 %25, ptr %24, align 4, !tbaa !5
  %indvars.iv.next79.epil = add nuw nsw i64 %indvars.iv78.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 %.preheader46, label %.lr.ph52.epil, !llvm.loop !11

.preheader46:                                     ; preds = %.lr.ph52.epil, %.preheader46.unr-lcssa
  %.not105 = icmp eq i32 %18, 1
  br i1 %.not105, label %._crit_edge.thread, label %.lr.ph54.preheader

.lr.ph54.preheader:                               ; preds = %.preheader46
  %wide.trip.count84 = zext nneg i32 %18 to i64
  %26 = add nsw i64 %wide.trip.count84, -1
  %min.iters.check112 = icmp ult i32 %18, 9
  br i1 %min.iters.check112, label %.lr.ph54.preheader127, label %vector.ph113

.lr.ph54.preheader127:                            ; preds = %middle.block110, %.lr.ph54.preheader
  %indvars.iv81.ph = phi i64 [ 1, %.lr.ph54.preheader ], [ %ind.end116, %middle.block110 ]
  br label %.lr.ph54

vector.ph113:                                     ; preds = %.lr.ph54.preheader
  %n.vec115 = and i64 %26, -8
  %ind.end116 = or disjoint i64 %n.vec115, 1
  br label %vector.body118

vector.body118:                                   ; preds = %vector.body118, %vector.ph113
  %index119 = phi i64 [ 0, %vector.ph113 ], [ %index.next125, %vector.body118 ]
  %vec.ind120 = phi <4 x i64> [ <i64 1, i64 2, i64 3, i64 4>, %vector.ph113 ], [ %vec.ind.next123, %vector.body118 ]
  %offset.idx124 = or disjoint i64 %index119, 1
  %27 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %offset.idx124
  %28 = trunc <4 x i64> %vec.ind120 to <4 x i32>
  %29 = add <4 x i32> %28, <i32 1, i32 1, i32 1, i32 1>
  %30 = trunc <4 x i64> %vec.ind120 to <4 x i32>
  %31 = add <4 x i32> %30, <i32 5, i32 5, i32 5, i32 5>
  %32 = getelementptr inbounds i8, ptr %27, i64 16
  store <4 x i32> %29, ptr %27, align 4, !tbaa !5
  store <4 x i32> %31, ptr %32, align 4, !tbaa !5
  %index.next125 = add nuw i64 %index119, 8
  %vec.ind.next123 = add <4 x i64> %vec.ind120, <i64 8, i64 8, i64 8, i64 8>
  %33 = icmp eq i64 %index.next125, %n.vec115
  br i1 %33, label %middle.block110, label %vector.body118, !llvm.loop !13

middle.block110:                                  ; preds = %vector.body118
  %cmp.n126 = icmp eq i64 %26, %n.vec115
  br i1 %cmp.n126, label %._crit_edge, label %.lr.ph54.preheader127

.lr.ph52:                                         ; preds = %.lr.ph52, %.lr.ph52.preheader.new
  %indvars.iv78 = phi i64 [ 1, %.lr.ph52.preheader.new ], [ %indvars.iv.next79.3, %.lr.ph52 ]
  %niter = phi i64 [ 0, %.lr.ph52.preheader.new ], [ %niter.next.3, %.lr.ph52 ]
  %34 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv78
  %35 = load i32, ptr %34, align 4, !tbaa !5
  %36 = add nsw i32 %35, -1
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %37
  %39 = trunc nuw nsw i64 %indvars.iv78 to i32
  store i32 %39, ptr %38, align 4, !tbaa !5
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %40 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv.next79
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = add nsw i32 %41, -1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %43
  %45 = trunc nuw nsw i64 %indvars.iv.next79 to i32
  store i32 %45, ptr %44, align 4, !tbaa !5
  %indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
  %46 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv.next79.1
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = add nsw i32 %47, -1
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %49
  %51 = trunc nuw nsw i64 %indvars.iv.next79.1 to i32
  store i32 %51, ptr %50, align 4, !tbaa !5
  %indvars.iv.next79.2 = add nuw nsw i64 %indvars.iv78, 3
  %52 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv.next79.2
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %55
  %57 = trunc nuw nsw i64 %indvars.iv.next79.2 to i32
  store i32 %57, ptr %56, align 4, !tbaa !5
  %indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 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 %.preheader46.unr-lcssa, label %.lr.ph52, !llvm.loop !16

._crit_edge.thread:                               ; preds = %.preheader46, %.preheader47, %9
  %.lcssa9698.ph = phi i32 [ %18, %.preheader46 ], [ %18, %.preheader47 ], [ %11, %9 ]
  %58 = sext i32 %.lcssa9698.ph to i64
  %59 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %58
  store i32 1, ptr %59, align 4, !tbaa !5
  store i32 %.lcssa9698.ph, ptr getelementptr inbounds (i8, ptr @L, i64 4), align 4, !tbaa !5
  br label %._crit_edge59

._crit_edge:                                      ; preds = %.lr.ph54, %middle.block110
  %60 = zext nneg i32 %18 to i64
  %61 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %60
  store i32 1, ptr %61, align 4, !tbaa !5
  store i32 %18, ptr getelementptr inbounds (i8, ptr @L, i64 4), align 4, !tbaa !5
  %62 = add nuw i32 %18, 1
  %wide.trip.count89 = zext i32 %62 to i64
  %63 = add nsw i64 %wide.trip.count, -2
  %min.iters.check = icmp ult i64 %63, 8
  br i1 %min.iters.check, label %.lr.ph58.preheader, label %vector.ph

.lr.ph58.preheader:                               ; preds = %middle.block, %._crit_edge
  %indvars.iv86.ph = phi i64 [ 2, %._crit_edge ], [ %ind.end, %middle.block ]
  br label %.lr.ph58

vector.ph:                                        ; preds = %._crit_edge
  %n.vec = and i64 %63, -8
  %ind.end = or disjoint i64 %n.vec, 2
  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 i32> [ <i32 2, i32 3, i32 4, i32 5>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, 2
  %64 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %offset.idx
  %65 = add <4 x i32> %vec.ind, <i32 -1, i32 -1, i32 -1, i32 -1>
  %66 = add <4 x i32> %vec.ind, <i32 3, i32 3, i32 3, i32 3>
  %67 = getelementptr inbounds i8, ptr %64, i64 16
  store <4 x i32> %65, ptr %64, align 8, !tbaa !5
  store <4 x i32> %66, ptr %67, align 8, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %68 = icmp eq i64 %index.next, %n.vec
  br i1 %68, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %63, %n.vec
  br i1 %cmp.n, label %._crit_edge59, label %.lr.ph58.preheader

.lr.ph54:                                         ; preds = %.lr.ph54.preheader127, %.lr.ph54
  %indvars.iv81 = phi i64 [ %indvars.iv.next82, %.lr.ph54 ], [ %indvars.iv81.ph, %.lr.ph54.preheader127 ]
  %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
  %69 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %indvars.iv81
  %70 = trunc nuw nsw i64 %indvars.iv.next82 to i32
  store i32 %70, ptr %69, align 4, !tbaa !5
  %exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
  br i1 %exitcond85.not, label %._crit_edge, label %.lr.ph54, !llvm.loop !18

._crit_edge59:                                    ; preds = %.lr.ph58, %middle.block, %._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
  %71 = 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 %71, 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
  %72 = load i32, ptr @n, align 4, !tbaa !5
  %73 = icmp sgt i32 %72, 0
  %74 = lshr i64 %71, 32
  %75 = trunc nuw i64 %74 to i32
  br i1 %73, label %.preheader, label %.thread

.lr.ph58:                                         ; preds = %.lr.ph58.preheader, %.lr.ph58
  %indvars.iv86 = phi i64 [ %indvars.iv.next87, %.lr.ph58 ], [ %indvars.iv86.ph, %.lr.ph58.preheader ]
  %76 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %indvars.iv86
  %77 = trunc i64 %indvars.iv86 to i32
  %78 = add i32 %77, -1
  store i32 %78, ptr %76, align 4, !tbaa !5
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89
  br i1 %exitcond90.not, label %._crit_edge59, label %.lr.ph58, !llvm.loop !19

.preheader:                                       ; preds = %._crit_edge59, %94
  %79 = phi i32 [ %93, %94 ], [ %75, %._crit_edge59 ]
  %indvars.iv91 = phi i64 [ %indvars.iv.next92, %94 ], [ 0, %._crit_edge59 ]
  %80 = phi i32 [ %104, %94 ], [ %72, %._crit_edge59 ]
  %.03168 = phi i32 [ %97, %94 ], [ %72, %._crit_edge59 ]
  %81 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %indvars.iv91
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %.not4360 = icmp eq i32 %.03168, %82
  br i1 %.not4360, label %._crit_edge64, label %.lr.ph63

.lr.ph63:                                         ; preds = %.preheader, %.lr.ph63
  %.062 = phi i32 [ %83, %.lr.ph63 ], [ 0, %.preheader ]
  %.161 = phi i32 [ %86, %.lr.ph63 ], [ %.03168, %.preheader ]
  %83 = add nuw nsw i32 %.062, 1
  %84 = sext i32 %.161 to i64
  %85 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %.not43 = icmp eq i32 %86, %82
  br i1 %.not43, label %._crit_edge64, label %.lr.ph63, !llvm.loop !20

._crit_edge64:                                    ; preds = %.lr.ph63, %.preheader
  %.1.lcssa = phi i32 [ %.03168, %.preheader ], [ %82, %.lr.ph63 ]
  %.0.lcssa = phi i32 [ 0, %.preheader ], [ %83, %.lr.ph63 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %87 = load i32, ptr %1, align 8, !tbaa !21
  %88 = trunc nuw nsw i64 %indvars.iv91 to i32
  %89 = sub nsw i32 %80, %88
  %90 = srem i32 %.0.lcssa, %89
  %91 = call i64 @_Z3CRTiiii(i32 noundef %87, i32 noundef %79, i32 noundef %90, i32 noundef %89)
  store i64 %91, ptr %4, align 8
  %92 = 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
  %93 = load i32, ptr %8, align 4, !tbaa !23
  %.not44 = icmp eq i32 %93, 0
  br i1 %.not44, label %.thread.thread, label %94

94:                                               ; preds = %._crit_edge64
  %95 = sext i32 %.1.lcssa to i64
  %96 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %95
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [30 x i32], ptr @L, i64 0, i64 %100
  store i32 %97, ptr %101, align 4, !tbaa !5
  %102 = sext i32 %97 to i64
  %103 = getelementptr inbounds [30 x i32], ptr @R, i64 0, i64 %102
  store i32 %99, ptr %103, align 4, !tbaa !5
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %104 = load i32, ptr @n, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next92, %105
  br i1 %106, label %.preheader, label %.thread.thread101, !llvm.loop !24

.thread:                                          ; preds = %._crit_edge59
  %107 = icmp ult i64 %71, 4294967296
  br i1 %107, label %.thread.thread, label %.thread.thread101

.thread.thread:                                   ; preds = %._crit_edge64, %.thread
  %108 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %117

.thread.thread101:                                ; preds = %94, %.thread
  %109 = phi i32 [ %75, %.thread ], [ %93, %94 ]
  %110 = load i32, ptr %1, align 8, !tbaa !21
  %111 = icmp slt i32 %110, 1
  br i1 %111, label %112, label %114

112:                                              ; preds = %.thread.thread101
  %113 = add nsw i32 %110, %109
  store i32 %113, ptr %1, align 8, !tbaa !21
  br label %114

114:                                              ; preds = %112, %.thread.thread101
  %115 = phi i32 [ %113, %112 ], [ %110, %.thread.thread101 ]
  %116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %115)
  br label %117

117:                                              ; preds = %114, %.thread.thread
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  %118 = load i32, ptr @t, align 4, !tbaa !5
  %119 = add nsw i32 %118, -1
  store i32 %119, ptr @t, align 4, !tbaa !5
  %.not = icmp eq i32 %118, 0
  br i1 %.not, label %._crit_edge73, label %9, !llvm.loop !25

._crit_edge73:                                    ; preds = %117, %0
  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}
!25 = distinct !{!25, !10}


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