; LLVM IR from tangjz/acm-icpc :: leetcode/extra (DD_2020005-序列移除)

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

@_ZZ4mainE1a = external hidden global [50001 x i32], align 16
@_ZZ4mainE1b = external hidden global [50001 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@_ZZ4mainE3pos = external hidden global [50001 x i32], align 16
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@_ZZ4mainE3que = external hidden global [50001 x i32], align 16
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %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
  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
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3, ptr noundef %4)
  %14 = icmp eq i32 %13, 3
  br i1 %14, label %15, label %16

15:                                               ; preds = %0
  br label %18

16:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 8, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

17:                                               ; No predecessors!
  br label %18

18:                                               ; preds = %17, %15
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = icmp sle i32 1, %19
  br i1 %20, label %21, label %24

21:                                               ; preds = %18
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp sle i32 %22, 50000
  br label %24

24:                                               ; preds = %21, %18
  %25 = phi i1 [ false, %18 ], [ %23, %21 ]
  br i1 %25, label %26, label %27

26:                                               ; preds = %24
  br label %29

27:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 9, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

28:                                               ; No predecessors!
  br label %29

29:                                               ; preds = %28, %26
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = icmp sle i32 1, %30
  br i1 %31, label %32, label %35

32:                                               ; preds = %29
  %33 = load i32, ptr %3, align 4, !tbaa !5
  %34 = icmp sle i32 %33, 300000
  br label %35

35:                                               ; preds = %32, %29
  %36 = phi i1 [ false, %29 ], [ %34, %32 ]
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  br label %40

38:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 10, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %37
  %41 = load i32, ptr %4, align 4, !tbaa !5
  %42 = icmp sle i32 1000, %41
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = icmp sle i32 %44, 100000
  br label %46

46:                                               ; preds = %43, %40
  %47 = phi i1 [ false, %40 ], [ %45, %43 ]
  br i1 %47, label %48, label %49

48:                                               ; preds = %46
  br label %51

49:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 11, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

50:                                               ; No predecessors!
  br label %51

51:                                               ; preds = %50, %48
  %52 = load i32, ptr %2, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul i64 %53, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @_ZZ4mainE3pos, i64 1), i8 -1, i64 %54, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %107, %51
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %110

60:                                               ; preds = %55
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i32, ptr @_ZZ4mainE1a, i64 %62
  %64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef %63)
  %65 = icmp eq i32 %64, 1
  br i1 %65, label %66, label %67

66:                                               ; preds = %60
  br label %69

67:                                               ; preds = %60
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 15, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

68:                                               ; No predecessors!
  br label %69

69:                                               ; preds = %68, %66
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = icmp sle i32 1, %73
  br i1 %74, label %75, label %82

75:                                               ; preds = %69
  %76 = load i32, ptr %5, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = icmp sle i32 %79, %80
  br label %82

82:                                               ; preds = %75, %69
  %83 = phi i1 [ false, %69 ], [ %81, %75 ]
  br i1 %83, label %84, label %85

84:                                               ; preds = %82
  br label %87

85:                                               ; preds = %82
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 16, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

86:                                               ; No predecessors!
  br label %87

87:                                               ; preds = %86, %84
  %88 = load i32, ptr %5, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3pos, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = icmp eq i32 %94, -1
  br i1 %95, label %96, label %97

96:                                               ; preds = %87
  br label %99

97:                                               ; preds = %87
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.2, i32 noundef 17, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

98:                                               ; No predecessors!
  br label %99

99:                                               ; preds = %98, %96
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = load i32, ptr %5, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1a, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3pos, i64 0, i64 %105
  store i32 %100, ptr %106, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %99
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %5, align 4, !tbaa !5
  br label %55, !llvm.loop !9

110:                                              ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %168, %110
  %112 = load i32, ptr %6, align 4, !tbaa !5
  %113 = load i32, ptr %2, align 4, !tbaa !5
  %114 = icmp sle i32 %112, %113
  br i1 %114, label %116, label %115

115:                                              ; preds = %111
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %171

116:                                              ; preds = %111
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr @_ZZ4mainE1b, i64 %118
  %120 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.6, ptr noundef %119)
  %121 = icmp eq i32 %120, 1
  br i1 %121, label %122, label %123

122:                                              ; preds = %116
  br label %125

123:                                              ; preds = %116
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.2, i32 noundef 21, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

124:                                              ; No predecessors!
  br label %125

125:                                              ; preds = %124, %122
  %126 = load i32, ptr %6, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp sle i32 1, %129
  br i1 %130, label %131, label %138

131:                                              ; preds = %125
  %132 = load i32, ptr %6, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr %2, align 4, !tbaa !5
  %137 = icmp sle i32 %135, %136
  br label %138

138:                                              ; preds = %131, %125
  %139 = phi i1 [ false, %125 ], [ %137, %131 ]
  br i1 %139, label %140, label %141

140:                                              ; preds = %138
  br label %143

141:                                              ; preds = %138
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.2, i32 noundef 22, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

142:                                              ; No predecessors!
  br label %143

143:                                              ; preds = %142, %140
  %144 = load i32, ptr %6, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3pos, i64 0, i64 %148
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = icmp ne i32 %150, -1
  br i1 %151, label %152, label %153

152:                                              ; preds = %143
  br label %155

153:                                              ; preds = %143
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.2, i32 noundef 23, ptr noundef @__PRETTY_FUNCTION__.main) #8
  unreachable

154:                                              ; No predecessors!
  br label %155

155:                                              ; preds = %154, %152
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3pos, i64 0, i64 %160
  store ptr %161, ptr %7, align 8, !tbaa !11
  %162 = load ptr, ptr %7, align 8, !tbaa !11
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = load i32, ptr %6, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %165
  store i32 %163, ptr %166, align 4, !tbaa !5
  %167 = load ptr, ptr %7, align 8, !tbaa !11
  store i32 -1, ptr %167, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %168

168:                                              ; preds = %155
  %169 = load i32, ptr %6, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  store i32 %170, ptr %6, align 4, !tbaa !5
  br label %111, !llvm.loop !13

171:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %172

172:                                              ; preds = %216, %171
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = load i32, ptr %2, align 4, !tbaa !5
  %175 = icmp sle i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %219

177:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %178 = load i32, ptr %9, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds i32, ptr @_ZZ4mainE3que, i64 %179
  %181 = getelementptr inbounds i32, ptr %180, i64 1
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %183
  %185 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef getelementptr inbounds (i32, ptr @_ZZ4mainE3que, i64 1), ptr noundef %181, ptr noundef nonnull align 4 dereferenceable(4) %184)
  %186 = ptrtoint ptr %185 to i64
  %187 = sub i64 %186, ptrtoint (ptr @_ZZ4mainE3que to i64)
  %188 = sdiv exact i64 %187, 4
  %189 = trunc i64 %188 to i32
  store i32 %189, ptr %11, align 4, !tbaa !5
  %190 = load i32, ptr %11, align 4, !tbaa !5
  %191 = load i32, ptr %9, align 4, !tbaa !5
  %192 = icmp sgt i32 %190, %191
  %193 = zext i1 %192 to i32
  %194 = load i32, ptr %9, align 4, !tbaa !5
  %195 = add nsw i32 %194, %193
  store i32 %195, ptr %9, align 4, !tbaa !5
  %196 = load i32, ptr %10, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !5
  %200 = load i32, ptr %11, align 4, !tbaa !5
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %201
  store i32 %199, ptr %202, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %203 = load i32, ptr %3, align 4, !tbaa !5
  %204 = load i32, ptr %10, align 4, !tbaa !5
  %205 = sub nsw i32 %203, %204
  %206 = load i32, ptr %10, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %207
  %209 = load i32, ptr %208, align 4, !tbaa !5
  %210 = sub nsw i32 %205, %209
  %211 = load i32, ptr %4, align 4, !tbaa !5
  %212 = sdiv i32 %210, %211
  store i32 %212, ptr %12, align 4, !tbaa !5
  %213 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %214 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %213)
  %215 = load i32, ptr %214, align 4, !tbaa !5
  store i32 %215, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %216

216:                                              ; preds = %177
  %217 = load i32, ptr %10, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %10, align 4, !tbaa !5
  br label %172, !llvm.loop !14

219:                                              ; preds = %176
  %220 = load i32, ptr %8, align 4, !tbaa !5
  %221 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %220)
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #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

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !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"

@_ZZ4mainE1a = external hidden global [50001 x i32], align 16
@_ZZ4mainE1b = external hidden global [50001 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@_ZZ4mainE3pos = external hidden local_unnamed_addr global [50001 x i32], align 16
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@_ZZ4mainE3que = external hidden global [50001 x i32], align 16
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %3)
  %8 = icmp eq i32 %7, 3
  br i1 %8, label %10, label %9

9:                                                ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 8, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

10:                                               ; preds = %0
  %11 = load i32, ptr %1, align 4
  %12 = add i32 %11, -1
  %13 = icmp ult i32 %12, 50000
  br i1 %13, label %15, label %14

14:                                               ; preds = %10
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 9, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

15:                                               ; preds = %10
  %16 = load i32, ptr %2, align 4
  %17 = add i32 %16, -1
  %18 = icmp ult i32 %17, 300000
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 10, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

20:                                               ; preds = %15
  %21 = load i32, ptr %3, align 4
  %22 = add i32 %21, -1000
  %23 = icmp ult i32 %22, 99001
  br i1 %23, label %.lr.ph.preheader, label %24

24:                                               ; preds = %20
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 11, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

.lr.ph.preheader:                                 ; preds = %20
  %25 = shl nuw nsw i32 %11, 2
  %26 = zext nneg i32 %25 to i64
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @_ZZ4mainE3pos, i64 4), i8 -1, i64 %26, i1 false)
  br label %.lr.ph

.preheader:                                       ; preds = %42
  %27 = icmp slt i32 %35, 1
  br i1 %27, label %._crit_edge.thread, label %.lr.ph46

._crit_edge.thread:                               ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %._crit_edge52

.lr.ph:                                           ; preds = %.lr.ph.preheader, %42
  %indvars.iv = phi i64 [ 1, %.lr.ph.preheader ], [ %indvars.iv.next, %42 ]
  %28 = getelementptr inbounds i32, ptr @_ZZ4mainE1a, i64 %indvars.iv
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %28)
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %32, label %31

31:                                               ; preds = %.lr.ph
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2, i32 noundef 15, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

32:                                               ; preds = %.lr.ph
  %33 = load i32, ptr %28, align 4, !tbaa !5
  %34 = icmp slt i32 %33, 1
  %35 = load i32, ptr %1, align 4
  %.not39 = icmp sgt i32 %33, %35
  %or.cond = select i1 %34, i1 true, i1 %.not39
  br i1 %or.cond, label %.critedge, label %36

.critedge:                                        ; preds = %32
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 16, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

36:                                               ; preds = %32
  %37 = zext nneg i32 %33 to i64
  %38 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3pos, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = icmp eq i32 %39, -1
  br i1 %40, label %42, label %41

41:                                               ; preds = %36
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.2, i32 noundef 17, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

42:                                               ; preds = %36
  %43 = trunc nuw nsw i64 %indvars.iv to i32
  store i32 %43, ptr %38, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %44 = sext i32 %35 to i64
  %.not.not = icmp slt i64 %indvars.iv, %44
  br i1 %.not.not, label %.lr.ph, label %.preheader, !llvm.loop !9

._crit_edge:                                      ; preds = %59
  %45 = icmp slt i32 %53, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !5
  br i1 %45, label %._crit_edge52, label %.lr.ph51

.lr.ph46:                                         ; preds = %.preheader, %59
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %59 ], [ 1, %.preheader ]
  %46 = getelementptr inbounds i32, ptr @_ZZ4mainE1b, i64 %indvars.iv54
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull %46)
  %48 = icmp eq i32 %47, 1
  br i1 %48, label %50, label %49

49:                                               ; preds = %.lr.ph46
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.2, i32 noundef 21, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

50:                                               ; preds = %.lr.ph46
  %51 = load i32, ptr %46, align 4, !tbaa !5
  %52 = icmp slt i32 %51, 1
  %53 = load i32, ptr %1, align 4
  %.not37 = icmp sgt i32 %51, %53
  %or.cond40 = select i1 %52, i1 true, i1 %.not37
  br i1 %or.cond40, label %.critedge2, label %54

.critedge2:                                       ; preds = %50
  call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.2, i32 noundef 22, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

54:                                               ; preds = %50
  %55 = zext nneg i32 %51 to i64
  %56 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3pos, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %.not38 = icmp eq i32 %57, -1
  br i1 %.not38, label %58, label %59

58:                                               ; preds = %54
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.2, i32 noundef 23, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #8
  unreachable

59:                                               ; preds = %54
  store i32 %57, ptr %46, align 4, !tbaa !5
  store i32 -1, ptr %56, align 4, !tbaa !5
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %60 = sext i32 %53 to i64
  %.not35.not = icmp slt i64 %indvars.iv54, %60
  br i1 %.not35.not, label %.lr.ph46, label %._crit_edge, !llvm.loop !11

._crit_edge52:                                    ; preds = %.lr.ph51, %._crit_edge.thread, %._crit_edge
  %61 = phi i32 [ 0, %._crit_edge ], [ 0, %._crit_edge.thread ], [ %84, %.lr.ph51 ]
  %62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i32 noundef %61)
  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 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph51:                                         ; preds = %._crit_edge, %.lr.ph51
  %indvars.iv57 = phi i64 [ %indvars.iv.next58, %.lr.ph51 ], [ 1, %._crit_edge ]
  %.02848 = phi i32 [ %72, %.lr.ph51 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  %63 = zext nneg i32 %.02848 to i64
  %gep = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @_ZZ4mainE3que, i64 4), i64 %63
  %64 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE1b, i64 0, i64 %indvars.iv57
  %65 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZZ4mainE3que, i64 4), ptr noundef nonnull %gep, ptr noundef nonnull align 4 dereferenceable(4) %64)
  %66 = ptrtoint ptr %65 to i64
  %67 = sub i64 %66, ptrtoint (ptr @_ZZ4mainE3que to i64)
  %68 = lshr exact i64 %67, 2
  %69 = trunc i64 %68 to i32
  store i32 %69, ptr %5, align 4, !tbaa !5
  %70 = icmp slt i32 %.02848, %69
  %71 = zext i1 %70 to i32
  %72 = add nuw nsw i32 %.02848, %71
  %73 = load i32, ptr %64, align 4, !tbaa !5
  %sext = shl i64 %67, 30
  %74 = ashr i64 %sext, 32
  %75 = getelementptr inbounds [50001 x i32], ptr @_ZZ4mainE3que, i64 0, i64 %74
  store i32 %73, ptr %75, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #7
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = trunc nuw nsw i64 %indvars.iv57 to i32
  %78 = add i32 %73, %77
  %79 = sub i32 %76, %78
  %80 = load i32, ptr %3, align 4, !tbaa !5
  %81 = sdiv i32 %79, %80
  store i32 %81, ptr %6, align 4, !tbaa !5
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %82)
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %85 = load i32, ptr %1, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %.not36.not = icmp slt i64 %indvars.iv57, %86
  br i1 %.not36.not, label %.lr.ph51, label %._crit_edge52, !llvm.loop !12
}

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_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 #2

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


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