; LLVM IR from lzyrapx/Competitive-Programming :: HDUOJ (1230)

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

@p = external dso_local global [150 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5primev() #0

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [150 x i32], align 16
  %9 = alloca [150 x i32], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca [150 x i32], align 16
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @_Z5primev()
  call void @llvm.lifetime.start.p0(i64 600, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 600, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #7
  br label %20

20:                                               ; preds = %191, %0
  br label %21

21:                                               ; preds = %20
  %22 = getelementptr inbounds [150 x i32], ptr %8, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %22, i8 0, i64 600, i1 false)
  %23 = getelementptr inbounds [150 x i32], ptr %9, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %23, i8 0, i64 600, i1 false)
  %24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %12)
  store i32 0, ptr %4, align 4, !tbaa !5
  %25 = load i32, ptr %12, align 4, !tbaa !5
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %4, align 4, !tbaa !5
  %28 = sext i32 %26 to i64
  %29 = getelementptr inbounds [150 x i32], ptr %8, i64 0, i64 %28
  store i32 %25, ptr %29, align 4, !tbaa !5
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %14)
  br label %31

31:                                               ; preds = %35, %21
  %32 = load i8, ptr %14, align 1, !tbaa !9
  %33 = sext i8 %32 to i32
  %34 = icmp eq i32 %33, 44
  br i1 %34, label %35, label %43

35:                                               ; preds = %31
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %12)
  %37 = load i32, ptr %12, align 4, !tbaa !5
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds [150 x i32], ptr %8, i64 0, i64 %40
  store i32 %37, ptr %41, align 4, !tbaa !5
  %42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %14)
  br label %31, !llvm.loop !10

43:                                               ; preds = %31
  %44 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %44, ptr %10, align 4, !tbaa !5
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %12)
  store i32 0, ptr %4, align 4, !tbaa !5
  %46 = load i32, ptr %12, align 4, !tbaa !5
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %4, align 4, !tbaa !5
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [150 x i32], ptr %9, i64 0, i64 %49
  store i32 %46, ptr %50, align 4, !tbaa !5
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %14)
  br label %52

52:                                               ; preds = %56, %43
  %53 = load i8, ptr %14, align 1, !tbaa !9
  %54 = sext i8 %53 to i32
  %55 = icmp eq i32 %54, 44
  br i1 %55, label %56, label %64

56:                                               ; preds = %52
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %12)
  %58 = load i32, ptr %12, align 4, !tbaa !5
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds [150 x i32], ptr %9, i64 0, i64 %61
  store i32 %58, ptr %62, align 4, !tbaa !5
  %63 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %14)
  br label %52, !llvm.loop !12

64:                                               ; preds = %52
  %65 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %65, ptr %11, align 4, !tbaa !5
  %66 = getelementptr inbounds [150 x i32], ptr %8, i64 0, i64 0
  %67 = getelementptr inbounds [150 x i32], ptr %8, i64 0, i64 0
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i32, ptr %67, i64 %69
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef %66, ptr noundef %70)
  %71 = getelementptr inbounds [150 x i32], ptr %9, i64 0, i64 0
  %72 = getelementptr inbounds [150 x i32], ptr %9, i64 0, i64 0
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr %72, i64 %74
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef %71, ptr noundef %75)
  %76 = getelementptr inbounds [150 x i32], ptr %8, i64 0, i64 0
  %77 = load i32, ptr %76, align 16, !tbaa !5
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %79, label %90

79:                                               ; preds = %64
  %80 = getelementptr inbounds [150 x i32], ptr %9, i64 0, i64 0
  %81 = load i32, ptr %80, align 16, !tbaa !5
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %90

83:                                               ; preds = %79
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = icmp eq i32 %84, 1
  br i1 %85, label %86, label %90

86:                                               ; preds = %83
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = icmp eq i32 %87, 1
  br i1 %88, label %89, label %90

89:                                               ; preds = %86
  br label %193

90:                                               ; preds = %86, %83, %79, %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %92 = load i32, ptr %91, align 4, !tbaa !5
  store i32 %92, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 600, ptr %16) #7
  %93 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %93, i8 0, i64 600, i1 false)
  store i32 0, ptr %4, align 4, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %112, %90
  %95 = load i32, ptr %4, align 4, !tbaa !5
  %96 = load i32, ptr %15, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %98, label %115

98:                                               ; preds = %94
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [150 x i32], ptr %8, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !5
  %103 = load i32, ptr %4, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [150 x i32], ptr %9, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = add nsw i32 %102, %106
  %108 = load i32, ptr %6, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %6, align 4, !tbaa !5
  %110 = sext i32 %108 to i64
  %111 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %110
  store i32 %107, ptr %111, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %98
  %113 = load i32, ptr %4, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %4, align 4, !tbaa !5
  br label %94, !llvm.loop !13

115:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %116 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %116, ptr %17, align 4, !tbaa !5
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %152, %115
  %118 = load i32, ptr %4, align 4, !tbaa !5
  %119 = load i32, ptr %17, align 4, !tbaa !5
  %120 = add nsw i32 %119, 10
  %121 = icmp slt i32 %118, %120
  br i1 %121, label %122, label %155

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %123 = load i32, ptr %4, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = load i32, ptr %4, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [150 x i32], ptr @p, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = srem i32 %126, %130
  store i32 %131, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  %132 = load i32, ptr %4, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr %4, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [150 x i32], ptr @p, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = sdiv i32 %135, %139
  store i32 %140, ptr %19, align 4, !tbaa !5
  %141 = load i32, ptr %18, align 4, !tbaa !5
  %142 = load i32, ptr %4, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %143
  store i32 %141, ptr %144, align 4, !tbaa !5
  %145 = load i32, ptr %19, align 4, !tbaa !5
  %146 = load i32, ptr %4, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = add nsw i32 %150, %145
  store i32 %151, ptr %149, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %152

152:                                              ; preds = %122
  %153 = load i32, ptr %4, align 4, !tbaa !5
  %154 = add nsw i32 %153, 1
  store i32 %154, ptr %4, align 4, !tbaa !5
  br label %117, !llvm.loop !14

155:                                              ; preds = %117
  store i32 149, ptr %4, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %167, %155
  %157 = load i32, ptr %4, align 4, !tbaa !5
  %158 = icmp sge i32 %157, 0
  br i1 %158, label %159, label %170

159:                                              ; preds = %156
  %160 = load i32, ptr %4, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %166

165:                                              ; preds = %159
  br label %170

166:                                              ; preds = %159
  br label %167

167:                                              ; preds = %166
  %168 = load i32, ptr %4, align 4, !tbaa !5
  %169 = add nsw i32 %168, -1
  store i32 %169, ptr %4, align 4, !tbaa !5
  br label %156, !llvm.loop !15

170:                                              ; preds = %165, %156
  %171 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %171, ptr %5, align 4, !tbaa !5
  %172 = load i32, ptr %5, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %175)
  %177 = load i32, ptr %5, align 4, !tbaa !5
  %178 = sub nsw i32 %177, 1
  store i32 %178, ptr %4, align 4, !tbaa !5
  br label %179

179:                                              ; preds = %188, %170
  %180 = load i32, ptr %4, align 4, !tbaa !5
  %181 = icmp sge i32 %180, 0
  br i1 %181, label %182, label %191

182:                                              ; preds = %179
  %183 = load i32, ptr %4, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [150 x i32], ptr %16, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !5
  %187 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %186)
  br label %188

188:                                              ; preds = %182
  %189 = load i32, ptr %4, align 4, !tbaa !5
  %190 = add nsw i32 %189, -1
  store i32 %190, ptr %4, align 4, !tbaa !5
  br label %179, !llvm.loop !16

191:                                              ; preds = %179
  %192 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 600, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %20, !llvm.loop !17

193:                                              ; preds = %89
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 600, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 600, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  ret i32 0
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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


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

@p = external dso_local local_unnamed_addr global [150 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5primev() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca [150 x i32], align 16
  %2 = alloca [150 x i32], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca [150 x i32], align 16
  tail call void @_Z5primev()
  call void @llvm.lifetime.start.p0(i64 600, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 600, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #7
  br label %8

8:                                                ; preds = %._crit_edge57, %0
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(600) %1, i8 0, i64 600, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(600) %2, i8 0, i64 600, i1 false)
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %10 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %10, ptr %1, align 16, !tbaa !5
  %11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %12 = load i8, ptr %6, align 1, !tbaa !9
  %13 = icmp eq i8 %12, 44
  br i1 %13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %8, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %8 ]
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %15 = load i32, ptr %5, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %16 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %indvars.iv
  store i32 %15, ptr %16, align 4, !tbaa !5
  %17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %18 = load i8, ptr %6, align 1, !tbaa !9
  %19 = icmp eq i8 %18, 44
  br i1 %19, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !10

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %20 = trunc nuw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %8
  %.0.lcssa = phi i32 [ 1, %8 ], [ %20, %._crit_edge.loopexit ]
  store i32 %.0.lcssa, ptr %3, align 4, !tbaa !5
  %21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %22 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %22, ptr %2, align 16, !tbaa !5
  %23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %24 = load i8, ptr %6, align 1, !tbaa !9
  %25 = icmp eq i8 %24, 44
  br i1 %25, label %.lr.ph44, label %._crit_edge45

.lr.ph44:                                         ; preds = %._crit_edge, %.lr.ph44
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph44 ], [ 1, %._crit_edge ]
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %5)
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %28 = getelementptr inbounds [150 x i32], ptr %2, i64 0, i64 %indvars.iv61
  store i32 %27, ptr %28, align 4, !tbaa !5
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %6)
  %30 = load i8, ptr %6, align 1, !tbaa !9
  %31 = icmp eq i8 %30, 44
  br i1 %31, label %.lr.ph44, label %._crit_edge45.loopexit, !llvm.loop !12

._crit_edge45.loopexit:                           ; preds = %.lr.ph44
  %32 = trunc nuw i64 %indvars.iv.next62 to i32
  br label %._crit_edge45

._crit_edge45:                                    ; preds = %._crit_edge45.loopexit, %._crit_edge
  %.1.lcssa = phi i32 [ 1, %._crit_edge ], [ %32, %._crit_edge45.loopexit ]
  store i32 %.1.lcssa, ptr %4, align 4, !tbaa !5
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %1, i64 %34
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull %1, ptr noundef nonnull %35)
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds i32, ptr %2, i64 %37
  call void @_ZSt7reverseIPiEvT_S1_(ptr noundef nonnull %2, ptr noundef nonnull %38)
  %39 = load i32, ptr %1, align 16, !tbaa !5
  %40 = icmp eq i32 %39, 0
  %41 = load i32, ptr %2, align 16
  %42 = icmp eq i32 %41, 0
  %or.cond = select i1 %40, i1 %42, i1 false
  %43 = load i32, ptr %3, align 4
  %44 = icmp eq i32 %43, 1
  %or.cond4 = select i1 %or.cond, i1 %44, i1 false
  %45 = load i32, ptr %4, align 4
  %46 = icmp eq i32 %45, 1
  %or.cond6 = select i1 %or.cond4, i1 %46, i1 false
  br i1 %or.cond6, label %114, label %47

47:                                               ; preds = %._crit_edge45
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %49 = load i32, ptr %48, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 600, ptr nonnull %7) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(600) %7, i8 0, i64 600, i1 false)
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph50.preheader, label %.preheader40

.lr.ph50.preheader:                               ; preds = %47
  %wide.trip.count = zext nneg i32 %49 to i64
  %min.iters.check = icmp ult i32 %49, 8
  br i1 %min.iters.check, label %.lr.ph50.preheader82, label %vector.ph

.lr.ph50.preheader82:                             ; preds = %middle.block, %.lr.ph50.preheader
  %indvars.iv64.ph = phi i64 [ 0, %.lr.ph50.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph50

vector.ph:                                        ; preds = %.lr.ph50.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %51 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %index
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %wide.load = load <4 x i32>, ptr %51, align 16, !tbaa !5
  %wide.load79 = load <4 x i32>, ptr %52, align 16, !tbaa !5
  %53 = getelementptr inbounds [150 x i32], ptr %2, i64 0, i64 %index
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %wide.load80 = load <4 x i32>, ptr %53, align 16, !tbaa !5
  %wide.load81 = load <4 x i32>, ptr %54, align 16, !tbaa !5
  %55 = add nsw <4 x i32> %wide.load80, %wide.load
  %56 = add nsw <4 x i32> %wide.load81, %wide.load79
  %57 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %index
  %58 = getelementptr inbounds i8, ptr %57, i64 16
  store <4 x i32> %55, ptr %57, align 16, !tbaa !5
  store <4 x i32> %56, ptr %58, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %59 = icmp eq i64 %index.next, %n.vec
  br i1 %59, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.preheader40.loopexit, label %.lr.ph50.preheader82

.preheader40.loopexit:                            ; preds = %.lr.ph50, %middle.block
  %.pre.pre = load i32, ptr %7, align 16, !tbaa !5
  br label %.preheader40

.preheader40:                                     ; preds = %.preheader40.loopexit, %47
  %.pre = phi i32 [ 0, %47 ], [ %.pre.pre, %.preheader40.loopexit ]
  %.039.lcssa = phi i32 [ 0, %47 ], [ %49, %.preheader40.loopexit ]
  %60 = add nuw nsw i32 %.039.lcssa, 10
  %wide.trip.count72 = zext nneg i32 %60 to i64
  br label %67

.lr.ph50:                                         ; preds = %.lr.ph50.preheader82, %.lr.ph50
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph50 ], [ %indvars.iv64.ph, %.lr.ph50.preheader82 ]
  %61 = getelementptr inbounds [150 x i32], ptr %1, i64 0, i64 %indvars.iv64
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = getelementptr inbounds [150 x i32], ptr %2, i64 0, i64 %indvars.iv64
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = add nsw i32 %64, %62
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %66 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %indvars.iv64
  store i32 %65, ptr %66, align 4, !tbaa !5
  %exitcond.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count
  br i1 %exitcond.not, label %.preheader40.loopexit, label %.lr.ph50, !llvm.loop !16

67:                                               ; preds = %.preheader40, %67
  %68 = phi i32 [ %.pre, %.preheader40 ], [ %76, %67 ]
  %indvars.iv69 = phi i64 [ 0, %.preheader40 ], [ %indvars.iv.next70, %67 ]
  %69 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %indvars.iv69
  %70 = getelementptr inbounds [150 x i32], ptr @p, i64 0, i64 %indvars.iv69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = srem i32 %68, %71
  %73 = sdiv i32 %68, %71
  store i32 %72, ptr %69, align 4, !tbaa !5
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %74 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %indvars.iv.next70
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = add nsw i32 %75, %73
  store i32 %76, ptr %74, align 4, !tbaa !5
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %.preheader, label %67, !llvm.loop !17

.preheader:                                       ; preds = %67, %100
  %.453 = phi i32 [ %101, %100 ], [ 149, %67 ]
  %77 = zext nneg i32 %.453 to i64
  %78 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %.not = icmp eq i32 %79, 0
  br i1 %.not, label %.preheader.1, label %102

.preheader.1:                                     ; preds = %.preheader
  %80 = add nsw i32 %.453, -1
  %81 = zext nneg i32 %80 to i64
  %82 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %.not.1 = icmp eq i32 %83, 0
  br i1 %.not.1, label %.preheader.2, label %102

.preheader.2:                                     ; preds = %.preheader.1
  %84 = add nsw i32 %.453, -2
  %85 = zext nneg i32 %84 to i64
  %86 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %.not.2 = icmp eq i32 %87, 0
  br i1 %.not.2, label %.preheader.3, label %102

.preheader.3:                                     ; preds = %.preheader.2
  %88 = add nsw i32 %.453, -3
  %89 = zext nneg i32 %88 to i64
  %90 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %.not.3 = icmp eq i32 %91, 0
  br i1 %.not.3, label %.preheader.4, label %102

.preheader.4:                                     ; preds = %.preheader.3
  %92 = add nsw i32 %.453, -4
  %93 = zext nneg i32 %92 to i64
  %94 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %.not.4 = icmp eq i32 %95, 0
  br i1 %.not.4, label %.preheader.5, label %102

.preheader.5:                                     ; preds = %.preheader.4
  %96 = add nsw i32 %.453, -5
  %97 = zext nneg i32 %96 to i64
  %98 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %.not.5 = icmp eq i32 %99, 0
  br i1 %.not.5, label %100, label %102

100:                                              ; preds = %.preheader.5
  %101 = add nsw i32 %.453, -6
  %.not78.5 = icmp eq i32 %96, 0
  br i1 %.not78.5, label %102, label %.preheader, !llvm.loop !18

102:                                              ; preds = %100, %.preheader.5, %.preheader.4, %.preheader.3, %.preheader.2, %.preheader.1, %.preheader
  %.4.lcssa = phi i32 [ %.453, %.preheader ], [ %80, %.preheader.1 ], [ %84, %.preheader.2 ], [ %88, %.preheader.3 ], [ %92, %.preheader.4 ], [ %96, %.preheader.5 ], [ -1, %100 ]
  %103 = sext i32 %.4.lcssa to i64
  %104 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %105)
  %107 = icmp sgt i32 %.4.lcssa, 0
  br i1 %107, label %.lr.ph56.preheader, label %._crit_edge57

.lr.ph56.preheader:                               ; preds = %102
  %108 = zext nneg i32 %.4.lcssa to i64
  br label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %.lr.ph56
  %indvars.iv74 = phi i64 [ %108, %.lr.ph56.preheader ], [ %indvars.iv.next75, %.lr.ph56 ]
  %indvars.iv.next75 = add nsw i64 %indvars.iv74, -1
  %109 = getelementptr inbounds [150 x i32], ptr %7, i64 0, i64 %indvars.iv.next75
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %110)
  %112 = icmp ugt i64 %indvars.iv74, 1
  br i1 %112, label %.lr.ph56, label %._crit_edge57, !llvm.loop !19

._crit_edge57:                                    ; preds = %.lr.ph56, %102
  %113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %7) #7
  br label %8, !llvm.loop !20

114:                                              ; preds = %._crit_edge45
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %1) #7
  ret i32 0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt7reverseIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

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

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

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


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