; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/Other/DIBZ2016/DBZ16XOR (A)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@cnt = external dso_local global [100100 x [20 x i32]], align 16
@l = external dso_local global [100100 x i32], align 16
@r = external dso_local global [100100 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::stack", align 8
  %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 i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %19

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

23:                                               ; preds = %19
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %73

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %26
  %28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %27)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %66, %24
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = icmp slt i32 %30, 20
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %69

33:                                               ; preds = %29
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sub nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %36
  %38 = load i32, ptr %4, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [20 x i32], ptr %37, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %43
  %45 = load i32, ptr %4, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [20 x i32], ptr %44, i64 0, i64 %46
  store i32 %41, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %2, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %4, align 4, !tbaa !5
  %53 = shl i32 1, %52
  %54 = and i32 %51, %53
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %56, label %65

56:                                               ; preds = %33
  %57 = load i32, ptr %2, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %58
  %60 = load i32, ptr %4, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [20 x i32], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %62, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %56, %33
  br label %66

66:                                               ; preds = %65
  %67 = load i32, ptr %4, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %4, align 4, !tbaa !5
  br label %29, !llvm.loop !9

69:                                               ; preds = %32
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %2, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !11

73:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 80, ptr %5) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %74 unwind label %80

74:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  store i32 0, ptr getelementptr inbounds ([100100 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 2, ptr %9, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %124, %74
  %76 = load i32, ptr %9, align 4, !tbaa !5
  %77 = load i32, ptr @n, align 4, !tbaa !5
  %78 = icmp sle i32 %76, %77
  br i1 %78, label %84, label %79

79:                                               ; preds = %75
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %127

80:                                               ; preds = %73
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %7, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %397

84:                                               ; preds = %75
  br label %85

85:                                               ; preds = %103, %84
  %86 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %87 unwind label %104

87:                                               ; preds = %85
  br i1 %86, label %100, label %88

88:                                               ; preds = %87
  %89 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %90 unwind label %104

90:                                               ; preds = %88
  %91 = load i32, ptr %89, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp sle i32 %94, %98
  br label %100

100:                                              ; preds = %90, %87
  %101 = phi i1 [ false, %87 ], [ %99, %90 ]
  br i1 %101, label %102, label %108

102:                                              ; preds = %100
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %103 unwind label %104

103:                                              ; preds = %102
  br label %85, !llvm.loop !12

104:                                              ; preds = %122, %115, %108, %102, %88, %85
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %7, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %397

108:                                              ; preds = %100
  %109 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %110 unwind label %104

110:                                              ; preds = %108
  br i1 %109, label %111, label %115

111:                                              ; preds = %110
  %112 = load i32, ptr %9, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [100100 x i32], ptr @l, i64 0, i64 %113
  store i32 0, ptr %114, align 4, !tbaa !5
  br label %122

115:                                              ; preds = %110
  %116 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %117 unwind label %104

117:                                              ; preds = %115
  %118 = load i32, ptr %116, align 4, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100100 x i32], ptr @l, i64 0, i64 %120
  store i32 %118, ptr %121, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %117, %111
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %9)
          to label %123 unwind label %104

123:                                              ; preds = %122
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %9, align 4, !tbaa !5
  br label %75, !llvm.loop !13

127:                                              ; preds = %79
  br label %128

128:                                              ; preds = %133, %127
  %129 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %130 unwind label %134

130:                                              ; preds = %128
  %131 = xor i1 %129, true
  br i1 %131, label %132, label %138

132:                                              ; preds = %130
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %133 unwind label %134

133:                                              ; preds = %132
  br label %128, !llvm.loop !14

134:                                              ; preds = %138, %132, %128
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %7, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %8, align 4
  br label %397

138:                                              ; preds = %130
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %139 unwind label %134

139:                                              ; preds = %138
  %140 = load i32, ptr @n, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  %142 = load i32, ptr @n, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [100100 x i32], ptr @r, i64 0, i64 %143
  store i32 %141, ptr %144, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %145 = load i32, ptr @n, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  store i32 %146, ptr %10, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %193, %139
  %148 = load i32, ptr %10, align 4, !tbaa !5
  %149 = icmp sgt i32 %148, 0
  br i1 %149, label %151, label %150

150:                                              ; preds = %147
  store i32 15, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %196

151:                                              ; preds = %147
  br label %152

152:                                              ; preds = %170, %151
  %153 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %154 unwind label %171

154:                                              ; preds = %152
  br i1 %153, label %167, label %155

155:                                              ; preds = %154
  %156 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %157 unwind label %171

157:                                              ; preds = %155
  %158 = load i32, ptr %156, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = load i32, ptr %10, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %163
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = icmp slt i32 %161, %165
  br label %167

167:                                              ; preds = %157, %154
  %168 = phi i1 [ false, %154 ], [ %166, %157 ]
  br i1 %168, label %169, label %175

169:                                              ; preds = %167
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %170 unwind label %171

170:                                              ; preds = %169
  br label %152, !llvm.loop !15

171:                                              ; preds = %191, %184, %175, %169, %155, %152
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %7, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %397

175:                                              ; preds = %167
  %176 = invoke noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %177 unwind label %171

177:                                              ; preds = %175
  br i1 %176, label %178, label %184

178:                                              ; preds = %177
  %179 = load i32, ptr @n, align 4, !tbaa !5
  %180 = add nsw i32 %179, 1
  %181 = load i32, ptr %10, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [100100 x i32], ptr @r, i64 0, i64 %182
  store i32 %180, ptr %183, align 4, !tbaa !5
  br label %191

184:                                              ; preds = %177
  %185 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %186 unwind label %171

186:                                              ; preds = %184
  %187 = load i32, ptr %185, align 4, !tbaa !5
  %188 = load i32, ptr %10, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100100 x i32], ptr @r, i64 0, i64 %189
  store i32 %187, ptr %190, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %186, %178
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %192 unwind label %171

192:                                              ; preds = %191
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %10, align 4, !tbaa !5
  %195 = add nsw i32 %194, -1
  store i32 %195, ptr %10, align 4, !tbaa !5
  br label %147, !llvm.loop !16

196:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 1, ptr %12, align 8, !tbaa !17
  br label %197

197:                                              ; preds = %385, %196
  %198 = load i64, ptr %12, align 8, !tbaa !17
  %199 = load i32, ptr @n, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = icmp sle i64 %198, %200
  br i1 %201, label %203, label %202

202:                                              ; preds = %197
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %388

203:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %204 = load i64, ptr %12, align 8, !tbaa !17
  %205 = getelementptr inbounds [100100 x i32], ptr @l, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  store i64 %207, ptr %13, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %208 = load i64, ptr %12, align 8, !tbaa !17
  %209 = getelementptr inbounds [100100 x i32], ptr @r, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  store i64 %211, ptr %14, align 8, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %212 = load i64, ptr %14, align 8, !tbaa !17
  %213 = sub nsw i64 %212, 1
  %214 = load i64, ptr %13, align 8, !tbaa !17
  %215 = sub nsw i64 %213, %214
  %216 = icmp eq i64 %215, 1
  br i1 %216, label %217, label %218

217:                                              ; preds = %203
  store i32 22, ptr %3, align 4
  br label %382

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

219:                                              ; preds = %378, %218
  %220 = load i32, ptr %17, align 4, !tbaa !5
  %221 = icmp slt i32 %220, 20
  br i1 %221, label %223, label %222

222:                                              ; preds = %219
  store i32 23, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %381

223:                                              ; preds = %219
  %224 = load i64, ptr %12, align 8, !tbaa !17
  %225 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %224
  %226 = load i32, ptr %225, align 4, !tbaa !5
  %227 = load i32, ptr %17, align 4, !tbaa !5
  %228 = shl i32 1, %227
  %229 = and i32 %226, %228
  %230 = icmp sgt i32 %229, 0
  br i1 %230, label %231, label %304

231:                                              ; preds = %223
  %232 = load i64, ptr %14, align 8, !tbaa !17
  %233 = sub nsw i64 %232, 1
  %234 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %233
  %235 = load i32, ptr %17, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [20 x i32], ptr %234, i64 0, i64 %236
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = load i64, ptr %12, align 8, !tbaa !17
  %240 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %239
  %241 = load i32, ptr %17, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [20 x i32], ptr %240, i64 0, i64 %242
  %244 = load i32, ptr %243, align 4, !tbaa !5
  %245 = sub nsw i32 %238, %244
  %246 = sext i32 %245 to i64
  store i64 %246, ptr %15, align 8, !tbaa !17
  %247 = load i64, ptr %12, align 8, !tbaa !17
  %248 = sub nsw i64 %247, 1
  %249 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %248
  %250 = load i32, ptr %17, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [20 x i32], ptr %249, i64 0, i64 %251
  %253 = load i32, ptr %252, align 4, !tbaa !5
  %254 = load i64, ptr %13, align 8, !tbaa !17
  %255 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %254
  %256 = load i32, ptr %17, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [20 x i32], ptr %255, i64 0, i64 %257
  %259 = load i32, ptr %258, align 4, !tbaa !5
  %260 = sub nsw i32 %253, %259
  %261 = sext i32 %260 to i64
  store i64 %261, ptr %16, align 8, !tbaa !17
  %262 = load i64, ptr %15, align 8, !tbaa !17
  %263 = load i64, ptr %16, align 8, !tbaa !17
  %264 = mul nsw i64 %262, %263
  %265 = load i32, ptr %17, align 4, !tbaa !5
  %266 = zext i32 %265 to i64
  %267 = shl i64 1, %266
  %268 = mul nsw i64 %264, %267
  %269 = load i64, ptr %11, align 8, !tbaa !17
  %270 = add nsw i64 %269, %268
  store i64 %270, ptr %11, align 8, !tbaa !17
  %271 = load i64, ptr %14, align 8, !tbaa !17
  %272 = sub nsw i64 %271, 1
  %273 = load i64, ptr %12, align 8, !tbaa !17
  %274 = sub nsw i64 %272, %273
  %275 = load i64, ptr %15, align 8, !tbaa !17
  %276 = sub nsw i64 %274, %275
  %277 = load i64, ptr %12, align 8, !tbaa !17
  %278 = sub nsw i64 %277, 1
  %279 = load i64, ptr %13, align 8, !tbaa !17
  %280 = sub nsw i64 %278, %279
  %281 = load i64, ptr %16, align 8, !tbaa !17
  %282 = sub nsw i64 %280, %281
  %283 = mul nsw i64 %276, %282
  %284 = load i32, ptr %17, align 4, !tbaa !5
  %285 = zext i32 %284 to i64
  %286 = shl i64 1, %285
  %287 = mul nsw i64 %283, %286
  %288 = load i64, ptr %11, align 8, !tbaa !17
  %289 = add nsw i64 %288, %287
  store i64 %289, ptr %11, align 8, !tbaa !17
  %290 = load i64, ptr %15, align 8, !tbaa !17
  %291 = load i32, ptr %17, align 4, !tbaa !5
  %292 = zext i32 %291 to i64
  %293 = shl i64 1, %292
  %294 = mul nsw i64 %290, %293
  %295 = load i64, ptr %11, align 8, !tbaa !17
  %296 = add nsw i64 %295, %294
  store i64 %296, ptr %11, align 8, !tbaa !17
  %297 = load i64, ptr %16, align 8, !tbaa !17
  %298 = load i32, ptr %17, align 4, !tbaa !5
  %299 = zext i32 %298 to i64
  %300 = shl i64 1, %299
  %301 = mul nsw i64 %297, %300
  %302 = load i64, ptr %11, align 8, !tbaa !17
  %303 = add nsw i64 %302, %301
  store i64 %303, ptr %11, align 8, !tbaa !17
  br label %377

304:                                              ; preds = %223
  %305 = load i64, ptr %14, align 8, !tbaa !17
  %306 = sub nsw i64 %305, 1
  %307 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %306
  %308 = load i32, ptr %17, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [20 x i32], ptr %307, i64 0, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !5
  %312 = load i64, ptr %12, align 8, !tbaa !17
  %313 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %312
  %314 = load i32, ptr %17, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [20 x i32], ptr %313, i64 0, i64 %315
  %317 = load i32, ptr %316, align 4, !tbaa !5
  %318 = sub nsw i32 %311, %317
  %319 = sext i32 %318 to i64
  store i64 %319, ptr %15, align 8, !tbaa !17
  %320 = load i64, ptr %12, align 8, !tbaa !17
  %321 = sub nsw i64 %320, 1
  %322 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %321
  %323 = load i32, ptr %17, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = getelementptr inbounds [20 x i32], ptr %322, i64 0, i64 %324
  %326 = load i32, ptr %325, align 4, !tbaa !5
  %327 = load i64, ptr %13, align 8, !tbaa !17
  %328 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %327
  %329 = load i32, ptr %17, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [20 x i32], ptr %328, i64 0, i64 %330
  %332 = load i32, ptr %331, align 4, !tbaa !5
  %333 = sub nsw i32 %326, %332
  %334 = sext i32 %333 to i64
  store i64 %334, ptr %16, align 8, !tbaa !17
  %335 = load i64, ptr %15, align 8, !tbaa !17
  %336 = load i64, ptr %12, align 8, !tbaa !17
  %337 = sub nsw i64 %336, 1
  %338 = load i64, ptr %13, align 8, !tbaa !17
  %339 = sub nsw i64 %337, %338
  %340 = load i64, ptr %16, align 8, !tbaa !17
  %341 = sub nsw i64 %339, %340
  %342 = mul nsw i64 %335, %341
  %343 = load i32, ptr %17, align 4, !tbaa !5
  %344 = zext i32 %343 to i64
  %345 = shl i64 1, %344
  %346 = mul nsw i64 %342, %345
  %347 = load i64, ptr %11, align 8, !tbaa !17
  %348 = add nsw i64 %347, %346
  store i64 %348, ptr %11, align 8, !tbaa !17
  %349 = load i64, ptr %14, align 8, !tbaa !17
  %350 = sub nsw i64 %349, 1
  %351 = load i64, ptr %12, align 8, !tbaa !17
  %352 = sub nsw i64 %350, %351
  %353 = load i64, ptr %15, align 8, !tbaa !17
  %354 = sub nsw i64 %352, %353
  %355 = load i64, ptr %16, align 8, !tbaa !17
  %356 = mul nsw i64 %354, %355
  %357 = load i32, ptr %17, align 4, !tbaa !5
  %358 = zext i32 %357 to i64
  %359 = shl i64 1, %358
  %360 = mul nsw i64 %356, %359
  %361 = load i64, ptr %11, align 8, !tbaa !17
  %362 = add nsw i64 %361, %360
  store i64 %362, ptr %11, align 8, !tbaa !17
  %363 = load i64, ptr %15, align 8, !tbaa !17
  %364 = load i32, ptr %17, align 4, !tbaa !5
  %365 = zext i32 %364 to i64
  %366 = shl i64 1, %365
  %367 = mul nsw i64 %363, %366
  %368 = load i64, ptr %11, align 8, !tbaa !17
  %369 = add nsw i64 %368, %367
  store i64 %369, ptr %11, align 8, !tbaa !17
  %370 = load i64, ptr %16, align 8, !tbaa !17
  %371 = load i32, ptr %17, align 4, !tbaa !5
  %372 = zext i32 %371 to i64
  %373 = shl i64 1, %372
  %374 = mul nsw i64 %370, %373
  %375 = load i64, ptr %11, align 8, !tbaa !17
  %376 = add nsw i64 %375, %374
  store i64 %376, ptr %11, align 8, !tbaa !17
  br label %377

377:                                              ; preds = %304, %231
  br label %378

378:                                              ; preds = %377
  %379 = load i32, ptr %17, align 4, !tbaa !5
  %380 = add nsw i32 %379, 1
  store i32 %380, ptr %17, align 4, !tbaa !5
  br label %219, !llvm.loop !19

381:                                              ; preds = %222
  store i32 0, ptr %3, align 4
  br label %382

382:                                              ; preds = %381, %217
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %383 = load i32, ptr %3, align 4
  switch i32 %383, label %403 [
    i32 0, label %384
    i32 22, label %385
  ]

384:                                              ; preds = %382
  br label %385

385:                                              ; preds = %384, %382
  %386 = load i64, ptr %12, align 8, !tbaa !17
  %387 = add nsw i64 %386, 1
  store i64 %387, ptr %12, align 8, !tbaa !17
  br label %197, !llvm.loop !20

388:                                              ; preds = %202
  %389 = load i64, ptr %11, align 8, !tbaa !17
  %390 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %389)
          to label %391 unwind label %393

391:                                              ; preds = %388
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #6
  %392 = load i32, ptr %1, align 4
  ret i32 %392

393:                                              ; preds = %388
  %394 = landingpad { ptr, i32 }
          cleanup
  %395 = extractvalue { ptr, i32 } %394, 0
  store ptr %395, ptr %7, align 8
  %396 = extractvalue { ptr, i32 } %394, 1
  store i32 %396, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %397

397:                                              ; preds = %393, %171, %134, %104, %80
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %5) #6
  br label %398

398:                                              ; preds = %397
  %399 = load ptr, ptr %7, align 8
  %400 = load i32, ptr %8, align 4
  %401 = insertvalue { ptr, i32 } poison, ptr %399, 0
  %402 = insertvalue { ptr, i32 } %401, i32 %400, 1
  resume { ptr, i32 } %402

403:                                              ; preds = %382
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl" = type { %"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" }
%"struct.std::_Deque_base<int, std::allocator<int>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@n = external dso_local global i32, align 4
@a = external dso_local global [100100 x i32], align 16
@cnt = external dso_local local_unnamed_addr global [100100 x [20 x i32]], align 16
@l = external dso_local local_unnamed_addr global [100100 x i32], align 16
@r = external dso_local local_unnamed_addr global [100100 x i32], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1

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

._crit_edge:                                      ; preds = %.lr.ph, %0
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %1) #6
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  store i32 1, ptr %2, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
          to label %50 unwind label %54

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %7 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %indvars.iv
  %8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %7)
  %9 = add nsw i64 %indvars.iv, -1
  %10 = load i32, ptr %7, align 4, !tbaa !5
  %11 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %9, i64 0
  %12 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %indvars.iv, i64 0
  %13 = lshr i32 %10, 1
  %14 = lshr i32 %10, 2
  %15 = lshr i32 %10, 3
  %16 = load <4 x i32>, ptr %11, align 16, !tbaa !5
  %17 = insertelement <4 x i32> poison, i32 %10, i64 0
  %18 = insertelement <4 x i32> %17, i32 %13, i64 1
  %19 = insertelement <4 x i32> %18, i32 %14, i64 2
  %20 = insertelement <4 x i32> %19, i32 %15, i64 3
  %21 = and <4 x i32> %20, <i32 1, i32 1, i32 1, i32 1>
  %22 = add <4 x i32> %16, %21
  store <4 x i32> %22, ptr %12, align 16, !tbaa !5
  %23 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %9, i64 4
  %24 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %indvars.iv, i64 4
  %25 = load <4 x i32>, ptr %23, align 16, !tbaa !5
  %26 = shufflevector <4 x i32> %17, <4 x i32> poison, <4 x i32> zeroinitializer
  %27 = lshr <4 x i32> %26, <i32 4, i32 5, i32 6, i32 7>
  %28 = and <4 x i32> %27, <i32 1, i32 1, i32 1, i32 1>
  %29 = add <4 x i32> %25, %28
  store <4 x i32> %29, ptr %24, align 16, !tbaa !5
  %30 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %9, i64 8
  %31 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %indvars.iv, i64 8
  %32 = load <4 x i32>, ptr %30, align 16, !tbaa !5
  %33 = lshr <4 x i32> %26, <i32 8, i32 9, i32 10, i32 11>
  %34 = and <4 x i32> %33, <i32 1, i32 1, i32 1, i32 1>
  %35 = add <4 x i32> %32, %34
  store <4 x i32> %35, ptr %31, align 16, !tbaa !5
  %36 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %9, i64 12
  %37 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %indvars.iv, i64 12
  %38 = load <4 x i32>, ptr %36, align 16, !tbaa !5
  %39 = lshr <4 x i32> %26, <i32 12, i32 13, i32 14, i32 15>
  %40 = and <4 x i32> %39, <i32 1, i32 1, i32 1, i32 1>
  %41 = add <4 x i32> %38, %40
  store <4 x i32> %41, ptr %37, align 16, !tbaa !5
  %42 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %9, i64 16
  %43 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %indvars.iv, i64 16
  %44 = load <4 x i32>, ptr %42, align 16, !tbaa !5
  %45 = lshr <4 x i32> %26, <i32 16, i32 17, i32 18, i32 19>
  %46 = and <4 x i32> %45, <i32 1, i32 1, i32 1, i32 1>
  %47 = add <4 x i32> %44, %46
  store <4 x i32> %47, ptr %43, align 16, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %48 = load i32, ptr @n, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %.not.not = icmp slt i64 %indvars.iv, %49
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

50:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  store i32 0, ptr getelementptr inbounds (i8, ptr @l, i64 4), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 2, ptr %3, align 4, !tbaa !5
  %51 = load i32, ptr @n, align 4, !tbaa !5
  %.not86108 = icmp slt i32 %51, 2
  br i1 %.not86108, label %._crit_edge109, label %.preheader102

.preheader102:                                    ; preds = %50, %76
  %52 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %52, label %.critedge, label %.lr.ph106

._crit_edge109:                                   ; preds = %76, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %53 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %53, label %._crit_edge112, label %.lr.ph111

54:                                               ; preds = %._crit_edge
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  br label %164

.lr.ph106:                                        ; preds = %.preheader102, %65
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %3, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %.not90 = icmp sgt i32 %60, %64
  br i1 %.not90, label %.critedge, label %65

65:                                               ; preds = %.lr.ph106
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %66 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %66, label %.critedge, label %.lr.ph106, !llvm.loop !11

67:                                               ; preds = %73
  %68 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  br label %164

.critedge:                                        ; preds = %.lr.ph106, %65, %.preheader102
  %69 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %69, label %73, label %70

70:                                               ; preds = %.critedge
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %72 = load i32, ptr %71, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %.critedge, %70
  %.sink = phi i32 [ %72, %70 ], [ 0, %.critedge ]
  %.sink137 = load i32, ptr %3, align 4, !tbaa !5
  %74 = sext i32 %.sink137 to i64
  %75 = getelementptr inbounds [100100 x i32], ptr @l, i64 0, i64 %74
  store i32 %.sink, ptr %75, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %76 unwind label %67

76:                                               ; preds = %73
  %77 = load i32, ptr %3, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  store i32 %78, ptr %3, align 4, !tbaa !5
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %.not86.not = icmp slt i32 %77, %79
  br i1 %.not86.not, label %.preheader102, label %._crit_edge109, !llvm.loop !12

.lr.ph111:                                        ; preds = %._crit_edge109, %.lr.ph111
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %80 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %80, label %._crit_edge112, label %.lr.ph111, !llvm.loop !13

81:                                               ; preds = %._crit_edge112
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %164

._crit_edge112:                                   ; preds = %.lr.ph111, %._crit_edge109
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) @n)
          to label %83 unwind label %81

83:                                               ; preds = %._crit_edge112
  %84 = load i32, ptr @n, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  %86 = sext i32 %84 to i64
  %87 = getelementptr inbounds [100100 x i32], ptr @r, i64 0, i64 %86
  store i32 %85, ptr %87, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %storemerge87115 = add nsw i32 %84, -1
  store i32 %storemerge87115, ptr %4, align 4, !tbaa !5
  %88 = icmp sgt i32 %84, 1
  br i1 %88, label %.preheader101, label %._crit_edge116

.preheader101:                                    ; preds = %83, %115
  %89 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %89, label %.critedge2, label %.lr.ph113

._crit_edge116.loopexit:                          ; preds = %115
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  %.pre133 = sext i32 %.pre to i64
  br label %._crit_edge116

._crit_edge116:                                   ; preds = %._crit_edge116.loopexit, %83
  %.pre-phi = phi i64 [ %.pre133, %._crit_edge116.loopexit ], [ %86, %83 ]
  %90 = phi i32 [ %.pre, %._crit_edge116.loopexit ], [ %84, %83 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %.not88119 = icmp slt i32 %90, 1
  br i1 %.not88119, label %._crit_edge125, label %.lr.ph124

.lr.ph113:                                        ; preds = %.preheader101, %101
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %92 = load i32, ptr %91, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp slt i32 %95, %99
  br i1 %100, label %101, label %.critedge2

101:                                              ; preds = %.lr.ph113
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %102 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %102, label %.critedge2, label %.lr.ph113, !llvm.loop !14

103:                                              ; preds = %112
  %104 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %164

.critedge2:                                       ; preds = %.lr.ph113, %101, %.preheader101
  %105 = call noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  br i1 %105, label %106, label %109

106:                                              ; preds = %.critedge2
  %107 = load i32, ptr @n, align 4, !tbaa !5
  %108 = add nsw i32 %107, 1
  br label %112

109:                                              ; preds = %.critedge2
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5stackIiSt5dequeIiSaIiEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %111 = load i32, ptr %110, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %109, %106
  %.sink138 = phi i32 [ %111, %109 ], [ %108, %106 ]
  %.sink141 = load i32, ptr %4, align 4, !tbaa !5
  %113 = sext i32 %.sink141 to i64
  %114 = getelementptr inbounds [100100 x i32], ptr @r, i64 0, i64 %113
  store i32 %.sink138, ptr %114, align 4, !tbaa !5
  invoke void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %115 unwind label %103

115:                                              ; preds = %112
  %116 = load i32, ptr %4, align 4, !tbaa !5
  %storemerge87 = add nsw i32 %116, -1
  store i32 %storemerge87, ptr %4, align 4, !tbaa !5
  %117 = icmp sgt i32 %116, 1
  br i1 %117, label %.preheader101, label %._crit_edge116.loopexit, !llvm.loop !15

._crit_edge125:                                   ; preds = %.loopexit, %._crit_edge116
  %.082.lcssa = phi i64 [ 0, %._crit_edge116 ], [ %.3, %.loopexit ]
  %118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.082.lcssa)
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #6
  ret i32 0

.lr.ph124:                                        ; preds = %._crit_edge116, %.loopexit
  %.081.neg122 = phi i64 [ %.081.neg, %.loopexit ], [ -1, %._crit_edge116 ]
  %.081121 = phi i64 [ %163, %.loopexit ], [ 1, %._crit_edge116 ]
  %.082120 = phi i64 [ %.3, %.loopexit ], [ 0, %._crit_edge116 ]
  %119 = getelementptr inbounds [100100 x i32], ptr @l, i64 0, i64 %.081121
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100100 x i32], ptr @r, i64 0, i64 %.081121
  %123 = load i32, ptr %122, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = add nsw i64 %124, -1
  %126 = sub nsw i64 %125, %121
  %127 = icmp eq i64 %126, 1
  br i1 %127, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.lr.ph124
  %128 = getelementptr inbounds [100100 x i32], ptr @a, i64 0, i64 %.081121
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = add nsw i64 %.081121, -1
  %.neg93 = add i64 %125, %.081.neg122
  br label %131

131:                                              ; preds = %.preheader, %160
  %indvars.iv129 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next130, %160 ]
  %.1117 = phi i64 [ %.082120, %.preheader ], [ %.2, %160 ]
  %132 = trunc nuw nsw i64 %indvars.iv129 to i32
  %133 = shl nuw nsw i32 1, %132
  %134 = and i32 %129, %133
  %.not89 = icmp eq i32 %134, 0
  %135 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %125, i64 %indvars.iv129
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %.081121, i64 %indvars.iv129
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = sub nsw i32 %136, %138
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %130, i64 %indvars.iv129
  %142 = load i32, ptr %141, align 4, !tbaa !5
  %143 = getelementptr inbounds [100100 x [20 x i32]], ptr @cnt, i64 0, i64 %121, i64 %indvars.iv129
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = sub nsw i32 %142, %144
  %146 = sext i32 %145 to i64
  %147 = add nsw i64 %140, %146
  br i1 %.not89, label %154, label %148

148:                                              ; preds = %131
  %149 = mul nsw i64 %146, %140
  %150 = sub i64 %.neg93, %140
  %151 = add nsw i64 %121, %146
  %152 = sub i64 %130, %151
  %153 = mul nsw i64 %152, %150
  br label %160

154:                                              ; preds = %131
  %155 = add nsw i64 %121, %146
  %156 = sub i64 %130, %155
  %157 = mul nsw i64 %156, %140
  %158 = sub i64 %.neg93, %140
  %159 = mul nsw i64 %158, %146
  br label %160

160:                                              ; preds = %148, %154
  %.sink144 = phi i64 [ %149, %148 ], [ %159, %154 ]
  %.sink143 = phi i64 [ %153, %148 ], [ %157, %154 ]
  %161 = add i64 %147, %.sink144
  %162 = add i64 %161, %.sink143
  %.pn126 = shl i64 %162, %indvars.iv129
  %.2 = add i64 %.pn126, %.1117
  %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next130, 20
  br i1 %exitcond.not, label %.loopexit, label %131, !llvm.loop !16

.loopexit:                                        ; preds = %160, %.lr.ph124
  %.3 = phi i64 [ %.082120, %.lr.ph124 ], [ %.2, %160 ]
  %163 = add nuw nsw i64 %.081121, 1
  %.081.neg = xor i64 %.081121, -1
  %exitcond132.not = icmp eq i64 %.081121, %.pre-phi
  br i1 %exitcond132.not, label %._crit_edge125, label %.lr.ph124, !llvm.loop !17

164:                                              ; preds = %103, %81, %67, %54
  %.pn = phi { ptr, i32 } [ %68, %67 ], [ %104, %103 ], [ %82, %81 ], [ %55, %54 ]
  call void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %1) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushEOi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIiSt5dequeIiSaIiEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEE4pushERKi(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIiSt5dequeIiSaIiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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


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